text
string
label_name
string
labels
int64
Error=IndyError>> { crypto::auth_crypt(wallet_handle, sender_vk, recipient_vk, message) .into_box() } pub fn auth_decrypt(wallet_handle: i32, recipient_vk: &str, encrypted_message: &[u8]) -> Box<Future<Item=(String, Vec<u8>), Error=IndyError>> { crypto::auth_dec...
Rust
0
from tkinter import* a=Tk() a.geometry("500x500") a.title("Registration Form") l1=Label(a,text="Registration Form",fg="red",font=("bold",20)) l1.pack() l1=Label(a,text="Name:",font=("bold",15)).place(x=50,y=100) l2=Label(a,text="Address:",font=("bold",15)).place(x=50,y=140) l3=Label(a,text="Email:",font=("bold",15))...
Python
1
_plus_x: Fe([ 0x426f5ea88bb26, 0x33092e77f75c8, 0x1a53940d819e7, 0x1132e4f818613, 0x72297de7d518d ]), y_minus_x: Fe([ 0x698de5c8790d6, 0x268b8545beb25, 0x6d2648b96fedf, 0x47988ad1db07c, 0x3283a3e67ad7 ]), xy2d: Fe([ 0x41dc7be0cb939, 0x1b16c66100904, 0xa24c20cbc66d, 0x4a2e9efe48681, 0x5e129684627...
Rust
0
original_height, original_width = frame.shape[:2] frame_resized = cv2.resize(frame, (720, 480)) # 标准尺寸 frames.append(frame_resized) original_sizes.append((original_width, original_height)) if not frames: raise RuntimeError(f"No frame...
Python
1
= b.clone(); let wlock = c_lock.clone(); thread::spawn(move || { //Both of objects are created on device 0 in main thread //Every thread needs to set the device that it is going to //work on. Note that all Array objects must h...
Rust
0
} #[test] fn test() { let deck = vec![17, 13, 11, 2, 3, 5, 7]; let res = vec![2, 13, 3, 11, 5, 17, 7]; assert_eq!(Solution::deck_revealed_increasing(deck), res); } <gh_stars>0 use structopt::StructOpt; use serde::{Serialize, Deserialize}; #[derive(Debug, Serialize, Deserialize, StructOpt)] #[structopt(ab...
Rust
0
offset((56) as isize) = (((x0 - t3) >> 10) as i32); *v.offset((8) as isize) = (((x1 + t2) >> 10) as i32); *v.offset((48) as isize) = (((x1 - t2) >> 10) as i32); *v.offset((16) as isize) = (((x2 + t1) >> 10) as i32); *v.offset((40) as isize) = (((x2 - t1) >> 10) as i32); ...
Rust
0
dmg, cryo_dmg: self.cryo_dmg, hydro_dmg: self.hydro_dmg, electro_dmg: self.electro_dmg, // physical_dmg: self.physical_dmg, anemo_dmg: self.anemo_dmg, geo_dmg: self.geo_dmg, dendro_dmg: self.dendro_dmg, elemental_dmg: self.elemental_dmg, // infusion: self.infusion // } // } // } #[a...
Rust
0
ponse.json() else: raise CelcatCannotConnectError( f"Expected JSON response but got different content type: {content_type}" ) else: ...
Python
1
import numpy as np from metaworld.policies.action import Action from metaworld.policies.policy import Policy, assert_fully_parsed, move class SawyerFaucetCloseV2Policy(Policy): @staticmethod @assert_fully_parsed def _parse_obs(obs): return { 'hand_pos': obs[:3], 'unused_gr...
Python
1
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInline from django.contrib.admin.sites import AdminSite, site from django.utils.importlib import import_module # A flag ...
Python
1
yer): tensorize_tensorcore_s8s8( N, C, H, W, K, R, S, stride, padding, dilation, layer) yolo_shapes_b1 = [ # yolo (1, 3, 448, 448, 64, 3, 7, 7, 1, 2, 3, 1, 1), # conv1 0 (1, 64, 112, 112, 192, 64, 3, 3, 1, 1, 1, 1, 1), # conv2 1 (1, 192, 56, 56, 128, 192, 1, 1, 1, 1, 0, 1, 1),...
Python
1
-> Result<(), std::num::ParseIntError> { assert_eq!(4, convert_from_binary("0100")?); assert_eq!(44, convert_from_binary("0101100")?); Ok(()) } #[test] fn test_find_gap() { assert_eq!(Some(4), find_gap(&[1, 2, 3, 5, 6])); assert_eq!(Some(4), find_gap(&[1, 2, 3, 5]))...
Rust
0
#!/usr/bin/env python3 # @Time : 2020-04-21 # @Author : caicai # @File : importssti.py from myscan.lib.scriptlib.ssti.engines.jinja2 import Jinja2 from myscan.lib.scriptlib.ssti.engines.dot import Dot from myscan.lib.scriptlib.ssti.engines.twig import Twig from myscan.lib.scriptlib.ssti.engines.ejs import Ejs ...
Python
1
# Repeat & get SFa and SFb (transpose conjugate) structure factor matrices: SF, PF = get_structure_factors(range_stl, phase.G, phase.components) SFa = np.repeat(SF[..., np.newaxis, :], SF.shape[1], axis=1) SFb = np.transpose(np.conjugate(SFa), axes=(0, 2, 1)) # Calculate the repetitio...
Python
1
.with(|inode_index| { PROC_INDEX.with(|proc_index| { let mut cache = proc_cache.borrow_mut(); let mut inodes = inode_index.borrow_mut(); let mut procs = proc_index.borrow_mut(); let ProcCache { new, old, .. } = &mut *cache; for ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Pyrate - Optical raytracing based on Python Copyright (C) 2014-2020 by Moritz Esslinger moritz.esslinger@web.de and Johannes Hartung j.hartung@gmx.net and Uwe Lippmann uwe.lippmann@web.de and Th...
Python
1
from multiprocessing.pool import ThreadPool import subprocess def f(x): a,b,c = x #alpha = [0.285, 0.376, 0.637, 0.8, 1.0] alpha = [0.376, 0.637, 0.8, 1.0] t1 = [0.6, 1.2, 1.4, 1.5] t2 = [2.5, 2.7, 3.0,3.0] j = 0 niters = "1000000" for i in range (len(alpha)): t = t1[i] t_end = t + 0.02 step = 1 ...
Python
1
import os import tqdm import time import numpy as np import nnabla as nn import nnabla.logger as logger import nnabla.functions as F import nnabla.parametric_functions as PF import nnabla.solvers as S import nnabla.utils.save as save from nnabla.contrib.context import extension_context def conv_bn(inputs, oup, stride,...
Python
1
unwrap_or_else(Number::zero), Number::from(255), ), scale( color.green(), green.unwrap_or_else(Number::zero), Number::from(255), ), scale( color.blue(), blue.unwrap_or_else(Num...
Rust
0
'# land_drags_scratch -> smash_values_fronts' global qicm8y098_o return l_hpck9h6ki = srn61ev5ele del kakqcqjpxti nonlocal p14dnqrq_ru from gvjq3ofjqy5 import awg7t6bjzxg as rxdol9qligf, divnttect1j, va4go9ax0la as sbvxuz8xjwz, ojxulmldopl, no7g_ehv3rs as e395p55q0vg, fuhl80licea, h8gxlp9vd...
Python
1
== "line": painter.drawLine(start, end) elif self.current_shape == "rect": painter.drawRect(QRect(start, end)) elif self.current_shape == "ellipse": painter.drawEllipse(QRect(start, end)) elif self.current_shape == "curve": ...
Python
1
::MPCNC::new(&mut window, &resources_dir); //let mut calibration_object = calibration_object::TwoWires::new(&mut window, &resources_dir); let mut calibration_object = calibration_object::FeelerGauge::new(&mut window, &resources_dir); let mut parameters = cnc.get_default_parameters(); window.set_light(L...
Rust
0
s': 'none', 'exclude_ids': 'none'} filter_params = {'a_t':100, 'a_h': 16, 'max_n_holes':8 } vis_params = {'vis_level': -1, 'line_thickness': 250} patch_params = {'white_thresh': 5, 'black_thresh': 40, 'use_padding': True, 'contour_fn': 'four_pt'} if args.preset: preset_df = pd.read_csv(os.path.join('presets', ar...
Python
1
to the same thing after zooming. self.cam_x = ((self.cam_zoom / old_zoom) * (self.cursor_x + self.cam_x)) - self.cursor_x; self.cam_y = ((self.cam_zoom / old_zoom) * (self.cursor_y + self.cam_y)) - self.cursor_y; } pub fn get_cursor_in_map_space(&self) -> (f64, f64) { ( sel...
Rust
0
from typing import Any, List, Mapping, Optional, Sequence, Union from iree.compiler.dialects.func import FuncOp # Qualified import of only np.dtype for type checking. np = __import__('numpy', fromlist=['dtype']) # Qualified import of iree.compiler.ir.Type to disambiguate with typing.Type. ir = __import__('iree.compil...
Python
1
(); while !queue.is_empty() { // kludgey, but we know the map isn't empty let (next, distance) = queue.pop().unwrap(); if next == target { return distance; } visited.insert(next); match vertex_map.get(next) { Some(vertexes) => vertexes.iter().f...
Rust
0
行解析の終了。 let len = req.get_line_len(); if let Some(req) = req.as_mut_any().downcast_mut::<RequestStruct>() { req.caret = len; } else { panic!("Downcast fail."); } ...
Rust
0
state.add_method.set(add_method.clone()); // might not be ideal when there's no audio_id already state.set_audio(None); })) }) } // Test that the initial version of Rust coverage injects Coverage statements at the top of each // function. The Coverage Counter statements a...
Rust
0
#!/usr/bin/python3 from bcc import BPF import ctypes as ct with open("./chall_4.c", "r") as fp: b = BPF(text=fp.read()) # b.attach_raw_tracepoint(tp="sys_enter", fn_name="hello") ignore_fn = b.load_func("ignore_opcode", BPF.RAW_TRACEPOINT) exec_fn = b.load_func("hello_exec", BPF.RAW_TRACEPOINT) timer_fn = ...
Python
1
{ 'regularization_loss/KL/PriorMean/Mean': 0.0, 'regularization_loss/KL/PriorVar/Mean': 1.0, 'regularization_loss/KL/Loss/Original': 40.710374394, 'regularization_loss/KL/Loss/Weighted': 122.131123182, 'regularization_loss/KL/Loss/Weight': 3.0, } self._assert_dict_equal_o...
Python
1
import tkinter as t window = t.Tk() window.title("Moje okno") def buttonClicked(): label = t.Label(window, text="Labelka") label.pack() frame = t.Frame(window, width=80, height=40, bg="red") frame.pack_propagate(0) frame.pack() button = t.Button(frame, text="Ok", command=buttonClicked) button.pack(fill="bot...
Python
1
よりデバイス(スレッド)の終了(正常ないし異常)を検知することが可能となる. /// /// なお`Device`インスタンスが破棄されると、裏で動いているデバイス用のOSスレッドも停止させられるので、 /// `Future::poll`を呼び出さない場合でも、インスタンス自体は保持しておく必要がある. /// /// [Lump]: ../lump/index.html /// [Future]: https://docs.rs/futures/0.1/futures/future/trait.Future.html /// /// # デバイスを安全に停止する方法 /// /// `Device::spawn`関数を呼び出すと...
Rust
0
vec![None; n], pot_final: FastClearBitVec::new(n), to_clear: Vec::new(), forward, backward, dijkstra_data: BucketCHSelectionData::new(n), num_pot_computations: 0, num_targets: 0, } } pub fn num_pot_computations(&self) ...
Rust
0
price == 0: data["ratio1_618"] = float(self._truncate(price_max + 0.618 * diff, 2)) return data def save_csv(self, filename: str = "tradingdata.csv") -> None: """Saves the DataFrame to an uncompressed CSV.""" p = compile(r"^[\w\-. ]+$") if not p.match(filename): ...
Python
1
def anaiversair(A,D): if A==d: print("joyeu anés vairsair") else: print("eureur") nom=input("donner votr nom") print("bonjour monsieur",nom) d=(input("DONNER LA DATE DE NAisanse\n")) a=(input("donner la date de aujourdhuit\n")) anaiversair(a,d)
Python
1
] = float(data_stuff[j].split()[3]) pres[j // 2] = float(data_stuff[j].split()[0]) wspd[j // 2] = float(data_stuff[j].split()[6]) wdir[j // 2] = float(data_stuff[j].split()[5]) omeg[j // 2] = float(data_stuff[j].split()[7]) prof = profile.crea...
Python
1
from .init_db import DataController
Python
1
0fmdlAdagradLight\x12@\n\x08adadelta\x18\x0c\x20\x01(\x0b2\ \".tensorflow.tpu.AdadeltaParametersH\0R\x08adadelta\x12V\n\x10proximal_\ adagrad\x18\x0e\x20\x01(\x0b2).tensorflow.tpu.ProximalAdagradParametersH\ \0R\x0fproximalAdagrad\x12G\n\x0bonline_yogi\x18\x14\x20\x01(\x0b2$.tens\ orflow.tpu.OnlineYogiP...
Rust
0
assert attrs == random_attrs class TestDropPrivate: """Tests for dropping private attrs.""" def test_simple_drop_private(self): """Ensure private attrs are removed after operation.""" attrs = PatchAttrs(_private1=1, extra_attr=2).drop_private() attr_dict = dict(attrs) as...
Python
1
sert_instr(ptest))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_test_all_zeros(a: __m128i, mask: __m128i) -> i32 { _mm_testz_si128(a, mask) } /// Tests whether the specified bits in `a` 128-bit integer vector are all /// ones. /// /// Argument: /// /// * `a` - A 128-bit integer vector conta...
Rust
0
urn sgx_status_t::SGX_ERROR_INVALID_PARAMETER; } } } else { sgx_status_t::SGX_ERROR_INVALID_PARAMETER } } /// FIXME: use bytestream (local socket) to read request and write response? #[no_mangle] pub extern "C" fn ecall_check_withdraw_tx( actual_fee_paid: *mut u64, sealed_lo...
Rust
0
_A; #[doc = "Field `i2c1_mux_sel` reader - I2C_1 wishbone control mux select"] pub type I2C1_MUX_SEL_R = I2C0_MUX_SEL_R; #[doc = "Field `i2c1_mux_sel` writer - I2C_1 wishbone control mux select"] pub struct I2C1_MUX_SEL_W<'a> { w: &'a mut W, } impl<'a> I2C1_MUX_SEL_W<'a> { #[doc = r"Writes `variant` to the fiel...
Rust
0
::one()); let f = graph.mulc(&e, c.clone()); let grad = graph.mul(&f, &gradient)?; store.add_gradient(graph, id, &grad)?; } Ok(()) } }) } ...
Rust
0
g_match : i32 ) -> *mut u8; fn RCS_getexpand(arg1 : *mut ::vers_ts::rcsnode) -> *mut u8; fn RCS_getrevtime( rcs : *mut ::vers_ts::rcsnode, rev : *const u8, date : *mut u8, fudge : i32 ) -> isize; fn RCS_gettag( rcs : *mut ::vers_ts::rcsnode, symtag : *...
Rust
0
else: self.before_head.train(mode) return self KNOWN_MODELS = OrderedDict([ ('BiT-M-R50x1', lambda *a, **kw: ResNetV2([3, 4, 6, 3], 1, *a, **kw)), ('BiT-M-R50x3', lambda *a, **kw: ResNetV2([3, 4, 6, 3], 3, *a, **kw)), ('BiT-M-R101x1', lambda *a, **kw: ResNetV2([3, 4, 23, 3], 1, *a, **k...
Python
1
customer: bool, // pub default_currency // pub updated_date_utc // ... } impl Contact { pub fn put(client: &Client, params: ContactParams) -> Result<Contact, Error> { let mut body = Vec::new(); { let mut xml = XmlWriter::new(&mut body); xml.element("Contact", &pa...
Rust
0
<gh_stars>100-1000 // This test ensures that variables bound with `ref` are always bound, // overwriting previous variables of the same name. // // Behavior may change in the future, since this is an edge case. use crepe::crepe; crepe! { @input struct Input(i32); @output #[derive(Debug, Ord, Partial...
Rust
0
e of corresponding pixels for 5.png is: 77.03398109721002 左 # dulinet 的 yita # The mean value of corresponding pixels for 1.png is: 35.58827928569264 # The mean value of corresponding pixels for 2.png is: 60.2663695434855 # The mean value of corresponding pixels for 3.png is: 54.089451243524884 # The mean value of...
Python
1
bler', 'Magnolia_Warbler', 'Mourning_Warbler', 'Myrtle_Warbler', 'Nashville_Warbler', 'Orange_crowned_Warbler', 'Palm_Warbler', 'Pine_Warbler', 'Prairie_Warbler', 'Prothonotary_Warbler', 'Swainson_Warbler', 'Tennessee_Warbler', 'Wilson_Warbler', 'Worm_eating_Warbler', 'Yellow_War...
Python
1
method = 'SimVP' # model spatio_kernel_enc = 3 spatio_kernel_dec = 3 model_type = 'vit' hid_S = 64 hid_T = 256 N_T = 4 N_S = 2 # training lr = 1.3e-3 drop_path = 0.1 batch_size = 2 # bs = 2 x 4GPUs sched = 'onecycle'
Python
1
/{}'.format(args.data_name, train_file)) train_loader = DataLoader(train_dataset, batch_size=args.train_batch_size, shuffle=True, collate_fn=collate.collate_fn, num_workers=4) test_dataset = dataset(file_path='data/{}/{}'.format(args.data_name, test_file)) test_loader = DataLoa...
Python
1
stributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::{fmt, result}; use std::error::Error; pub type Result<T> = result...
Rust
0
= owner .get_account_id() .expect("Account should have id to exit"); // restore account state zksync_prover_utils::exit_proof::create_exit_proof( accounts, owner_id, owner.address, token.0, ) .expect("Failed to gene...
Rust
0
ndex.push((acc_id, record_id)); } } stronghold.record_remove(index_record_id)?; stronghold .record_create_with_hint( &serde_json::to_string(&new_index)?, RecordHint::new(ACCOUNT_ID_INDEX_HINT).unwrap(), ...
Rust
0
, Fb, En, Hi> = Fun_<'a, Ex, Fb, En, Hi>; #[derive( Clone, Copy, Debug, Eq, FromOcamlRepIn, Hash, NoPosHash, Ord, PartialEq, PartialOrd, Serialize, ToOcamlRep )] pub enum Def<'a, Ex, Fb, En, Hi> { Fun(&'a FunDef<'a, Ex, Fb, En, Hi>), Class(&'a Class_<'a, Ex, Fb, ...
Rust
0
# -*- coding: utf-8 -*- # # simple_expression_printer.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 version 2 of t...
Python
1
ADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF"; pub(crate) const HASH_MARK_NUMBER :u8 = 35; // # pub(crate) fn decimal_to_lower_hexstring(value : u8, arr : &mut [u8]) { let index : usize = (value as usize) << 1; arr[0] = HEX_LOWER_TABLE[index]; arr[1] =...
Rust
0
raphs = self.__get_paragraphs(text, True) # Wrap and Indent the paragraphs wrapper = textwrap.TextWrapper(width = max((self.__text_width - indent),1)) # The first paragraph is special case due to the inclusion of the label formatted_paragraphs = [' ' * max((indent - len(...
Python
1
}; let dlen = decoded_len(buf.len()); let full_chunks = buf.len() / 4; for chunk in 0..full_chunks { // SAFETY: `p3` and `p4` point inside `buf`, while they may overlap, // read and write are clearly separated from each other and done via // raw pointers. unsafe { ...
Rust
0
/// If two values are specified, the first is automatically selected for interactive sessions and the second for non-interactive sessions. /// The default is **af21** (Low-Latency Data) for interactive sessions and **cs1** (Lower Effort) for non-interactive sessions. #[derive(Debug, Clone, Copy, PartialEq, Eq, Partial...
Rust
0
| Code::EVEX_Vmovupd_ymmm256_k1z_ymm | Code::EVEX_Vmovupd_zmmm512_k1z_zmm | Code::Movups_xmmm128_xmm | Code::VEX_Vmovups_xmmm128_xmm | Code::VEX_Vmovups_ymmm256_ymm | Code::EVEX_Vmovups_xmmm128_k1z_xmm | Code::EVEX_Vmovups_ymmm256_k1z_ymm | Code::EVEX_Vmovups_zmmm512_k1z_zmm // GENERATOR-END: ...
Rust
0
= LinearSegmentedColormap.from_list(cmap_name, colors, N=n_bins) ax = sns.heatmap(uniform_data, vmin=0, vmax=1, cmap=cm) # 设置横坐标的刻度位置和标签 plt.xticks(ticks=np.arange(uniform_data.shape[1])+0.5, labels=[f'{i / 1000}k' for i in x_bins]) # 设置纵坐标的刻度位置和标签 plt.yticks(ticks=np.arange(uniform_data.shape[0...
Python
1
arrays[0]) } } }; (@func $(#[$attr:meta])* pub async fn $name:ident( $($arg1:ident: $type1:ty)? $(=> {$($conv1:tt)*})?, $($arg2:ident: $type2:ty)? $(=> {$($conv2:tt)*})? ) -> $ret_type:ty => $syscall_num:tt;) => { $(#[$attr])* pub async fn $name...
Rust
0
from kiwixbuild._global import option from .base import Dependency, GitClone, QMakeBuilder import platform class KiwixDesktop(Dependency): name = "kiwix-desktop" force_build = True class Source(GitClone): git_remote = "https://github.com/kiwix/kiwix-desktop.git" git_dir = "kiwix-desktop" ...
Python
1
_utf8_unchecked(b) }).ok()? - 1) .ok()?; if dig3 >= dim.rows { return None; } Some(Coord { down: true, lane: alp2, idx: dig3, }) } // /^[+-](?:0|[1-9]\d*)$/ fn is_score_token(coord: &str) -> bool { let b = coord.as_bytes(); if !(!b.is_empty() && (b[0] == ...
Rust
0
item.get("geometry", {}) coordinates = geometry.get("coordinates") if not coordinates or not isinstance(coordinates, list) or len(coordinates) != 2: logger.warning(f"Missing or invalid 'coordinates' for train item: {item}. Skipping location creation.") return None # Coo...
Python
1
] 0x001234 // 4 > 3 /// [0,0,1,2,3,4,5,T] 0x30012345 // 7 > 4 /// [0,0,1,2,3,4,T] 0x20001234 // 6 > 4 /// [0,1,2,3,4,5,T] 0x20012345 // 6 > 4 /// [1,2,3,4,5,T] 0x312345 // 5 > 3 /// [1,2,3,4,T] 0x201234 // 4 > 3 /// ``` fn hex_prefix_encode<'a>(nibbles: &'a [u8], leaf: bool) -> impl Ite...
Rust
0
8]> { let mut out_bytes = Vec::<u8>::new(); //Write manager "header" (manager type & command count) if self.command_count != 0 { out_bytes.write_u8(ManagerType::Command as u8).unwrap(); // write manager type out_bytes.write_u8(self.command_count).unwrap(); // write numbe...
Rust
0
import sys from models_train.solver import Solver from data_loader.data_loader import get_loader,get_loader_custom_video_data from configs.configs import get_config import os if __name__ == '__main__': # Check the path if len(sys.argv) > 1: use_custom_video = True # data_path = sys.argv[1].s...
Python
1
: @four_valued // CHECK-NEXT: {{^.*:$}} // CHECK-NEXT: ret i8 %0 match x { First => First, Second => Second, Third => Third, Fourth => Fourth, } } <reponame>msklywenn/bevy-inspector-egui<gh_stars>0 use crate::egui::Grid; use crate::impls::NumberAttributes; use crate::{uti...
Rust
0
# Collect facts related to systems 'capabilities' via capsh # # This file is part of Ansible # # Ansible 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 version 3 of the License, or # (at your option) a...
Python
1
#! /usr/bin/python #*********************************************************** #* Software License Agreement (BSD License) #* #* Copyright (c) 2009, Willow Garage, Inc. #* All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the ...
Python
1
='Z' | '0'..='9' | '_' => true, _ => false, }) } fn is_whitespace(c: Option<char>) -> bool { c.map_or(false, |c| c.is_whitespace()) } pub struct WordStream<'a> { pub scanner: Scanner, handler: &'a errors::Handler, } impl<'a> WordStream<'a> { pub fn new(scanner: Scanner, handler: &'a error...
Rust
0
output = output[0] summary.append( ModuleDetails( name=layer_name, input_size=list(input[0].size()), output_size=list(output.size()), num_parameters=params, multiply_adds=flops) ...
Python
1
mut *mut c_char, dimensions: *mut npy_intp, steps: *mut npy_intp, func: *mut c_void)]; impl_api![7; PyUFunc_g_g(args: *mut *mut c_char, dimensions: *mut npy_intp, steps: *mut npy_intp, func: *mut c_void)]; impl_api![8; PyUFunc_F_F_As_D_D(args: *mut *mut c_char, dimensions: *mut npy_intp, steps: *mut npy_intp, f...
Rust
0
essarily correspond to anything meaningful. #[serde(default = "potential_kolmogorov_crespi_new__skin_check_frequency")] #[serde(skip_serializing_if = "potential_kolmogorov_crespi_new__skin_check_frequency__skip")] pub skin_check_frequency: u64, pub normals: KolmogorovCrespiNormals, } fn potential_kolmo...
Rust
0
2 = dom0 address (0x5008_0000) * SPSR_EL2 = 0x1c5 (D clear, AIF masked, Aarch64, EL1h) * */ msr!("ELR_EL2", guest_address); //msr!("SPSR_EL2", SPSR_EL1h | (0x1c << 4)); msr!("SPSR_EL2", 0x1c5); isb(); flush_hypervisor_tlb(); unsafe { asm!("eret"); } } #[allow(dead_c...
Rust
0
arget_env = "sgx")))] use std::prelude::v1::*; use crate::binary_tree::BinaryTree; use crate::binary_tree::BinaryTreeNode; use crate::binary_tree::TreeIndex; use crate::config::Loss; #[cfg(feature = "enable_training")] use crate::fitness::almost_equal; use std::error::Error; #[cfg(feature = "enable_training")] use ra...
Rust
0
fn token_decoder(&self) -> &Self::TokenDecoder; } pub trait ValidateApiTokenRequestDecoder { fn decode(self) -> RequireAuthRoles; } mod authorization; mod collection; mod confidentiality; mod core; mod delayed_upload; mod meta_type; mod parent; mod read_option; mod write_option; pub use self::core::*; pub use a...
Rust
0
} } { let mut f = FileReader::open(name.as_str()); let s = "Hello File"; match &mut f { Ok(f) => { let mut txt = String::new(); match f.read_to_string(&mut txt) { Ok(r) => { ...
Rust
0
import pandas as pd from sklearn.metrics import precision_recall_fscore_support # 读取CSV文件 file_path = r'.\cmt\data\data-yitu.csv' df = pd.read_csv(file_path) # 转换正确率为浮点数 for col in ["意图任务正确率(平均)", "意图任务正确率(多数)", "GPT意图任务正确率", "GPT正确率2", "GPT正确率3"]: df[col] = df[col].str.replace('%', '').astype(float) / 100 # 展开“...
Python
1
shutdown: CancellationToken, } impl LifecycleWorker { /// Creates a new `LifecycleWorker` /// /// The worker starts with persistence suppressed, persistence must be enabled /// by a call to [`LifecycleWorker::unsuppress_persistence`] pub fn new(db: Arc<Db>) -> Self { let db = ArcDb::n...
Rust
0
-d5", "Kc6xb5", "Kc6-c5" ); board_after_move_is!( "Kc6xb7", "N/1P6/2kp5/1P6/8/8/8/8 b - - 0 1", "N/1k6/3p5/1P6/8/8/8/8 w - - 0 2" ); } #[test] fn white_castling() { legal_moves_include!("8/8/8/8/8/8/8/R3K2R w KQ - 0...
Rust
0
> //! <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> #![allow(non_snake_case)] use std::marker::PhantomData; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use crate::math::num::RealNumber; use super::Distance; use crate::linalg::Matrix;...
Rust
0
deduced_hands[player_id] = known_initial[player_id] continue # 获取最终状态 final_data = final_hands.get(player_id, {}) final_hand = final_data.get('hand', []) melds = final_data.get('melds', []) # 获取操作记录 ops = player_operations[player_id] ...
Python
1
import argparse import yaml ap = argparse.ArgumentParser() ap.add_argument('-a', type=str, help='Base for comparison') ap.add_argument('-b', type=str, help='Compared data') ap.add_argument('-r', '--raw', action="store_true", default=False, help='Store differences as raw values (instead of percentages)...
Python
1
download_offset": 0 , // "downloaded_prefix_size": 0 , // "downloaded_size": 0 // } , // "remote": { // "@type": "remoteFile" , // "id": "EAACAgUAAxUAAWIQSNEg6RZR0muOUkeZUrH4BO3HAAIZDAACRs9AUtC8cY-lHrI1IwQ" , // "unique_id": "AgADGQwAAkbPQFI" , // "is_upload...
Rust
0
maxtasksperchild=args.maxtasksperchild, context=mp_context, ) manager: SyncManager = mp_context.Manager() targets: list[tuple[str, Queue]] = [ (target, manager.Queue()) for target in parallel_targets ] if targets: for index, (target, queue) ...
Python
1
d); return start; } */ use std::u8; use failure::{Error, bail}; #[derive(Debug, Default)] pub struct Vernam { pub message: String, pub key: String, } impl Vernam { pub fn get_char_alphabet_index(&self, char: char) -> Result<u8, Error> { let letter_code: u8 = char as u8; if letter_...
Rust
0
# Validation Settings VALIDATION_SCHEMAS = { "DEFAULT_STRING_LENGTH": 255, "MAX_STRING_LENGTH": 1000, "MIN_PASSWORD_LENGTH": 8, "MAX_PASSWORD_LENGTH": 128, "USERNAME_PATTERN": r"^[a-zA-Z0-9_-]{3,16}$", "EMAIL_PATTERN": r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" } # Input Sanitization S...
Python
1
use size_format::SizeFormatterBinary; use ssh2::{Channel, CheckResult, KnownHostFileKind, Session}; use structopt::StructOpt; use thiserror::Error; use crate::{ blob::{ARCH_BLKXMIT, ZERO_BLOCK_HASH}, config::{BackupConfig, HostVerification, LOG_BLOCK_SIZE}, db::{Database, RedoContentOrHash}, util::sha256hash, ...
Rust
0
assert_eq!(transaction, original_transaction); } #[test] fn test_calculate_omitted_amounts_virtual_single_commodity() { let mut transaction = parse_transaction( r#" 2018-10-01 <NAME> TEST:ABC $1.20 TEST:DEF ; Comment 1 [TEST:GHI] $3.40 [TEST:JKL] ; C...
Rust
0
def cambiar_texto(texto): i = 0 nuevo_texto = list(texto) while i < len(texto): if nuevo_texto[i] == 'A': nuevo_texto[i] = '4' if nuevo_texto[i] == 'B': nuevo_texto[i] = 'I3' if nuevo_texto[i] == 'C': nuevo_texto[i] = '[' if nuevo_texto[i]...
Python
1
import sys import steel from steel import bits VERSIONS = ( ('87a', '87a'), ('89a', '89a'), ) class Color(steel.Structure): red = steel.Integer(size=1) green = steel.Integer(size=1) blue = steel.Integer(size=1) def __str__(self): return '#%x%x%x' % (self.red, self.green, self.blue) ...
Python
1
"""Module creates an animation of an oscillating point charge's fields.""" import sys import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from matplotlib import animation from matplotlib.animation import FuncAnimation import pycharge as pc lim = 50e-9 grid_size = 1000 x, y, z = np.meshgrid(np...
Python
1
ter.1 as usize; let w: usize = size.0; let h: usize = size.1; let x: usize = max(0, (pos_x as f32 - (w as f32 / 2 as f32)).ceil() as usize); let y: usize = max(0, (pos_y as f32 - (h as f32 / 2 as f32)).ceil() as usize); let x_end: usize = min(width, w + x); let y_end: us...
Rust
0
ma, failure: AtomicUsize::new(0), } } } impl Borrow<PeerMultiaddr> for AddrInfo { fn borrow(&self) -> &PeerMultiaddr { &self.addr } } impl PartialEq for AddrInfo { fn eq(&self, other: &Self) -> bool { self.addr == other.addr } } impl Eq for AddrInfo {} impl Ha...
Rust
0
from cryptography.hazmat.primitives.ciphers.aead import AESGCM import os # A e B já derivaram a mesma shared_key (32 bytes) shared_key = os.urandom(32) # simulação, no real vem do Diffie-Hellman aesgcm = AESGCM(shared_key) nonce = os.urandom(12) mensagem = b"Oi, tudo bem?" ciphertext = aesgcm.encrypt(nonce, mens...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- #Copyright 2009-2011 Matt Turnbull #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU Affero General Public License as published by #the Free Software Foundation, version 3 of the License. # #This program is distributed in...
Python
1