text
string
label_name
string
labels
int64
= 0xFFFF_FFFF_FFFF & ra; ia_p | ra_p } /// Phase 2 (LE legacy) short term key (STK) function pub fn s1(k: u128, r1: u128, r2: u128) -> u128 { let r1_p = (0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF & r1) << 64; let r2_p = 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF & r2; e(k, r1_p | r2_p) } /// Phase 2...
Rust
0
from ....utils.util import getUsedMaterials, getAllMeshNamesInOrder, getMeshName class c_lod(object): def __init__(self, lodsStart, batches, lod_level): def get_lodBatches(self, batches, lod_level): lodBatches = [] for batch in batches.batches: if batch.blenderObj.me...
Python
1
# hangul_decompose.py import warnings from hangulpy.utils import ( CHOSUNG_LIST, CHOSUNG_BASE, is_hangul, HANGUL_BEGIN_UNICODE, JUNGSUNG_LIST, JUNGSUNG_DECOMPOSE, JONGSUNG_LIST, JONGSUNG_DECOMPOSE, JUNGSUNG_BASE ) def decompose_hangul_string(s): """ 주어진 문자열의 각 한글 음절을 초성, 중성, 종성으로 분해하여 배열 형태로 반환합니다. ...
Python
1
og(this.rng); let r = this.rng >> (l - 16); let mut b :u32 = (r >> 12) - 8; b += (r > CORRECTION[b as usize]) as u32; l = (l << 3) + b; return nbits - l; } pub extern fn ec_tell_frac_slow(this :&mut ec_ctx) -> u32 { // To handle the non-integral number of bits still left in the encoder/decoder // state, we comp...
Rust
0
import typing from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, Redire...
Python
1
l use only and should not be called directly. Args: passthru (Optional[Dict[str, Any]], optional): Optional dictionary of attributes to pass through to the new instance. Defaults to `None`. Returns: Sanic: The refreshed application in...
Python
1
e. """ config = self.GetMethodConfig('Update') return self._RunMethod( config, request, global_params=global_params, download=download) Update.method_config = lambda: base_api.ApiMethodInfo( http_method='PUT', method_id='storage.objects.update', ordered...
Python
1
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE import os from configuration_models.install_config import InstallationConfig from configuration_models.upgrade_config import UpgradeConfig from constants.charts import ISTIO_BASE_CHART from constants.paths import PLATFORM_INSTALL_...
Python
1
import pandas as pd import numpy as np from mlxtend.preprocessing import TransactionEncoder from mlxtend.frequent_patterns import apriori, association_rules def generate_faculty_data(num_rows=100000): """ Generate a faculty dataset and save to CSV. """ np.random.seed(0) experience = np.random.randint(1,21,...
Python
1
ubsampling) -> (i32, i32) { let mut factors: [i32; 2] = Default::default(); unsafe { sb::C_SkYUVAInfo_SubsamplingFactors(subsampling.into_native(), &mut factors[0]) }; (factors[0], factors[1]) } /// `SubsamplingFactors(Subsampling)` if `plane_index` refers to a U/V plane and otherwise `(1, 1)` /// if input...
Rust
0
lifetime, _) = msg_span_from_free_region(self.tcx(), sup_r); let lifetime_name = if sup_r.has_name() { sup_r.to_string() } else { "'_".to_owned() }; // only apply this suggestion onto functions with // explicit non-desugar'able return....
Rust
0
eq(b, epsilon, ignore_gphase)) }) } /// Approximately compares two basis matrices. ///> ///> `a` and `b` are borrowed matrix handles. ///> `epsilon` specifies the maximum element-wise root-mean-square error ///> between the matrices that results in a positive match. ///> ///> This checks that the following holds f...
Rust
0
&cur].clone().into_iter()); } // first kill, then gen if let Some(lockguards) = self.kill.get(&cur) { self.kill_kill_set(&mut new_before, lockguards); } if let Some(lockguards) = self.gen.get(&cur) { let double_locks = self.unio...
Rust
0
): im = torch.empty(*imgsz, dtype=torch.half if self.fp16 else torch.float, device=self.device) # input for _ in range(2 if self.jit else 1): self.forward(im) # warmup @staticmethod def _model_type(p="path/to/model.pt"): """ Takes a path to a model file...
Python
1
import random top_of_range = input("Type a number: ") if top_of_range.isdigit(): top_of_range = int(top_of_range) if top_of_range <= 0: print("Please type a number larger than 0 next time.") quit() else: print("Please type a number next time.") quit() random_number = random.randint(0...
Python
1
rtion': 0.3, 'crossover_type': 'two_point', 'max_iteration_without_improv': 5000 } model = ga( function=fitness_function, dimension=64, variable_type='int', variable_boundaries=varbound, algorithm_parameters=algorithm_param, convergence_curve=...
Python
1
DSSKJrJrJrJrJrJrJrJrJ r SSK J r J r "SS5r "SS\ 5r"SS\ 5r"S S \ 5r"S S \ 5r"S S\ 5r"SS\ 5r"SS\5r"SS\5r"SS\ 5r"...
Python
1
a8ebf); assert_eq!(seq.next_raw(), 0x2028917c9861dfd1); assert_eq!(seq.next_raw(), 0x84dab38837c31b23); assert_eq!(seq.next_raw(), 0x3ed75049f2155e95); assert_eq!(seq.next_raw(), 0x3f4413aeb0a12689); seq.seek(1_000_000_000_000_000_000); assert_eq!(seq.next_raw(), 0x685b...
Rust
0
print("%s: %s -> %s" % (file_name, result[0], repl)) else: print("%s: version is already %s" % (file_name, repl)) update.append(l) if hit_counter != 1: raise RuntimeError("Cannot find version in %s" % file_name) if need_update and not dry_run: ...
Python
1
max_connections=self.config.storage_service.config.get( "max_connections", 10 ), in_memory=True if db_path == ":memory:" else False, ) else: raise ServiceFactoryError( f"Unknown storage serv...
Python
1
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH ...
Rust
0
import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" # USED TO SUPPRESS UNNECESSARY WARNING FROM TENSORFLOW import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPool2D, BatchNormalization, Flatten, Reshape, Conv2DTranspose, LeakyReLU, Act...
Python
1
def sort_it(tubes): def is_sorted(tubes): return all(all(ball == tubes[0][0] for ball in tube) for tube in tubes) def move_ball(tubes, moves): if is_sorted(tubes): return moves shortest_moves = None for i in range(3): for j in range(3): ...
Python
1
"" Unit test method (make linter happy) """ ret = Span.squeeze(0, 7, 7) assert ret == [Span(0,1), Span(1,2), Span(2,3), Span(3,4), Span(4,5), Span(5,6), Span(6,7)] ret = Span.squeeze(0, 7, 2) assert ret == [Span(0,4), Span(4,7)] ret = Span.squeeze(0, 3, 2) ...
Python
1
fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "{} = {}", &self.name, &self.url) } } // pub enum RemoteRef<'a> { // Undefined, // Unique(Option<&'a Remote>), // Duplicate // } // impl Remote { // pub fn getter<'cfg>(config: &'cfg mut Config, name: &str) -> RemoteR...
Rust
0
:new(c); // NomParserWrapper::new(b) // } // A workaround I found is to wrap the returned impl FnMut into another closure, as demonstrated below. // That gets rid of the 'a: 'b dependency and seems to work fine. There's probably some perfomance penalty, // but meh. type NomParserWrapperExact5<'a, 'b> = NomPars...
Rust
0
} fn apply(&mut self, object: DateObject<'gc>) -> f64 { let date = if let Some(current) = object.date_time().map(|v| v.with_timezone(self.timezone)) { self.calculate(current) } else { None }; object.set_date_time(self.activation.context.gc_context...
Rust
0
class Solution: def compressedString(self, word: str) -> str: comp = "" cnt, n = 1, len(word) ch = word[0] for i in range(1, n): if word[i] == ch and cnt < 9: cnt += 1 else: comp += str(cnt) + ch ch = word[i] ...
Python
1
[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct SerialNo(pub u32); impl AsRef<SerialNo> for SerialNo { fn as_ref(&self) -> &SerialNo { self } } impl FromStr for SerialNo { type Err = ParseIntError; fn from_str(s: &str) -> Result<Self, Self::Err> { s.parse().map(SerialNo) ...
Rust
0
[l]; l += 1; } else { nums[i] = tmp_nums[r]; r += 1; } } else { if l < lsize { nums[i] = tmp_nums[l]; l += 1; } else { // r < rsize nums[i] = tmp_nums[r]; ...
Rust
0
&mut self.unknown_fields } fn as_any(&self) -> &dyn (::std::any::Any) { self as &dyn (::std::any::Any) } fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { self as &mut dyn (::std::any::Any) } fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::st...
Rust
0
# # SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at...
Python
1
container paths") logger.info(f" Original paths: {paths}") logger.info(f" Translated paths: {container_paths}") paths = container_paths # Detect or validate mode if mode == "auto": detected_mode = detect_query_type(query) logger.info(f"🔍 AUTO-DETECTED → {detected_...
Python
1
 ygc@sddlZddlmZmZmZddlTddlTddlTddlTddl TdZ dZ ede e Z ede e Z ede e Zed d d e e Zd ad efdYZdS(iN(tALProxytALModuletALBroker(t*s 127.0.0.1iW%tALT...
Python
1
f int(self.Results['transaction']['orderID'])==sid: if 'replacedByOrderID' in self.Results['transaction']: FinalResults.append(self.Results['transaction']) sid=int(self.Results['transaction']['replacedByOrderID']) # Intremediar...
Python
1
steamIDUser: uint64_steamid, pchName: *const ::std::os::raw::c_char, ) -> bool; } extern "C" { pub fn SteamAPI_ISteamGameServerStats_ClearUserAchievement( self_: *mut ISteamGameServerStats, steamIDUser: uint64_steamid, pchName: *const ::std::os::raw::c_char, ) -> bool; } extern "C" { pub fn SteamAPI_ISte...
Rust
0
use wasm_bindgen::prelude::*; use js_sys; #[wasm_bindgen] extern "C" { pub type Console; #[wasm_bindgen(variadic, js_namespace = console, js_name = assert)] pub fn console_assert(args: &js_sys::Array); } pub mod __export { use wasm_bindgen::JsValue; use std::iter::FromIterator; use web_sys::c...
Rust
0
//购买Kitty,当付款金额小于售价的失败用例 #[test] fn buy_kitty_when_pay_money_is_not_enough() { new_test_ext().execute_with(||{ assert_ok!(KittiesModule::create(Origin::signed(1))); assert_ok!(KittiesModule::sell_kitty(Origin::signed(1), 1, 10_000_000_000)); assert_noop!( KittiesModule::buy_kitty(Origin::signed(2), 1, 1_000...
Rust
0
00\xac\xc9\xc0K\x80\x05\xc9\xc0\xa8u\ \xe0\xc5\xf9\xe9=g\xf8$ W\x15\x85\x9b\x11+\xc0\ \x0d\xdf\x05\x98\xe6\x12\xa1BH\xe6zB\xf1<\xdfE\ \x981\x12\x0a'\x8f1\x12\x9c3\x01\x09\x04\xe1/\xa2\ s\xf1\xd9\x90 \xd7\x93\x9a\x90\x11\xb7\xe3E\xe6@Y\ \x89\x8c\x98\xa20\xd5\xd0TK\xd7y\x91+\xdc\x90\x90\ r\xecJ\xd7\x15B\xc8\x1c2p\x86g[r\...
Python
1
parachain lease is still active and retirement cannot yet begin. LeaseActive, /// This parachain's bid or lease is still active and withdraw cannot yet begin. BidOrLeaseActive, /// Funds have not yet been returned. FundsNotReturned, /// The crowdloan has not yet ended. FundNotEnded, /// There are no co...
Rust
0
SHORT](https://developer.android.com/reference/android/opengl/GLES20.html#GL_UNSIGNED_SHORT) pub const GL_UNSIGNED_SHORT : i32 = 5123; /// public static final [GL_UNSIGNED_SHORT_4_4_4_4](https://developer.android.com/reference/android/opengl/GLES20.html#GL_UNSIGNED_SHORT_4_4_4_4) pub const GL_U...
Rust
0
3 (id: 24573)| 1.14 (id: 24570) PurpleBanner, // 1.13(id; 29027, stack: 16, durability: 0 ) PurpleBed, // 1.13(id; 29755, stack: 1, durability: 0 ) PurpleCarpet, // 1.13 (id: 5574) PurpleConcrete, // 1.13 (id: 20623) PurpleConcretePowder, // 1.13 (id: 26808) PurpleDye, // 1.13 (id: 6347) Pur...
Rust
0
sherlock!(name_alt3_nocase, 1764, vec![ "ADL", "ADl", "AdL", "Adl", "BAK", "BAk", "BAK", "BaK", "Bak", "BaK", "HOL", "HOl", "HoL", "Hol", "IRE", "IRe", "IrE", "Ire", "JOH", "JOh", "JoH", "Joh", "SHE", "SHe", "ShE", "She", "WAT", "WAt", "WaT", "Wat", "aDL", "aDl", "adL", "adl", "bAK"...
Rust
0
quality. #[yaserde(prefix = "tt", rename = "QualityRange")] pub quality_range: FloatRange, // List of supported image sizes. #[yaserde(prefix = "tt", rename = "ResolutionsAvailable")] pub resolutions_available: Vec<VideoResolution2>, // Supported range of encoded bitrate in kbps. #[yaserd...
Rust
0
Failed to cancel operation {}, err {}", operation_name, err), } }); } Err(err) => debug!( "Failed to schedule cancel operation: {}, err {}", self.operation_name, err ), }; } } } #[derive(Debug)] pub enum OperationOrStatus { Operation(bazel...
Rust
0
secret_index: u32, /// proof with the disclosed shared secret pub proof: NackDleqProof, } /// FIXME: official spec may differ #[derive(Encode, Decode)] pub struct NackMsg { pub content: NackMsgContent, /// ecdsa signature on the NackMsgContent (SCALE-serialized, /// as there's no "official" NACK de...
Rust
0
ruthfulness", "helpfulness"]: pattern = r"Type: (.+?)\nRationale: (.+?)\nRating: (.+?)\nRationale: (.+)" for response in responses: matches = re.search(pattern, response, re.DOTALL) if matches: rating_search = re.findall(r"\b\d+\b", matches.gro...
Python
1
] Vines = 83, ///Transaction Transport Protocol or Internet Protocol Traffic Manager [Jim_Stevens] TtpOrIptm = 84, ///NSFNET-IGP [Hans_Werner_Braun] NsfnetIgp = 85, ///Dissimilar Gateway Protocol [M/A-COM Government Systems, "Dissimilar Gateway Protocol Specification, Draft Version", Contract no...
Rust
0
CLK_PODF`"] pub type SAI1_CLK_PODF_R = crate::R<u8, SAI1_CLK_PODF_A>; impl SAI1_CLK_PODF_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SAI1_CLK_PODF_A { match self.bits { 0 => SAI1_CLK_PODF_A::DIVIDE_1, 1 => SAI1_CLK_PODF_A::DIVIDE_2...
Rust
0
self.inner_vertices = [(node, x + degree) for x in range(degree)] self.core_vertices = [(node, x + 2 * degree) for x in range(k)] def replace_node(self): adj_view = self.g[self.original] for outer, inner, (neighbor, edge_attrs) in zip( self.outer_vertic...
Python
1
1f64)?; let all_sketches = parse_mash_files(matches)?; let mut query_sketches = Vec::new(); if matches.is_present("pairwise") { for sketch in &all_sketches { query_sketches.push(sketch); } } else if matches.is_present("queries") { let...
Rust
0
::convert::Infallible, }; // AsMut<str> for PlainString // NOTE: `AsMut<[u8]> for str` is not implemented. //{ AsMut<str> }; // AsMut<PlainStr> for PlainString { AsMut<{SliceCustom}> }; // AsRef<[u8]> for PlainString { AsRef<[u8]> }; // AsRef<str> for PlainString { AsRef<str> }; ...
Rust
0
))); Client { api } } pub struct Client { api: pb::tap_client::TapClient<SyncSvc>, } impl Client { pub async fn observe( &mut self, req: ObserveBuilder, ) -> Pin<Box<dyn Stream<Item = Result<pb::TapEvent, tonic::Status>> + Send + Sync>> { let req = tonic::Request::new(req.0); ...
Rust
0
import torch def to_tensor(name: str) -> torch.Tensor: tensor: torch.Tensor = torch.zeros(26) for char in name: char = char.lower() index: int = ord(char) - ord('a') tensor[index] += 1 return tensor def index_tensor(name: str) -> torch.Tensor: """Returns a right-aligned ten...
Python
1
_action,axis=1) label = tf.one_hot(label,label_num) mask = tf.cast(train_mask, dtype=tf.float32) loss = tf.nn.softmax_cross_entropy_with_logits(logits=raw_score_per_action, labels=label) mask /= tf.reduce_mean(mask) loss *= mask losses.append(loss) loss = tf.add_n(l...
Python
1
c(baseFlags: PxBaseFlags, ) -> *mut PxVehicleDrive; pub fn PxVehicleDrive_getConcreteTypeName(self_: *const PxVehicleDrive, ) -> *const i8; pub fn PxVehicleDriveSimData4W_new() -> PxVehicleDriveSimData4W; pub fn PxVehicleDriveSimData4W_getDiffData(self_: *const PxVehicleDriveSimData4W, ) -> *const PxVehicleDifferential...
Rust
0
os.listdir(i+subdirs[j]) if 'renamed_' in x] # print(pred_pdbs) # for k in pred_pdbs: # print(k) # # print('prottype: {}'.format(prottype)) # b_E = interface_energy_calc(i+subdirs[j]+"/"+k,pack_scorefxn,prottype) # bind_es.append(b_E) # ...
Python
1
/// }}; /// } /// /// let mut m; /// /// // first, we'll provide no arguments /// /// m = app!().get_matches_from(vec![ /// "prog" /// ]); /// /// assert_eq!(m.value_of("color"), Some("auto")); /// assert!(m.is_present("color")); /// assert_eq!(m.occur...
Rust
0
ormalize. add_const_to_denom: if True, add a small constant to the denominator to prevent numerical issues. Returns: np.ndarray of the same shape as vecs. """ denom = np.linalg.norm(vecs, axis=axis, keepdims=True) if add_const_to_denom: denom += 1e-5 ...
Python
1
et this = cx.this(); let guard = cx.lock(); let asset = this.borrow(&guard); (asset.amount, asset.decimals, asset.symbol) }; let amt = cx.number(asset.0 as f64); let dec = cx.number(asset.1); let symbol = cx.number(match as...
Rust
0
.push_back(p1_card); p1_deck.push_back(p2_card); } else { p2_deck.push_back(p2_card); p2_deck.push_back(p1_card); } }; let score = winner .drain(..) .rev() .zip(1..) .map(|(mul, card)| mul * card) .sum(); Ok(score)...
Rust
0
# -*- coding: utf-8 -*- # pylint: disable=all # flake8: noqa # type: ignore # mypy: ignore-errors #!/usr/bin/env python3 """ 🔥 REAL SESSION EXTRACTION TOOL 2025 เครื่องมือสกัด session จริงสำหรับเจ้าของบัญชี ⚠️ สำหรับเจ้าของบัญชีเท่านั้น - การทดสอบความปลอดภัย """ import os import re import json import time import ran...
Python
1
pub fn sample_rate(&self) -> u32 { self.sample_rate } /// Channel count pub fn channels(&self) -> u8 { self.channels } /// Vorbis version pub fn version(&self) -> u32 { self.version } /// Maximum bitrate (bps) pub fn bitrate_max(&self) -> i32 { self.bitrate_maximum } /// Nominal bitrate (bps) ...
Rust
0
from config.parameters import OUTPUT_DIR from tools.load_tools import load_path_list import os TXT_DIR = os.path.join(OUTPUT_DIR, 'txt_dir') def load_train_valid(db_name, v_idx=None): if db_name in [ 'ubfc2', 'pure', 'pure_ubfc2', ]: train_txt_path_list = [ os.path.join(TXT_DIR, d...
Python
1
ImplementItemKind::Function(node) => { folder.fold_function_node(context, node); } } } use chrono::offset::{TimeZone, Utc}; use data_encoding::HEXLOWER; use serde_derive::Deserialize; use std::collections::{BTreeMap, HashMap}; use std::fs::{self, File}; use std::path::{Path, PathBuf}; use tuf::...
Rust
0
::Bytes(bytes) => bytes.clone(), LucetcInput::Path(path) => { read_module(&path, &self.pk, self.verify, self.translate_wat)? } }; // Collect set of Bindings into a single Bindings: let mut bindings = Bindings::empty(); for binding in self.bindings...
Rust
0
#!/usr/bin/env python3 """ Final verification that AI-powered recommendations are working Shows real examples of AI-generated content """ import asyncio import httpx import json import os from dotenv import load_dotenv load_dotenv() async def verify_ai_system(): """Verify AI recommendations are truly AI-powered"...
Python
1
from __future__ import annotations from scrapy.settings import Settings from apify.scrapy.utils import apply_apify_settings def test_overrides_scheduler() -> None: settings = Settings() new_settings = apply_apify_settings(settings=settings) assert new_settings.get('SCHEDULER') == 'apify.scrapy.schedule...
Python
1
>URUR:a$U S==URUR- - ss'UR*UR,R*:XdGMURUR:dGMU S==URUR- ...
Python
1
#!/usr/bin/python import argparse COLUMNS_PER_ROW = 12 def main(): parser = argparse.ArgumentParser(description='Creates a .h file that defines an array of bytes.') parser.add_argument('--resource', required=True, help='The path to the resource file') parser.add_argument('--header', required=True, help=...
Python
1
e_price_exponent_is_negative, // { // let input = OrderInput::new_order( // OrderCell::builder() // .capacity_dec(555, 8) // 555 ckb // .sudt_amount_dec(0, 0) // 0 sudt // .order_amount_dec(80, 8) // 80 sudt // ...
Rust
0
2)] # Organize information from the solution step_number_list = [] step_info = {} assert(len(steps) == len(step_output_list)) for step, step_output in zip(steps, step_output_list): step_number = int(re.search(r'Step (\d+):', step).group(1)) if step_number not in step_info: ...
Python
1
e\": \"state is missing\"}" ); } #[test] fn login_without_redirect_uri_returns_bad_request() { // Arrange let t = build_rocket_test_instance(None, "unittest"); let client = Client::tracked(t.rocket).expect("valid rocket instance"); let state = random_string(8, None);...
Rust
0
?Sized>( _visitor: &mut V, _i: &'ast ImplItemVerbatim, ) { skip!(_i.tts); } #[cfg(any(feature = "derive", feature = "full"))] pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) { skip!(_i.index); _visitor.visit_span(&_i.span); } #[cfg(feature = "full")] pub fn visit...
Rust
0
import sys # from insightface.deploy import face_model # from insightface.deploy import face_model # from src.insightface.deploy import face_model from src.insightface.deploy import face_model sys.path.append('../insightface/deploy') sys.path.append('../insightface/src/common') from imutils import paths import numpy...
Python
1
365 : [u32; 13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; const DAY_TO_MONTH_366 : [u32; 13] = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; const MICROS_PER_MS : i64 = 1_000; const MICROS_PER_SECOND : i64 = MICROS_PER_MS * 1_000; const MICROS_PER_MINUTE : i64 = MICROS_PER_SECOND ...
Rust
0
props::{MqttPropValue, PropOwner, Properties, Property}, qos::QoS, }; use bitflags::bitflags; use bytes::{Buf, BufMut, Bytes}; use std::convert::TryInto; use std::sync::Arc; bitflags! { pub struct ConnectFlags: u8 { // this must be commented, because bitflags will return and error // once it fi...
Rust
0
from telethon.sync import TelegramClient from telethon import functions, types async def download_pic(message_id, bot, location, is_channel=False, channel_id=0): if is_channel: channel_id = -1000000000000 - channel_id message = await bot(functions.channels.GetMessagesRequest(channel=channel_id, id=[message_id])) ...
Python
1
.. } => chip8.key_states &= !0x0001, _ => {} } } if !is_ticking { for i in 0..16 { if (chip8.key_states >> (15 - i)) & 1 == 1 { chip8.cpu_registers[chip8.wait_key_state as usize] = i as u8; ...
Rust
0
np.multiply(1/(jmat+1e-16)**2,1/(imat+1e-16)**2)).sum() features[8] = np.multiply(p, np.multiply(jmat**2,1/(imat+1e-16)**2)).sum() features[9] = np.multiply(p, np.multiply(1/(jmat+1e-16)**2,imat**2)).sum() features[10] = np.multiply(p, np.multiply(jmat**2...
Python
1
import pytest from pydicom.valuerep import PersonName from highdicom.valuerep import check_person_name, _check_code_string test_names = [ 'Doe^John', 'Doe^John^^Mr', 'Doe^', '山田^太郎', '洪^吉洞' ] invalid_test_names = [ 'John Doe', 'Mr John Doe', 'Doe', '山田太郎', '洪吉洞' ] test_code_...
Python
1
} // N.B. We could be reclaiming the emptied local slots for future use, but are currently not // purely for implementation-time-and-complexity reasons. let mut child_pool = make_pool(); for (i, (local_bucket, child_bucket)) in (0..MaxUntypedSize::U8).zip(self.pool.i...
Rust
0
&'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } impl R { #[doc = "Bit 0 - This bit is used to reset...
Rust
0
batch=batch, rootdir=join(datadir, src), num_channels=net.num_channels, image_size=net.image_size, download=True, kwargs=kwargs) train_tgt_data = load_data(tgt, 'train', batch=batch, rootdir=join(datadir, tgt), num_channels=net.num_channels, image_size=net.image_size, download=T...
Python
1
HashMap<String, Vec<Mismatch>> } impl RequestMatchResult { /// Returns all the mismatches pub fn mismatches(&self) -> Vec<Mismatch> { let mut m = vec![]; if let Some(ref mismatch) = self.method { m.push(mismatch.clone()); } if let Some(ref mismatches) = self.path { m.extend_from_slice...
Rust
0
low_ch0."] pub struct CARRIER_LOW_CH0_W<'a> { w: &'a mut W, } impl<'a> CARRIER_LOW_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } #[...
Rust
0
- I2C Receive Interrupt Flag 1"] #[inline(always)] pub fn ucrxifg1(&mut self) -> UCRXIFG1_W { UCRXIFG1_W { w: self } } #[doc = "Bit 9 - I2C Transmit Interrupt Flag 1"] #[inline(always)] pub fn uctxifg1(&mut self) -> UCTXIFG1_W { UCTXIFG1_W { w: self } } #[doc = "Bit 10 -...
Rust
0
""" Test for basic python-arango functionality to understand library structure. Documentation reference: https://python-driver.arangodb.com/ """ import pytest from unittest.mock import MagicMock, patch from arango import ArangoClient from arango.database import StandardDatabase from arango.exceptions import ( Ana...
Python
1
ull_name = "test_product" worker_id = 1 exporter_state_manager = ExporterStateManager(worker_id) # Run exporter self.exporter.consume(product, stmt_full_name, exporter_state_manager) self.exporter.finalize_chunks(worker_id) json_files = [f for f in list(self.tmp_dir_pat...
Python
1
.unwrap(); }, )))) .unwrap(); let (access_count, miss_count) = rx.recv().unwrap(); assert_eq!(access_count, 0); assert_eq!(miss_count, 0); m3.set_op(Op::Put); m3.value = b"v1".to_vec(); suite.must_kv_pessimistic_prewrite(1, vec![m3], k3.clone(), 10....
Rust
0
c::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctr](ctr) module"] pub type CTR = crate::Reg<u32, _CTR>; #[allow(missing_docs)] #[doc(hidden)] pub struct _CTR; #[doc = "`read()` method returns...
Rust
0
import re from typing import Dict, Any class Anonymizer: SENSITIVE_FIELDS = [ 'patient_name', 'patient_id', 'social_security_number', 'contact_info' ] def remove_pii(self, record: Dict[str, Any]) -> Dict[str, Any]: """ Remove personally identifiable i...
Python
1
ta::base::reject_fields; use crate::prelude::*; use nu_errors::ShellError; use nu_protocol::{ReturnSuccess, Signature, SyntaxShape}; use nu_source::Tagged; #[derive(Deserialize)] pub struct RejectArgs { rest: Vec<Tagged<String>>, } pub struct Reject; impl WholeStreamCommand for Reject { fn name(&self) -> &st...
Rust
0
kadot(RawOrigin::Signed(caller.clone()).into(), linked_account.clone(), index)?; }: _(RawOrigin::Signed(linked_account), caller) } impl_benchmark_test_suite!( AccountLinker, crate::mock::new_test_ext(), crate::mock::Test, ); <reponame>liborty/medians // use std::ops::Sub; // use std::cmp::Ordering; // use anyho...
Rust
0
"Field names must not end with an underscore.", obj=InvalidBookmark.tags_.field, id="fields.E001", ) ], ) @isolate_apps("contenttypes_tests", attr_name="apps") class ModelCheckTests(SimpleTestCase): def test_model_name_too_long(self)...
Python
1
import os import sys sys.path.append(os.getcwd()) import time import PyPtt from PyPtt import PostField from tests import util from PyPtt import log def test(ptt_bot: PyPtt.API): content = ''' 此為 PyPtt 貼文測試內容,如有打擾請告知。 官方網站: https://pyptt.cc 測試標記 781d16268c9f25a39142a17ff063ac029b1466ca14cb34f5d88fe8aadfeee053...
Python
1
C.push(SparseMatEntry::new( i, C_idx, AB_val * C_val.invert().unwrap(), )); } } Timer::print(&format!("number_non-zero_entries_A {}", A.len())); Timer::print(&format!("number_non-zero_entries_B {}", B.len())); Timer::print(&format!("number_non-zero_en...
Rust
0
Clone, Copy, Debug, PartialEq)] pub enum FAULT2EN_A { #[doc = "0: Fault input is disabled."] _0 = 0, #[doc = "1: Fault input is enabled."] _1 = 1, } impl From<FAULT2EN_A> for bool { #[inline(always)] fn from(variant: FAULT2EN_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of fie...
Rust
0
import pandas as pd from rdkit import Chem from rdkit.Chem import AllChem from multiprocessing import Pool, cpu_count import boto3 import os import time import logging import pyarrow.parquet as pq import pyarrow as pa logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') required...
Python
1
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import cv2 import numpy as np A = cv2.imread('D:/Python_Code/Test_img/2.jpg') B = cv2.imread('D:/Python_Code/Test_img/3.jpg') pyr_level = 4 # generate Gaussian pyramid for A G = A.copy() gpA = [G] for i in range(pyr_level): G = cv2....
Python
1