text
string
label_name
string
labels
int64
h a blurry background. ' "There is a light shining on the top of the kitten's head and the front of its body.") def test_pixtral(): pt_engine = PtEngine('AI-ModelScope/pixtral-12b') _infer_model(pt_engine, messages=[{'role': 'user', 'content': '<image>这是什么'}]) def test_glm_edge_v(): pt_engine = ...
Python
1
FA_def_cfa_register = 0x0d DW_CFA_def_cfa_offset = 0x0e DW_CFA_def_cfa_expression = 0x0f DW_CFA_expression = 0x10 DW_CFA_offset_extended_sf = 0x11 DW_CFA_def_cfa_sf = 0x12 DW_CFA_def_cfa_offset_sf = 0x13 DW_CFA_val_offset = 0x14 DW_CFA_val_offset_sf = 0x15 DW_CFA_val_expression = 0x16 DW_CFA_GNU_args_size = 0x2e # Co...
Python
1
.add_text_field(&name.into(), text_options); } let schema = schema_builder.build(); let index = match cache_dir { None => Index::create_in_ram(schema.clone()), Some(index_dir) => { fs::create_dir_all(&index_dir)?; let mut index_res = Index::open_or_cre...
Rust
0
).max().unwrap() + 1; let y_dim = points.iter().map(|t| t.1).max().unwrap() + 1; let mut matrix = vec![false; x_dim * y_dim]; for (x, y) in points { matrix[x + (y * x_dim)] = true; } DotMatrix { matrix: matrix, x_dim: x_dim, y_dim: ...
Rust
0
if isinstance(l, list): ret = ', '.join(map(str, l)) else: ret = l if remove_blank: ret = ret.replace(' ', '') return ret def clean_text(raw_text: str) -> str: """ Cleans the raw text by removing HTML tags, special characters, and extra spaces. Args: raw_tex...
Python
1
(&file_pattern) { format!("!./{}", &file_pattern[1..]) } else { format!("./{}", file_pattern) } } } fn process_config_patterns(file_patterns: Vec<String>) -> Vec<String> { file_patterns.into_iter().map(process_config_pattern).collect() } fn process_config_pattern(file_pattern: String) -> Strin...
Rust
0
pub ulNumBuffers: u32, } impl ::core::marker::Copy for WIA_EXTENDED_TRANSFER_INFO {} impl ::core::clone::Clone for WIA_EXTENDED_TRANSFER_INFO { fn clone(&self) -> Self { *self } } #[doc = "*Required features: `\"Win32_Devices_ImageAcquisition\"`*"] pub const WIA_FEEDER_CONTROL_AUTO: u32 = 0u32; #[d...
Rust
0
x31\x01"; const BMP: &'static [u8] = b"BM"; const BGP: &'static [u8] = b"BPG\xfb"; const RGB: &'static [u8] = b"\x01\xda"; const FLIF: &'static [u8] = b"FLIF"; const ICO: &'static [u8] = b"\x00\x00\x01\x00"; #[inline] fn is_pbm(ref bytes: [u8; 32]) -> bool { return bytes[0] == b'P' && b"14".contains(&bytes...
Rust
0
Buttons for operations read_button = tk.Button(root, text="Read Data", command=lambda: perform_card_operation("read")) read_button.pack(pady=5) write_button = tk.Button(root, text="Write Data", command=lambda: perform_card_operation("write")) write_button.pack(pady=5) data_entry_label = tk.Label(root, text="Data to ...
Python
1
// rebuild if source changed println!("cargo:rerun-if-changed={}", src); } // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing use spirv_std as _; #[derive(Clone, Copy)] #[spirv(matrix)] pub struct Affine3 { pub x: glam::Vec3, pub y: glam::Vec3, pub z: glam::...
Rust
0
0..num_params { w_new[j] = w[j]; } let mut g_new = self.grad_log_posterior(&w_new); for _ in 0..num_steps { for j in 0..num_params { p[j] = p[j] - 0.5*epsilon*g_new[j]; w_new[j] = w_new[j] + epsilon*p[j] ...
Rust
0
macro_rules! query_models_iter { ($query:expr, $cn:expr, $params:expr) => ( query_pg!($query, $cn, $params, rows, { rows.iter().map(|row| { ::deuterium_orm::adapter::postgres::from_row($query, &row) }) }) ) } #[macro_export] macro_rules! query_models { ...
Rust
0
from confluent_kafka import Producer p = Producer({"bootstrap.servers": "localhost:9092"}) def acked(err, msg): if err: print("Failed to deliver message:", err) else: print(f"Produced to {msg.topic()} [{msg.partition()}] at offset {msg.offset()}") for i in range(5): p.produce( "...
Python
1
E_EXTRACTOR = re.compile('(basic|enhanced|improved|trophy)*([a-z]+)(_(\\w+\\d*))*', re.I) _REWARD_NATION_EXTRACTOR = re.compile('.*({})'.format('|'.join(GUI_NATIONS)), re.I) def _extractRewardName(rewardRawName): name = _REWARD_NAME_EXTRACTOR.sub('\\2', rewardRawName) return name[0].upper() + name[1:] def _e...
Python
1
ash") sys.exit(1) merges[d["name"]] = d merges[d["name"]]["deps"] = [] if "base_model" in d: d["base_model"] = add_model_deps(d["base_model"], d["name"], out_path) if "slices" in d: for slc in d["slices"]: ...
Python
1
distribution_as_poisson(&'a self) -> Option<Poisson> { if self.distribution_type() == Distribution::Poisson { self.distribution().map(|u| Poisson::init_from_table(u)) } else { None } } } pub struct SampleArgs<'a> { pub address: Option<flatbuffers::WIPOffset<&'a str>>, pub name: Opti...
Rust
0
import os import streamlit as st import re from modules.layout import Layout from modules.utils import Utilities from modules.sidebar import Sidebar from youtube_transcript_api import YouTubeTranscriptApi from langchain.chains.summarize import load_summarize_chain from langchain.chains import AnalyzeDocumentChain from ...
Python
1
path_ifc = ifc.get_path() log_text = ifcgit.entity_log(path_ifc, step_id) # ERROR is only way to display a multi-line message operator.report({"ERROR"}, log_text) def install_git(ifcgit: type[tool.IfcGit], operator: bpy.types.Operator) -> None: if platform.system() == "Windows": ifcgit.in...
Python
1
from Client.Actions.Action import Action class AttackAction(Action): name = 'attack' def __init__(self, attacker, targets): self.attacker = attacker self.targets = targets super().__init__() def data(self): return { 'attacker': self.attacker.card.card_id, ...
Python
1
result as *const ffi::evmc_result); } } ret } } fn allocate_output_data(output: Option<Vec<u8>>) -> (*const u8, usize) { if let Some(buf) = output { let buf_len = buf.len(); // Manually allocate heap memory for the new home of the output buffer. let memlayo...
Rust
0
ended_context=False, ), Page=GenerationConfig( crop_image=CroppingStrategy.ALL, html=GenerationStrategy.LLM, llm=None, markdown=GenerationStrategy.LLM, embed_sources=["Markdown"], extended_context=Tru...
Python
1
Query, _melted_data: &[u8]| { let province_owners = query.province_owners(); let nation_events = query.nation_events(&province_owners); let histories = query.player_histories(&nation_events); assert_eq!(histories, true_heir_expected_histories()); } ); ironman_test!( revolution_...
Rust
0
} hint = path .parent() .and_then(|s| s.to_str()) .unwrap_or("") .to_string(); } else if let BufferContent::Scratch(..) = &editor_buffer.editor.content...
Rust
0
tId): self._RequestId = RequestId def _deserialize(self, params): self._ErrCode = params.get("ErrCode") self._ErrMessage = params.get("ErrMessage") if params.get("Result") is not None: self._Result = WechatPreAuthResult() self._Result._deserialize(params.get...
Python
1
import gmpy2 from Crypto.PublicKey import RSA f = open("key_public.txt", "r") key = RSA.importKey(f.read()) print("n:", key.n) print("e:", key.e) n = key.n # 26179751854087331402331071604988485626982836276798177195222446151071273439780592994270737435017138406631242790569709 e = key.e # 65537 p = 514695177218426930002...
Python
1
project. /// /// Note: currently only names are supported for user, user domain and project domain. ID support is /// coming later. /// /// Start with creating a `Password` object using [new](#method.new), then add a project scope /// with [with_project_scope](#method.with_project_scope): /// /// ```rust,no_run /// le...
Rust
0
#[test] fn ints() { // TODO: Test overflow? eq(5isize, vec![0, 3, 4]); eq(-5isize, vec![5, 0, -3, -4]); eq(0isize, vec![]); } #[test] fn ints8() { eq(5i8, vec![0, 3, 4]); eq(-5i8, vec![5, 0, -3, -4]); eq(0i8, vec![]); } #[test] fn...
Rust
0
from django import forms import vesper.django.app.form_utils as form_utils import vesper.django.app.model_utils as model_utils class TransferClipClassificationsForm(forms.Form): source_detector = forms.ChoiceField(label='Source detector') target_detector = forms.ChoiceField(label='Target detector') ...
Python
1
q| *freq); let inverse = self.inverse.lock(|inverse| *inverse); let (sp, last, kp, ki, kd, kf, kv) = self.reg.lock(|reg| { ( reg.sp, reg.last, reg.pid.kp, reg.pid.ki, reg.pid.kd, reg.pid.kf, reg.pid.kv, ) }); write!(shell, "{0}reg:\t{1}{0}f:\t{2} ...
Rust
0
from rest_framework import routers from django.urls import include, path from django.contrib import admin from labfairyapi.views import * router = routers.DefaultRouter(trailing_slash=False) router.register(r"equipment", EquipmentViewSet, "equipment") router.register(r"labequipment", LabEquipmentViewSet, "labequipmen...
Python
1
import numpy as np import matplotlib.pyplot as plt def cubic_spline_coeffs(p0, v0, p1, v1, tf): T = np.array([ [1, 0, 0, 0], [0, 1, 0, 0], [1, tf, tf**2, tf**3], [0, 1, 2*tf, 3*tf**2] ]) X = np.array([p0, v0, p1, v1]) a = np.lina...
Python
1
unsafe { &(*(::std::ptr::null::<cmsCurveSegment>())).Params as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(cmsCurveSegment), "::", stringify!(Params) ) ); assert_eq!( unsafe { &(*(::std::ptr::null...
Rust
0
#!/usr/bin/python3 """Starts a Flask web application. The application listens on 0.0.0.0, port 5000. Routes: /hbnb_filters: HBnB HTML filters page. """ from models import storage from flask import Flask from flask import render_template app = Flask(__name__) @app.route("/hbnb_filters", strict_slashes=False) def ...
Python
1
#!/usr/bin/env python from vtkmodules.vtkCommonDataModel import vtkSphere from vtkmodules.vtkIOImage import vtkPNGReader from vtkmodules.vtkImagingCore import vtkImageShiftScale from vtkmodules.vtkImagingStencil import ( vtkImageStencil, vtkImplicitFunctionToImageStencil, ) from vtkmodules.vtkInteractionImage i...
Python
1
hat use different derivation paths, its good to keep track of /// every address -> Private key pair, this can be done using a `std::collections::HashMap`, and this is how the more high-level /// keychain functions do it that exist in `xavax_crypto::avm::keys` or `xavax_crypto::eth::keys`, etc you get the point....
Rust
0
55)); ui_component.set_margine(hud_ui_margine); ui_component.set_padding(hud_ui_padding); ui_component.set_expandable(true); target_hud_layer.add_widget(target_distance); self._target_distance = target_distance; self._target_hull_point_widget = Some(HullPointWidget::crea...
Rust
0
/// ## Original /// /// [`slice::split_last`](https://doc.rust-lang.org/std/primitive.slice.html#method.split_last) /// /// ## API Differences /// /// `bitvec` uses a custom structure for both read-only and mutable /// references to `bool`. /// /// ## Examples /// /// ```rust /// use bitvec::prelude::*; //...
Rust
0
efix("Type"); if let Some(var_276) = &input.r#type { scope_275.number( #[allow(clippy::useless_conversion)] aws_smithy_types::Number::NegInt((*var_276).into()), ); } Ok(()) } #[allow(unused_mut)] pub fn serialize_structure_crate_model_port_range( mut writer: aws_...
Rust
0
import dbcan.constants.base_constants as base_constants # File paths and names CGC_GFF_FILE = base_constants.CGC_GFF_FILE CGC_RESULT_FILE = base_constants.CGC_RESULT_FILE CGC_CIRCOS_DIR = "cgc_circos" CGC_CIRCOS_PLOT_FILE = "cgc_circos_plot.svg" CGC_CIRCOS_CONTIG_FILE_TEMPLATE = "cgc_circos_{contig_name}.svg" DEG_FILE...
Python
1
cpal::SampleFormat::F32 => hound::SampleFormat::Float, } } fn wav_spec_from_config(config: &cpal::SupportedStreamConfig) -> hound::WavSpec { hound::WavSpec { channels: config.channels() as _, sample_rate: config.sample_rate().0 as _, bits_per_sample: (config.sample_format().sample_size(...
Rust
0
st.success("🚀 DECIDE Workflow started successfully!") SessionManager.add_log("INFO", "DECIDE Workflow initiated") # Navigate to workflow page st.rerun() except Exception as e: st.error(f"Failed to start workflow: {str(e)}") SessionManager.add_log("ER...
Python
1
from kivy.lang import Builder from plyer import gps from kivy.app import App from kivy.properties import StringProperty from kivy.clock import mainthread from kivy.utils import platform kv = ''' BoxLayout: orientation: 'vertical' Label: text: app.gps_location Label: text: app.gps_status ...
Python
1
4, 5, 4] """ was_list = False was_tuple = False if isinstance(array, list): array = np.array(array) was_list = True if isinstance(array, tuple): array = np.array(array) was_tuple = True if bit_number > 0: array &= ~(1 << bit_number - 1) if was_list...
Python
1
None => { let mut reader = BufReader::new(std::io::stdin()); self.produce_lines(&mut producer, &mut reader).await?; } }; if !self.interactive_mode() { print_cli_ok!(); } Ok(()) } async fn produce_lines<B>( ...
Rust
0
= 1: print (" Computer won.") else: print (" Dealer won.") print ("") temp = input ("Hit ENTER to see the next sample game.") # then, initialize the variables for the big run of 1000 games print ("") print ("Now, let me simulate 1000 games for you.") print ("") # the baseline variables ...
Python
1
er\s*10\b', # Matches "3 over 10", etc. r'\bscore\s+is\s+(\d{1,2})\b', # Matches "score is 10", "score is 3", etc. r'\brated\s+(\d{1,2})\s*/\s*10\b', # Matches "rated 7/10", etc. r'\brating\s+of\s+(\d{1,2})\s*/\s*10\b', # Matches "rating of 8/10", etc. r'\b...
Python
1
$($other:ty),+) => { impl Primitive for $t {} impl_primitive_for!($($other),+); }; ($t:ty) => {}; } // TODO: char? &str? SocketAddr? Path? Duration? NonZero*? impl_primitive_for![ bool, String, u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f32, f64 ]; macro_rules! impl_r...
Rust
0
content_desc = parts[0].strip() risk_part = parts[1].strip() time_part = parts[2].strip() risk_level = 'low' if '高风险' in risk_part or '高' in risk_part: risk_level = 'high' elif '中风险' in risk_part or '中' in risk_part: ...
Python
1
4>; #[doc = "Writer for register RCR4"] pub type W = crate::W<u32, super::RCR4>; #[doc = "Register RCR4 `reset()`'s with value 0"] impl crate::ResetValue for super::RCR4 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Frame Sync Direction\n\nValue on reset: 0...
Rust
0
CHIEU_RONG = 800 CHIEU_CAO = 400 CACH_HOANH = 0 CACH_TUNG = 0 BLACK="#000000" WHITE="#FFFFFF" RED="#FF0000" LIME="#00FF00" BLUE="#0000FF" YELLOW="#FFFF00" ICON = "C:\\Users\\Administrator\\Downloads\\whitespot.png"
Python
1
etimes.insert(last.game.clone(), date - last.date); } // record what is now playing, if anything match game { Some(game) => last_user_game.insert(user_id, GameDate { date, game }), None => last_user_game.remove(&user_id), }; } // users are currently play...
Rust
0
assert_eq!( "cpu-region_west-usage_system_53.1-2020-10-10 13:54:57", template .partition_key(&line, ARBITRARY_DEFAULT_TIME) .unwrap() ); } #[test] #[allow(clippy::trivial_regex)] fn test_sharder() { let shards: Vec<_> = (1000..1...
Rust
0
is LoggingEventInfo. Operator details of DataSource for a Problem :param operator: The operator of this LoggingEventInfo. :type: str """ self._operator = operator @property def log_result(self): """ Gets the log_result of this LoggingEventInfo. ...
Python
1
.rev().collect::<Vec<_>>(); iter_values.sort_unstable(); assert_eq!(iter_values, [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]); } #[test] fn iter_values_with_removal() { let mut arena = Arena::new(); let mut ins_values = (0..10).map(|i| arena.insert(i * 10)).collect::<Vec<usize>>...
Rust
0
players: Vec<T::AccountId>, ) -> T::Hash { let single_gomoku_app_account = Self::app_account(); let mut encoded = single_gomoku_app_account.encode(); encoded.extend(nonce.encode()); encoded.extend(players[0].encode()); encoded.extend(players[1].encode()); let sessio...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
&self.intermediates } fn save_dir(&self) -> Option<&Path> { self.underlying.save_dir() } fn composite(&self, s: u32) -> CompositeData<Self::Algebra> { let d1 = self.underlying.differential(s); let d0 = self.underlying.differential(s - 1); vec![(1, d1, d0)] }...
Rust
0
oc.to_dict() ltp_values.append((data.get('SN'),data.get('Symbol'), data.get('LTP'))) return ltp_values def main(): url = "https://www.sharesansar.com/live-trading" # url = "https://merolagani.com/LatestMarket.aspx" scraper = WebScraper(url) html_content = scraper.make_request() ...
Python
1
def calculer(a, b, op): if op == "+": return a + b elif op == "-": return a - b elif op == "*": return a * b elif op == "/": if b != 0: return a / b else: return "Division par zéro impossible." else: return "Opérateur non valide...
Python
1
if the conversion is naive and saturates or not const NOM: u32 = 4; const DENOM: u32 = 4_000_000; const INITIAL_INSTANT: EPInstantGeneric<NOM, DENOM> = EPInstantGeneric::from_ticks(EPContainer::MAX - 10); const RESULT_INSTANT: EPInstant = convert_instant(INITIAL_INSTANT); ...
Rust
0
#[doc = "0x04 - Interrupt Controller Type Register"] pub ictr: crate::Reg<ictr::ICTR_SPEC>, #[doc = "0x08 - Auxiliary Control Register"] pub actlr: crate::Reg<actlr::ACTLR_SPEC>, } #[doc = "ICTR register accessor: an alias for `Reg<ICTR_SPEC>`"] pub type ICTR = crate::Reg<ictr::ICTR_SPEC>; #[doc = "Interr...
Rust
0
(format!("{}", e)))?; Ok(()) } pub fn create_configuration_sample(config_file: &'a Path) -> Result<KafkyConfig, KafkyError> { print!( "Configuration file {} not found, do you want to create a sample one? [y/N]: ", config_file.display() ); let kafky_direct...
Rust
0
ror_type: &str) { assert_eq!(error_type, result.unwrap_err().error_type()); } fn assert_waveform( result: Result<FloatWaveform, Error>, num_channels: u32, num_frames: u64, frame_rate_hz: u32, ) { let waveform = result.unwrap(); assert_eq!(num_channels...
Rust
0
, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); self.w } } impl R { #[doc = "Bits 13:17"] #[inline(always)] pub fn gpio_pin16_int_ena(&self) -> GPIO_PIN16_INT_ENA_R { GPIO_PIN16_INT_ENA_R::new(((self.bits >> 13) & 0x1f) as u8) } ...
Rust
0
. static ref SCHEMA: Arc<Mutex<Option<Schema>>> = Arc::new(Mutex::new(None)); /// Variable to keep track of the state of the PackFile. static ref IS_MODIFIED: Arc<Mutex<bool>> = Arc::new(Mutex::new(false)); /// History for the filters, search, columns...., so table and loc filters are remembered when ...
Rust
0
be run without CUDA. Please specify a CUDA device.') deployment['image'] = 'nvcr.io/nvidia/tensorrtserver:19.10-py3' # ulimits currently can't be set on kubernetes #Check open issue: https://github.com/kubernetes/kubernetes/issues/3595 deployment['args'] = f'["trtserver", "--model-stor...
Python
1
k, Yellow, Dark red, Green, Blue, Orange, Purple and Crimson brown. /// Grey is used for all ranks that are not in the top 8. When in ordinal /// we simply use the rank as an index. pub fn rank_to_color(&self, rank: &usize) -> Point3<f32> { match self.mode { // Ordinal color mode ...
Rust
0
in(512 / width, 512 / height) width_new, height_new = (round(width * ratio), round(height * ratio)) width_new = int(np.round(width_new / 64.0)) * 64 height_new = int(np.round(height_new / 64.0)) * 64 img = img.resize((width_new, height_new)) img = img.convert('RGB') img.s...
Python
1
31 2 1", TemporaryDataWorkspace="dataMD", TemporaryNormalizationWorkspace="normMD", OutputWorkspace="result", OutputDataWorkspace="dataMD", OutputNormalizationWorkspace="normMD", ) self.assertRaises( RuntimeError, MDNorm...
Python
1
parser::interner::*; use dora_parser::parser::NodeIdGenerator; pub use self::annotations::{Annotation, AnnotationId}; pub use self::classes::{ class_accessible_from, class_field_accessible_from, find_field_in_class, find_method_in_class, find_methods_in_class, method_accessible_from, Candidate, Class, ClassDef...
Rust
0
import os # 导入模块 from app import book from app import entodo from app import pomodoro def clear(): os.system('cls' if os.name == 'nt' else 'clear') # 示例调用 def main(): # 定义颜色:模仿苹果官网风格 WHITE = '\033[38;5;15m' # 白色(主要文本色) LIGHT_GRAY = '\033[38;5;245m' # 浅灰色(次要信息) GREEN = '\033[38;5;34m' ...
Python
1
if !config.relations.skip { tr.execute( "CREATE TABLE relations ( id INTEGER PRIMARY KEY )", [], )?; create_index(&config.relations, "relations")?; if !config.relation_members.skip { tr.execute( "CREATE...
Rust
0
on.metric("CIFAR-100 Image Recognition", "http://https://www.cs.toronto.edu/~kriz/cifar.html", scale=correct_percent) cifar10 = image_classification.metric("CIFAR-10 Image Recognition", "http://https://www.cs.toronto.edu/~kriz/cifar.html", scale=correct_percent, target=94, target_source="http://karpathy.github.io/2011...
Python
1
target_tdfs(); let mut client = TDFSClient::new(target)?; client.read_file(file_id, check_user_id) } fn get_input(&mut self) -> WorkerInput { self.worker_input.clone() } fn save_file_for_task_creator(&mut self, data: &[u8]) -> Result<String> { self.save_file(data, &self...
Rust
0
Buf, DmaError, GenericStatusCode, IoCompletionCallback, IoCompletionCallbackArg, IoCompletionStatus, IoType, NvmeCommandStatus, }, ffihelper::{cb_arg, done_cb, FfiResult}, subsys, }; use super::NvmeIoChannelInner; /* * I/O context for NVMe controlle...
Rust
0
8") as f: for ln in f: ln=ln.strip() if not ln: continue try: rec=json.loads(ln) except: records.append(ln) continue total += 1 texts=rec.get("texts") or {} chars=rec.get("chars") or {} has_any = any(isinstance(text...
Python
1
ty1), SignatureToken::Reference(ty2)) | (SignatureToken::MutableReference(ty1), SignatureToken::MutableReference(ty2)) => { compare_types(context, ty1, ty2, def_module) } (SignatureToken::TypeParameter(idx1), SignatureToken::TypeParameter(idx2)) => { if idx1 != idx2 { ...
Rust
0
hashmap: HashMap<u64, u64> = HashMap::default(); let start = Instant::now(); for i in 0..iters { assert!(hashmap.insert(i, i).is_ok()); } let elapsed = start.elapsed(); drop(hashmap); elapsed }) }); } fn insert_array_w...
Rust
0
=false,s=\"c\" 1000", "h2o,state=MA,city=Cambridge f=7.0,i=7i,b=true,s=\"a\" 2000", ]; let lp_lines2 = vec![ "h2o,state=MA,city=Cambridge f=6.0,i=6i,b=true,s=\"z\" 3000", "h2o,state=MA,city=Cambridge f=5.0,i=5i,b=false,s=\"c\" 4000", ]; make_two_chunk...
Rust
0
( r#"(Type<'a> {}) foo!()"#, r#"foo!(() (Type<'a>) () ({}) )"#, ), ( r#"(Trait<'a> for Foo {}) foo!()"#, r#"foo!(() trait(Trait<'a>) (Foo) () ({}) )"#, ), ( r#"(Trait<'a> for for<'a> Foo {}) foo!()"#, r#"foo!(() trait(Trait<'a>) (for<'a> Foo) () ({}) ...
Rust
0
# Copyright 2024 The Google Earth Engine Community Authors # # 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.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
1
# /entities/entities/enemies.py """`Enemies` module containing the `Enemy` sprite class.""" # Import 3rd-Party Dependencies import arcade # Import Local Dependencies from ...utils.constants import TILE_SIZE from ...utils.types import ClassVar, NamedTuple from ..particles import coins from . import entities, tanks ...
Python
1
margin = Some(TblCellMar::from_xml_element(xml_node)?), "tblLook" => self.look = Some(TblLook::from_xml_element(xml_node)?), _ => (), } Ok(self) } } #[derive(Debug, Clone, PartialEq)] pub struct TblPrExChange { pub base: TrackChange, pub properties_ex: TblPrExBase, ...
Rust
0
ans.push(vec2[j]); j += 1; } ans } } #[cfg(test)] mod tests { use super::*; #[test] fn test_1305() { } } <filename>chumbucket/src/commands/mod.rs<gh_stars>1-10 mod generate; mod index; pub use generate::generate_command; pub use index::index_command; <gh_stars>1-10 ...
Rust
0
if let Some(newop) = DEPR_BINOPS.get(&op) { self.push(Warning::with_info(e.span, format!("use of deprecated operator `{}`", op), vec![format!("use `{}` instead", newop)] )); } }, ExprKind::UnO...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. All Rights Reserved. # # 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.org/licenses/LICENSE-2.0 # # Unless requir...
Python
1
ransform, response: Prediction) { let key = BoardTuple::new(board, to_move); self.cache_table.lock().expect("could not acquire cache table lock") .insert(&key, Prediction::with_transform(&response, symmetry.inverse())); } fn predict(&self, features_list: &[f16], batch_size: usize) ...
Rust
0
&Vec::from(reserve_in_usd.to_string()), ); } return reserve_in_bnb; }; let reserve0_bnb = apply( t0_derived_bnb_price, pair.token0_address.clone(), ...
Rust
0
# Generated by Django 5.0.7 on 2024-07-26 12:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_alter_user_twitter'), ] operations = [ migrations.AlterField( model_name='user', name='facebook', ...
Python
1
rl') sThumb = oInputParameterHandler.getValue('sThumb') sMovieTitle = oInputParameterHandler.getValue('sMovieTitle') clientID, deviceID, sid = getData() sHosterUrl = sUrl sHosterUrl += "?appName=web&appVersion=5.14.0-0f5ca04c21649b8c8aad4e56266a23b96d73b83a&deviceDNT=false" sHosterUrl += "&dev...
Python
1
try: val=next(generators[i][0]) value+=val*generators[i][1] i+=1 except StopIteration: del generators[i] # 此时i不加1 if not generators:return yield int(value) def wave_mixer(sounds,seconds,volume,samprate,sampwidth): ...
Python
1
me.as_ptr(), ptrs.as_ptr(), lens.as_ptr(), ptrs.len() as c_int); } Ok(()) } /// Sets an int-valued attribute. pub fn set_attr_int(&mut self, attr_name: &str, value: i64) -> std::result::Result<(), NulError> { let c_attr_name = try!(CString::new(attr_name)); unsafe { ...
Rust
0
); let ss = parse_input(&input); println!("Part 1: {}", part1(&ss)); println!("Part 2: {}", part2(&ss)); } fn parse_input(str: &str) -> Vec<Vec<u32>> { str.lines().map(|line| line.split_whitespace().map(|x| x.parse().unwrap()).collect()).collect() } fn part1(ss: &Vec<Vec<u32>>) -> u32 { ss.iter()...
Rust
0
passID = newPassword return 0 case 3: return 0 case _: print("Error, not a valid choice") def repairChoice(listName): while True: print("Welcome\n 1.Repair specific tab...
Python
1
::new_builtin(BuiltinNetworkID::Halley); let (storage, chain_info, _) = Genesis::init_storage_for_test(&net)?; let chain = BlockChain::new(net.time_service(), chain_info.head().id(), storage.clone())?; let (sender, _) = unbounded(); let chain_status = chain.status(); let target = SyncTarget { ...
Rust
0
y_obs_mean)) mult = mult * mult y_obs_sq = sum((y_obs - y_obs_mean) * (y_obs - y_obs_mean)) y_pred_sq = sum((y_pred - y_pred_mean) * (y_pred - y_pred_mean)) return mult / (float(y_obs_sq * y_pred_sq) + 0.00000001) def get_k(y_obs, y_pred): y_obs = np.array(y_obs) y_pred = np.array(y_pred) ...
Python
1
#!/usr/bin/env vpython3 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. Al...
Python
1
mpl.rcParams["mathtext.fontset"] = "stix" plt.figtext(0.5, 0.5, "Mass $m$") @pytest.mark.parametrize('fonttype', ["3", "42"]) def test_fonttype(fonttype): mpl.rcParams["ps.fonttype"] = fonttype fig, ax = plt.subplots() ax.text(0.25, 0.5, "Forty-two is the answer to everything!") buf = io.Byt...
Python
1
{ if row.name == struct_name { stream.push(row.identifier.clone()); stream.push(":".to_string()); stream.push(get_default_value_for(row.member_type)); stream.push(",".to_string()); } } stream.push("};".to_string());...
Rust
0
F) { let n = num_cpus::get(); let cnt = CNT / n; thread::scope(|s| { for _ in 0..n { s.spawn(|_| { let cnt = cnt; f(cnt); }); } }).unwrap(); } #[bench] fn alloc_multi(b: &mut Bencher) { b.iter(|| { split(boxed_sequence...
Rust
0