text
string
label_name
string
labels
int64
#[doc = "0x568 - AES Data Input/Output 2"] pub aesdataout2: AESDATAOUT2, #[doc = "0x56c - AES Data Input/Output 3"] pub aesdataout3: AESDATAOUT3, #[doc = "0x570 - AES Tag Output"] pub aestagout: AESTAGOUT, _reserved10: [u8; 396usize], #[doc = "0x700 - Master Algorithm Select This register c...
Rust
0
pub const K_0: u8 = 0x0B; pub const K_1: u8 = 0x02; pub const K_2: u8 = 0x03; pub const K_3: u8 = 0x04; pub const K_4: u8 = 0x05; pub const K_5: u8 = 0x06; pub const K_6: u8 = 0x07; pub const K_7: u8 = 0x08; pub const K_8: u8 = 0x09; pub const K_9: u8 = 0x0A; /// Tick/tilde key pub const K_TICK: u8 = 0x29; /// Minus/...
Rust
0
crate::msgpack::MsgPack) type for further details. //! //! # Enabling //! //! This module is only available when the `msgpack` feature is enabled. Enable //! it in `Cargo.toml` as follows: //! //! ```toml //! [dependencies.rocket_contrib] //! version = "0.5.0-dev" //! default-features = false //! features = ["msgpack"]...
Rust
0
{ let mut shape = Sphere::new(); shape.material.color = Color::new(1.0, 0.2, 1.0); draw_shape(&shape, "ch06_circle.ppm"); // shrink it along the y axis shape.transform = Transformation::new().scale(1.0, 0.5, 1.0).build(); draw_shape(&shape, "ch06_shrink_y.ppm"); // shrink it along the x a...
Rust
0
Some(BinaryColor::Off)) .fill_color(Some(BinaryColor::On)) .draw(&mut display); Triangle::new(Point::new(32, 0), Point::new(0, 64), Point::new(64, 64)) .translate(Point::new(96 * 2 + 32, 32)) .stroke_color(Some(BinaryColor::Off)) .fill_color(Some(BinaryColor::Off)) ....
Rust
0
ED=1'b1, even if the slave responds to the general call address by generating ACK. The STOP_DET interrupt is generated only when the transmitted address matches the slave address (SAR). - If IC_CON\\[7\\]=1'b0 (STOP_DET_IFADDRESSED), the STOP_DET interrupt is issued irrespective of whether it is being addressed. In Mas...
Rust
0
image, face_landmarks, self.mp_face_mesh.FACEMESH_CONTOURS, self.mp_drawing.DrawingSpec(color=(255, 0, 0), thickness=1, circle_radius=1), self.mp_drawing.DrawingSpec(color=(150, 150, 150), thickness=1)...
Python
1
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. ENVIRONMENT_VARIABLES = [ "CIRCLE_PROJECT_USERNAME", "CIRCLE_PROJECT_REPONAME", "CIRCLE_BRANCH", "CIRCLE...
Python
1
:default().add_modifier(Modifier::BOLD | Modifier::ITALIC); /// let diff = Style::default().remove_modifier(Modifier::ITALIC); /// let patched = style.patch(diff); /// assert_eq!(patched.add_modifier, Modifier::BOLD); /// assert_eq!(patched.sub_modifier, Modifier::ITALIC); /// ``` pub fn remove_...
Rust
0
impl Seconds for u32 { fn seconds(self) -> u64 { self.into() } } impl Seconds for ::std::time::Duration { fn seconds(self) -> u64 { self.as_secs() } } pub trait IntoOrigin { fn into_origin(self) -> Origin; } impl<'a> IntoOrigin for &'a str { fn into_origin(self) -> Origin { ...
Rust
0
. fn main2() -> Result<(), Box<std::io::Error>> { if ARGS.flag_list_encodings { let list = all::encodings() .iter() .filter_map(|&e| e.whatwg_name()) .sorted(); // Available encodings for e in list { println!("{}", e); } return ...
Rust
0
_macro :: Mirror, Debug, Clone, PartialEq, )] pub struct PersonByEmail { #[partition_key] pub email: String, #[clustering_key] pub name: String, #[clustering_key] pub age: i32, } impl PersonByEmail { #[doc = r" Create an borrowed primary key from the struct values"] #[doc = r" You can us...
Rust
0
elif data_len == 8 and arm == 14 and cmd_id == ProtocolCode.GET_DOWN_ENCODERS: i = 0 while i < data_len: byte_value = int.from_bytes(valid_data[i:i + 4], byteorder='big', signed=True) i += 4 res.append(byte_value) ...
Python
1
TVariant i_index: :rtype: ArrangementArea """ return ArrangementArea(self.arrangement_areas.Item(i_index)) def remove(self, i_index: CATVariant) -> None: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)) ...
Python
1
er().enumerate().into())?; Ok(packet) } fn parse_helper( bits: &mut CountingIter<impl Iterator<Item = (usize, Bit)>>, ) -> Result<(usize, Packet), &'static str> { let start_idx = bits.processed; let version = Bit::as_num(bits.by_ref().map(|x| x.1).take(3)) as u8; le...
Rust
0
#!/bin/python3 # Mimosa # Marc Feeley, Samuel Yvon # Create the list of CPP files dependencies to include in the makefile # The paths are not always straightforward but this tool understands them # Usage: # (from the dir of the project) # ./utils/make-dependencies.py import os import re import glob def list_includes(...
Python
1
ViewColumn::new(); gtk::prelude::CellRendererExt::set_alignment(&renderer, 0.5, 1.0); column.pack_start(&renderer, true); column.set_title("# Completed"); column.set_alignment(0.5); column.add_attribute(&renderer, "text", pos); tree_view.append_column(&column); } ...
Rust
0
ot(data.index, data['price'], label='价格', linewidth=1, alpha=0.8, color='#94a3b8') ax1.plot(data.index, data['short_ma'], label='短期均线(5日)', linewidth=2, color=colors['primary']) ax1.plot(data.index, data['long_ma'], label='长期均线(20日)', linewidth=2, color=colors['warning']) # 标记买卖点 buy_signals = data...
Python
1
rev2 and // rev3 and make sure that the hash has not changed. // build-pass (FIXME(62277): could be check-pass?) // revisions: cfail1 cfail2 cfail3 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans #![allow(warnings)] #![feature(rustc_attrs)] #![crate_type="rlib"] fn callee1(_x: u32, _y: i64) {} fn c...
Rust
0
pub dwFlags: u32, pub xDlg: i32, pub yDlg: i32, pub dwCallbackId: usize, pub pCallback: RASPBDLGFUNCW, pub dwError: u32, pub reserved: usize, pub reserved2: usize, } #[cfg(feature = "Win32_Foundation")] impl ::core::marker::Copy for RASPBDLGW {} #[cfg(feature = "Win32_Foundation")] impl ::co...
Rust
0
# !/usr/bin/env python import numpy as np import pandas as pd import scanpy as sc from sklearn.preprocessing import scale, minmax_scale from sklearn import preprocessing def read_csv1(filename1, filename2, take_log): dataset = {} data = pd.read_csv(filename1, index_col=0, sep='\t') print(data.shape) ...
Python
1
odel_saving(self, model, trainer, training_config): """Test final saving for the mmvae model.""" dir_path = training_config.output_dir trainer.train() model = deepcopy(trainer._best_model) training_dir = os.path.join( dir_path, f"MMVAE_training_{trainer._training_s...
Python
1
#[derive(Debug)] pub struct Relationship { pub control: Control1, pub caption: String, pub from: String, pub to: String, pub name: String, } #[derive(Debug)] pub struct SysDiagram { pub tables: Vec<Table>, pub relationships: Vec<Relationship>, pub dsref_schema_contents: DSRefSchemaCon...
Rust
0
import math def valid(per_day, task, d): cur_day = 0 for index in range(0, len(task)): day_req = math.ceil((task[index]) / (per_day)) cur_day += day_req if (cur_day > d): return False return cur_day <= d def minimumTask(task, d): left = 1 right...
Python
1
,5)) plt.subplot(1,2,1) plt.plot(fpr, tpr, label=f'ROC curve (AUC = {roc_auc:.3f})') plt.plot([0,1], [0,1], 'k--') plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate (Recall)') plt.title('ROC Curve') plt.legend() plt.subplot(1,2,2) plt.plot(recall, precision, label='Precision-Recall curve') plt.xlabel('...
Python
1
# Copyright (C) 2024 qBraid # # This file is part of the qBraid-SDK # # The qBraid-SDK is free software released under the GNU General Public License v3 # or later. You can redistribute and/or modify it under the terms of the GPL v3. # See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.ht...
Python
1
rs>10-100 // Copyright 2020 Google LLC // // Use of this source code is governed by an MIT-style license that can be found // in the LICENSE file or at https://opensource.org/licenses/MIT. use crate::session::RegexParseError; use regex::Regex; /// Converts glob expression into a Rust Regex. /// /// # Examples /// ```...
Rust
0
1), 241..=248 => { let varint = 240 + 256 * (u64::from(buf[0]) - 241) + u64::from(buf[1]); (varint, 2) } 249 => { let varint = 2288 + 256 * u64::from(buf[1]) + u64::from(buf[2]); (varint, 3) } other => { ...
Rust
0
e { N[(pos ^ 1) * 5 + 3] = 125; } } #[deps(NN_020: NN_011 NN_012 NN_013 NN_014 NN_015)] #[test] fn neural_network_020() { let mut input = 0; let pos = 3 % 2; thread::sleep(time::Duration::from_secs_f64(0.025000 * rand::thread_rng().gen::<f64>())); unsafe { for n in &N[(pos * 5)..((p...
Rust
0
ructopt::StructOpt; use tokio::fs::File; use tokio::io::AsyncWriteExt; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // get cli let cli: Cli = Cli::from_args(); let current_dir = env::current_dir().unwrap(); println!( " ██████╗██╗ ██╗██████╗ ██████╗██╗ ...
Rust
0
.unbounded_send(MessageInternal::InputReport( DeviceId(device_id.clone()), view_key, report, )) .expect("unbounded_send"); ...
Rust
0
); layout.add(Box::new(v_layout_1)); layout.add(Box::new(v_layout_2)); layout.add(Box::new(button_b)); let anchor = ui::Anchor(ui::HAnchor::Right, ui::VAnchor::Bottom); gui.add(&ui::pack(layout), anchor); } Ok(gui) } struct State { gui: ui::Gui<Message>, } impl Stat...
Rust
0
frontend::sync(&mut buf); Ok(buf) } async fn get_type(client: &Arc<InnerClient>, oid: Oid) -> Result<Type, Error> { if let Some(type_) = Type::from_oid(oid) { return Ok(type_); } if let Some(type_) = client.type_(oid) { return Ok(type_); } let stmt = typeinfo_statement(cl...
Rust
0
eq!(url, "file://x:/path/to/git"); Ok(()) } #[test] fn file_path_with_backslashes_without_protocol() -> crate::Result { let url = assert_url_and( "x:\\path\\to\\git", url(Scheme::File, None, None, None, b"x:\\path\\to\\git"), )? .to_string(); ...
Rust
0
T3 dz5 = dz0 - 1 - 2 * SQUISH_CONSTANT3 attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5 if attn5 > 0: attn5 *= attn5 value += attn5 * attn5 * _extrapolate3(perm, perm_grad_index3, xsb + 1, ysb + 0, zsb + 1, dx5, dy5, dz5) # Contribution (0,1,1) dx6 = dx0 - ...
Python
1
ms.min_acceptable: stat.summary(DiagnosticStatus.ERROR, 'Timestamps too far in future seen.') self.early_count += 1 if self.max_delta > self.params.max_acceptable: stat.summary(DiagnosticStatus.ERROR, ...
Python
1
import unittest # Create the insertion sorting function. def insertion_sort(A, n): # 'A' is the array of values to be sorted, 'n' being the numbers of values to sort. # Traverse through 1 to n. for i in range(1, n): # ^ i = range of number values from 1 to n, n being the highest possible number in ...
Python
1
rst_page_wrapper = HeaderPageWrapper::from_raw_page(first_page); let version = first_page_wrapper.get_version(); let meta_pid = first_page_wrapper.get_meta_page_id(); let free_list_pid = first_page_wrapper.get_free_list_page_id(); let free_list_size = first_page_wrapper.get_free_list_siz...
Rust
0
nerate_trt_nodes_num(attrs, dynamic_shape): return 1, 2 attrs = [ program_config.ops[i].attrs for i in range(len(program_config.ops)) ] # for dynamic_shape generate_dynamic_shape(attrs) self.trt_param.precision = paddle_infer.PrecisionType.Int8 ...
Python
1
] } } impl Solid for ChevronDoubleRight {} <filename>src/hrpwm0/csgstatg.rs #[doc = "Register `CSGSTATG` reader"] pub struct R(crate::R<CSGSTATG_SPEC>); impl core::ops::Deref for R { type Target = crate::R<CSGSTATG_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } i...
Rust
0
from src.simple_server.http_server import HTTPServer from src.simple_server.tcp_server import TCPServer def main(): print("hello world") if __name__ == "__main__": server = HTTPServer() server.start()
Python
1
import streamlit as st import requests import json # URL del microservicio FastAPI url = "http://fastapi:8000/registro_mascota/" st.title("Registrar Mascota 🐾") # Crear el formulario para registrar la mascota with st.form("registro_mascota"): nombre_dueño = st.text_input("Nombre del Dueño") nombre_mascota =...
Python
1
().to_owned(), ); keys.insert( AlgorithmAndDeviceId(KeyAlgorithm::Ed25519, (*self.device_id).clone()), identity_keys.ed25519().to_owned(), ); let device_keys = json!({ "user_id": (*self.user_id).clone(), "device_id": (*self.device_id).clon...
Rust
0
10\x10\n\x0c\n\x05\x04\x02\ \x02\x01\x05\x12\x03\x11\x02\x07\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\ \x11\x08\x0c\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x11\x0f\x10\n\x0b\n\ \x04\x04\x02\x02\x02\x12\x03\x12\x02\x15\n\r\n\x05\x04\x02\x02\x02\x04\ \x12\x04\x12\x02\x11\x11\n\x0c\n\x05\x04\x02\x02\x02\x05...
Rust
0
import bpy from bpy.props import * from ..node_socket import RenderNodeSocket, SocketBase, RenderNodeSocketmixin, RenderNodeSocketInterface from ..node_socket import update_node class RenderNodeSocketInterfaceFloat(RenderNodeSocketmixin, RenderNodeSocketInterface, bpy.types.NodeSo...
Python
1
game_ver, game_date, game_time = get_game_version() file.writelines([ "H.P.W build info:\n", f' ASAN checks: {hpw_config.enable_asan}\n', f' Game ver: {game_ver if game_ver else "unknown"}\n', f' last commit date: {game_date if game_date else "unknown"}\n', f' las...
Python
1
"{} {} `{}`{}", emoji::WRENCH, style("Moving generated files into:").bold(), style(project_dir.display()).bold().yellow(), style("...").bold() ); copy_dir_all(&template_folder, &project_dir)?; if !args.init { args.vcs.initialize(&project_dir, branch)?; } pri...
Rust
0
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from typing import Dict, List,Optional,Any import os from .metrics import compute_roc_curve # 设置字体和样式 plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 sns.set_theme(style="whitegrid...
Python
1
raise # Optionally re-raise the exception if you want it to propagate async def start_litellm_background(self): print("start_litellm_background") # Command to run in the background command = [ "litellm", "--port", str(self.valves.LITELLM_PROXY...
Python
1
#[derive(Clone, PartialEq, Eq)] pub enum ExecutableDeployItem { ModuleBytes { module_bytes: Vec<u8>, args: Vec<u8>, }, StoredContractByHash { hash: Vec<u8>, args: Vec<u8>, }, StoredContractByName { name: String, args: Vec<u8>, }, StoredContract...
Rust
0
import subprocess # to run shell programs import sys from datetime import datetime # to get timestamp of program getting push in repo import os try: today_prefix = f"day_{datetime.now().strftime('%Y%m%d')}_" print (today_prefix) script_folder = "scripts" scripts_today = [f for f in os.listdir(s...
Python
1
(2)); width].into_iter().collect(); height ].into_iter().collect(); let n_s: VecDeque<VecDeque<f64>> = vec![ vec![O9TH*(1.0-1.5*u0.powi(2)); width].into_iter().collect(); height ].into_iter().collect(); let n_e: VecDeque<VecDeque<f64>> = vec![ vec![O9TH*(1.0+3.0*u...
Rust
0
o)". Analyze the impact of various factors on students' ability to pass mathematics exams. Based on the following principles, make predictions regarding students' likelihood of passing the exam: 1.Goout: Students with goout values of 1, 2, or 3 are highly li...
Python
1
"""Test Calendar.app access.""" import subprocess from datetime import datetime, timedelta def run_applescript(script: str) -> str: """Run AppleScript and return its output.""" try: process = subprocess.Popen( ['osascript', '-e', script], stdout=subprocess.PIPE, std...
Python
1
836, -117.333484316}, {0xab8c832252abce1d, "pf6868kkpg71", -77.297727015, 172.381661592}, {0x8c67ac1d8c9c3fc7, "jjmus7ddmhzw", -59.658095434, 53.27636308}, {0xdbf4141d69242eb8, "vgu187c94hrc", 66.378215883, 84.388142665}, {0x669c31b670e9bbc6, "duf33emhx6xw", 26.95711635, -53.01283175}, ...
Rust
0
ath) elif sys.argv[7] == "search": print("Eg.") print(" size:>100") print(" sent:>=2021/1/1 AND sent:<=2021/12/30") print(" received:>=2021/1/1 AND received:<=2021/12/30") print(" password") querystring = input("Input the search s...
Python
1
let pretty = PrettyConfig::new() .with_depth_limit(4) .with_separate_tuple_members(true); let s = to_string_pretty(&item, pretty)?; println!("{}", s); } } Ok(()) } fn print_document<D, I>(document: D, format: Format) -> anyhow::Result...
Rust
0
from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field T = TypeVar("T", bound="GetIndexResponse200ItemResponseFormatType0JsonSchemaSchema") @_attrs_define class GetIndexResponse200ItemResponseFormatType0JsonSchemaSchema: ...
Python
1
se = "" if parsed["action"] == "enable": response = self.toggle_active(True) elif parsed["action"] == "disable": response = self.toggle_active(False) elif parsed["action"] == "add_rule": new_rule = { "senders": parse...
Python
1
q, Eq, Copy, Clone)] pub enum ShorthandNotation { Never, IfPossible, } fn can_shorthand_hexadecimal_channel(channel_hex_str: &str) -> bool { debug_assert!(channel_hex_str.len() == 2); channel_hex_str[0..1] == channel_hex_str[1..2] } fn shorthand_hexadecimal_channel(channel_hex_str: &str) -> String { debug_asser...
Rust
0
models::ResultTopFilesFile>, /// Limit on number of top results. #[serde(rename = "top_n_max")] pub top_n_max: i32, /// Total count of file results. #[serde(rename = "total_count")] pub total_count: i32, } <reponame>ajuna-network/open-runtime-module-library use codec::Encode; use parking_lot::Rw...
Rust
0
ion in FutureProducer fn send_copy<P, K>( &self, topic_name: &str, partition: Option<i32>, payload: Option<&P>, key: Option<&K>, timestamp: Option<i64> ) -> KafkaResult<DeliveryFuture> where K: ToBytes + ?Sized, P: ToBytes + ?Sized { ...
Rust
0
HipRaise, 13 => HipRaiseExerciseName::HipRaiseWithFeetOnSwissBall, 14 => HipRaiseExerciseName::WeightedHipRaiseWithFeetOnSwissBall, 15 => HipRaiseExerciseName::HipRaiseWithHeadOnBosuBall, 16 => HipRaiseExerciseName::WeightedHipRaiseWithHeadOnBosuBall, ...
Rust
0
"end_tokens": end_tokens, "is_block_step": is_block_step, "output_cum_offsets": output_cum_offsets, "actual_candidate_len": actual_candidate_len, "actual_draft_token_nums": actual_draft_token_nums, "topp": topp, "max_seq_len": max_seq_len, "verify_window": veri...
Python
1
def xyxy2xywh(x): """ Convert bounding box coordinates from (x1, y1, x2, y2) format to (x, y, width, height) format. Args: x (np.ndarray | torch.Tensor): The input bounding box coordinates in (x1, y1, x2, y2) format. Returns: y (np.ndarray | torch.Tensor): The bounding box coordinates in...
Python
1
和 chart 适配 section_type if column_class == "SYSTEM": section_type: SectionType = "SYSTEM" else: if chart is ChartType.ECHARTS: section_type = "CUSTOM" else: section_type = "PUBLIC" # 4. 创建 ColumnInfo 对象 column_info = Co...
Python
1
dias = int(input('Quantos dias você vai alugar? : ')) km = float(input('Quantos km rodados? : ')) total = (60*dias) + (0.15*km) print(f'O total a pagar é R${total:.2f}')
Python
1
readonly=True, disabled_readonly_background_color='#ECECEC', disabled_readonly_text_color='#545454'), sg.FilesBrowse(file_types=(('ALL Files', '*.pdf'),))]], [sg.Column([centrilizedButtons], justification="center")]] window = sg.Window("Anexar Documento", layout...
Python
1
min)", "home 6 goal segnato(min)", "home 7 goal segnato(min)", "home 8 goal segnato(min)", "home 9 goal segnato(min)" ] away_goal_cols = [ "1 goal away (min)", "2 goal away (min)", "3 goal away (min)", "4 ...
Python
1
f\x90\xf3\ \x06%\xd7\xee\x9a\xf5B\x99\xe3\xfe\xaf\xe5,6\xbf\x0b\ \xc4\xe3\x95\xd8Ty\xb3\xc1U\x0c{\x17i\x04\x13R\ \x0d\xef\xa5\x8f\xc2\xf5\xb7q(\xb2q\xaf\xe2Q\x07\xe1\ \xf8R\xfb\xbc\xb1\xd7\xb3\x96.\xc4hBT\x0fN!\ C\xe7In\xae\xe4\xfe\xa4\xf5{6\xe1\xd9c\x13\xc4\ \xb0\xba.\x8fautx\xfc\xb3@%\x93\x15\xacx\ a\xb4\x91:\xb8(=\x...
Python
1
def padding(self, seq): padded_seq = torch.nn.utils.rnn.pad_sequence(seq, batch_first=True, padding_value=1.0) return padded_seq
Python
1
_frag_tbl { ///< ttl for table entries. pub max_cycles: u64, ///< hash value mask. pub entry_mask: u32, ///< max entries allowed. pub max_entries: u32, ///< entries in use. pub use_entries: u32, ///< hash assocaitivity. pub bucket_entries: u32, ///< total size of the table. ...
Rust
0
pub nargs: c_int, pub identity: c_int, pub functions: *mut PyUFuncGenericFunction, pub data: *mut *mut c_void, pub ntypes: c_int, pub reserved1: c_int, pub name: *const c_char, pub types: *mut c_char, pub doc: *const c_char, pub ptr: *mut c_void, pub obj: *mut PyObject, pub ...
Rust
0
init(&mut self, repo_path: &str) -> Result<(), git2::Error> { git2::Repository::open(&Path::new(&repo_path)).map(|repo| self.repo = Some(repo)) } fn checkout_branch(&self, branch_name: &str) -> Result<(), git2::Error> { let repo = self.repo.as_ref().unwrap(); let commit = repo ...
Rust
0
import math class Circle: def __init__(self, x, y, r): self.x = x self.y = y self.r = r # DFS 알고리즘을 사용하는 솔루션 class CircleGroup(object): def IsOverlapped(self, circle1, circle2): distance = math.sqrt( math.pow(circle1.x - circle2.x, 2) + math.pow(circle...
Python
1
))); st.write_run_finish() } #[test] fn should_sort_failures_before_printing_them() { let test_a = TestDesc { name: Cow::from("a"), ignore: false, }; let test_b = TestDesc { name: Cow::from("b"), ignore: false, }; let mut st = ConsoleTestState { log_out...
Rust
0
tempo_str = input("Enter tempo in BPM (default=120): ") if tempo_str.lower() == 'q': break tempo = 120 if tempo_str: try: tempo = int(tempo_str) except ValueError: print("Invalid tempo, using default") ...
Python
1
_coef( score::chain_bonus(current_chain), long_bonus_coef, score::color_bonus(num_used_colors) ); 10 * erase_queue_head * rensa_bonus_coef } pub fn simulate(&mut self) -> RensaResult { let mut chains = 1; let mut score = 0; let mut fra...
Rust
0
it, config)) .collect_vec(), new_grapheme.repetitions.as_mut(), config, ); } } fn convert_chars_to_range(chars: &[(char, char)]) -> Vec<CharRange> { chars .iter() .map(|&(start, end)| CharRange::closed(start, end)) .collect_vec() } pub mod...
Rust
0
import matplotlib.pyplot as plt import seaborn as sns def plot_predictions(actual, predicted, model_name): plt.figure(figsize=(10, 6)) plt.scatter(actual, predicted, alpha=0.6, color='blue', label='Predicted') plt.plot([actual.min(), actual.max()], [actual.min(), actual.max()], 'k--', lw=2, label='Actual'...
Python
1
} } pub fn evt_handler(&self, ipcc: &mut Ipcc, queue: &mut HeaplessEvtQueue) { unsafe { let mut node_ptr: *mut LinkedListNode = core::ptr::null_mut(); let node_ptr_ptr: *mut *mut LinkedListNode = &mut node_ptr; while !LST_is_empty(SYSTEM_EVT_QUEUE.as_mut_ptr(...
Rust
0
hat each sample has. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SampleFormat { /// The value 0 corresponds to 0. I16, /// The value 0 corresponds to 32768. U16, /// The boundaries are (-1.0, 1.0). F32, } impl SampleFormat { /// Returns the size in bytes of a sample of this format...
Rust
0
self.state.cnt.fetch_add(1, Ordering::Relaxed); Self { state: self.state.clone(), } } } impl Drop for ThreadPool { fn drop(&mut self) { if self.state.cnt.fetch_sub(1, Ordering::Relaxed) == 1 { for _ in 0..self.state.size { self.state.send(Message...
Rust
0
import os from talon import Context, actions, ui # TODO: fit this to terminal.py ctx = Context() ctx.matches = r""" app: apple_terminal """ directories_to_remap = {} directories_to_exclude = {} @ctx.action_class("edit") class EditActions: def delete_line(): actions.key("ctrl-u") @ctx.action_class("us...
Python
1
('%s:index' % admin_site_name), description=_('Dashboard'), ), items.MenuItem( title=_('Books'), icon='fa-book', url=reverse('%s:books_book_changelist' % admin_site_name), ), i...
Python
1
POWERUP_TIMER_R { RTC_CNTL_BT_POWERUP_TIMER_R::new(((self.bits >> 25) & 0x7f) as u8) } #[doc = "Bits 16:24"] #[inline(always)] pub fn rtc_cntl_bt_wait_timer(&self) -> RTC_CNTL_BT_WAIT_TIMER_R { RTC_CNTL_BT_WAIT_TIMER_R::new(((self.bits >> 16) & 0x01ff) as u16) } #[doc = "Bits 9:1...
Rust
0
import cv2 img = cv2.imread("Pictures/Venom.png") #bu .imwirte() komutu dosyanın üzerinde işlem yapılmak için kaydedilmesi sağlar # cv2.imwrite("VenomGri.png",img) # resim üzerine bir çizgi çizmek için: # hedef resim # başlangıç noktası # bitişş noktası # RBG renk kodları # çizginin pixel kalınlığı cv2.line(img,(0...
Python
1
Reg<'a, T, AccessSafeWO>; pub type WriteOnly <'a, T> = Reg<'a, T, AccessWriteOnly>; pub type UnsafeRead<'a, T> = Reg<'a, T, AccessUnsafeRead>; pub type ReadWrite <'a, T> = Reg<'a, T, AccessReadWrite>; pub struct Reg<'a, T: POD, A: Access>(*const T, PhantomData<&'a T>, PhantomData<A>); // NOTE: Not Sync, accesses are u...
Rust
0
(Debug)] pub struct RateCounter { count: f64, instant: Instant, interval: Duration, } impl RateCounter { pub fn new(interval: Duration) -> Self { Self { count: 0.0, instant: Instant::now(), interval, } } pub fn with_second_intertal() -> Self ...
Rust
0
let mut words = HashMap::<&str, usize>::new(); let chars = str_utils::simple_words_pattern(); for word in chars.find_iter(&text) { let word = word.as_str(); let count = words.entry(word).or_default(); *count += 1; } let mut result = Vec::<Word>::new(); for (word, count) in...
Rust
0
from django.urls import reverse import pytest from rest_framework.test import APIClient from tasks.models import Task @pytest.mark.django_db def test_list_tasks(): Task.objects.create(title="Task 1", completed=False) Task.objects.create(title="Task 2", completed=True) client = APIClient() response ...
Python
1
239.5], [0, 0, 1]]) # meta info for re-label mug category with open(os.path.join(data_dir, 'obj_models/mug_meta.pkl'), 'rb') as f: mug_meta = cPickle.load(f) valid_img_list = [] for img_path in tqdm([img_path]): img_full_path = os.path.join(data_dir, 'CAMERA', img_path) all_exi...
Python
1
\002\026Autokitteh.Runtimes.V1\312\002\026Autokitteh\\Runtimes\\V1\342\002\"Autokitteh\\Runtimes\\V1\\GPBMetadata\352\002\030Autokitteh::Runtimes::V1' _DESCRIBEREQUEST.fields_by_name['name']._options = None _DESCRIBEREQUEST.fields_by_name['name']._serialized_options = b'\372\367\030\004r\002\020\001' _LISTRESPONS...
Python
1
nd afar off.") }, PsalmVerse { number: 12, a: String::from("Those who seek after my life lay snares for me; *"), b: String::from("those who strive to hurt me speak of my ruin\nand plot treachery all the day long.") }, PsalmVerse...
Rust
0
from app.common.address.repository import AddressRepository from app.common.address.schema import ( AddressCreate, AddressCreateWithoutUserId, AddressUpdate, ) from app.common.base.controller import BaseController from app.common.address.exception import ( UserAddressAlreadyRegisteredException, User...
Python
1
len, } => self.compile_open( range, *filename, *mode, *filenum, len.as_ref().cloned(), ), StmtKind::Play(arg) => self.compile_unary_stmt( range, &stmt.kind, *arg, Type::String, "PLAY", "参数", ), ...
Rust
0
import bpy, json _ORIGINAL_NODE_DEF = json.loads(""" { "attributes": { "color": { "class": "Color", "name": "color", "value": [ 0.608, 0.608, 0.608 ] }, "height": { "class": "float", ...
Python
1
b change_close: f64, pub change_close_percentage: f64, pub company_name: String, pub high: f64, pub last_trade: f64, pub low: f64, pub total_volume: i64, } #[derive(Debug, Clone, Deserialize, Serialize, Default)] #[serde(rename_all = "camelCase", default)] pub struct FundamentalQuoteDetails { pub company...
Rust
0
np.diag([SIGMA_R**2, (SIGMA_THETA * np.pi / 180.0) ** 2]), KAPPA, ) # Create the plot and axes fig3, ax3 = plt.subplots() plt.xlabel(r"$y_1$") plt.ylabel(r"$y_2$") plt.grid(color="0.95") # Create a covariance ellipse for the actual statistics ell_actual = patches.Ellipse( (y_bar[0], y_bar[1]), 2 * np....
Python
1
from time import sleep import time from typing import Callable import mss import numpy as np import cv2 as cv from services import Controller, Screen from constants import Monitor type Matcher = Callable[[], bool | None] __listenFlag = True __shot: np.ndarray | None = None __shotGray: np.ndarray | None = None __moni...
Python
1