text
string
label_name
string
labels
int64
start_peer(&matches)); } } extern crate base32; extern crate chrono; extern crate byteorder; extern crate rand; use byteorder::{ByteOrder, BigEndian}; use base32::Alphabet; use chrono::Utc; use rand::os::OsRng; use rand::Rng; use std::ascii::AsciiExt; const CROCKFORD_ALPHABET: &'static [u8] = b"0123456789ABCDEFGH...
Rust
0
LheFile1loop; /// /// let bytes = b"\ /// <LesHouchesEvents version=\"1.0\"> /// <!-- /// File generated with HELAC-1LOOP_v2.2 /// Type: LO+V /// --> /// <init> /// 2212 2212 6500 6500 0 0 13100 13100 3 1 /// 3.82E-02 2.87E-05 1.00E+00 81 /// ## NORM 100000 3.82E-02 2.91E-05 /// ## SUMPDF 2 1 -1 3 -3 /// </init> /// </...
Rust
0
} pub fn tls_collect_scan_details(cmd: &'static str, stats: &Statistics) { TLS_COP_METRICS.with(|m| { m.borrow_mut() .local_scan_details .entry(cmd) .or_insert_with(Default::default) .add(stats); }); } pub fn tls_collect_read_flow(region_id: u64, statist...
Rust
0
ude::*; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[wasm_bindgen] extern "C" { // Use `js_namespace` here to bind `console.log(..)` instead of just // ...
Rust
0
char *resourceString = XResourceManagerString(_glfw.x11.display); XrmDatabase db; XrmValue value; char *type = NULL; double dpi = 0.0; XrmInitialize(); /* Need to initialize the DB before calling Xrm* functions */ db = XrmGetStringDatabase(resourceString); ...
Rust
0
\x80\xdd\xd6\xc6\x9f\x0f\xb7\xf4\xd99\x92\xf23\xbc\xe8b\ .5n\xc6_\x07HR&?I\x9d\x17\xfc-\x8c\ M\xc0O\x0d\xb6\xfa\x19;\x9f\xf8\x82nk\xdc\x03\xbc\ y\xb0\xd5K\x92jq\x1ap7\xf1}g[\xe3\x0b\ \x83\xad>\xc0j\xea\xfcE\xc0\x96\x89\xebcx\xdb`\ I\x1a\xa3\x95\x94;\xfc\xd5|Dz\x0ex\x02x\xe9\ @5\x08\xf3\xfb\xc4\x17v\x92q\x09\x0d\xff\xec...
Python
1
ink: ComponentLink<Self>, active: bool, onclick: Callback<()>, } pub enum Msg { Clicked, } #[derive(Properties, Clone)] pub struct Props { pub active: bool, pub onclick: Callback<()>, } impl Component for Wallet { type Message = Msg; type Properties = Props; fn create(props: Self::Pr...
Rust
0
2); let down_tile = get_matrix_element(map_tiles, y as i32 + 1, x as i32); let left_tile = get_matrix_element(map_tiles, y as i32, x as i32 - 1); let right_tile = get_matrix_element(map_tiles, y as i32, x as i32 + 1); if up_tile.is_some() && up_tile.unwrap().gid != cur_t...
Rust
0
import numpy as np import matplotlib.pyplot as plt N = 100 mu = np.array([1., 1.]) cov = np.eye(2)*0.01 xn = np.random.multivariate_normal(mu, cov, N) plt.scatter(xn[:,0], xn[:,1]) plt.show() def ELBO(xn, N, K, alpha, m_o, beta_o, Delta_o, lambda_pi, lambda_mu_m, lambda_mu_beta, phi): ELBO = log_beta_function(lamb...
Python
1
import sqlite3 # Таблицы: # students (id, name, email, reg_date) # courses (id, title, category) # enrollments (id, student_id, course_id, enroll_date) # payments (id, enrollment_id, amount, status, paid_at) # Твои задачи: # 1 Получить список всех студентов и курсов, на которые они записаны (включая тех, кто никуда...
Python
1
cleDriveSimDataNW() { assert_eq!(std::mem::size_of::<PxVehicleDriveSimDataNW>(), 544); } #[derive(Clone, Copy)] #[repr(C)] pub struct PxVehicleDriveNW { pub structgen_pad0: [u8; 8], pub mConcreteType: u16, pub mBaseFlags: PxBaseFlags, pub structgen_pad1: [u8; 4], pub mWheelsSimData: PxVehicl...
Rust
0
ptr, len) }; Set::new_unchecked(slice) } } impl Serialize for DocIds { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { self.data.as_ref().serialize(serializer) } } // (c) 2017 <NAME> <<EMAIL>> /// a beer style #[derive(Serialize, Deserialize, Debug, Default)]...
Rust
0
tokens) } struct VecAssignOpAttr { op_trait: Ident, other: Ident, } impl Parse for VecAssignOpAttr { fn parse(input: ParseStream) -> syn::Result<Self> { Ok(VecAssignOpAttr { op_trait: input.parse()?, other: input.parse()?, }) } } #[proc_macro_attribute] /// Exp...
Rust
0
ref mut sorted_set) = old.data { let old_len = sorted_set.hash.len(); for ref m in self.members { if let Some(ref on) = sorted_set.hash.remove(m) { sorted_set.value.remove(on); } } Ok(Resp { ...
Rust
0
ive(Debug)] pub enum ContextBuildError { FailedToBuildWindow(winit::error::OsError), FailedToRequestGraphicsAdapter, FailedToRequestDevice(wgpu::RequestDeviceError), } const fn dimensions_from_logical_size(size: winit::dpi::LogicalSize<f64>) -> Dimensions<f64> { Dimensions { width: size.width, ...
Rust
0
[T], from_raw_parts } /// An iterator that will return non-overlapping *mutable* groups /// in the slice using *binary search*. /// /// It will give an element to the given function, producing a key and comparing /// the keys to determine groups. pub struct BinaryGroupByKeyMut<'a, T, F> { ptr: *mut T, end: *m...
Rust
0
ad, EmSpace } impl UnicodeWhitespaceCharacters { fn value(&self) -> char { match *self { UnicodeWhitespaceCharacters::NewLine => NEWLINE, UnicodeWhitespaceCharacters::FormFeed => FORM_FEED, UnicodeWhitespaceCharacters::CarriageReturn => CARRIAGE_RETURN, Unico...
Rust
0
:types::BlockContext; use validator_utils::error::Error; use gw_common::{ builtins::CKB_SUDT_ACCOUNT_ID, error::Error as StateError, h256_ext::H256Ext, merkle_utils::{calculate_compacted_account_root, calculate_merkle_root}, smt::{Blake2bHasher, CompiledMerkleProof}, state::State, CKB_SUDT_...
Rust
0
| c.is_alphabetic() || c == '_')(s.chars().next().unwrap()) && !s.contains(|c: char| !c.is_alphanumeric() && c != '_') { Ok(()) } else { Err(Error::invalid_identifier(s)) } } } /// decision for an explicitly named dimension #[derive(Debug, Clone, PartialE...
Rust
0
from pydantic import BaseModel from typing import Optional class Resume(BaseModel): id: str name: str experience: Optional[str] = None
Python
1
world1 ="Fantastico" len1 = len(world1) len2 = len("012 3 4") print(len1,len2)
Python
1
)?; // cbmc-viewer isn't bundled, it's pip install'd on first-time setup create_release_bundle(dir, &bundle_name)?; std::fs::remove_dir_all(dir)?; println!("\nSuccessfully built release bundle: {}", bundle_name); Ok(()) } /// Parse command line arguments, and return the only thing we expect: a v...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional from typing_extensions import Literal from .._models import BaseModel __all__ = ["FileListResponse", "Data"] class Data(BaseModel): id: Optional[str] = None """The file identifier, which ...
Python
1
lename>src/kernel/trampoline.rs use core::arch::asm; use core::hint::unreachable_unchecked; // code to switch between user and kernel space. // // this code is mapped at same virtual address // (TRAMPOLINE) in user and kernel space so that // is continues to work when it switches page tables. // // kernel.ld causes th...
Rust
0
""" ===================================== Metric measures :mod:`metric` ===================================== .. currentmodule:: metric This package provides a number of metric measures that e.g. can be used for testing and/or evaluation purposes on two binary masks (i.e. measuring their similarity) or distance betwee...
Python
1
sd1: crate::RESULT__SPARE_0_SD1, result__spare_1_sd1: crate::RESULT__SPARE_1_SD1, result__spare_2_sd1: crate::RESULT__SPARE_2_SD1, result__spare_3_sd1: crate::RESULT__SPARE_3_SD1, result__thresh_info: crate::RESULT__THRESH_INFO, } } entries_struct! { pub struct CoreResults { ...
Rust
0
from re import finditer with open('txt/24-347.txt') as file: st = file.readline() ans = [] leen = 0 pattern = r'[1-7][0-7]*' res = [i.group() for i in finditer(pattern, st)] for i in res: if int(i, 8) % 13 == 0: ans.append(i) arr = [] for i in ans: if len(i) == 16: arr.append(i) print(st.i...
Python
1
import pytest from qtpy.tests.utils import pytest_importorskip def test_shiboken(): """Test the qtpy.shiboken namespace""" shiboken = pytest_importorskip("qtpy.shiboken") assert shiboken.isValid is not None assert shiboken.wrapInstance is not None assert shiboken.getCppPointer is not None as...
Python
1
ENTS_BARE.len()).is_none()); } #[test] fn test_SymtabMut_from_bytes_iter_with_strtab() { let mut buf = ELF32_SYMTAB.clone(); let strtab: Strtab<'_> = Strtab::try_from(&ELF32_STRTAB[0..]).expect("Expected success"); let symtab: SymtabMut<'_, LittleEndian, Elf32> = SymtabMut::try_from(&mut bu...
Rust
0
rdinator.tools tool_agents = [tool.agent for tool in tools] # Find the news scraper and bias analyzer agents news_scraper = next((agent for agent in tool_agents if agent.name == "news_scraper_agent"), None) bias_analyzer = next((agent for agent in tool_agents if agent.name == "b...
Python
1
)>, mask: &mut T, answers: &mut Answers) { let pos = mask.lowest_unset_bit(); if pos == dic.n_target_cells { save_answer(dic, rem_piece, answer_raw, answers); return; } for i in 0..rem_piece.len() { if unsafe { *rem_piece.get_unchecked(i) } > 0 { unsafe { *rem_piece...
Rust
0
def test_full_loop_multistep_deter(self): sample = self.full_loop(num_inference_steps=10) result_sum = torch.sum(torch.abs(sample)) result_mean = torch.mean(torch.abs(sample)) assert abs(result_sum.item() - 181.204) < 0.001 assert abs(result_mean.item() - 0.2359) < 0.001
Python
1
from typing import Optional, List from sqlalchemy import ( Boolean, DateTime, Integer, String, func, ) from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship from . import Base class Skill(Base): __tablename__ = "skills" id: Mapped[int] = mapped_column(Integer, ...
Python
1
const INPUT_FILENAME_2A: &str = "input/example_input_2a.txt"; const INPUT_FILENAME_2B: &str = "input/example_input_2b.txt"; const INPUT_FILENAME_3: &str = "input/example_input_3.txt"; // Import puzzle solutions module use arithmetic_logic_unit; /// Test of part 1 (program 1). #[test] fn task_1_1() { ...
Rust
0
ität); Ok(match self { Anschluss::Pin(pin) => { OutputAnschluss::Pin { pin: pin.into_output(gesperrt_level), polarität } } Anschluss::Pcf8574Port(port) => { OutputAnschluss::Pcf8574Port { port: port.into_output(gesperrt_level)?, polarität } ...
Rust
0
import os from conan import ConanFile from conan.tools.files import * from conan.tools.layout import basic_layout required_conan_version = ">=2.1" class HalfConan(ConanFile): name = "half" description = ( "C++ header-only library to provide an IEEE 754 conformant 16-bit " "half-precision flo...
Python
1
std::collections::HashSet; match *alphabet { None => { let mut vec = vec![0; DEFAULT_ALPHABET.len()]; vec.clone_from_slice(DEFAULT_ALPHABET); Ok(vec) } Some(ref alphabet) => { let mut reg = HashSet::new(); let mut ret = Vec::new(...
Rust
0
/ (2*d) if i == 1 else (v[i-1, j] - v[i+1, j]) / (2*d) divergence[i, j] = dudx + dvdy for j in [1, n-2]: for i in range(1, m-1): dudx = (u[i, j+1] - u[i, j-1]) / (2*d) if j == 1 else (u[i, j-1] - u[i, j+1]) / (2*d) dvdy = (v[i+1, j] - v[i-1, j]) / (2*d) d...
Python
1
) operation = client.projects_locations_caPools_certificateAuthorities.Delete( messages .PrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesDeleteRequest( name=ca_name, ignoreActiveCertificates=args.ignore_active_certificates, skipGracePeriod=args.skip_grace_...
Python
1
# # vba_function_name = 'get_list_of_attributes' # # vba_code = """ # # Public Function get_list_of_attributes(manufacturing_tool) # # Dim oListOfAttributes (2) # # manufacturing_tool.GetListOfAttributes oListOfAttributes # # get_list_of_attributes = oListOfAt...
Python
1
''' ### POSICIÓN DE UN ELEMENTO EN UNA LISTA ### Escribir una función llamada posicionEltLista(L, x) que tome como parámetros una lista de elementos L y un elemento x, y devuelva el índice (o los índices) donde se encuentra el elemento x en la lista L. La función debe devolver una lista de índices. Si el elemento x no ...
Python
1
: Transmission is independent of frame timer and will start when the STARTTX task is triggered. No timeout."] FREERUN = 0, #[doc = "1: Frame is transmitted between FRAMEDELAYMIN and FRAMEDELAYMAX"] WINDOW = 1, #[doc = "2: Frame is transmitted exactly at FRAMEDELAYMAX"] EXACTVAL = 2, #[doc = "3: ...
Rust
0
e(value: JsValue) -> Result<Request<Option<T>>> { let json_request: JsonHttpRequestValue<T> = value.into_serde()?; let req: Request<Option<T>> = json_request.into_http_req()?; Ok(req) } } #[derive(Debug, Serialize)] pub struct JsonHttpResponseValue<T> { headers: HashMap<String, String>...
Rust
0
nted, this may be replaced by one. pub trait RuleType: Copy + Debug + Eq + Hash + Ord {} impl<T: Copy + Debug + Eq + Hash + Ord> RuleType for T {} #[cfg(any(feature = "tokio-runtime", feature = "async-std-runtime"))] use std::path::Path; use std::sync::Arc; use std::time::Duration; #[cfg(feature = "async-std-runtime"...
Rust
0
56, 97, 113, 56, 85, 113, 56, 69, 113, 56, 56, 113, 69, 56, 113, 85, 56, 113, 97, 56, 113, 113, 56, 97, 113, 56, 85, 113, 56, 69, 113, 56, 56, 113, 56, 56, 113, 69, 56, 113, 85, 56, 113, 97, 56, 113, 113, 56, 97, 113, 56, 85, 113, 56, 69, 113, 81, 81, 113, 89, 81, 1...
Python
1
mesajs}\nKar/Zarar durumunuz: {hesap},\n Anlık Fiyat: {sonanlıkfiyat},\n FAVÖK Oranı: {favök},\n Ölçülen Saat: {saat},\n Günlük Yüzdesel Değişim: % {yüzde}" mail(mesaj) elif (funcsaat == 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8,9): print("Sistem kendini U...
Python
1
angle, fillcolor=(128, 128, 128)) img = np.array(pil_img) images.append(img) labels.append(class_id) # Convert to numpy arrays images = np.array(images) labels = np.array(labels) # Shuffle the data indices = np.random.permutation(len(ima...
Python
1
`/Df:ddlZddlmZddlmZGddeZy)N)DesiredCapabilities) ArgOptionsceZdZdZd fd ZedefdZejdeddfdZdZ ede jeeffd Z xZ S) Optionsz...
Python
1
test_case) with warnings.catch_warnings(record=True) as warning_list: logger.enable("woningwaardering") stelselgroep().waardeer(json_instance) assert len(warning_list) == 0, f"{[str(w.message) for w in warning_list]}" # For test_pydantic_equals_json @pytest.mark.parametrize( "test_...
Python
1
from brownie import * import time import json import csv import math import os totalAmountSatoshi = 0 totalAmountSOV = 0 totalCount = 0 chunkSize = 250 rowNumber = 0 chunksProcessed = 0 appendAddresses = [] appendAmounts = [] # https://github.com/DistributedCollective/SIPS/blob/main/SIP-0006(A1).md EX_RATE = 9736 MUL...
Python
1
from dataclasses import dataclass import torch import inspect @dataclass class TrainingState: _trainer = None _status = 'aborted' # later set to 'success' if termination criteria met global_steps = 0 skipped_steps = 0 iter_dataloader_idx = 0 loss: float = 0.0 embedding_average: float =...
Python
1
node_map[edge[1]], edge[2], edge[3]) for edge in p_edges] # # find start event idx # # 전체 event에서 # q_to_event_nodes = list(set([event_index[1] for event_index in all_event_indexs]) - set(event_indexs_e)) # other_edges = [] # for edge in q_edge...
Python
1
"line", "bar", "barh", pytest.param("kde", marks=td.skip_if_no("scipy")), "area", "hist", ], ) def test_no_legend(self, kind): df = DataFrame(np.random.default_rng(2).random((3, 3)), columns=["a", "b", "c"]) ax = df...
Python
1
of the system on our selected components /// /// This function is given a list of the components described under [SystemData](#associatedtype.SystemData). /// /// It selects the life entities and components, and, for each life, /// checks to see if its number is greater than the current number ...
Rust
0
/// /// Use `None` for either or both of `len_y` and `len_x` in order to /// go through the boundary of the plane in that axis (same as `0`). /// /// Merging is independent of the position of both planes on the z-axis. /// /// It is an error to define a subregion that is not entirely contain...
Rust
0
ER and i.tendbclusterspiderext.spider_role in [ TenDBClusterSpiderRole.SPIDER_MNT, TenDBClusterSpiderRole.SPIDER_SLAVE_MNT, ]: bk_instance_id = 0 else: bk_instance_id = i.bk_instance_id spider_role = "" if i.machine_type == MachineType.SPI...
Python
1
from datetime import datetime as DT from discord.ext import commands import calendar import datetime import discord import json import time class channelDelete(commands.Cog): def __init__(self, bot): self.bot = bot print("channelDelete initialized") @commands.Cog.listener() async def on_g...
Python
1
from sqlalchemy.orm import Session from models import labtechnician as model_labtechnician,labtest as model_labtest from schemas import labtechnician as schema_labtechnician from typing import List def create_labtechnician(db: Session, labtechnician: schema_labtechnician.LabTechnicianCreate): db_labtechnician = m...
Python
1
FIELD_OFFSET!(KUSER_SHARED_DATA, Reserved1), 692); assert_eq!(FIELD_OFFSET!(KUSER_SHARED_DATA, Reserved3), 696); assert_eq!(FIELD_OFFSET!(KUSER_SHARED_DATA, TimeSlip), 700); assert_eq!(FIELD_OFFSET!(KUSER_SHARED_DATA, AlternativeArchitecture), 704); assert_eq!(FIELD_OFFSET!(KUSER_SHARED_DATA, BootId), 7...
Rust
0
#!/usr/bin/env python """Test to clearly hear the effect of torque on sound""" import numpy as np import time from sound_sim import MujocoSoundSystem from sound_sim import TorqueSynthesizer def main(): print("Testing torque effect on sound synthesis") print("=" * 50) # Create sound system with torqu...
Python
1
i gli episodi\n" \ "- Inserisci un intervallo di episodi (ad esempio, 1-2) per scaricare da un episodio all'altro\n" \ "- Inserisci (ad esempio, 3-*) per scaricare dall'episodio specificato fino alla fine della serie" ...
Python
1
#!/usr/bin/env python3 """The module for using appropriate time zone""" from flask import Flask, render_template, request, g from flask_babel import Babel import pytz class Config: """The config class that has a LANGUAGES class attribute.""" LANGUAGES = ["en", "fr"] BABEL_DEFAULT_LOCALE = "en" BABEL_D...
Python
1
-> Self::Output { rng.gen_range(self) } } )* }; } impl_generable_for_range_expr!(usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128); #[macro_export] macro_rules! gen { () => {}; (@rng [$rng:expr]) => {}; // repeat pattern // fo...
Rust
0
:?}({}, {:?}, {:?})", op.op.operation, op.size(), left, right ) } DivuDp(ref op) | DivsDp(ref op) | ModuDp(ref op) | ModsDp(ref op) => { let high = op.high(); let low ...
Rust
0
from django.urls import path, re_path from django.views.decorators.csrf import csrf_exempt from .views import ( CookieGroupAcceptView, CookieGroupDeclineView, CookieGroupListView, CookieStatusView, ) urlpatterns = [ path( "accept/", csrf_exempt(CookieGroupAcceptView.as_view()), ...
Python
1
v.update_time = uuid; deleted = 1; let mut d = HashMap::new(); for (nodeid, (value, _)) in g.iter() { d.insert(nodeid, value); } let m...
Rust
0
import plotly.graph_objects as go import plotly.express as px import pandas as pd # Créer un DataFrame avec des données fictives df = pd.DataFrame({ 'x': [1, 2, 3, 4, 5], 'y1': [10, 15, 7, 20, 12], 'y2': [5, 12, 9, 14, 8], 'category': ['A', 'B', 'C', 'D', 'E'] }) # Fonction pour afficher les graphique...
Python
1
ss-origin)\n- text: { maxLength, startIndex, raw }(既定: 20000/0/false)\n- security: { ignoreRobotsTxt }(既定: false)\n\n旧APIキー(enableFetchImages, returnBase64, saveImages, imageMax*, imageStartIndex 等)は後方互換のため引き続き受け付けます(非推奨)。\n\nExamples(新API)\n{\n \"url\": \"https://example.com\",\n \"images\": true\n}\n\n{\n \"url\":...
Python
1
] macro_rules! extern_rust_type { ($($tt:tt)*) => { $crate::usage!{$($tt)*} }; } /// See [`subclass::subclass`]. #[macro_export] macro_rules! subclass { ($($tt:tt)*) => { $crate::usage!{$($tt)*} }; } #[doc(hidden)] #[macro_export] macro_rules! usage { (__docs) => {}; ($($tt:tt)*) => { compile_...
Rust
0
h)?; let mut buffer = Vec::new(); // read the whole file file.read_to_end(&mut buffer)?; trace!("importing control file {}", path.display()); // Import it as ControlFile modification.put_control_file(Bytes::copy_from_slice(&buffer[..]))?; // Extract the checkpoint record and import it sep...
Rust
0
e, r'\\') for fn in alloc_fns] # This regexp matches the relevant lines in the output of |nm|, which look # like the following. # # U malloc /path/to/objdir/dist/include/js/Utility.h:142 # alloc_fns_re = r'U (' + r'|'.join(alloc_fns) + r').*\/([\w\.]+):(\d+)$' # This tracks which alloca...
Python
1
from math import dist import turtle as t def centroid(cluster): dists = [] for dot1 in cluster: sumd = 0 for dot2 in cluster: sumd += dist(dot1, dot2) dists.append([sumd, dot1]) return min(dists)[1] with open('txt/27.13.A_19567.txt') as file: data = [list(map(float,...
Python
1
.len() as u64)); Ok(true) } SYSCODE_SERVICE_CALL | SYSCODE_SERVICE_WRITE | SYSCODE_SERVICE_READ => { machine.add_cycles(CONTRACT_CALL_FIXED_CYCLE)?; let service_ptr = machine.registers()[ckb_vm::registers::A0].to_u64(); let method...
Rust
0
sys.exit(1) if platform.system() == "Linux": debug("Running on Linux") elif platform.system() == "Windows": debug("Running on Windows") else: debug("Running on Unsupported OS") # generate filter filters = [] filter_ids = [] for config in vehicle_configuration...
Python
1
import torch import numpy as np import os from PIL import Image from .SDDINO import SDDINOFeaturizer def get_featurizer(name, num_patches, rot_inv=False, aggre_net_weights_folder='checkpoints/SDDINO_weights', **kwargs): name = name.lower() if name == "sd_dino": patch_size = 16 model = SDDINOFea...
Python
1
n Iterator<Item = Share<Self>>> { let mut polys = Vec::with_capacity(secret.len()); for chunk in secret { polys.push(Self::random_polynomial(GF256(*chunk), threshold, rng)) } Box::new(Self::get_evaluator(polys)) } fn interpolate(shares: &[Share<Self>]) -> Vec<Self...
Rust
0
tring.clone(), }, true, )); testdata.push(test_subdata); } let mut test_subdata2 = Vec::new(); test_subdata2.push(( Item { key: 11, value: String::from("n"), }, false, )); testdata.push(test_subdata2); for ...
Rust
0
if num_scalars > *r { ret += 1; } else { break } } ret } } #[derive(Clone, Debug)] pub struct G1Prepared(pub(crate) G1Affine); impl G1Prepared { pub fn is_zero(&self) -> bool ...
Rust
0
img_names = sorted(glob.glob(img_dir+'/*.jpg')) intrinsics = [] extrinsics = [] for img_name in img_names: name = img_name.split('/')[-1][:-4] extrinsics.append(np.loadtxt(os.path.join(pose_dir, name+'.txt'))) intrinsics.append(np.loadtxt(os.path.join(intr_dir, name+'.txt'))) ...
Python
1
fn stop(&mut self) -> Result<bool, Self::Error>; /// Resets the simulation in order to be able to rerun it again. This /// method resets the simulation in its initial state, as if it's just /// newly created. fn reset(&mut self) -> Result<bool, Self::Error>; } /// The `SimulationBuilder` creates a new...
Rust
0
t.contains(&sum) { // let by5: u128 = ((sum as f64).powf(0.2f64) + 0.5f64) as u128; // println!("{}<sup>5</sup>+{}<sup>5</sup>+{}<sup>5</sup>+{}<sup>5</sup>={}<sup>5</sup>", n4, n3, n2, n1, by5); // println!("{:?} seconds for whatever ...
Rust
0
from objects.Game import Game from config import SHOW_GAME_CASH, LEARNING_MODE from player.gamePlayer.AbstractGamePlayer import AbstractGamePlayer from utils.DataHandler import DataHandler class GamePlayerV2(AbstractGamePlayer): def __init__(self, game_storage, decision_strategy): super().__init__(game_s...
Python
1
Node<'i> = pest_consume::Node<'i, Rule, ()>; #[pest_consume::parser] impl ZoneParser { fn EOI(input: Node) -> Result<()> { assert_eq!(input.as_rule(), Rule::EOI); Ok(()) } fn ip4(input: Node) -> Result<Ipv4Addr> { assert_eq!(input.as_rule(), Rule::ip4); match Ipv4Addr::fr...
Rust
0
ir::passes::deduplicate_fast(), ir::passes::remove_known_loads_fast(), ir::passes::remove_dead_stores_fast(), ir::passes::undefined_propagate(), ir::passes::minimize_phis(), ir::passes::branch_to_select(), ir::passes::reorder(), ]; let start = Instant::now(); ...
Rust
0
from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ) class GolemIE(InfoExtractor): _VALID_URL = r'^https?://video\.golem\.de/.+?/(?P<id>.+?)/' _TEST = { 'url': 'http://video.golem.de/handy/14095/iphone-6-und-6-plus-t...
Python
1
class_index, name_and_type_index, }) => (CONSTANT_METHOD_REF_TAG, *class_index, *name_and_type_index), Some(Type::InterfaceMethodRef { class_index, name_and_type_index, }) => ( CONSTANT_INTERFACE_METHOD_REF_TAG, *class_index...
Rust
0
===== HuggingFace配置信息 ============") logger.info(f"huggingface_hub版本: {importlib.metadata.version('huggingface_hub')}") logger.info(f"环境变量HF_ENDPOINT: {os.environ.get('HF_ENDPOINT', '未设置')}") logger.info(f"环境变量HF_HUB_ENABLE_HF_TRANSFER: {os.environ.get('HF_HUB_ENABLE_HF_TRANSFER', '未设置')}") ...
Python
1
"""A package that contains models that represent entities. """
Python
1
pe_Entity), Ok(ObjectType::Entity)); assert_eq!(ObjectType::from(kMIDIObjectType_Source), Ok(ObjectType::Source)); assert_eq!(ObjectType::from(kMIDIObjectType_Destination), Ok(ObjectType::Destination)); assert_eq!(ObjectType::from(kMIDIObjectType_ExternalDevice), Ok(ObjectType::ExternalDevice));...
Rust
0
movdqu %xmm3, %xmm4 pslldq $$4, %xmm4 pxor %xmm4, %xmm3 pxor %xmm2, %xmm3 ret 2: " : "=r" (round_keysp) : "r" (keyp), "0" (round_keysp) : "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "memory" : "volatile" ...
Rust
0
client = TikvClient::new(channel); must_register_lock_observer(&client, safe_point); // Add a new peer. Lock observer should collect all locks from snapshot. let peer = new_peer(store_id, store_id); cluster.pd_client.must_add_peer(region_id, peer.clone()); cluster.pd_client.must_none_pending_peer(...
Rust
0
import pytest from src.tools.deepseek_wrapper import DeepseekToolWrapper from src.tools.package_manager_tool import PackageManagerTool from src.tools.file_tool import FileTool import os import subprocess def test_package_manager_tool(): """Test using PackageManagerTool with Deepseek.""" wrapper = DeepseekToolW...
Python
1
t_NotifyServer_Notification", fields, file_descriptor_proto() ) }) } fn default_instance() -> &'static CMsgTest_NotifyServer_Notification { static instance: ::protobuf::rt::LazyV2<CMsgTest_NotifyServer_Notification> = ::protobuf::rt::LazyV2::INIT; ...
Rust
0
given port does not connect to another switch """ for link in self.adjacency: if link.dpid1 == dpid and link.port1 == port: return False if link.dpid2 == dpid and link.port2 == port: return False return True def launch (no_flow = False, explicit_drop = True, link_timeout = None...
Python
1
"].as_str().unwrap(); if !raw_project["procedures"].is_array() { return Err(anyhow!("Procedures is invalid")); } let raw_procedures_array: &Vec<Value> = raw_project["procedures"].as_array().unwrap(); let mut procedures: Vec<Procedure> = Vec::new(); for raw_procedure ...
Rust
0
bytes = s.as_bytes(); let mut i = start; let len = bytes.len(); while i < len { match bytes[i] { 0..=32 | b'\'' | b'"' | b',' | b':' | b'/' | b'*' | b'(' | b')' => { return i; } b'\\' => i += 2, _ => i += 1, }; } i } #[inline] fn unicode_range(s: &str) -> bool { if...
Rust
0
impl<T> Reflection for MaskedStorage<T> where T: Component + MarshalTo + Send + Sync, { fn open<'a>(&'a self, entities: Fetch<'a, EntitiesRes>) -> Box<dyn ReflectionStorage + 'a> { Box::new(Storage::new(entities, self)) } } impl<T> ReflectionMut for MaskedStorage<T> where T: Component + Marsha...
Rust
0
} pub use authpb::*; pub use etcdserverpb::*; pub use mvccpb::*; use alloc::sync::Arc; use core::ops::Add; use core::time::Duration; use ibc::core::ics23_commitment::merkle::MerkleProof; use crossbeam_channel as channel; use tendermint_testgen::light_block::TmLightBlock; use tokio::runtime::Runtime; use ibc::client...
Rust
0
let fmt = kserd.as_str_with_config(FormattingConfig { /// width_limit: Some(0), // Always will be verbose where applicable /// ..Default::default() /// }); /// assert_eq!(&fmt, "a = 101 /// b = 3.14 /// "); /// ``` /// /// [`Kserd`]: crate::Kserd #[derive(Copy, Clone, Debug, PartialEq)] pub struct FormattingCon...
Rust
0
cont_SOURCE += f""" {prefx}if(name == \"{name}\") {{ const QStringList parts = value.toString().split(","); if(parts.length() == 2) m_{tab}{name} = QPoint(parts[0].toDouble(), parts[1].toDouble()); else ...
Python
1