text
string
label_name
string
labels
int64
, ) -> Result<ThresholdEcdsaSigShare, ThresholdEcdsaSignShareError> { Ok(ThresholdEcdsaSigShare { sig_share_raw: vec![], }) } } impl ThresholdEcdsaSigVerifier for CryptoReturningOk { fn verify_sig_share( &self, _signer: NodeId, _inputs: &ThresholdEcdsaSig...
Rust
0
fft_values = fft(sample) fft_magnitude = np.abs(fft_values[positive_freq_idx]) / seq_length plt.plot(frequencies, fft_magnitude, color=lead_colors[0], label='导联 1') else: # 多导联 for lead in range(n_leads): if lead_dim == 1: # (样本数, 导联数, 序...
Python
1
import math from string import ascii_lowercase, digits SYNDICATION_URL = "https://cdn.syndication.twimg.com" TWEET_URL = f"{SYNDICATION_URL}/tweet-result" def validate_tweet_id(tweet_id: str) -> bool: """Validates a tweet ID. This function checks if the given tweet ID is less than 40 characters long and ...
Python
1
ators=100, learning_rate=0.05, max_depth=3, random_state=34) model.fit(X_train, y_train) merged_data["PredictedRaceTime (s)"] = model.predict(X_imputed) # sort the results to find the predicted winner final_results = merged_data.sort_values("PredictedRaceTime (s)") print("\n🏁 Predicted 2025 Emilia Romagna GP Winner �...
Python
1
query_index: u32, ) -> Result<(), QueryError> { let hub = A::hub(self); let mut token = Token::root(); let (mut cmd_buf_guard, mut token) = hub.command_buffers.write(&mut token); let (query_set_guard, _) = hub.query_sets.read(&mut token); let cmd_buf = CommandBuffe...
Rust
0
# Copyright (c) 2025, NVIDIA 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
1
hat if we use method 1, # we are quite likely to lose the bet when cat is the correct decision. # # It turns out that by switching from method 1 to method 2, we gain 0.5~0.8 mAP in evaluation. # # One obvious drawback of method 2 is that it is significantly slower than method 1. # For N classes, method 2 has O(N) compl...
Python
1
istKey::new(realm, PersistKind::Certificate, &primary_name); debug!("Save certificate: {}", pk_crt); persist.put(&pk_crt, cert.as_bytes())?; Ok(Certificate::new(pkey_pem.to_string(), cert)) } /// Access the underlying JSON object for debugging. pub fn api_order(&self) -> &ApiOrder ...
Rust
0
= ch_mgr(&self.ch_mgrs, id) { if ch_e.is_blocked(t, &delta) { return true; } } else { error!("out events of channel {} not found", id); } } false } else { fals...
Rust
0
!(&reloaded.get(&i).unwrap()[..], &i); assert!(reloaded.contains_key(&i)); assert!(reloaded.remove(&i).unwrap().is_some()); assert!(!reloaded.contains_key(&i)); }); assert_eq!(1, reloaded.len()); reloaded.clear(); assert!(reloaded.is_empty()); reloaded.version_create(Versio...
Rust
0
def get_perturbed_connectivity_from_single_neuron(perturbed_X, selected_neuron): """ Computes the connectivity matrix from the selected neuron using differences in means. Args: perturbed_X (np.ndarray): the perturbed dynamical system matrix of shape (n_neurons, timesteps) se...
Python
1
oXh1IFrHgK06gk1wl5LaxY2i/CQgBoWIPx9o2EYMBbNfQcu+pRzFmiDjzT6BIhYrPbo+gm6wHFiNhp3FvAuSUH2/N+5MKZo7Eh7LwgGLc0fL4MEI").unwrap(), post_rand: base64::decode("<KEY>").unwrap(), candidates: vec![etik] }; BlockHeader::builder() .miner_address(Address::new_id(1227).unwrap()) ...
Rust
0
# Umi-OCR # OCR software, free and offline. 开源、免费的离线OCR软件。 # Website - https://github.com/hiroi-sora/Umi-OCR # Author - hiroi-sora # # You are free to use, modify, and distribute Umi-OCR, but it must include # the original author's copyright statement and the following license statement. # 您可以免费地使用、修改和分发 Umi-OCR ,但必须包含...
Python
1
est_time, 754018); } #[test] fn earliest_time_buses_depart_in_sequence_in_example4() { let notes = parse_bus_service_notes(EXAMPLE4); let earliest_time = earliest_time_buses_depart_in_sequence(&notes); assert_eq!(earliest_time, 779210); } #[test] fn earliest_time_buses_depart_in_sequence_in_example5() {...
Rust
0
test: i = 0 print("[INFO] Evaluating test_loader ...") for _, (data, target) in enumerate(tqdm(self.eval_loader)): _, output = step_fwd(self.pipeline, self.device, data, target, train=False) ...
Python
1
# -*- coding:utf-8 -*- ''' 基于PCA9685 I2C舵机控制模块对舵机进行控制的库 上臂舵机 控制精度: 0.45度 下臂舵机 控制精度: 0.63度 ''' import pca9685 import math from car_config import car_property class Servo: ''' 利用PCA9685控制Servo ''' def __init__(self, pca9685, servo_idx, min_duty=30, max_duty=130, angle_range=180, default_angle=90): ...
Python
1
# !/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'limin' ''' R-Breaker策略(非隔夜留仓: 在每日收盘前,对所持合约进行平仓) 参考: https://www.shinnytech.com/blog/r-breaker 注: 该示例策略仅用于功能示范, 实盘时请根据自己的策略/经验进行修改 ''' from datetime import datetime from tqsdk import TqApi, TqAuth, TargetPosTask SYMBOL = "SHFE.au2006" # 合约代码 CLOSE_HOUR, C...
Python
1
me = "type")] pub ty: String, pub volume: f64, pub x: f64, pub y: f64, /// Name of the item's parent (if this item belongs to a group). #[serde(rename = "parentGroupName")] pub parent_group_name: Option<String>, /// List of children (if this item is a group). #[serde(rename = "groupC...
Rust
0
/// A reconfigurable file system that tracks map and unmap operations. #[derive(Default)] struct MockFS { /// Capture of all reconfiguration requests received, in order. /// /// Map operations are recorded as "map foo" and unmap operations are recorded as "unmap /// foo", whe...
Rust
0
era, # (B*Dx*Dy*Dz, ) avg_factor=num_total_samples ) loss['loss_occ'] = loss_occ else: voxel_semantics = voxel_semantics.reshape(-1) preds = einops.rearrange(occ_pred, 'b x y z cls -> (b x y z) cls') if self.class_balance: ...
Python
1
$(#[$attr])* #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[repr(transparent)] pub struct $name($under); impl $name { /// Wrap an integer if its value can be losslessly converted to ` #[doc = $str_name] /// `. pub fn new(val...
Rust
0
# import librosa # import librosa.display # import numpy as np # import matplotlib.pyplot as plt # # Загрузка аудиофайла # y, sr = librosa.load('.\music\Don_t Let Me Down (Illenium Remix).mp3') # # Вычисление RMSE # rms = librosa.feature.rms(y=y)[0] # # Визуализация (опционально) # times = librosa.times_like(rms, sr...
Python
1
p_size"], detect_threshold=p["detect_threshold"], detect_interval=p["detect_interval"], num_workers=p["num_workers"], verbose=verbose, ) # temporary folder ms4_version = Mountainsort4Sorter.get_sorter_version() if ms4_version != "unknown"...
Python
1
# https://forum.omz-software.com/topic/3710/how-to-spritesheet-subtexture/7 from scene import * x,y,xs,ys = 0,0,1,1 # Above sets up the initial subtexture(Rect(x,y,xs,ys)) on line 25 to show the full image until touch_began and touch_ended changes the coordinates of the subtexture to show whatever section you set in ...
Python
1
curve::Curve; use core::f64::consts::PI; use crate::plane::Plane; pub struct EllipseArcCurve { pub plane: Plane, pub a: f64, pub b: f64, pub angle: f64, } impl Default for EllipseArcCurve { fn default() -> Self { EllipseArcCurve::new(Plane::default(), 1.0, 2.0, PI) } } impl EllipseArcCurve { pub f...
Rust
0
e, $f, $g, $h>; Fed5::T1, Fed5::T2, Fed5::T3, Fed5::T4, Fed5::T5); fed_promotion!(Fed5 => Fed8; <$b, $d, $e, $g, $h> => <$a, $b, $c, $d, $e, $f, $g, $h>; Fed5<$b, $d, $e, $g, $h> => Fed8<$a, $b, $c, $d, $e, $f, $g, $h>; Fed5::T1, Fed5::T2, Fed5::T3, Fed5::T4, Fed5::T5); fed_promotion!(Fed5 => Fed8; <$b,...
Rust
0
import os import datasets def make_map_fn(split, source=None): def process_fn(example, idx): if source is None: data_source = example.pop("source") else: data_source = source question = example.pop("prompt") solution = example.po...
Python
1
from .shelf import Shelf from .toolkit_shelf import ToolkitShelf __all__ = [ "Shelf", "ToolkitShelf", ]
Python
1
import requests import os def download_file_from_google_drive(id, destination): def get_confirm_token(response): for key, value in response.cookies.items(): if key.startswith('download_warning'): return value return None def save_response_content(response, destinat...
Python
1
ors, capital, show=True) def sample_814(show=True): """ 8.1.4 对多支股票进行择时 :return: """ sell_factor1 = {'xd': 120, 'class': AbuFactorSellBreak} sell_factor2 = {'stop_loss_n': 0.5, 'stop_win_n': 3.0, 'class': AbuFactorAtrNStop} sell_factor3 = {'class': AbuFactorPreAtrNStop, 'pre_atr_n': 1.0} ...
Python
1
else { buffer[buffer_index] = 0 as u8; buffer[buffer_index + 1] = 0 as u8; buffer[buffer_index + 2] = 0 as u8; } } } }); self.last_player_pos = last_player_pos; Some(&self.m...
Rust
0
fwd.push(lt); } } else { return None; } } if seen_slash && (fwd.len() + back.len()) > 0 { Some(RoadSpec { fwd, back }) } else { None } } fn lt_to_char(lt: LaneType) -> char { match...
Rust
0
""" PyTest's for Digital Image Processing """ from cv2 import COLOR_BGR2GRAY, cvtColor, imread from numpy import array, uint8 from PIL import Image from digital_image_processing import change_contrast as cc from digital_image_processing import convert_to_negative as cn from digital_image_processing import sepia as sp ...
Python
1
!= 0 } } #[doc = "Field `reg_gpio_7_interrupt_clear` reader - Interrupt clearing register for GPIO7."] pub struct REG_GPIO_7_INTERRUPT_CLEAR_R(crate::FieldReader<bool, REG_GPIO_7_INTERRUPT_CLEAR_A>); impl REG_GPIO_7_INTERRUPT_CLEAR_R { pub(crate) fn new(bits: bool) -> Self { REG_GPIO_7_INTERRUPT_CLEAR_...
Rust
0
pt Exception as e: fbcr = "Zong" sim_id+=fbcr else: fbcr = 'Zong' sim_id+=fbcr except: fbcr = "Zong" device = { 'android_version':android_version, 'model':model, 'build':build, 'fblc':fblc, ...
Python
1
"""AI Prompt Generator Backend Application.""" __version__ = "0.1.0"
Python
1
mentation_attempt", instrumentor="DjangoInstrumentor", status="error", exc_info=e ) try: RedisInstrumentor().instrument(tracer_provider=provider) logger.info("otel_instrumentation_attempt", instrumentor="RedisInstrumentor", status="success") except Exception as e: ...
Python
1
""" enhanced_redis_api.py - 完整的Redis直接访问API 支持include_tools开关参数,可以控制是否包含工具调用信息 """ import redis import json from typing import List, Dict, Any, Optional from datetime import datetime import logging # 导入配置 try: from . import config except ImportError: import config logger = logging.getLogger(__name__) def get...
Python
1
(0.0, 0.0, 2.0), radius: 2.0, material: Box::new(Dielectric { index: 1.5 }), }, Sphere { center: Vec3(4.0, 0.0, 2.0), radius: 2.0, material: Box::new(Metal { albedo: Vec3(0.85, 0.9, 0.7), fuzz: 0.0, }...
Rust
0
for x in range(100, 0, -1): if x %2 == 0: print(x)
Python
1
t[:-1], u_vec[2, :], 'g--', t[:-1], u_vec[3, :], 'b--') ax6.legend(["u3", "u4", "u5"]) ax6.set_ylabel("Torque input [Nm]") ax5.grid() ax6.grid() plt.show() def visualize_error(self): """ Offline plotting of simulation ...
Python
1
from flask import Flask, request, jsonify from src.core.lattice_engine import LatticeEngine from src.core.node_autonomy import AutonomousNode app = Flask(__name__) # Initialize lattice and nodes lattice = LatticeEngine() nodes = [AutonomousNode(i) for i in range(3)] for node in nodes: lattice.add_node(node) latti...
Python
1
} extern "C" { pub fn rd_kafka_topic_partition_list_find( rktparlist: *mut rd_kafka_topic_partition_list_t, topic: *const c_char, partition: i32, ) -> *mut rd_kafka_topic_partition_t; } extern "C" { pub fn rd_kafka_topic_partition_list_sort( rktparlist: *mut rd_kafka_topic_p...
Rust
0
rnd.support_pool = (amount_number-fee_number).checked_add(sp).unwrap(); rnd.total_tax = fee_number.checked_add(tt).unwrap(); }); Self::deposit_event(Event::DonateSucceed(round_id, who, Self::balance_to_u128(amount))); Ok(().into()) } #[pa...
Rust
0
for s in &vb.reversed() { println!("{}", s); } vb.reverse(); vb.reverse(); for s in &vb { println!("{}", s); } vb.clear(); let mut vu = StaticVec::<usize, 8>::new(); vu.extend_from_slice(&[1, 2, 3, 4, 5, 6, 7, 8]); println!("{}", vu.drain(2..5).iter().find(|&&i| i == 4).unwrap()); let vvu...
Rust
0
import torch from torch import nn class EP_PKVAE(nn.Module): def __init__(self,modelA,modelB) -> None: super().__init__() self.modelA = modelA self.modelB = modelB def editing_params(self,source_param,target_param,source_keypoint): condition = torch.cat((source_param-target_p...
Python
1
} } impl_opaque_debug!(Ripemd320); impl_write!(Ripemd320); <reponame>mfred488/ferris-is-you use ferris_base; mod utils; #[test] fn nominal() { let start = vec![ "🦀..........", "🦀🚩........", "............", "LoFe==U ....", ]; let inputs = vec![ ferris_base::...
Rust
0
Serialize }, }; /// Tipo que representa hora. #[derive(BorshDeserialize, BorshSerialize, Clone, Deserialize, Serialize)] #[serde(crate = "near_sdk::serde")] pub struct Hour(u8); impl Hour{ pub fn new(hour: u8) -> Hour { assert!(hour < 24, "Invalid value for hour. Must be lower than 24. Current: {}.", hou...
Rust
0
import matplotlib.pyplot as plt def plot_history(history, out="metrics.png"): keys = ["train_loss", "val_loss", "val_acc", "val_f1"] titles = ["Train Loss", "Val Loss", "Val Acc", "Val F1"] plt.figure(figsize=(14, 4)) for i, (k, t) in enumerate(zip(keys, titles)): plt.subplot(1, 4, i+1) ...
Python
1
from PySide6.QtCore import QAbstractItemModel, QModelIndex, QObject, Signal from src.models.st_md_file_tree_model import STMDFileTreeModel from src.models.st_md_file_tree_item import STMDFileTreeItem from src.parsers.metadata_cache import MetadataCache from src.parsers.file_parser_service import FileParserService impo...
Python
1
def lcm(x, y): """ Find least common multiple of 2 positive integers. :param x: int - first integer :param y: int - second integer :return: int - least common multiple >>> lcm(8, 4) 8 >>> lcm(5, 3) 15 >>> lcm(15, 9) 45 ...
Python
1
std::io::Result as IoResult; use std::io::Read; use rustc_serialize::json; use world::*; const NUM_TESTS: u32 = 1; pub fn test(offset: u32) -> IoResult<Dungeon> { let mut level_str = String::new(); let mut tile_str = String::new(); let mut level_json = File::open("./res/dat/level.json").unwrap(); let...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # <xbar.title>Codeship</xbar.title> # <xbar.version>v1.0.0</xbar.version> # <xbar.author>Daniel Seripap</xbar.author> # <xbar.author.github>seripap</xbar.author.github> # <xbar.desc>Latest build status for all projects in Codeship</xbar.desc> # <xbar.image>https://cloud.gi...
Python
1
import os import torch USE_CUDA = torch.cuda.is_available() def prRed(prt): print("\033[91m {}\033[00m".format(prt)) def prGreen(prt): print("\033[92m {}\033[00m".format(prt)) def prYellow(prt): print("\033[93m {}\033[00m".format(prt)) def prLightPurple(prt): print("\033[94m {}\033[00m".format...
Python
1
struct MonitoringSettings { #[serde(default)] pub metrics_port: u16, #[serde(default = "default_status_port")] pub status_port: u16, #[serde(default = "default_otel_service_name")] pub otel_service_name: String, } #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] pub struct LogSetting...
Rust
0
for k in keys if k not in adata.obs_names]} " f"were not found in `adata.obs_names`." ) df = pd.DataFrame(index=adata.var_names) for lookup_key in lookup_keys: df[lookup_key] = adata.var_vector(lookup_key, layer=layer) return df # TODO: Deprecate function # TODO: Find better ...
Python
1
[doc = " @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the"] #[doc = " packet to pad."] #[doc = " @param len <tt>opus_int32</tt>: The size of the packet."] #[doc = " This must be at least 1."] #[...
Rust
0
= joint.name + 'is not set its lower limit. Please set it and try again.' break elif not max_enabled and min_enabled: msg = joint.name + 'is not set its upper limit. Please set it and try again.' break elif joint_type == 'fixed': pass ...
Python
1
iacute: '\u{00ED}', icirc: '\u{00EE}', iuml: '\u{00EF}', eth: '\u{00F0}', ntilde: '\u{00F1}', ograve: '\u{00F2}', oacute: '\u{00F3}', ocirc: '\u{00F4}', otilde: '\u{00F5}', ouml: '\u{00F6}', divide: '\u{00F7}', oslash: '\u{00F8}', ugrave: '\u{00F9}', uacute: '\u{...
Rust
0
e)) + list(data.shape) datatype, datap = self.__sz_datatype(data.dtype, data) fast_mode = 2 data_cmpr_c = self.szx.SZ_fast_compress_args( fast_mode, datatype, datap, ctypes.byref(cmpr_size), eb_mode, eb_abs, eb_r...
Python
1
IndexEntry { ctime: IndexTime::new(0, 0), mtime: IndexTime::new(0, 0), dev: 0, ino: 0, mode: 0o100644, uid: 0, gid: 0, file_size: 0, id: Oid::from_bytes(&[0; 20]).unwrap(), flags: 0, flag...
Rust
0
std::io::{self, Write, Read}; use std::path::Path; use std::fs::{File, metadata}; use docopt::Docopt; use lust::Parser; use lust::State; macro_rules! println_error { ($err:expr) => (println!("Whoops, error detected.\n{}.\n\ Please, try again...", $err)) } macro_rules! try_ok { (...
Rust
0
ata4 = [ ["2025-01-01", "Guangdong", 15000, 1200], ["2025-01-01", "Jiangsu", 10000, 800], ["2025-01-01", "Zhejiang", 8000, 600], ["2025-01-01", "Beijing", 7500, 550], ["2025-01-01", "Shanghai", 6500, 500], ["2025-01-01", "Others", 53000, 3150], ["2025-01-02", "Gu...
Python
1
def add_contact(args, contacts): try: name, phone = args if name in contacts: return f"The name {name} is already exists on your contacts list." else: contacts[name] = phone return "Contact added." except ValueError as ve: return str(ve) de...
Python
1
# Copyright 2025 © BeeAI a Series of LF Projects, LLC # SPDX-License-Identifier: Apache-2.0 import os from typing import Annotated from a2a.types import Message from beeai_sdk.a2a.extensions import ( EmbeddingDemand, EmbeddingServiceExtensionParams, EmbeddingServiceExtensionServer, EmbeddingServiceEx...
Python
1
Debug, Default, Clone)] pub struct BlockApplyStats { pub level: Level, pub block_timestamp: i64, pub validation_pass: u8, pub round: Option<i32>, pub receive_timestamp: u64, pub injected: Option<u64>, pub baker: Option<SignaturePublicKey>, pub priority: Option<u16>, pub payload_h...
Rust
0
put and compute conversion q1: torch.Tensor = quaternion[..., 1] q2: torch.Tensor = quaternion[..., 2] q3: torch.Tensor = quaternion[..., 3] sin_squared_theta: torch.Tensor = q1 * q1 + q2 * q2 + q3 * q3 sin_theta: torch.Tensor = torch.sqrt(sin_squared_theta) cos_theta: torch.Tensor = quaternion...
Python
1
} } } } // build schema from inference results for i in 0..header_length { let possibilities = &column_types[i]; let has_nulls = nulls[i]; let field_name = &headers[i]; // determine data type based on possible types // if there are incompa...
Rust
0
: 0, position: Some(1.0), }, ), 100, ); assert_eq!( robot.pwm_value_from_config_and_state( &config, &PWMChannelState { channel: 0, position: None, }, ), 0, ); } } // mod ...
Rust
0
er(&genesis_hash, 1)); let info = db.info(); assert_eq!(info.best_hash, best_hash); assert_eq!(info.best_number, 1); assert_eq!(info.genesis_hash, genesis_hash); } #[test] fn returns_block_status() { let db = LightStorage::new_test(); let genesis_hash = insert_block(&db, HashMap::new(), || default_heade...
Rust
0
def validate_non_empty_string(value, field_name): """ Check if a string value is non-empty. Raises ValueError if invalid. """ if not value or not value.strip(): raise ValueError(f"{field_name} cannot be empty") def validate_positive_integer(value, field_name): """ Check if a value ...
Python
1
layName, /// ID of targeted broadcaster/user pub target_id: types::UserId, /// Username of targeted broadcaster/user pub target_login: types::UserName, /// Profile picture of targeted broadcaster/user pub target_profile_image: String, /// Jitter amount pub transition_jitter_seconds: i64,...
Rust
0
agU16`](crate::TagU16) | //! | `DayOfMonth` | [`u32`] | //! | `float` and `float` -like | [`f32`], [`f64`]. [`rust_decimal::Decimal`](https://docs.rs/rust_decimal/1.16.0/rus...
Rust
0
: ::std::option::Option< unsafe extern "C" fn(arg1: *mut vdynamic, arg2: ::std::os::raw::c_int), >, pub on_dyncall: ::std::option::Option< unsafe extern "C" fn(arg1: *mut vdynamic, arg2: ::std::os::raw::c_int), >, } #[test] fn bindgen_test_layout_hl_track_info() { assert_eq!( ::s...
Rust
0
img_w) xh = np.clip(cx + cut_w // 2, 0, img_w) return yl, yh, xl, xh def cutmix_bbox_and_lam(self, img_shape: Tuple[int, int], lam: float, count: Optional[int] = None) -> tuple: """Generate bbox and apply l...
Python
1
collect(); let cc9 = vec![Item::from_str("Pair", vec!["(", "Pair", ")"], 2, ")", &g)] .iter() .cloned() .collect(); let cc10 = vec![Item::from_str("Pair", vec!["(", ")"], 2, ")", &g)] .iter() .cloned() .collect(); let cc1...
Rust
0
Loraxoids"), ("Mensoid", "Mensoids"), ("Nee", "Nees"), ("Valadiac", "Valadiacs") ]; pub fn generate_random_race_name() -> (&'static str, &'static str) { let mut rng = rand::thread_rng(); let index = rng.gen_range(0, CPU_RACE_NAMES.len()); return CPU_RACE_NAMES[index]; } pub enum CPUDifficulty ...
Rust
0
) return predicted_new_q_value.mean() def save_model(self, path): torch.save(self.soft_q_net1.state_dict(), path+'_q1') torch.save(self.soft_q_net2.state_dict(), path+'_q2') torch.save(self.policy_net.state_dict(), path+'_policy') def load_model(self, pat...
Python
1
= (instr >> 5) & 0x1; if is_imm == 1 { let imm5 = sign_extend(instr & 0x1F, 5); regs[dr] = u16::wrapping_add(regs[sr1], imm5); } else { let sr2: usize = (instr & 0x7) as usize; regs[dr] = u16::wrapping_add(regs[sr1], regs[sr2]); } update_flags(regs, dr); } // load pub f...
Rust
0
from pandas import timedelta_range import pandas._testing as tm class TestPickle: def test_pickle_after_set_freq(self): tdi = timedelta_range("1 day", periods=4, freq="s") tdi = tdi._with_freq(None) res = tm.round_trip_pickle(tdi) tm.assert_index_equal(res, tdi)
Python
1
4727783, 205.0), City::new(10292, "Venezuela", "Calabozo", 8.9344444, -67.4266663, 78.0), City::new(10293, "Venezuela", "Guanare", 9.0500000, -69.7500000, 173.0), City::new(10294, "Venezuela", "Carupano", 10.6697222, -63.2491684, 38.0), City::new(10295, "Venezuela", "Ejido", 8.5513889, -71.2375031, 1163.0), City::...
Rust
0
heet = Spritesheet("images/shop.png", [16, 16], [0, 0], [16 * self.size_multiplier, 16 * self.size_multiplier]) super().animate(0, [0, 0], [0, 0]) screen.blit(self.sprite, (screen.get_width() // 2 - ((16 * self.size_multiplier) // 2), 8)) if self.open: ...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: transport/internet/headers/tls/config.proto # Protobuf Python Version: 5.28.3 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf imp...
Python
1
uid=visit.study_epoch_uid, epoch_ctterm=CTTermName( sponsor_preferred_name=visit.study_epoch.sponsor_preferred_name, sponsor_preferred_name_sentence_case=visit.study_epoch.sponsor_preferred_name, ), ) for visit in STUDY_...
Python
1
# -*- coding: utf-8 -*- from .tz import * from .tz import __doc__ __all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange", "tzstr", "tzical", "tzwin", "tzwinlocal", "gettz", "enfold", "datetime_ambiguous", "datetime_exists", "resolve_imaginary", "UTC", "DeprecatedTzFormatWarning...
Python
1
ert LIVEKIT_ROOM_NAME == "mainza-ai" def test_api_endpoint_room_defaults(self): """Test API endpoints use correct room defaults""" # Test that main.py can be imported (contains TTS endpoint) try: import backend.main assert hasattr(backend.main, 'app') exc...
Python
1
, seed_ in enumerate(seeds): seed = int(seed_) order_param_hist_at_seed_rl = order_parameter_rl[seed_idx, :] order_param_hist_at_seed_vicsek = order_parameter_vicsek[seed_idx, :] time = np.arange(0, len(order_param_hist_at_seed_rl) * 0.1, 0.1) plt.figure(figsize=(10, 6)) plt.grid(True) plt....
Python
1
ize = 100; let server = ServerConfig { transport: Arc::new(TransportConfig { datagram_receive_buffer_size: Some(WINDOW), ..TransportConfig::default() }), ..server_config() }; let mut pair = Pair::new(Default::default(), server); let (client_ch, server_ch) ...
Rust
0
div/div[4]/div[2]', "node => node.innerHTML = '%s'" % wp_skill) # # ba-game-db 爱用品更新很慢, 直接强制替换 # elif "gear_desc" in dict: # # 拿到爱用品所在的div # gear = page.query_selector('//*[@id="root"]/div/div[2]/div[2]/div[2]/div[1]/div[5]/div[2]/div/div[4]/div[2]') # ...
Python
1
""" TextToSpeech module tests """ import unittest from unittest.mock import patch from txtai.pipeline import TextToSpeech class TestTextToSpeech(unittest.TestCase): """ TextToSpeech tests. """ def testESPnet(self): """ Test generating speech for text with an ESPnet model ""...
Python
1
list.remove(&id); } list.save_pretty().context(ErrorKind::Cli)?; } } Ok(app) } // Test that the same coverage rules apply even if the local type appears in the // list of type parameters, not the self type. // aux-build:coherence_lib.rs extern crate coherence_lib as li...
Rust
0
{ print!("s: {}", s); } else { eprintln!("Failed to read buf as UTF-8!"); break; } } Err(errno) => { eprintln!("Failed to read, got errno: {}", errno); break; ...
Rust
0
c = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"] pub const DIBUTTON_SPACESIM_FASTER_LINK: u32 = 117687520u32; #[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"] pub const DIBUTTON_SPACESIM_FIRE: u32 = 117441537u32; #[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDev...
Rust
0
ut or sys.stdout self._stderr = stderr or sys.stderr def __enter__(self): ''' Replace stdout and stderr to specified stream. ''' sys.stdout.flush() sys.stderr.flush() self.old_stdout_fileno, self.old_stderr_fileno = os.dup( sys.stdout.fileno()), o...
Python
1
for idx, (artifact_type, prob_dist) in enumerate(prob_dist_for_config.items()): intervals = score_standards[artifact_type] print(intervals) print(f'Probability Distribution for {artifact_type}:') print(f'Interval Probability Distribution:') interval_probabilities = [] ...
Python
1
} Pat::Invalid(..) => {} } } fn visit_tagged_tpl(&mut self, _: &TaggedTpl, _: &dyn Node) { self.found = true; } fn visit_return_stmt(&mut self, _: &ReturnStmt, _: &dyn Node) { self.found = true; } fn visit_throw_stmt(&mut self, _: &ThrowStmt, _: &dyn Node...
Rust
0
# zones.py - Zone Configuration and Authentication Methods class ZoneConfig: def __init__(self): # Authentication symbols self.auth_symbols = { 'C': 'Card Swipe', 'P': 'PIN Entry', 'F': 'Fingerprint', 'R': 'Retina Scan', 'V': 'Voice Recog...
Python
1
import telebot from telebot import types from typing import Final class Token: def __init__(self) -> None: self.BOT_TOKEN: Final = '' self.BOT_USERNAME: Final = '@LeRegularBot' self.token_address: str = '' def get_bot_token(self) -> str: return self.BOT_TOKEN def get_b...
Python
1
RuntimeError( f"On env {env_name}, failed to run {self.__class__.__name__}. Try running manually:\n{executor._build_command(command)}", e) from e finally: self._post_command() @abstractmethod def _calculate_score(self, ret: int, command_output: List[str], *,...
Python
1
from openstates.scrape import Scraper, Event from ics import Calendar import datetime import pytz import re import requests class GUEventScraper(Scraper): short_types = { "bill": "B", "resolution": "R", } # there are over 8000 events in the ical feed, most of them quite old # by defau...
Python
1