text
string
label_name
string
labels
int64
e? ref_true = module.feature(y_true) ref_pred = module.feature(y_pred) # Calculate feature differences diff = ref_pred - ref_true error = diff - data[0] error = error[0].tolist() meta = [] for feature in module.feature.features: frame_size = ...
Python
1
new(term))?.to_string(), "(Int, Bool)"); let src = r#" let things = { zero: (0,), apply: fn x => fn y => x y, } in let do_something = fn things => match things with | { zero: (zero,), app...
Rust
0
import os, pickle import numpy as np import matplotlib.pyplot as plt def write_pkl(path: str, data: list): # Open the file in binary mode and write the list using pickle with open(path, 'wb') as f: pickle.dump(data, f) # Generate the source and receiver list # Please note that in Seistorch, # the coo...
Python
1
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Component: DESCRIPTION = "Add a GitHub Issue to a ZenHub Epic" class Input: EPIC_ID = "epic_id" ISSUE = "issue" REPO_ID = "repo_id" class Output: ISSUE = "issue" STATUS_CODE = "status_code" class AddIssueToEp...
Python
1
# sudo pip3 install igraph import igraph import sys from PIL import Image graph_dir = sys.argv[1] file_path = graph_dir + '/gml.txt' label_file = graph_dir + '/labels.txt' image_path = graph_dir + '/graph_image.png' def getValue(value): colorList = ['blue','green','purple','yellow','red','pink','orange','black'...
Python
1
ForNonMember { requester: Actor, members: BTreeSet<Actor>, }, #[error("A vote is always for the next generation: vote gen {vote_gen} != {gen} + 1")] VoteNotForNextGeneration { vote_gen: Generation, gen: Generation, pending_gen: Generation, }, #[error("Vote fro...
Rust
0
T: DagCbor> { key: Box<[u8]>, value: T, } impl<T: DagCbor> Entry<T> { pub fn new<I: Into<Box<[u8]>>>(key: I, value: T) -> Self { Entry { key: key.into(), value, } } fn with_hash(self) -> EntryWithHash<T> { let hash = hash(&self.key); EntryWith...
Rust
0
import csv input_file = r"D:\py projects\jadi python course\jadi-python-course\Programming Tasks\Working with CSV files in Python\1741502118270796.csv" output_file = r"D:\py projects\jadi python course\jadi-python-course\Programming Tasks\Working with CSV files in Python\processed_products.csv" # Detect possible deli...
Python
1
signal!(super::usart::Usart3, SigCts); ::bobbin_mcu::periph_signal!(super::usart::Usart3, SigRts); ::bobbin_mcu::periph_signal!(super::usart::Usart3, SigCk); ::bobbin_mcu::periph_signal!(super::usart::Uart4, SigTx); ::bobbin_mcu::periph_signal!(super::usart::Uart4, SigRx); ::bobbin_mcu::periph_signal!(super::usart::Uar...
Rust
0
} /// Given a control plane replica /// When its destruction fails /// Then it should eventually be destroyed async fn destroy_deleting_replica( replica_spec: &Arc<Mutex<ReplicaSpec>>, context: &PollContext, ) -> PollResult { let _guard = match replica_spec.operation_guard(OperationMode::ReconcileStart) { ...
Rust
0
# pylint: disable=attribute-defined-outside-init import unittest from django.conf import settings from django.core.cache import cache from django.test import override_settings from mock import MagicMock, patch from tcms.rpc.tests.utils import APITestCase if "tcms.bugs.apps.AppConfig" not in settings.INSTALLED_APPS:...
Python
1
pub async fn gather(conf: &NetstatConfig, proc_path: &str) -> Result<Vec<Metric>, Error> { let path = format!("{}/net/netstat", proc_path); let mut net_stats = get_net_stats(&path).await.context("read netstat failed")?; let path = format!("{}/net/snmp", proc_path); let snmp_stats = get_net_stats(&path...
Rust
0
iscv_op__bindgen_ty_1, } #[repr(C)] #[derive(Copy)] pub union cs_riscv_op__bindgen_ty_1 { pub reg: libc::c_uint, pub imm: i64, pub mem: riscv_op_mem, _bindgen_union_align: [u64; 2usize], } impl Clone for cs_riscv_op__bindgen_ty_1 { fn clone(&self) -> Self { *self } } impl ::core::fmt::De...
Rust
0
-mem-channels {mem_channels} " if MAA_SIM_TYPE: COMMAND += "--maa " COMMAND += f"--cmd {cmd} " COMMAND += f"--options \"{options}\" " if checkpoint_address != None: COMMAND += f"-r 1 " COMMAND += f"--prog-interval={program_interval} " # COMMAND += f"--work-end-exit-count=1 " ...
Python
1
利用性质:(n_user, 1, n_hidden) * (n_user, len, n_hidden) = (n_user, len, n_hidden),即broadcast # 利用性质:np.sum((n_user, len, n_hidden), axis=2) = (n_user, len), # 即得到各用户对test里正负样本的偏好值 all_upqs = T.sum(users.reshape((shp0, 1, shp2)) * (tes_usrs - tes_usrs_neg), axis=2) + \ T.sum(poi...
Python
1
from . import BaseActor import torch import torch.nn.functional as F import numpy as np import matplotlib.pyplot as plt import cv2 import os def draw_axis(ax, img, title, show_minmax=False): ax.imshow(img) if show_minmax: minval_, maxval_, _, _ = cv2.minMaxLoc(img) title = '%s \n min=%.2f max=...
Python
1
i2a state = { 'img_encoder': img_encoder.state_dict(), 'aud_encoder': aud_encoder.state_dict(), 'clip_net': net.state_dict(), 'best_acc': best_acc_top1_i2a, 'out_acc': cur_out_acc_i2a } torch.save(state,...
Python
1
().into()) .collect(); for bid in expired { store_remove(&bid); } } pub fn routing_notify(notification: RoutingNotifcation) { (*DTNCORE.lock()).routing_agent.notify(notification); } <filename>src/main.rs extern crate num; extern crate cgmath; #[macro_use] extern crate approx; extern crate im...
Rust
0
ertDict[key] = {} # alertDict[key]['host'] = hostDict[hostid] # alertDict[key]['message'] = alert['subject'] # alertDict[key]['time'] = datetime.fromtimestamp(int(alert['clock'])).strftime('%Y-%m-%d %H:%M:%S') if alert['eventid'] in problemEvents: # hostWiseAlerts[hostDict[hostid]][alert['subject']] = ...
Python
1
"], "macos" => &[ "framework=Foundation", "framework=IOKit", "framework=IOSurface", ], "linux" => &["X11"], _ => &[], }; for lib in libs { println!("cargo:rustc-link-lib={lib}"); } let out = PathBuf::from(env::var("OUT_DIR")?)...
Rust
0
ternalSiteAdmin(TreeAdmin): readonly_fields = ('parent',) form = ExternalSiteForm list_display = ('domain', 'site',) filter_include_ancestors = True admin.site.register(ExternalLink, ExternalLinkAdmin) admin.site.register(ExternalSite, ExternalSiteAdmin) admin.site.register(LinkType, LinkTypeAdmin) ...
Python
1
léfono crear un socket 2. marcar el número introducir la ip en el socket 3. llamar hacer la petición al servidor desde el socket 4. recibir respuesta recibir la respuesta en el socket 5. tomar la decisión hasta finalizar la llamada tomar datos... hasta cerra comunicación desde el socket ''' # socke...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, api, _ from odoo.tools.json import scriptsafe as json_safe from odoo.exceptions import ValidationError class ChooseDeliveryCarrier(models.TransientModel): _inherit = 'choose.deliver...
Python
1
from signal_predictor.predictor import Predictor from signal_predictor.predictor_repl import PredictorRepl from signal_predictor.trainer import Trainer import argparse class Cli: def parse_args(self): parser = argparse.ArgumentParser( description="Train and use signal predictor transformer mod...
Python
1
import numpy as np def compute_dense_overlap(ofx, ofy, stx, sty, vsx, vsy, dx1, dy1, dx2, dy2, gx1, gy1, gx2, gy2, zmx=1, zmy=1): """ Compute the dense IoU """ num_templates = dx1.shape[0] num_gt = gx1.shape[0] ty, tx = (vsy - 1) * zmy + 1, ...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init from .form_variable_value_info_example import FormVariableValueInfoExample class FormFieldVariableRecordValueExample(object): _types = { "country_region...
Python
1
LMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#"); println!("{:?}", result); } <reponame>ryjones/aries-framework-rs #[cfg(test)] pub mod test { use aries_vcx::agency_client::payload::PayloadKinds; use aries_vcx::error::{VcxError, VcxErrorKind, VcxResult}; use aries_vcx::handlers::connection::connection::{...
Rust
0
C should overflow /// and have the same result fn test_cpc_rr_overflow() { let mut mcu = McuFactory::create("attiny85"); mcu.set_register(1, 0); mcu.set_register(2, 255); let memory_data = vec![0x12, 0x04]; mcu.load_program_memory(&memory_data); let mut flags = mcu.get_flags(); flags.carry =...
Rust
0
Plugin { fn build(&self, app: &mut AppBuilder) { app.add_system(create_mass.system()) .add_system(constrain_rotation.system()) .add_system_to_stage(CoreStage::PreUpdate, body_to_velocity.system()) // IMPORTANT: The impulse/force systems MUST run before the physics simulat...
Rust
0
#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse import logging import os import re class partition: name = "" addr = "" size = "" filename = "" def __init__(self, name, addr, size): self.name = name self.addr = addr self.size = size def parse_args(): parse...
Python
1
_not_exists); // 테이블명 설정 let table = self.parse_table_name()?; query_builder = query_builder.set_table(table); // 여는 괄호 체크 if !self.has_next_token() { return Err(ParsingError::boxed("need more tokens")); } let current_token = self.get_next_token(); ...
Rust
0
import torch, time import numpy as np import jittor as jt from lib.Network_Res2Net_GRA_NCD import Network as py_Network from jittor.lib.Network_Res2Net_GRA_NCD import Network as jt_Network jt.flags.use_cuda = 1 # 定义numpy输入矩阵 bs = 32 test_img = np.random.random((bs,3,224,224)).astype('float32') # 定义 pytorch & jittor...
Python
1
t.set(Tracker { base: psm::stack_pointer(), ..t.get() }) }); f() }); TRACKER.with(|t| { // Restore old tracker but preserve peak. t.set(Tracker ...
Rust
0
.operand(0).width() as u64 * 8))); dfg.write_operand(&instr.operand(0), res); } Opcode::SHL => { let amt = dfg.read_operand(&instr.operand(1)); let value = dfg.read_operand(&instr.operand(0)); let res = value.shl(&amt.modulo(&V::from_const(instr.operand(0)...
Rust
0
vec_count[0] = self.work.len() as u8; let data = pack_vec_of_vec(&self.work); let data_len = data.len(); if data_len < VEC_DATA { vec_data_length[..].copy_from_slice(&(data_len as u32).to_le_bytes()); sol_memcpy(vec_data, &data, data_len); } else { ...
Rust
0
import numpy as np import cv2 as cv left_img = cv.imread(cv.samples.findFile("aloeL.jpg"), cv.IMREAD_COLOR) right_img = cv.imread(cv.samples.findFile("aloeR.jpg"), cv.IMREAD_COLOR) frame_size = left_img.shape[0:2]; stereo = cv.stereo.QuasiDenseStereo_create(frame_size[::-1]) stereo.process(left_img, right_img) disp ...
Python
1
, /// Kip #[serde(rename = "LAK")] Lak, /// Kroon #[serde(rename = "EEK")] Eek, /// Kuna #[serde(rename = "HRK")] Hrk, /// Kuwaiti Dinar #[serde(rename = "KWD")] Kwd, /// Kwacha #[serde(rename = "MWK")] Mwk, /// Kwacha #[serde(rename = "ZMK")] Zmk, /// Kwanza Reajustado #[serde(rename = "AOR")] Aor...
Rust
0
from typing import Dict, Any, List import numpy as np from datetime import datetime, timedelta class DepartureDecision: def __init__(self, min_passengers: int = 5, max_wait_time: int = 30, min_occupancy_rate: float = 0.6): """ 初始化发车决策器 :pa...
Python
1
_c4 = def_water_control if group == 17: items_list_c1 = ( well_water_pallida_low + well_water_pallida_high + well_water_rostoch_low + well_water_rostoch_high ) items_list_c2 = well_water_control items_list_c3 = def_water_control c...
Python
1
sage string: {:?}", retmsg) .as_str(), ), 0, ) .expect("Error occured while sending return message."); } Regress::Infinite => { let ack_msg = ResponseMsg { code: String::from("S001"), message: String::from("Regression started on thread."), }; responder .se...
Rust
0
def main(): """Función principal de instalación""" print("🚀 INSTALADOR AUTOMÁTICO - TriptaFittings-FreeCAD") print("=" * 60) # Instalar plugin if not install_plugin(): print("\n❌ La instalación falló") return # Crear script de activación script_path = create_activa...
Python
1
data, ground_positions, positions, l_velocity, data_obj = process_file(source_data, source_data_obj, 0.002) rec_ric_data = recover_from_ric(torch.from_numpy(data).unsqueeze(0).float(), joints_num) seq_len = data.shape[0] # 263 human + 6 obj data = np.concaten...
Python
1
s(input_result).unwrap(); let reference_set: HashSet<Point> = HashSet::from_iter(reference_velocities.into_iter()); let initial_velocities: HashSet<Point> = target_trench.compute_initial_velocities(); assert_eq!(initial_velocities, reference_set); } } // This file is part of dpdk...
Rust
0
evice_type_KVM_DEV_TYPE_ARM_VGIC_V2, kvm_device_type_KVM_DEV_TYPE_ARM_VGIC_V3, KVM_DEV_ARM_VGIC_CTRL_INIT, KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, KVM_VGIC_V2_ADDR_TYPE_CPU, KVM_VGIC_V2_ADDR_TYPE_DIST, KVM_VGIC_V3_ADDR_TYPE_DIST, KVM_VGIC_V3_ADDR_TYPE_REDIST, ...
Rust
0
& graph theory", "PBW" => "Applied mathematics", "PBWH" => "Mathematical modelling", "PBWL" => "Stochastics", "PBWR" => "Nonlinear science", "PBWS" => "Chaos theory", "PBWX" => "Fuzzy set theory", "PBX" => "History of mathematics", "PD" => "Science: general issues", "PDA" => "Philos...
Rust
0
2f}s" print(log_msg) log_and_profile(h, w, avg_time, log_msg, args, args.model.split("/")[-1], "diffusers", prof) @rerun_if_address_is_in_use() @clear_cache_before_run() def benchmark(args): if args.mode == "colossalai": spawn(benchmark_colossalai, nprocs=args.patched_parallel_size, args=...
Python
1
# Copyright © 2022 Rot127 <unisono@quyllur.org> # SPDX-License-Identifier: BSD-3 from tree_sitter import Node from autosync.cpptranslator.patches.Helper import get_text from autosync.cpptranslator.patches.Patch import Patch class GetNumOperands(Patch): """ Patch MI.getNumOperands() to MCInst_getN...
Python
1
ed_count = result.properties_set self.env.assertGreater(modified_count, 0) # Validate that the full-text index reflects the update result = redis_graph.query("CALL db.idx.fulltext.queryNodes('label_a', 'Group NEW')") self.env.assertEquals(len(result.result_set), modified_count) ...
Python
1
.map(|variant_info| { let substd_args = variant_info.args.iter() .map(|aty| aty.subst(cx, substs)).collect::<Vec<_>>(); let substd_ctor_ty = variant_info.ctor_ty.subst(cx, substs); Rc::new(VariantInfo { args: substd_args, ctor_ty: substd_ctor_ty, ...
Rust
0
tt => r#"Date, time and user of last change"#, M::Forms_selectfile => r#"Select a file"#, M::Forms_select => r#"Select"#, M::Date_unknown => r#"Unbekannt"#, M::Date_unknown_tt => r#"No date"#, M::Date_yesterday => r#"-"#, M::Date_yesterday_tt => r#...
Rust
0
# Import python dependencies import argparse base_dir='./data' backbone='FCGF' arg_lists = [] parser = argparse.ArgumentParser() def add_argument_group(name): arg = parser.add_argument_group(name) arg_lists.append(arg) return arg Dirs=add_argument_group('Dirs') Dataset_Args=add_argument_group('Dataset')...
Python
1
""" You can do natural gradient by using a few conjugate gradient steps to approximately invert the covariance matrix. Razvan says the right thing to do is use the uncentered covariance. Let f:X->R^m be a function giving the cost at each example. If you use conjugate gradient to solve Ad = grad_theta mean f you get ...
Python
1
': 'marati', 'sv': 'marathi', 'sw': 'Kimarathi', 'ta': 'மராத்தி', 'te': 'మరాఠీ', 'tg': 'маратҳӣ', 'th': 'มราฐี', 'ti': 'ማራቲ', 'tk': 'marathi dili', 'to': 'lea fakamalati', 'tr': 'Marathi dili', 'tt': 'маратхи', 'ug': 'ماراتىچە', 'uk': 'маратхі', 'ur': 'مراٹهی', 'uz': 'maratxi', 'uz-Cyrl': 'маратхи', 'uz-Latn': 'maratxi...
Python
1
sive range. #[derive(Debug, PartialEq, Clone, Default)] pub struct Span { /// Index of the first the byte pub first: u64, /// Index one past the last byte pub end: u64, } /// A lexical token, identifying its kind and span. #[derive(Debug, PartialEq, Clone)] pub struct Token { /// The exact type of ...
Rust
0
k(1), // validation_passes: HashSet::new(), // retries: 1, // }); // heap.push_data(MissingOperations { // history_order_priority: 7, // block_hash: block(9), // validation_passes: HashSet::new(), // retries: 1, // }); /...
Rust
0
_to_sexpr(fun_name)], grit::Callee::KnownClosure(ref fun_name, ref val) => vec![ident("known-closure"), fun_name_to_sexpr(fun_name), val_to_sexpr(val)], grit::Callee::Unknown(ref val) => vec![ident("unknown"), val_to_sexpr(val)], }) } pub fn var_to_sexpr(var: &grit::Var) -> sexpr::Elem { sexpr::E...
Rust
0
ve25519 shared secret X25519SharedSecret(x25519_dalek::SharedSecret), } impl DhSharedSecret { /// Outputs the internal byte representation of a shared secret pub(crate) fn as_bytes(&self) -> &[u8] { match self { DhSharedSecret::X25519SharedSecret(p) => p.as_bytes(), } } } /...
Rust
0
# This file is part of pylabels, a Python library to create PDFs for printing # labels. # Copyright (C) 2012, 2013, 2014 Blair Bonnett # # pylabels is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either versio...
Python
1
offsets[*block]); // Ensure inst offsets always increase let encinfo = isa.encoding_info(); for block in blocks { for (offset, inst, size) in func.inst_offsets(block, &encinfo) { let srcloc = func.srclocs[inst]; instructions.push(InstructionAddressMap { ...
Rust
0
stringify!(length) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<ibv_sge>())).lkey as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(ibv_sge), "::", stringify!(lkey) ) ); } #[repr(C...
Rust
0
ep: output.append(sep) if sep: output = output[:-1] return output # Do not call these methods, the _ means they're private. Use class_=... and style=.... def _classes(self, *classes): return {'class': _format_classes(_flatten_classes(classes))} # Turn ...
Python
1
into(), // <KEY> hex!["<KEY>"] .unchecked_into(), // <KEY> hex!["<KEY>"] .unchecked_into(), // <KEY> hex!["<KEY>"] .unchecked_into(), // <KEY> hex!["<KEY>"] .unchecked_into(), ), ( // 5Gb8Ji9JBTwgQ254iYQmYtKkPBLtREVQFZSJXjJnxu9itHcg hex!["<KEY>"].into(), // 5GCCQ...
Rust
0
''' 思路:将 A 中缺失的部分补齐,然后求顺序对数,等于 k 则计数+1. 为此,先找到 A 缺失的是哪些数字,它们分别在什么位置。 其次,将这些缺失的数字全排列,分别按位置填充到 A 中, 计算当前组合的情况下 A 的顺序对数。 ## 全排列:从 n 个不同元素中任取 m 个元素,按照一定的顺序排列起来, 叫做从 n 个不同元素中取出 m 个元素的一个排列。当 m=n 时所有的排 列情况叫做全排列。 ''' from itertools import permutations # 求 A 中顺序对数 def number(A): count = 0 for i in range(len(A)): ...
Python
1
(ctx) => { state = State::Msgid { id, ctx: Some(ctx) }; } _ => { state = State::Msgid { id, ctx: None }; } } continue; } match state { Sta...
Rust
0
"""LCM type definitions This file automatically generated by lcm. DO NOT MODIFY BY HAND!!!! """ from io import BytesIO import struct class body_control_data_lcmt(object): __slots__ = ["q", "qd", "timestamp_us"] __typenames__ = ["float", "float", "int64_t"] __dimensions__ = [[29], [29], None] def _...
Python
1
pub fn wifi_mgmr_sta_powersaving(ps: ::cty::c_int) -> ::cty::c_int; } #[safe_wrap(_)] extern "C" { pub fn wifi_mgmr_sta_autoconnect_enable() -> ::cty::c_int; } #[safe_wrap(_)] extern "C" { pub fn wifi_mgmr_sta_autoconnect_disable() -> ::cty::c_int; } #[safe_wrap(_)] extern "C" { pub fn wifi_mgmr_sta_ssid_s...
Rust
0
# Check whether crop mode should be switched to channels first channels_last = len(pages) == 0 or isinstance(pages[0], np.ndarray) # Rectify crops if aspect ratio loc_preds = self._remove_padding(pages, loc_preds) # Crop images crops, loc_preds = self._prepare_crops( ...
Python
1
.code_percentage, "emptyCount": language_summary.empty_count, "emptyPercentage": language_summary.empty_percentage, "fileCount": language_summary.file_count, "filePercentage": language_summary.file_percentage, "isPseudoL...
Python
1
< 5: raise ValueError("text() can only generate text of at least 5 characters") if max_nb_chars < 25: # join words while not text: size = 0 # determine how many words are needed to reach the $max_nb_chars # once; ...
Python
1
VK_BLEND_OP_HSL_SATURATION_EXT: VkBlendOp = 1000148032; pub const VK_BLEND_OP_HSL_COLOR_EXT: VkBlendOp = 1000148033; pub const VK_BLEND_OP_HSL_LUMINOSITY_EXT: VkBlendOp = 1000148034; pub const VK_BLEND_OP_PLUS_EXT: VkBlendOp = 1000148035; pub const VK_BLEND_OP_PLUS_CLAMPED_EXT: VkBlendOp = 1000148036; pub const VK_BLE...
Rust
0
x4CAA73B2; const CAMELLIA_SIGMA3L: u32 = 0xC6EF372F; const CAMELLIA_SIGMA3R: u32 = 0xE94F82BE; const CAMELLIA_SIGMA4L: u32 = 0x54FF53A5; const CAMELLIA_SIGMA4R: u32 = 0xF1D36F1C; const CAMELLIA_SIGMA5L: u32 = 0x10E527FA; const CAMELLIA_SIGMA5R: u32 = 0xDE682D1D; const CAMELLIA_SIGMA6L: u32 = 0xB05688C2; const CAMELLIA_...
Rust
0
from med_agent.agents.base import BaseAgent from med_agent.tools.pubmed import PubMedSearch, PubMedFetch from med_agent.tools.clinicaltrials import ClinicalTrialsSearch from med_agent.tools.cdc import CDCGuidelines from med_agent.tools.synthesis import EvidenceSynthesizer class ResearchAgent(BaseAgent): def __init...
Python
1
= BeamerBlock() block.ReadXMLContent(xmlblock) self.Columns[k].append(block) k += 1 # Build the internal elements def GenLaTeX(self): latexcontent = [] if self.TitleMode == "Section": ...
Python
1
] } } else { for i in 0..sha { w[i + pad - sha] = r[i] } for i in 0..(pad - sha) { w[i] = 0 } } } } #[allow(non_snake_case)] pub fn SPhashit(hash: usize, sha: usize,w: &mut [u8],a: Option<&[u8]>) { GPhas...
Rust
0
#name: Kashish Adlakha #UID: U31221034 #Description: The program is made to develop a guessing game where the user is asked to choose a number between 1 and 100. The user will then have 10 tries to guess the number. Num= int(input("Please guess a number between 1 and 100: ")) def main(): high = 0 low = 0 w...
Python
1
tion(critical_genes) drivers_df = gene_influence_score.loc[ list(MFVS_driver_set.union(MDS_driver_set).union(critical_genes)), ['influence_score'] ].copy() drivers_df['is_driver_regulator'] = drivers_df.index.isin(list(CEFCON_drivers)) drivers_df['is_MFVS_driver'] = drivers_df.index.isi...
Python
1
f32::NAN; /// /// assert!(f.is_finite()); /// /// assert!(!nan.is_finite()); /// assert!(!inf.is_finite()); /// assert!(!neg_inf.is_finite()); /// ``` #[inline] pub fn is_finite(self) -> bool { num::Float::is_finite(self) } /// Returns `true` if the number is neither zero, infin...
Rust
0
e211b, 0x84d37b826214abc6, 0x8da40c1ef2bb4598, 0x0c83ea7744bf1bee], [0x694341f608c9dd56, 0xed3a181fabb30adc, 0x1339a815da8b398f, 0x2c6d4e4511657e1e], [0x63e7cb4906ffc93f, 0xf070bb00e28a193d, 0xad1715b02e5713b5, 0x4b5371495990693f] ]; pub const G1_GENERATOR: FsG1 = FsG1 { 0: blst_p1 { x: blst_fp { ...
Rust
0
nToken::AmPm => "%p".into() }.as_str()); } buffer } #[cfg(test)] mod tests { use super::*; use expectest::prelude::*; #[test] fn parse_date_and_time() { expect!(validate_datetime(&"2001-01-02".into(), &"yyyy-MM-dd".into())).to(be_ok()); expect!(validate_datetime(&"2001-01-02 12:33:45".into(),...
Rust
0
=> { impl PrimitiveEndian for $type { fn from_be(x: Self) -> Self { Self::from_be(x) } fn from_le(x: Self) -> Self { Self::from_le(x) } fn to_be(self) -> Self { self.to_be() } fn to_le(self) -> Self { self.to_le() } } }; } impl_endian!(u8); ...
Rust
0
6 [shape = doublecircle] 10 [shape = doublecircle] 18 [shape = doublecircle] 0 -> 2 [style=dotted] 0 -> 7 [style=dotted] 0 -> 11 [style=dotted] 1 -> 2 [style=dotted] 1 -> 7 [style=dotted] 1 -> 11 [style=dotted] 2 -> 3 [label="{ ['a'] }"] 3 -> 4 [label="{ ['b'] }"] 4 -> 5 [style=dotted] 5 -> 6 [label="{ ['d']['f'] }"] 5...
Rust
0
import time from datetime import datetime from enum import Enum from typing import TYPE_CHECKING, List import numpy as np from pydantic import BaseModel from docling.datamodel.settings import settings if TYPE_CHECKING: from docling.datamodel.document import ConversionResult class ProfilingScope(str, Enum): ...
Python
1
record page of the types defined here. # noqa: E501 :param object_types: The object_types of this CardFetchBodyPatch. # noqa: E501 :type object_types: list[CardObjectTypeBody] """ if self.local_vars_configuration.client_side_validation and object_types is None: # noqa: E501 ...
Python
1
# -*- coding: utf-8 -*- # AwesomeTTS text-to-speech add-on for Anki # Copyright (C) 2010-Present Anki AwesomeTTS Development Team # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
Python
1
use std::thread; use cache_padded::CachePadded; use crate::{PopError, PushError}; // Bits indicating the state of a slot: // * If a value has been written into the slot, `WRITE` is set. // * If a value has been read from the slot, `READ` is set. // * If the block is being destroyed, `DESTROY` is set. const WRITE: u...
Rust
0
// We want the same seed on every run to avoid random fails let uniform_sampler = Uniform::new($min, $max); for _ in 0..SAMPLES { let color: $ty = rng.sample(&uniform_sampler); $(let color: $base_ty = crate::convert::IntoColorUnclamped::into_color_unclamped(colo...
Rust
0
urls = parse_resource_urls(&u(), &html); assert_eq!(resource_urls.len(), 1); assert_eq!( resource_urls[0], ResourceUrl::Javascript( Url::parse("http://example.com/js.js").unwrap() ) ); } #[test] fn test_deep_nesting() { le...
Rust
0
0, -72410, 0) OP_67(0, 7490, -10000, 0) CameraSetDistance(1830, 0) OP_6C(45000, 0) OP_6E(536, 0) ChrSetPos(0x0101, -1190, 0, -72040, 0) ChrSetPos(0x0105, -1330, 0, -73970, 0) ChrSetPos(0x0103, -30, 0, -72830, 0) ChrSetFlags(0x0008, 0x0040) ChrSetFlags(0x0009, 0x0040) ChrSetFlags(...
Python
1
import librosa.display import scipy from tqdm import tqdm import tensorflow as tf import librosa import matplotlib.pyplot as plt import numpy as np from scipy.signal import lfilter from glob import glob import os from collections import defaultdict os.environ['CUDA_VISIBLE_DEVICES'] = '2' def lpc_coeff(s, p): ...
Python
1
.create_rectangle(sx, sy, ex, ey, width=1) def dropMouse(event): global inImage, outImage, inH, inW, outH, outW global window, canvas, paper, sbar, filename global sx, sy, ex, ey, boxLine if boxLine is not None: canvas.delete(boxLine) ex = event.x ey = event.y if sx > ex: # 만약,...
Python
1
import tvm_ext import tvm import numpy as np def test_bind_add(): def add(a, b): return a + b f = tvm_ext.bind_add(add, 1) assert f(2) == 3 def test_ext_dev(): n = 10 A = tvm.placeholder((n,), name='A') B = tvm.compute((n,), lambda *i: A(*i) + 1.0, name='B') s = tvm.create_schedul...
Python
1
from ..core import Writer, run_process __all__ = ['SizeDistr'] class SizeDistr(Writer): # basic @run_process('SizeDistr - basic', 'distr_basic') def basic(self, df, hybrid_bin_start_loc=None, unit='nm', bin_range=(0, 20000), input_type='norm'): from ._size_distr import _basic out = _bas...
Python
1
..32]).copy_from_slice(handshake.nonce.as_bytes()); (&mut nonce_material[32..64]).copy_from_slice(handshake.remote_nonce.as_bytes()); } let mut key_material = H512::default(); (&mut key_material[0..32]).copy_from_slice(shared.as_bytes()); write_keccak(&nonce_material, &mut key_material[32..64]); let key_ma...
Rust
0
1]) }; let read_fd = FileDesc::new(read_fd); let write_fd = FileDesc::new(write_fd); Ok((read_fd, write_fd)) } /// Creates a file descriptor pointing to the standard input or `/dev/tty`. fn tty_fd() -> Result<FileDesc> { let (fd, close_on_drop) = if unsafe { libc::isatty(libc::STDIN_FILENO) == 1 ...
Rust
0
from abc import abstractmethod from typing import Iterable, Mapping, Optional, Protocol, TypeGuard, TypeVar from telethon.tl.custom import Message from tgmount import vfs from tgmount.fs.util import measure_time_sync from tgmount.tgclient import guards from tgmount.util import is_not_none T = TypeVar("T") class Su...
Python
1
?; let address_string = address.to_address_string_impl()?; if verify_address != address_string { return Err(BSVErrors::MessageVerification(format!( "Provided address ({}) does not match signature address ({})", address_string, verify_address ))); ...
Rust
0
Err(format!("Invalid window size value: 0"))? } if c > 25 { Err(format!( "Invalid window size value: {}. It must be smaller than 25", c ))? } if scalars.len() > bases.len() { Err(format!( "Invalid MSM l...
Rust
0
put( //! &self, //! psbt: &mut psbt::PartiallySignedTransaction, //! input_index: usize, //! _secp: &Secp256k1<All>, //! ) -> Result<(), SignerError> { //! self.device.hsm_sign_input(psbt, input_index)?; //! //! Ok(()) //! } //! } //! //! let custom_signer = Custo...
Rust
0
from visual_mpc.video_prediction.setup_predictor import setup_predictor from visual_mpc.video_prediction.vpred_model_interface import VPred_Model_Interface from video_prediction.models.savp_model import SAVPVideoPredictionModel import video_prediction base_dir = video_prediction.__file__ base_dir = '/'.join(str.split(...
Python
1
= *self.get_unchecked(i); let (y, z) = crate::rca1(a, b, c); // Write the sum into `self` self.set_unchecked(i, y); // Propagate the carry z }; } c } /// Accesses the backing storage of the `BitSlice` as a slice of its /// elements. /// /// This will not include partially-owned edge e...
Rust
0