text
string
label_name
string
labels
int64
drawn_numbers = self.draw_numbers() for card in cards: matches = self.get_matches(card, drawn_numbers) card.card_data["Matches"][str(len(matches))] += 1 card.card_history.append(matches) self.calc_cards() self.print_cards() return(...
Python
1
import torch from nnunet_mednext.network_architecture.generic_UNet import Generic_UNet from nnunet_mednext.network_architecture.initialization import InitWeights_He from nnunet_mednext.training.network_training.nnUNet_variants.data_augmentation.nnUNetTrainerV2_insaneDA import \ nnUNetTrainerV2_insaneDA from nnunet_...
Python
1
} fn set_language_override( &mut self, language_override: Option<unic_langid::LanguageIdentifier>, ) -> Result<(), I18nEmbedError> { self.implementation.set_language_override(language_override) } fn poll(&mut self) -> Result<(), I18nEmbedError> { self.implementation...
Rust
0
Sized>(input: &'a mut T) -> &'static mut T { let f: fn(_, &'a mut T) -> &'static mut T = cell; f(&&(), input) } fn zombie(size: usize) -> &'static mut [u8] { let mut object = vec![b'A'; size]; let r = virus(object.as_mut()); r } fn infect(lines: &mut impl Iterator<Item = std::io::Result<String>>) -> &'static mut...
Rust
0
oise elif noise_scheduler.config.prediction_type == "v_prediction": target = noise_scheduler.get_velocity(latents, noise, timesteps) else: raise ValueError(f"Unknown prediction type {noise_scheduler.config.prediction_type}") if wit...
Python
1
) } else { Ok(wrote) } } } /// Writes `size` bytes of `buffer` to `address`. /// Alias for [`Self::write_from_buffer`]. pub fn write_bytes( &self, address: usize, buffer: *const u8, size: usize ) -> EResult<usize> { ...
Rust
0
next() .map(|s| s.to_string()) .unwrap_or_default() .trim(), theirs.title(&org).raw.trim() ); assert_eq!(ours.children(&arena).count(), theirs.children(&org).count()); for (ours, theirs) in ours.children(&ar...
Rust
0
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import unittest import frappe from erpnext.setup.doctype.employee.test_employee import make_employee class TestEmployeeGroup(unittest.TestCase): pass def make_employee_group(): employee = make_employee("testemployee@example....
Python
1
# sage_setup: distribution = sagemath-categories """ Graded Lie Conformal Algebras AUTHORS: - Reimundo Heluani (2019-10-05): Initial implementation. """ #****************************************************************************** # Copyright (C) 2019 Reimundo Heluani <heluani@potuz.net> # # This program is ...
Python
1
variance metrics for subgroups. Parameters ---------- save_results If we need to save result metrics in a file result_filename [Optional] Filename for results to save save_dir_path [Optional] Location where to save the results file wi...
Python
1
routepen::R) reader structure"] impl crate::Readable for ROUTEPEN {} #[doc = "`write(|w| ..)` method takes [routepen::W](routepen::W) writer structure"] impl crate::Writable for ROUTEPEN {} #[doc = "I/O Routing Pin Enable Register"] pub mod routepen; #[doc = "I/O Routing Location Register\n\nThis register you can [`rea...
Rust
0
buf!( //! nrf52833::gpio::GPIOPin, //! nrf52::rtc::Rtc<'static> //! )); //! ``` //! //! Single LED usage //! ---------------- //! //! ```rust //! let led = components::led_matrix_led!( //! nrf52::gpio::GPIOPin<'static>, //! capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52::rtc::Rtc<'static>>, //!...
Rust
0
Err(_) => { /* connection failed */ break; } } } } ///send a command to the reciever thread pub fn send(msg: String) { match US::connect(&SOCKET_FILE).and_then(|mut writer| { print!("{:?}", msg); writer.write(msg.as_bytes()) }...
Rust
0
#=============================================================================== # Copyright 2014 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
Python
1
itches::new( rx.into_push_pull_output(), tx_rfo.into_push_pull_output(), tx_boost.into_push_pull_output(), )); RNG = Some(rng); }; LongFiBindings { bindings: BoardBindings { reset: Some(radio_reset), ...
Rust
0
Any], None]: callables = [c for c in legal_values if callable(c)] legal_values = [c for c in legal_values if not callable(c)] def inner(x) -> None: if x not in legal_values: if not any(c(x) for c in callables): uvals = [str(lval) for lval in legal_values] ...
Python
1
": detailed_scores["uniform_encoding"], "max_score": 0 if notes["uniform_encoding"] == "No date or time columns found." or detailed_scores["uniform_encoding"] == 0 else 10 } ] }, { "bucket": "Regular Refresh", "weight": 0 if notes["...
Python
1
} let name = String::from_utf16_lossy(&process_name[..pos]); processes.push(super::Process { pid: pid as _, name, }); } } } } ...
Rust
0
SIZE: `_` `:` `_` `*` [Type] #[derive(Debug, Clone, Span, Parse, Format)] pub struct BitstringType(BitstringLike<BitstringItem>); #[cfg(test)] mod tests { use super::*; #[test] fn mfargs_works() { let texts = [ "foo()", "foo:bar(A, 1)", indoc::indoc! {" ...
Rust
0
G_FILTERSPEC { pszName: wch_c!("balance.xml").as_ptr(), pszSpec: wch_c!("balance.xml").as_ptr() }, w32::COMDLG_FILTERSPEC { pszName: wch_c!("All Files").as_ptr(), pszSpec: wch_c!("*.*").as_ptr() ...
Rust
0
(ImageView) def setImage(self, image, *args, **kwargs): if hasattr(image, "dtype") and hasattr(image, "shape"): assert image.ndim == 2 or (image.ndim == 3 and image.shape[2] in (3, 4)) height, width = image.shape[0:2] dataInfo = "Data: %dx%d (%s)" % (width, height, str(im...
Python
1
rt_ref(6, &BUFFER); let rm_len = writer.get_rem_len(); assert_ok!(test_write); assert_ok!(rm_len); assert_eq!(rm_len.unwrap(), REF); } #[test] fn buffer_get_rem_len_zero_end() { static BUFFER: [u8; 6] = [0x82, 0x82, 0x83, 0x85, 0x04, 0x34]; static REF: VariableByteInteger = [0x82, 0x83, 0x85, 0...
Rust
0
M, location: jlocation) -> Result<()> where M: Transform<'a, jmethodID> { jvmti_call!(self.jvmti_raw(), SetBreakpoint, method.transform(jni)?, location ) } pub fn clear_breakpoint<M>(&self, jni: &jni::JNIEnv<'a>, method: M, location: jlocation) -> Re...
Rust
0
-> Transition { Some(Box::new(IdleState::default())) } } #[derive(Debug)] pub(crate) struct RangeSelectedState { index_in_ranges: usize, } impl RangeSelectedState { fn new(index_in_ranges: usize) -> Self { RangeSelectedState { index_in_ranges } } fn deselect(&self, ctx: &mut Cont...
Rust
0
ET_DATA_SIZE}, signature::Keypair, }, std::{ error::Error, net::{IpAddr, SocketAddr, UdpSocket}, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, thread, time::Duration, }, tokio::{ runtime::{Builder, Runtime}, ...
Rust
0
self.velocity = np.zeros( (space.n_agents, space.n_variables, space.n_dimensions) ) self.loudness = rnd.generate_uniform_random_number(0, self.A, space.n_agents) self.pulse_rate = rnd.generate_uniform_random_number(0, self.r, space.n_agents) def update(self, space: Space,...
Python
1
// [ // OMAPRecord { // source_address: 0x005e40e0, // target_address: 0x005e50e0 // }, // OMAPRecord { // source_address: 0x005e5000, // target_address: 0x00000000 // }, // OMAPRecord { // source_address: 0x005e70c0, // target_ad...
Rust
0
ficate]; check_files(cert, &file_types) } <reponame>pcwalton/rust-core-graphics // Copyright 2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE...
Rust
0
:GattDescriptorFlags::EncryptRead); } if Self::ENCRYPT_WRITE { ret.push(super::GattDescriptorFlags::EncryptWrite); } if Self::ENCRYPT_AUTH_READ { ret.push(super::GattDescriptorFlags::EncryptAuthenticatedRead); } if Self::ENCRYPT_AUTH_WRITE { ...
Rust
0
y_csv::Array2Reader; use ndarray_rand::{rand_distr, RandomExt}; use wasm_bindgen::prelude::*; #[wasm_bindgen] impl FloatsVector { /// Create a new FloatsVector of the given length filled with zeros #[wasm_bindgen(js_name = "newWithZeros")] pub fn new_with_zeros(len: usize) -> FloatsVector { FloatsV...
Rust
0
mainder = 43 % 5; // Booleans let t = true; let f: bool = false; // with explicit type annotation // Character types let c = 'z'; let z = 'ℤ'; let heart_eyed_cat = '😻'; // Tuples let tup: (i32, f64, u8) = (500, 6.4, 1); let (t1, t2, t3) = tup; println!("The value of t2 is...
Rust
0
], "advanced": [ "智能制造系统:某制造企业建设智能工厂,实现自动化生产", "自动化控制设计:某工程师设计机器人控制系统,提升精度", "可靠性工程:某航天公司分析系统可靠性,确保任务成功", ], "research": [ "自主系统开发:某研究机构开发无人驾驶技术,革新交通", "可持续工程技术:某大学研究清洁...
Python
1
import cv2 from cvzone.HandTrackingModule import HandDetector import mouse import numpy as np import pyautogui def game(): cap = cv2.VideoCapture(0) cam_w, cam_h = 560, 480 cap.set(3, cam_w) cap.set(4, cam_h) frameR = 100 detector = HandDetector(detectionCon=0.80, maxHands=1) pressed = Fal...
Python
1
645) -> zwqgf, wnmbn, jipgo ompzpgp (290) -> uemklxf, vwltm mbvjj (76) kbyrlz (35) adwzzi (71) -> yirmii, pptok, iqcjr, uhuieb fplzsya (201) -> ifdeve, sdiyd qrpis (19) -> srbczq, efajqe, qdxvydf qdibw (78) ouuud (11) wohob (108) -> drdvm, mdbzm, bmswiwx, fjuudqb lbflpug (252) -> mgqfs, bpknup, qxubki, bbijzr xeyfy (51...
Rust
0
import os import time import pytest def count_characters_from_file(char_to_count, file_to_count): ''' Open a file and count the characters in the text contained in the file ''' number = 0 with open(file_to_count) as fp: for line in fp: for char in line: if c...
Python
1
u8, duration_days: u8, } fn main() { let gemini_2 = Mission { project: Project::Gemini, number: 2, duration_days: 0, }; let mut missions: [&Mission; 2] = [&gemini_2, &gemini_2]; unsafe { let m0 = missions.get_unchecked_mut(0); let _m1 = missions.get_unchec...
Rust
0
dom_uniform([self.vocab_size, self.embed_size],-1.0,1.0) # test started def test(): # below is a function test; if you use this for text classifiction, you need to tranform sentence to indices of vocabulary first. then feed data to the graph. num_classes = 3 learning_rate = 0.01 batch_size = 8 dec...
Python
1
DecodeErrorKind::InvalidDescriptor)) } pub fn parameters(&self) -> impl Iterator<Item = TypeDescriptor<'a>> + 'a { struct Parameters<'a> { chars: CharsLossy<'a>, } impl<'a> Iterator for Parameters<'a> { type Item = TypeDescriptor<'a>; fn next(&mut s...
Rust
0
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
Python
1
recv<'de, Msg: Deserialize<'de>>(&'de mut self) -> io::Result<Msg> { let mut len = [0,0,0,0]; self.stream.read_exact(&mut len).await?; let len = u32::from_be_bytes(len) as usize; self.buffer.clear(); self.buffer.resize(len, 0u8); self.stream.read_exact(&mut self.buffer...
Rust
0
self.send_find_value_query(&closest[0], key).await.unwrap(); } } } pub async fn bootstrap(&mut self, seed_node_socket_addr_opt: Option<SocketAddr>) -> Result<()> { // if let Some(seed_node_socket_addr) = seed_node_socket_addr_opt { // use resolve::resolve_host; // let entry_node_ip_addr: ...
Rust
0
Date::from_ymd(2004, 6, 11), // <NAME> dead at 93 // https://georgewbush-whitehouse.archives.gov/news/releases/2006/12/20061228-2.html NaiveDate::from_ymd(2007, 1, 2), // <NAME> NaiveDate::from_ymd(2012, 10, 29), NaiveDate::from_ymd(2012, 10, 30), // <NAME> dead at 94 NaiveDate::from_ymd...
Rust
0
entity.components_mask() & mask != 0) { let velocity = velocities.get_mut(*entity); if velocity.is_movable && velocity.y < MAX_VELOCITY { velocity.y += 1; } } Ok(UpdateStatus::Continue) } } struct Render; impl System for Render { fn u...
Rust
0
h names[0].as_str() { "allowaperture" => mib.push(MACHDEP_ALLOWAPERTURE), "kbdreset" => mib.push(MACHDEP_KBDRESET), "lidaction" => mib.push(MACHDEP_LIDACTION), "pwraction" => mib.push(MACHDEP_PWRACTION), _ => return Err(Error::invalid_argument()), }; let res = Sysctl::ne...
Rust
0
le_decode_segment(encoded) assert ds.Rows * ds.Columns == len(redecoded) assert decoded == redecoded # Tests for deprecated rle_encode_frame() function @pytest.mark.skipif(not HAVE_NP, reason="Numpy not available") class TestRLEEncodeFrame: """Tests for rle_encode_frame().""" def test_16_segme...
Python
1
eature = "serde-serialize")] pub(crate) fn default_query_dispatcher() -> std::sync::Arc<dyn parry::query::QueryDispatcher> { std::sync::Arc::new(parry::query::DefaultQueryDispatcher) } mod broad_phase_multi_sap; mod collider; mod collider_set; mod contact_pair; mod interaction_graph; mod interaction_groups; mod na...
Rust
0
_string(10)) data = "hello" f = open(filename, 'w') f.write(data) f.flush() sz = os.stat(filename).st_size os.remove(filename) #assert sz == len(data), "%d, %d"%(sz, len(data)) self.assertEqual(len(data), sz) # suppose the "multipart_size" is set ...
Python
1
""" Write a function to remove all elements from a given list present in another list. assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8]) == [1, 3, 5, 7, 9, 10] """ def remove_elements(list1, list2): for i in list2: if i in list1: list1.remove(i) return list1 print(remov...
Python
1
import torch def eval_depth(pred, target): assert pred.shape == target.shape thresh = torch.max((target / pred), (pred / target)) # print(len(thresh)) d1 = torch.sum(thresh < 1.25).float() / len(thresh) d2 = torch.sum(thresh < 1.25 ** 2).float() / len(thresh) d3 = torch.sum(thresh < 1.25 ** ...
Python
1
TokenTree::Group(group) => TokenTree::Group(PmGroup::new( group.delimiter(), self.apply_to_stream(group.stream(), endidness), )), TokenTree::Ident(ident) => { let ident_str = ident.to_string(); if ident_str == "_numname_" { ...
Rust
0
q(service_id)) .get_result(conn)?) } pub fn list( conn: &PgConnection, status: Option<TaxpayerServiceStatus>, ) -> Result<Vec<ViewableTaxpayerService>, Error> { Ok(match status { Some(TaxpayerServiceStatus::Authorized) => taxpayers_services_view::table .filter(taxpayers_services...
Rust
0
rate::config_file::TsConfig; use crate::diagnostics::Diagnostics; use crate::emit; use crate::graph_util::GraphData; use crate::graph_util::ModuleEntry; use deno_ast::MediaType; use deno_core::anyhow::anyhow; use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::located_script_name; use deno_c...
Rust
0
class Iters: def __init__(self, value): self.data = value def __getitem__(self, i): # Fallback for iteration print('get[%s]' % i, end = '') # Also for index, slice return self.data[i] def __iter__(self): # Preferred for iteration ...
Python
1
64_init(st: Hacl_Impl_Poly1305_64_State_poly1305_state, k1: *mut u8); } extern "C" { pub fn Hacl_Poly1305_64_update_block( st: Hacl_Impl_Poly1305_64_State_poly1305_state, m: *mut u8, ); } extern "C" { pub fn Hacl_Poly1305_64_update( st: Hacl_Impl_Poly1305_64_State_poly1305_state, ...
Rust
0
_scalar_to_montgomery, fiat_secp256k1_scalar_from_montgomery } ); impl Scalar { /// Get the multiplicative inverse /// /// Note that 0 doesn't have a multiplicative inverse and will result in a panic /// TODO this will change to being a method of NonZeroScalar pub fn inverse(&self) -> S...
Rust
0
from torch import Tensor import transformers.activations from ...ops.gelu import GELUFunction def gelu_forward( self: "transformers.activations.GELUActivation", input: Tensor, compress_kwargs: dict | None = None, ) -> Tensor: output = GELUFunction.apply( input, "none", compres...
Python
1
collide = true; for k in 1..3 { let (a, b, c) = get_quadratic_abc(particle_a, particle_b, k); if a * t * t + b * t + c != 0.0 { collide = false; break; } } if collide { result.push(t as i32); } } res...
Rust
0
import re from typing import List def check_args(args: List[str]): name_pattern = r"^[A-Za-z]+$" phone_pattern = r"^\+380\d{9}$" if len(args) != 2: return "Invalid number of arguments. Please provide name and phone number." elif not re.match(name_pattern, args[0]) or not re.match(phone_pattern...
Python
1
ut("Load JSON descriptions of algorithms unit tests.") .arg(Arg::with_name("json_unittests") .short("j") .long("json_unittests") .takes_value(true) .required(true) .help("A json unit tests file")) .arg(Arg::with_name("index") .short("...
Rust
0
n = int(input()) a=[] for i in range(n): a.append(int(input())) for i in range(n): if a[i]%2==0: print(a[i], end=" ")
Python
1
) -> Vec<SerializableMessage> { self.shared_data.broker.deadlettered().await } async fn scheduled(&self) -> Vec<SerializableMessage> { self.shared_data.broker.scheduled().await } } impl<B: Broker> Clone for IronworkerApplication<B> { fn clone(&self) -> Self { Self { ...
Rust
0
ternal_memory_capabilities"; /// `"VK_KHR_external_memory"` pub const VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME : &str = "VK_KHR_external_memory"; /// `"VK_KHR_external_memory_fd"` pub const VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME : &str = "VK_KHR_external_memory_fd"; /// `"VK_KHR_external_semaphore_capabilities"` pub ...
Rust
0
9 + 3"; let answer = evaluate_expression(&input, 2); assert_eq!(answer, 48); } #[test] fn test_example_2_1() { let input: &str = "1 + 2 * 3 + 4 * 5 + 6"; let answer = evaluate_expression(&input, 2); assert_eq!(answer, 231); } #[test] fn test_example_2_2()...
Rust
0
or: self.connector.clone(), } } } impl<T: Address, U> ServiceFactory<Connection<T, U>> for NativetlsConnector where U: ActixStream + 'static, { type Response = Connection<T, TlsStream<U>>; type Error = io::Error; type Config = (); type Service = Self; type InitError = (); type F...
Rust
0
rn target return None except Exception as e: print(f"Debug: Error in _create_target_from_indicators: {e}") return None def _create_target_from_momentum(self, features_df): """Create target from momentum indicators""" try: # Strategy 1: Mome...
Python
1
""" CD to this directory to run these invoke commands. """ from __future__ import annotations import pathlib from typing import Optional import invoke import pandas as pd TEST_ROOT = pathlib.Path(__file__).parent.parent.parent.resolve(strict=True) @invoke.task(aliases=["gen-assets"]) def generate_asset_files( ...
Python
1
.expect("Unable to alloc page for packet_buffer") .as_ptr() as u64; // Allocate 0x3000 bytes for each buffer. 0x2000 + 16 is needed, just going to use 3 pages each // Crude way to alloc 3 pages for our packets // Alloc Page 2 ...
Rust
0
sentence = "Today I learned Python Programming" hasJava = "Java" in sentence hasPython = "Python" in sentence print(hasJava) print(hasPython) print("-----------------------------") print("Java" not in sentence) print("Python" not in sentence)
Python
1
# * Ejercicio 3 # Leer un Excel y listar las columnas que contiene. import pandas as pd df = pd.read_excel("C:/Users/katec/OneDrive/Escritorio/PROYECTOS/Python-Practices/Artech/Excel/viajes.xlsx", sheet_name="Sheet1") print() columns = df.columns print(columns) print("-------------------------------------------...
Python
1
from __future__ import annotations import os from dataclasses import dataclass from dotenv import load_dotenv load_dotenv() @dataclass class LLMSettings: enabled: bool api_key: str | None model: str = "gpt-4o-mini" temperature: float = 0.2 def get_llm_settings() -> LLMSettings: key = os.getenv("O...
Python
1
match e { Endian::LE => (lo << 8) | hi, Endian::BE => (hi << 8) | lo, } }) .collect(); Cow::from(String::from_utf16_lossy(&ws)) } } } } <gh_stars>1-10 #![no_...
Rust
0
<'a> { w: &'a mut W, } impl<'a> SUS_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"W...
Rust
0
"campaign_performance"]} @app.get("/metrics/channels/", tags=["Metrics"]) def get_channel_metrics( start_date: date = Query(None, description="Start date for metrics"), end_date: date = Query(None, description="End date for metrics"), channel_id: Optional[int] = Query(None, description="Filter by channel I...
Python
1
son", "w") as f: json.dump(matches_for_json, f, indent=2) print(f"[INFO] Zapisano {len(matches_for_json)} dopasowań do pliku 'analysisResults.json'.") else: print("[INFO] Brak dopasowań – nie tworzę pliku 'analysisResults.json'.") # Zwracamy listę słowników (jednolity format) re...
Python
1
rmat the result items to the output @type result: Result @param result: The result of the request @returns Tuple[str, str, str, str, str, str]: The tuple with the formatted result items """ payload, rtt, length, words, lines = ResultUtils.get_formatted_result( self._...
Python
1
scores = [] while 1: score = input("Enter score (or just ENTER to end): ") if not score: break scores.append(int(score)) for i, score in enumerate(scores): print(f"Student #{i+1} score: {score}") score_avg = sum(scores) / len(scores) score_min = min(scores) score_max = max(scores) print(f"Av...
Python
1
from .neighbor import serial_neighbor
Python
1
".into())); aeon.add_property(aeon_value); let ser = aeon::serialize(aeon); assert_eq!("character: \"erki isthename\"\n\n", ser); } #[test] pub fn serialize_ip_property() { let mut aeon = AeonObject::new(); let aeon_value = AeonProperty::new( "ip".into(),...
Rust
0
.with_context(|| format!("Failed to read signature from {}", npk.display()))?; let mut signature = String::new(); signature_file.read_to_string(&mut signature)?; Hashes::from_str(&signature).context("Failed to load hashes")? }; let (fs_offset, fs_size) = { let f = archi...
Rust
0
lista = [] for x in range(3): for y in range(3): lista.append((x, y)) lista = [ (x, y) for x in range(3) for y in range(3) ] lista = [ [(x, letra) for letra in 'Luiz'] for x in range(3) ] print(lista)
Python
1
Test the text-to-speech functionality. Parameters ---------- text : str, optional The text to be converted to audio. If not provided, a default test text will be used. Returns ------- None Notes ------- This test uses the ge...
Python
1
, it handles the results based on the fit_code: logs and prompts success or failure. """ scm = SoundcardCalibrationManager() if len(self.output_voltage_value) != self.calibration_param["calibration_nums"]: self.calibration_popup(success_flag=False) self.default_logger.err...
Python
1
from src.testproject.enums.report_type import ReportType from src.testproject.sdk.drivers import webdriver DEV_TOKEN = "YOUR_DEV_TOKEN" def test_local_report(): driver = webdriver.Chrome( token=DEV_TOKEN, project_name="Report Decorator Project", job_name="Report Decorator Job", re...
Python
1
ime and line_time > end_time: in_session = False break if in_session: session_lines.append(line.rstrip('\n')) return { "session_id": session_id, ...
Python
1
GlobalContext: *mut ::std::os::raw::c_void; } extern "C" { pub fn process_site_Renviron(); } extern "C" { pub fn process_system_Renviron(); } extern "C" { pub fn process_user_Renviron(); } extern "C" { pub static mut R_Consolefile: *mut FILE; } extern "C" { pub static mut R_Outputfile: *mut FILE; } ...
Rust
0
link_name = "llvm.aarch64.crypto.sha512h")] fn vsha512hq_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t; } vsha512hq_u64_(a, b, c) } /// SHA512 hash update part 2 #[inline] #[target_feature(enable = "neon,sha3")] #[cfg_attr(test, assert_instr(sha512h2))] pub unsafe fn vsha512h2q_u64(a...
Rust
0
plicit), } #[derive(Clone, Debug, PartialEq, Node)] pub struct NetPortTypeInterconnect { pub nodes: (Keyword, ImplicitDataType), } #[derive(Clone, Debug, PartialEq, Node)] pub struct VariablePortType { pub nodes: (VarDataType,), } #[derive(Clone, Debug, PartialEq, Node)] pub enum VarDataType { DataType(B...
Rust
0
sert("~/".into(), "./".into()); imports.insert("comps/".into(), "./components/".into()); imports.insert("lib".into(), "./lib/mod.ts".into()); imports.insert("react".into(), "https://esm.sh/react".into()); imports.insert("react-dom/".into(), "https://esm.sh/react-dom/".into()); imports.insert( ...
Rust
0
or::Error; use std::fs::File; use std::io::{Read, Seek, SeekFrom}; use std::collections::HashMap; use crate::header::*; use crate::symbols::*; use crate::section::{Strtab, Section, SecHeader, SecHeader32, SecHeader64, SH_Type}; use crate::segment::{Segment, ProgHeader, ProgHeader32, ProgHeader64}; use byteorder::*; ...
Rust
0
IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the copyright holders s...
Rust
0
display += 1; } } } if count > opt.max { println!("there was {} entries only {} was displayed", count, display); } else { println!("there was {} entries:", count); } Ok(()) } #[derive(Debug, StructOpt)] pub(crate) struct SegmentValidateOpt { ...
Rust
0
eshCoord(5)]); let x = Mon3d { exps: [Deg(1), Deg(0), Deg(0)] }; let y = Mon3d { exps: [Deg(0), Deg(1), Deg(0)] }; let z = Mon3d { exps: [Deg(0), Deg(0), Deg(1)] }; let x2_y3 = |x: &[R]| -> R { pow(x[0]-mins[0], 2) * pow(x[1]-mins[1], 3) }; assert_approx(rmesh3x4x5.intg_global_fn_x_facerel_mon_on_fe_i...
Rust
0
F8SU016PKWPeVEpuKQ2ksT9enIf1hVrzlypOkhFTFhIS28IT9OQZ3BS3693487mSb6QNuuaBCD8yNWWlo74c79EFWUWNaAmRcSxVaNcbDa80SovlnL8lyO2yS7XlmE7rPmLI4IvPtko3QguI4Th2JPrVnM7QCCjMgvlIO".as_bytes()); assert_eq!( hash[0], [ 0xe5, 0x0b, 0xe7, 0x33, 0x07, 0x72, 0xe0, 0x89, 0xf6, 0x5e, 0x0e, 0xf...
Rust
0
import xml.etree.ElementTree as ET from typing import IO def outputElement(el: ET.Element, stream: IO, ns:str=None, offset:str=""): tag = el.tag namespace=None if '}' in tag: (namespace, tag) = tag.split("}") namespace = namespace.replace("{", "") stream.write(offset) stream.write("...
Python
1
::windows_sys::core::GUID { data1: 4146755297, data2: 60170, data3: 4560, data4: [172, 228, 0, 0, 192, 204, 22, 186] }; pub const KSDATAFORMAT_TYPE_VIDEO: ::windows_sys::core::GUID = ::windows_sys::core::GUID { data1: 1935960438, data2: 0, data3: 16, data4: [128, 0, 0, 170, 0, 56, 155, 113] }; #[repr(C)] #[doc = "*Req...
Rust
0
wf_setting.workflow_settings[self.LAST_LOADED_ID_KEY] load_queue = self.origin.list_events(last_loaded, self.BATCH_LIMIT) self.log.info(f"Found {len(load_queue)} events to load.") if not load_queue: self.log.info("Quitting.") return # Sav...
Python
1
ClockProvider { fn clock_for(&self, _: ::wdt::Wdt) -> Hz { self.gclk_wdt() } } impl<CP> ClockFor<::rtc::Rtc> for Clocks<CP> where CP: ClockProvider { fn clock_for(&self, _: ::rtc::Rtc) -> Hz { self.gclk_rtc() } } impl<CP> ClockFor<::adc::Adc> for Clocks<CP> where CP: ClockProvider { fn clock_for(&self, _...
Rust
0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Weight Shapes are in the format # ([K, N], TP_SPLIT_DIM) # Example: # A shape of ([14336, 4096], 0) indicates the following GEMM shape, # - TP1 : K = 14336, N = 4096 # - TP2 : K = 7168, N = 4096 # A shape...
Python
1
ted_time): ticker_list = get_ticker_list() all_output = [] with ProcessPoolExecutor(max_workers=8) as executor: # 최대 8개의 프로세스 사용 futures = {executor.submit(process_stock_data, ticker_info): ticker_info for ticker_info in ticker_list} for future in as_completed(futures): ...
Python
1
} }; } m!(Test); #[test] fn test_to_lower() { assert_eq!(my_test_here(0), "test"); } } #[test] fn test_env_to_lower() { paste::expr! { struct [<Lib env!("CARGO_PKG_NAME"):lower>]; let _ = Libpaste; } } mod test_to_upper { macro_rules! m {...
Rust
0