text
string
label_name
string
labels
int64
Writer { name: name.to_owned(), cf, writer: Writer::new(writer), limiter, }) } /// Write Kv_pair to buffered SST files. pub fn write<I>(&mut self, kv_pairs: I, need_checksum: bool) -> Result<()> where I: Iterator<Item = Result<KvPair>>, ...
Rust
0
their_team: Vec<Team>, pub(crate) timer: Timer, trades: Vec<Option<serde_json::Value>>, } #[derive(Debug, Serialize, Deserialize)] pub struct Action { #[serde(rename = "actorCellId")] actor_cell_id: i64, #[serde(rename = "championId")] champion_id: i64, completed: bool, id: i64, #[s...
Rust
0
bool { match c { b'a'..=b'z' | b'A'..=b'Z' | b'_' => true, c => !c.is_ascii(), } } fn is_name(c: u8) -> bool { match c { b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' | b'_' | b'-' => true, c => !c.is_ascii(), } } fn is_whitespace(c: u8) -> bool { c <= b' ' && (c == b' '...
Rust
0
r in self.retrieval_workers]) else: # Non-distributed training. Load index into this same process. self.index.init_index() def retrieve(self, question_hidden_states, n_docs): """ Retrieves documents for specified ``question_hidden_states``. If running trainin...
Python
1
BPtrT, } pub struct MBMemMove<'a> { _marker: PhantomData<&'a u8>, } impl<'a> MBMemMove<'a> { pub fn new() -> MBMemMove<'a> { MBMemMove { _marker: PhantomData, } } } impl<'a> MBRpc for MBMemMove<'a> { type REQ = &'a MBMemMoveArgs; type RESP = (); fn put_req(&self, req:...
Rust
0
df\ J\xba\x830\xbc\x12\xf9\x06ls\x8c\xcff\xbf97\ 4}\xd8\x0d\x80\x10w\xaex\x19[\x0d\x80\x9c>\xc6\ \x01\x907/k\x00d\x05|\x01\x98%\x17\x95`H\ \x06\x0c\x80\xe0\x07\xc4'.k\x00\xe4|\x11}n\x1d\ \x90.\xa0\x13\xe74\x00\xd2xS\xdb\x1f\xf1\xea\xaf\xf6\ >\xb1\xf4\xa9#\xfc\xbb\xc99\xcf\x09c~\xe2\x01\x10\ \xc5\xa0\x1a\x00\xd9\x10\xec...
Python
1
def f(i): if i > 0: if (i // 2) % 2 == 0: return f(i - 2) * i else: return f(i - 2) * (-i) else: return 1
Python
1
), ( edo12, [1, 4, 5, 8, 9, 12], [0, 1, 4, 5, 8, 9], [0, 1, 4, 5, 8, 9] ), ] ) def test_primeform_rahn_pitch( tuning, input_scale_pi, output_scale_pi, output_pci, inverted, transposition ): """ Test if primeform_...
Python
1
n UU n[U5Hn['XZU5USS2U4'M U S:aD[USUS5(d [)S5e[USU S5(d [)S5eU S:a4[U5H%n[U UUU5(a...
Python
1
# Basic libraries import os import random import warnings import numpy as np warnings.filterwarnings("ignore") class StrategyHelperFunctions: def __init__(self): print("Helper functions have been created") def random_matrix_theory_based_cov(self, returns_matrix): """ This is inspired by the excellent post @...
Python
1
{ // otherwise we're too big, so go left. (i.e. do // nothing) } modifier /= 2; } return self.items[idx + 1].item.clone(); } } mod ziggurat_tables; /// Sample a random number using the Ziggurat method (specifically the /// ZIGNOR variant fro...
Rust
0
42) beepAndPrint(82, 395) sleep(0.464) beepAndPrint(90, 300) beepAndPrint(83, 300) sleep(0.41) beepAndPrint(132, 300) beepAndPrint(85, 300) sleep(0.5) pass def ka_nong(): """卡农未完工""" beepAndPrint(1000, 400) beepAndPrint(1200, 400) beepAndPrint(1400, 400) beepAnd...
Python
1
while self.current()[0] != "RPARENT": group, value = self.current() if group == "SEMICOLON" and len(buffer) == 0: raise ParserError("expected for init before ';'", position=self.pos) if group == "REGISTER": buffer.append(Register(value)) elif group == "NUMBER": buffer.append(Literal(value)...
Python
1
# -*- coding: utf-8 -*- """Logging related classes and functions.""" import gzip import logging class CompressedFileHandler(logging.FileHandler): """Compressed file handler for logging.""" def __init__(self, filename, mode='a', encoding='utf-8'): """Initializes a compressed file logging handler. Args: ...
Python
1
trace_enabled and context_member is not None: _export_trace_and_clean(context_member) if context_member is not None: context_member.close() if browser_member is not None: browser_member.close() # Retain the ability to run directly for quick de...
Python
1
.age, self.creature_vec.len() ) } } trait Habitable { fn new(size: Size) -> Self; fn olden(&mut self); fn add_creature(&mut self, creature: Creature); fn print_creatures(&self); } impl Habitable for World { fn new(size: Size) -> World { let age = Age { age: 0 }; ...
Rust
0
from squash_bot.match_tracker.badges import badge_definitions, queries from tests.factories import core as core_factories from tests.factories import match_tracker as match_tracker_factories class TestDeduplicateBadges: def test_deduplicate_crush_badges(self): ricky = core_factories.UserFactory(username=...
Python
1
_addr, signal); Err(CallProtError(Box::new(s))) } } } else { let ret = f(); // TODO: Switch stack? *jmp_buf = prev_jmp_buf; Ok(ret) } } } /// Unwinds to last protected_call. pub unsafe fn do_unwind(signum: i32, sigi...
Rust
0
(nthreads: usize) -> Option<Self> { NonNull::new(unsafe {hts_tpool_init(nthreads as c_int)}) .map(|tpool| Self { inner: tpool, qsize: 0, phantom: PhantomData, }) } } pub struct HtsIndex { inner: NonNull<hts_idx_t>, phantom: Phan...
Rust
0
(hand_send, hand_recv) = mpsc::channel(config.wait_buffer_size()); let (sock_send, sock_recv) = mpsc::channel(config.done_buffer_size()); let filters = Filters::new(); let (handshake_timer, initiate_timer) = configured_handshake_timers(config.handshake_timeout(), config.connect_timeout...
Rust
0
from django.http import JsonResponse from rest_framework.views import APIView import service.custo_mensal.custo_mensal as custo_service from StockFlowBack.decorators import group_required from django.utils.decorators import method_decorator class CustoMensalView(APIView): @method_decorator(group_required('Administ...
Python
1
################################################################################################## # Created by Sam Insanali # GitHub: https://github.com/SInsanali ################################################################################################## # Description: # Silent auction game #T he focus of this ...
Python
1
pub fn rank1(&self, end: usize) -> usize { let t = &self.data[end / WORD]; t.sum + rank(t.bit, end % WORD) } pub fn select0(&self, k: usize) -> usize { let (mut st, mut en) = (0, self.data.len()); while en - st != 1 { let mid = (st + en) / 2; if mid * WOR...
Rust
0
import heapq def initialize(): initial_state = [[], [], ['White', 'Yellow', 'Yellow', 'Green', 'Blue', 'Green'], ['Red', 'Yellow', 'White', 'Blue', 'Black', 'Black'], ['Black', 'Red', 'Blue', 'Black', 'Green', 'Green'], ['Green', 'Black', 'Yellow', 'Red', 'White', 'Red'], ['White', 'Blue', 'Red', 'Blue', 'White',...
Python
1
t_location.map(|location| VehiclePlace { location, time: time .map_or(Default::default(), |(start, _)| TimeInterval { earliest: Some(start), latest: None }), }), end: end_location.map(|location| VehiclePlace { location, ...
Rust
0
""" Plugin for ResolveURL Copyright (C) 2021 gujal 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 version 3 of the License, or (at your option) any later version. ...
Python
1
import duden import FreeSimpleGUI as sg import threading layout = [ [ sg.T(key="WortDesTagesText") ],[ sg.In(key="Suchleiste",expand_x=True,enable_events=True) ],[ sg.Table([],headings=[""],expand_x=True,key="Tabelle",enable_events=True,cols_justification="left") ],[ sg....
Python
1
e(src.read_f32_le().await?)), FixedLenType::Float8 => ColumnData::F64(Some(src.read_f64_le().await?)), FixedLenType::Datetime => super::datetimen::decode(src, 8).await?, FixedLenType::Datetime4 => super::datetimen::decode(src, 4).await?, FixedLenType::Money4 => super::money::decode(src, ...
Rust
0
# 5 - Verificando a Média do Aluno: # Crie um algoritmo que peça quatro notas de um aluno, calcule a # média e exiba se o aluno foi aprovado ou reprovado (média >= 6). print('------------------ School -------------------') c = 0 n = 0 md = 0 alu = input('Nome do aluno: ') while c < 4: n = float(input('Digite a nota:...
Python
1
self.obs[task_name][episode_name] = {} self.obs[task_name][episode_name][index] = { k: task_obs['robot'][k] for k in self.saved_obs_keys } def save_episode_info(self, task_obs): task_name = task_obs['robot']['metric']['task_name'] episode_name = task_obs['r...
Python
1
FLASH_NVR2_W_LOCKED = 0, #[doc = "1: Indicates that the Flash NVR2 sector can be write accessed by the Flash interface"] FLASH_NVR2_W_UNLOCKED = 1, } impl From<NVR2_W_UNLOCK_A> for bool { #[inline(always)] fn from(variant: NVR2_W_UNLOCK_A) -> Self { variant as u8 != 0 } } #[doc = "Reader...
Rust
0
""Method to remove any file handlers in the logger of Pastas. Parameters ---------- logger : logging.Logger A Logger-instance. Use ps.logger to initialise the Logging instance that handles all logging throughout pastas, including all submodules and packages. """ if logger is None: ...
Python
1
mut result = String::with_capacity(src.len()); let buf_byte = &[b' '; 128]; let buffer = from_utf8(buf_byte).unwrap(); let mut prev = BytePos::ZERO; for range in chunks { fill_gaps(buffer, &mut result, range.start.0, prev.0); result.push_str(&src[range.to_range()]); prev = range...
Rust
0
ee.calc_n_matches(), 0); tree.filter("src"); assert_eq!(tree.calc_n_matches(), 8); let mut expected: Vec<usize> = (3..10).collect(); expected.push(0); for (i, pth) in tree.paths.iter().enumerate() { let should_match = expected.contains(&i); assert_eq!(pth.borrow().matched, should_match); } } #[t...
Rust
0
) => { current_hash = *current_header.parent_hash(); route.push(current_hash); } _ => return Err(GrandpaError::NotDescendent), } } route.pop(); // remove the base Ok(route) } fn best_chain_containing( ...
Rust
0
angle // ASSOCIATED FUNCTIONS // in impl blocks, we're allowed to define functions that don't take self as a // parameter. These are called associated functions. ex String::from // associated functions are often used for constructors that will return // a new instance of the struct. for example, ta...
Rust
0
2 { for y in 0..2 { for z in 0..2 { for &s in [0u64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 48, 49, 50, 51, 52, 53, 54...
Rust
0
xq = b'' del sivv_0rwzc4 '# bang_steamers_july -> travel_police_purchaser' global dxf3yep_l2g bi42wx4xrwh.rzckj9ce3i8: fnds_udm7qk = oqoh4839eze def h1anl7x4u2f(vsbsehn2r2v, gttmwultvsy: k5dgody7jiz, cvq5z53cz3l, rjkyya_tgxe: yzhj2ybat2s, ihp4pxewkdn, tmqry3gtog0: ox4_gzm_kfm, y7irqspasbi: dr1flj5xel8, ...
Python
1
sync, ..Default::default() } } fn sync() -> task::Result { if OS != "macos" { return Ok(Status::Skipped); } utils::process::command_spawn_wait("qlmanage", &["-d", "1", "-r", "cache"])?; Ok(Status::Done) } <filename>src/htrie/mod.rs use ahtable::*; pub mod dense; const B...
Rust
0
f, count: *mut i16, serials: *mut i8, serialLth: *mut i16, ) -> PICO_STATUS { let sym = self .ps2000aEnumerateUnits .as_ref() .expect("Expected function, got error."); (sym)(count, serials, serialLth) } pub unsafe fn ps2000aPingUnit...
Rust
0
acc = Accountant::new_from_deposit(&deposit.unwrap()); acc.register_entry_id(&entry0.id); acc.register_entry_id(&entry1.id); eprintln!("processing entries..."); let mut last_id = entry1.id; for entry in entries { last_id = entry.id; let results = acc.process_verified_events(entry.e...
Rust
0
[doc = "Port Status & Control"] pub PORTSC1: PORTSC1<P>, #[doc = "On-The-Go Status & control"] pub OTGSC: OTGSC<P>, #[doc = "USB Device Mode"] pub USBMODE: USBMODE<P>, #[doc = "Endpoint Setup Status"] pub ENDPTSETUPSTAT: ENDPTSETUPSTAT<P>, #[doc = "Endpoin...
Rust
0
L2R::BATT, 14 => CHSEL2R::VSS, i => CHSEL2R::_Reserved(i), } } #[doc = "Checks if the value of the field is `SE0`"] #[inline] pub fn is_se0(&self) -> bool { *self == CHSEL2R::SE0 } #[doc = "Checks if the value of the field is `SE1`"] #[inline] pub ...
Rust
0
format : str, optional The format in which the MOC will be serialized before being saved. Possible formats are "ascii" or "json". By default, ``format`` is set to "ascii". Returns ------- `~mocpy.TimeMOC` """ if format == "ascii": ...
Python
1
"""Calculate probability of detecting 32 LY-diameter radio bubble given 15.6 M randomly-distributed civilizations in the galaxy.""" import math from random import uniform, random from collections import Counter # length units in light-years DISC_RADIUS = 50000 DISC_HEIGHT = 1000 NUM_CIVS = 15600000 DETECTION_RADIUS = ...
Python
1
ots_sender, &mut progress, latest_leader_slot, ); let received_slots = receive_slots(&retransmit_slots_receiver); assert_eq!(received_slots, vec![0]); // expect range of slots from start of consecutive slots let latest_leader_slot = 6; ReplayStage...
Rust
0
err()); } #[test] fn deserialize_biguint_test() { // Create a 129 bytes large BigUint let mut bytes = vec![u8::MAX; 129]; bytes[0] = 0; // Serialize manually let mut cbor = Vec::new(); serde_bytes::serialize(&bytes, &mut Serializer::new(&mut cbor)).unwrap();...
Rust
0
let index = registry.add_index(tablename, case, &fields)?; Ok(index) } /// Takes a static boolean argument and return the value it resolves to. fn arg_to_bool(arg: &FunctionArgument) -> std::result::Result<bool, Box<dyn DiagnosticMessage>> { arg.expr() .as_value() .as_ref() .and_t...
Rust
0
) -> Result<Self> { let executor = ExpressionExecutor::try_create( "expression executor", input_schema, output_schema, exprs, false, )?; executor.validate()?; Ok(ExpressionTransform { input: Arc::new(EmptyProcesso...
Rust
0
ty_3 = 1138; pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1139; pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: _bindgen_ty_3 = 1140; pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: _bindgen_ty_3 = 1141; pub const _CS_POSIX_V7_LP64_OFF64_LIBS: _bindgen_ty_3 = 1142; pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: _b...
Rust
0
import random import os chosen_number = random.randint(0,101) print(chosen_number) end_game = False def start(): print('''Welcome to the Number Guessing Game! I'm thinking of a number between 1 and 100.''') difficulity() def restart(): global end_game restart = input("Do you want to play again ...
Python
1
(&context_ex)} else {None}); if let Ok(rv)=toks.eval() { if let Some(res)=rv { match test.expected { EVar::SVal(_) => assert!(false, "eval returned wrong type for {} {:?} {:?}", test.expr, res, test.expected), EVar::IVal(i) => if let EVar::IVal(ires)=res { assert!(ires ==...
Rust
0
ze); pub fn RadioButton_GetBorderSpacing(AObj: usize) -> usize; pub fn RadioButton_SetBorderSpacing(AObj: usize, AValue: usize); pub fn RadioButton_GetDockClients(AObj: usize, Index: i32) -> usize; pub fn RadioButton_GetControls(AObj: usize, Index: i32) -> usize; pub fn RadioButton_GetComponents(AObj: usize, ...
Rust
0
import bittensor as bt import random import hashlib from typing import List from .epoch import get_epoch_start_block from constants import NUM_MINER_GROUPS def get_shuffled_uids( current_epoch: int, last_shuffle_epoch: int, metagraph: bt.metagraph, subtensor: bt.subtensor, shuffled_uids: List[int...
Python
1
[test] fn bindgen_test_layout_TPMS_CAPABILITY_DATA() { assert_eq!( ::std::mem::size_of::<TPMS_CAPABILITY_DATA>(), 1032usize, concat!("Size of: ", stringify!(TPMS_CAPABILITY_DATA)) ); assert_eq!( ::std::mem::align_of::<TPMS_CAPABILITY_DATA>(), 4usize, concat!("...
Rust
0
import os from pathlib import Path from invoke import task, Context # type: ignore DATA_GENERATORS = [ "create_basic.py", "create_location.py", "create_topology.py", "create_security_nodes.py" ] # If no version is indicated, we will take the latest VERSION = os.getenv("INFRAHUB_VERSION", None) COMP...
Python
1
from random import choice from time import sleep moves = ('rock', 'paper', 'scissors') def print_winner(winner): print('\n') if winner == 'draw': print('DRAW...') elif winner == 'computer': print('YOU LOSE THIS ROUND!') else: print('YOU WIN THIS ROUND!') print('\n---------...
Python
1
lazy_static! { /// 静态初始化配置文件数据库 pub(crate) static ref PROPERTY_DB: AsyncOnce<Mutex<DatabaseConnection>> = AsyncOnce::new(async { init_dir(); let db = connect_db(join_paths(vec![cfg_local_dir().as_str(), "properties.db"]).as_str()) .await; ...
Rust
0
} else { // client disconnected return Ok(()); }; pa_ws_writer.send(axum_to_tungstein(msg)).await?; } Ok(()) } if let Err(e) = handler_impl(proxy_socket, cfg, req).await { tracing::error!("{}", e); }; } fn get_sta...
Rust
0
class Solution: def setZeroes(self, matrix: List[List[int]]) -> None: rows = len(matrix) cols = len(matrix[0]) first_row_has_zero = False first_col_has_zero = False for c in range(cols): if matrix[0][c] == 0: first_row_has_zero = True ...
Python
1
bedded = self.dropout(embedded) # test batch_size = encoder_outputs.shape[1] alpha = hidden + encoder_outputs # 特征融合采用+/concat其实都可以 alpha = alpha.view(-1, alpha.shape[-1]) attn_weights = self.vat( torch.tanh(alpha)) # 将encoder_output:batch*seq*featu...
Python
1
import os import sys port = int(sys.argv[1]) root_dirname = os.path.dirname(os.path.dirname(__file__)) if root_dirname not in sys.path: sys.path.append(root_dirname) import pydevd # Ensure that pydevd uses JSON protocol from _pydevd_bundle import pydevd_constants from _pydevd_bundle import pydevd_defaults pydevd...
Python
1
{ consumers[consumed.item].push(recipe); } } (producers, consumers) } use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::json_types::WrappedDuration; use near_sdk::{env, AccountId, Duration, Promise, Timestamp}; pub trait Ownable { fn assert_owner(&sel...
Rust
0
""" Formatação básica de strings s - string d - int f- float .<número de digitos>f x ou X - hexadecimal (caractere)(><^)(quantidade) > - esquerda < - direita ^ - centro Sinal - + ou - Ex.: 0>-100,.1f Conversion flags - !r !s !a """ variavel = 'ABC' print(f'{variavel}') print(f'{variavel: >10}') print(f'{variavel: >10}...
Python
1
import os import faiss import numpy as np from sentence_transformers import SentenceTransformer import json # Load the extracted text EXTRACTED_TEXT_FILE = r"C:\Users\mehta\Downloads\dataset-innovatex-test-output\extracted_text.txt" MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2" # Lightweight, fast, and free ...
Python
1
for Blog16Template { fn default() -> Self { Self { links: &NAV } } } #[derive(Template)] #[template(path = "post_debian-buster.html")] pub struct Blog17Template { links: &'static [Hyperlink], } impl Default for Blog17Template { fn default() -> Self { Self { links: &NAV } } } #[deri...
Rust
0
self.set_need_to_do(netflix_account_email, 0) # 忽略下一封密码重置邮件 break if (time.time() - wait_start_time) > 60 * self.max_wait_reset_mail_time: raise Exception( f'等待超过 {self.max_wait_reset_mail_time} 分钟,依然没有收到奈飞的重置密码来信,故将重走恢复密码流程') time.sl...
Python
1
/// Converts the `UVec` to an `FVec`. #[inline] pub fn to_fvec(&self) -> FVec<D> { FVec::from_fn(|ax| r64(self[ax] as f64)) } } // Copyright 2018-2022 Cargill Incorporated // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with...
Rust
0
let mut radius = AOE_RADIUS; if let Some(_) = skill.unwrap().skills.get(&Skills::SlowAOE) { radius = SLOW_AOE_RADIUS; } let c = entities_in_radius( pos.unwrap(), &*entities, &positions, |e, _| teams.get(e).map(|t| t != team.unwrap())....
Rust
0
self.set_register_idle(value_reg); } // Fill <bool_arr>, <value> pub(super) fn compile_fill_boolean_array(&mut self, var_name: &str, value: &parser::Expr) { assert!(matches!(value.return_type(), parser::ExprType::Boolean)); self.add_debugger_hint(|| format!("Fill {var}, {value}", v...
Rust
0
9-133 GMOW GX33,GX33,R3 |0| gx33|x|gx33 |0 0 0 1 0| r3 | # HB: 9-134 GMSW GX33,GX33,R3 |0| gx33|0|gx33 |0 0 1 0 0| r3 | # HB: 9-135 GMOB GX33,GX33,R3 |0| gx33|0|gx33 |0 0 0 1 1| r3 | # HB: 9-136 GLDB GX33,R3 |0| gx33|0| r3 |0 0 1 1 0 0 0 0| # HB: 9-137 GSTB R3,GX33,R3 |0| gx33|1| r3 |0 0 1 1 0 0 0 0| # HB: 9-138...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet3d.models.layers.torchsparse import IS_TORCHSPARSE_AVAILABLE if IS_TORCHSPARSE_AVAILABLE: from torchsparse import SparseTensor from mmdet3d.models.layers.torchsparse_block import (TorchSparseBasicBlock, ...
Python
1
le(1.0, 100.0); let center = Vec3::new( a as f64 + 0.9 * random_double(1.0, 100.0), 0.2, b as f64 + 0.9 * random_double(1.0, 100.0), ); if (center - Vec3::new(4.0, 0.2, 0.0)).len() > 0.9 { if choose_mat < 0.8 { ...
Rust
0
, ch), nn.SiLU(), zero_module(nn.Conv2d(base_channels * channel_mults[0], self.out_channels, 3, padding=1)) ) def forward(self, x, time): time_embed = self.time_embedding(time) skips = [] h = x.type(self.dtype) for i, module in enum...
Python
1
from jinja2 import Environment, FileSystemLoader from backend.app.core.emails.config import TEMPLATES_DIR from backend.app.core.logging import get_logger from backend.app.core.tasks.email import send_email_task logger = get_logger() email_env = Environment( loader=FileSystemLoader(TEMPLATES_DIR), autoescape=...
Python
1
def deleteRecordButtonClick(self): # 弹出一个新窗口, 用于增加记录, 回调函数用于刷新考勤记录 window = DeleteRecordWindow(self, onExit=lambda: self.showAttendanceRecord( sqlController.SelectAttendanceRecordByEmployeeID(self.idEntry.get()))) self.wait_window(window) def showBaseInfo(self, _id, _name,...
Python
1
chars().collect(), curr: 0, } } } impl CharStream for StaticCharStream { fn advance(&mut self) -> Option<char> { if self.curr >= self.buffer.len() { None } else { let c = self.buffer[self.curr]; self.curr += 1; Some(c) ...
Rust
0
(any(target_os = "android", target_os = "linux"))] LinuxMergeable = c::MADV_MERGEABLE, /// `MADV_UNMERGEABLE` #[cfg(any(target_os = "android", target_os = "linux"))] LinuxUnmergeable = c::MADV_UNMERGEABLE, /// `MADV_HUGEPAGE` #[cfg(any(target_os = "android", target_os = "linux"))] LinuxHugep...
Rust
0
# 07-dars.STRING (Matn) # 23-yanvar 2025-yil # Muallif.Adolat ism = 'Adolat' shahar = ''
Python
1
s_with("0x") || s.starts_with("0X") { start = 2; radix = 16; } else if s.starts_with('0') { radix = 8; } let mut ends_with = s.chars().rev(); match ends_with.next() { Some('b') if radix != 16 => { multiply = 512; len -= 1; } Some('...
Rust
0
sg_rpc.SecurityGroupAgentRpcApiMixin, type_tunnel.TunnelAgentRpcApiMixin): """Agent side of the openvswitch rpc API. API version history: 1.0 - Initial version. 1.1 - Added get_active_networks_info, create_dhcp_port, update_dhcp_port, and removed get_dhcp_po...
Python
1
orch.optim.Adam(self.zeta_net.parameters(), lr=self.zeta_lr) v_optim = torch.optim.Adam(self.v_net.parameters(), lr=self.value_lr) avg_zeta_loss = RunningAverage() avg_v_loss = RunningAverage() sample_time = time.process_time() for sampled in range(self.training_samples): ...
Python
1
,11923.6043,W,001.4,356.8,130223,19.20,W00,U00002,207,00,*2E" msg = pynmea2.parse(data) assert msg.manufacturer == "KND" assert msg.timestamp == datetime.time(11, 44, 00, tzinfo=datetime.timezone.utc) assert msg.status == 'A' assert msg.is_valid == True assert msg.lat == '4954.1450' assert m...
Python
1
et_bin_path('sysctl') cmd = [sysctl_cmd, '-n', 'kern.boottime'] rc, out, err = self.module.run_command(cmd) if rc != 0: return {} kern_boottime = out.strip() if not kern_boottime.isdigit(): return {} return { 'uptime_seconds': int(t...
Python
1
from datasets import Dataset from transformers import AutoTokenizer, AutoModelForSequenceClassification, TrainingArguments, Trainer import numpy as np import torch import pandas as pd from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, roc_auc_score MODEL = "distilbert-base-uncased" d...
Python
1
# Generated by Django 5.0.6 on 2024-05-18 19:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('phishing', '0004_alter_phishing_html'), ] operations = [ migrations.AlterField( model_name='phishing', name='html', ...
Python
1
on::is_none")] #[serde(rename = "42705")] pub payment_stub_start_date_business_centers: Option<fix_common::RepeatingValues<PaymentStubStartDateBusinessCenter>>, } #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct PaymentStubStartDateBusinessCenter { /// Required if NoPaymentStubStartDat...
Rust
0
writeln!(f, " => seriatim_client: {}", self.client)?; writeln!(f, " => seriatim_twitter_key: set")?; writeln!(f, " => seriatim_twitter_secret: set")?; writeln!(f, " => seriatim_google_id: set")?; writeln!(f, " => seriatim_google_secret:...
Rust
0
if len(line) > 0 and line[0] not in ["\t", " "]: rule = sline result[headings[key]][rule] = dict() elif rule is not None and sline.startswith('[') and sline.endswith(']'): items = sline[1:].strip().lower().split(':') for idx, item in...
Python
1
'/occup_' + str(b) +'_' #viz_utils.write_tensor_imgSegm(predicted_occup_grid_maps, save_img_dir, name="img_segm", t=stepk, labels=3) #save_img_dir = "example/" + scene_id + '/img_' + str(b) +'_' #im_path = save_img_dir + "_" + str(stepk) + ".png"...
Python
1
== u"Duplicate subtest name" assert stability.err_string( {u'FAIL': 1}, 2) == u"**FAIL: 1/2, MISSING: 1/2**" assert stability.err_string( {u'FAIL': 1, u'OK': 1}, 3) == u"**FAIL: 1/3, OK: 1/3, MISSING: 1/3**" assert stability.err_string( {u'OK': 1, u'FAIL': 1}, 2) == u"**FAIL: 1/2,...
Python
1
rcent_change_7d"]), change_precision ) output += f"7d:{percentage_change:+}% " output_obj["text"] += output output_obj["tooltip"] += output return json.dumps((output_obj)) def main(): # Get the absolute path of this script abs_dir = os.path.dir...
Python
1
test, parameters, select1) # Heal where target includes alpha layer. # This selects from an area having a transparent area. # The transparent area should NOT be resynthesized, but yield white upon flattening. test = "pdb.python_fu_heal_selection" parameters = "50, 1, 1" runtest('ufo-input-w-alpha', 'hea...
Python
1
xception('general failure'), ): # create_pyarrow_table is not called, but must be provided def dummy_create_pyarrow_table(file_like): raise AssertionError('Should not be called') result = await import_file_to_table( warehouse=warehouse, region=region, ...
Python
1
import pytest def test_uid(): pytest.importorskip("ulid") from uuid import UUID from ulid import ULID from jobflow.utils.uid import get_timestamp_from_uid, suid uuid = suid("uuid1") assert UUID(uuid).version == 1 t1 = get_timestamp_from_uid(uuid) assert isinstance(t1, float) u...
Python
1
f ApiKeys /// # Params /// * `conn` - The r2d2 connection needed to fetch the data from the db /// * `cid` - The customer ID pub fn get_keys(conn: &ConnType, cid: &Uuid) -> Result<Vec<Self>, AppError> { Ok(dsl_apikeys.filter(customer_id.eq(cid)).get_results(conn)?) } /// Return a Vec of...
Rust
0
imit(&mut self, new_limit: usize) { let old_limit = self.id_limit(); assert!(new_limit > old_limit); let extra = new_limit - old_limit; // Reserve space for additional task handles self.task_storage.reserve(extra*2); self.task_scratch.extend(self.task_storage.non...
Rust
0
MultiSignature: From<P::Signature>, { fn data(&self, nft_id: u32) -> ApiResult<Option<NFTData>> { let key = storage_map_key(NFTS, "Data", &nft_id, &StorageHasher::Blake2_128Concat); self.get_storage_by_key_hash(StorageKey(key), None) } fn owner(&self, nft_id: u32) -> ApiResult<Option<AccountId>> { Ok(self.da...
Rust
0
}, {"step": 7, "prompt": "Do you want to proceed with this operation?", "user_selects": "Yes"}, ] print("Expected wizard flow:") for step in mock_flow: print(f"\nStep {step['step']}: {step['prompt']}") print(f" User selects: {step['user_selects']}") async def example_error_handli...
Python
1
offset: offset_of!(Self, normal) as _, }, GsVertexInputAttribute { binding : 0, location: 4, format: vk_format!(vec3), offset: offset_of!(Self, tangent) as _, }, ...
Rust
0