text
string
label_name
string
labels
int64
arts) return (result,) # 否则使用模板替换 replacements = { "{role}": role_val, "{clothing}": clothing_val, "{hairstyle}": hairstyle_val, "{skin}": skin_val, "{face shape}": face_shape_val, "{ears}": ears_val, ...
Python
1
# Copyright 2022 Huawei Technologies Co., Ltd # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
1
# Generated by Django 4.0.5 on 2025-07-30 20:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cook_for_kids', '0012_globalsettings'), ] operations = [ migrations.AlterModelOptions( name='globalsettings', option...
Python
1
rue, a[1:] > a[:-1]] & N.r_[a[:-1] > a[1:], True] p = N.array(N.where(peaks)[0]) maxidx = N.zeros(N.shape(p)) maxvals = N.zeros(N.shape(p)) for i, pk in enumerate(p): maxidx[i] = N.argmax(vec[pk - 16:pk + 16]) + pk - 16 maxvals[i] = N.max(vec[pk - 16:pk + 16]) out = N.array([maxidx,...
Python
1
(&self) -> Self { *self } } impl ::std::default::Default for Struct__HPDF_DashMode { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } pub type HPDF_DashMode = Struct__HPDF_DashMode; #[repr(C)] #[derive(Copy)] pub struct Struct__HPDF_TransMatrix { pub a: HPDF_REAL, pub b: HPDF_REAL, pub c: HPDF...
Rust
0
eight, width). target is the object returned by ``coco.loadAnns``. """ img_id = self.ids[index] target = self.coco.imgToAnns[img_id] ann_ids = self.coco.getAnnIds(imgIds=img_id) target = self.coco.loadAnns(ann_ids) path = osp.join(self.root, self.coco....
Python
1
import sys import socket import pyfiglet ascii_banner = pyfiglet.figlet_format("Hamza_Elatmani \n Python 4 Pentesters \nPort Scanner") print(ascii_banner) ip = '10.9.231.156' open_ports =[] ports = range(1, 65535) def probe_port(ip, port, result = 1): try: sock = socket.socket(socket.AF_INET, socket.SO...
Python
1
sed, group_all_fused, group_all_buffers, ) = _fused_parameters_impl( real_param, use_main_grad=use_main_grad, fuse_param=fuse_param, comm_overlap=comm_overlap, comm_group=comm_group, ...
Python
1
: filedata = f.read() num = rel_path.count(os.sep) if rel_path.startswith('comfyui'): filedata = re.sub(r'(from\s+["\'])rgthree/', f'\\1{"../" * (num + 1)}rgthree/', filedata) filedata = re.sub(r'(from\s+["\'])scripts/', f'\\1{"../" * (num + 1)}scripts/', filedata) else: filedata = re.sub(r'(from\...
Python
1
, None] > cpr).sum(1) for j in range(n): OUT.write("%d, %d," % (i, y[j])) OUT.write(",".join(["%.3f" % b for b in x[j, :]]) + "\n") OUT.close() def generate_poisson(): # Regression coefficients beta = np.zeros(5, dtype=np.float64) beta[2] = 0.5 beta[4] = -0.5 ...
Python
1
_by_name(&question.qname) { builder = svc.add_srv_rr(services.get_hostname(), builder, DEFAULT_TTL); builder = self.add_ip_rr(services.get_hostname(), builder, DEFAULT_TTL); } } QueryType::TXT => { if let Some(svc) = service...
Rust
0
pr<S: Clone + PartialEq, F: Clone, P: Clone> { True, False, Var(usize), Apply(Predicate<S, P>, Vec<Pattern<F, usize>>) } impl<S: Clone + PartialEq, F: Clone + fmt::Display, P: Clone + fmt::Debug> fmt::Debug for Expr<S, F, P> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Expr::True => ...
Rust
0
"2 * 3 + 4", |arena| binop(arena, binop(arena, int(2), "*", int(3)), "+", int(4)) } test_parse! { expression2, r#"\x y -> x + y"#, |arena| lambda(arena, "", vec![intern("x"), intern("y")], binop(arena, id("x"), "+", id("y")), ) } test_parse! { expression3, r#"t...
Rust
0
Type::U: return 0x16; case KeybdKey::Type::V: return 0x2f; case KeybdKey::Type::W: return 0x11; case KeybdKey::Type::X: return 0x2d; case KeybdKey::Type::Y: return 0x15; case KeybdKey::Type::Z: return 0x2c; case KeybdKey::Type::Numpad0: return 0x52; ...
Rust
0
pleInheritance( ParentDescriptor: PSECURITY_DESCRIPTOR, CreatorDescriptor: PSECURITY_DESCRIPTOR, NewDescriptor: *mut PSECURITY_DESCRIPTOR, ObjectType: *mut *mut GUID, GuidCount: ULONG, IsDirectoryObject: BOOLEAN, AutoInheritFlags: ULONG, Token: HANDLE, ...
Rust
0
_lookup = (geoip_lookup as *const GeoIpLookup).as_ref(); let normalizer = StoreProcessor::new(config, geoip_lookup); Ok(Box::into_raw(Box::new(normalizer)) as *mut RelayStoreNormalizer) } } ffi_fn! { unsafe fn relay_store_normalizer_free( normalizer: *mut RelayStoreNormalizer ) { ...
Rust
0
def myfunc(): global x x = "fantastic"
Python
1
i) //~ ERROR can't compare `&i32` with `(i32, &i32)` } type Moo<'a, 'b> = (i32, impl PartialEq<Moo<'b, 'a>> + std::fmt::Debug); fn moo<'a, 'b>(i: &'a i32) -> Moo<'a, 'b> { (42, i) //~ ERROR can't compare `&i32` with `(i32, Moo<'b, 'a>::{opaque#0})` } fn main() { let meh = 42; let muh = 69; assert_eq!...
Rust
0
elf.gamma; let f3_tau = Spair::random(rng, self.tau).unwrap(); let f4_alpha_a = Spair::random(rng, self.alpha_a).unwrap(); let f5_alpha_c = Spair::random(rng, self.alpha_c).unwrap(); let f6_rho_b = Spair::random(rng, self.rho_b).unwrap(); let f7_rho_a_rho_b = Spair::random(rng, ...
Rust
0
red: 0.2, green: 0.2, blue: 0.2, alpha: 1.0, }, bottom_panel_color: Color::Rgba { red: 0.17, green: 0.17, blue: 0.17, alpha: 1.0, }, text_color: Color::Rgba { red: 0.9, green: 0.6, blue: 0.2, alpha: 1.0, ...
Rust
0
Decode, <<N::Runtime as Runtime>::Signature as Verify>::Signer: From<<<C::KeyType as KeyType>::Pair as Pair>::Public> + TryInto<<<C::KeyType as KeyType>::Pair as Pair>::Public> + IdentifyAccount<AccountId = <N::Runtime as System>::AccountId> + Clone + Send + Sync, C: Cli...
Rust
0
import numpy as np from opensourceleg.actuators.base import CONTROL_MODES from opensourceleg.actuators.dephy import DephyActuator from opensourceleg.logging.logger import Logger from opensourceleg.robots.osl import OpenSourceLeg from opensourceleg.sensors.encoder import AS5048B from opensourceleg.utilities import Soft...
Python
1
term, stop_term) }; prop_assert_eq!( native(&arc_process, binary, start_term, stop_term), Err(badarg!().into()) ); Ok(()) }, ) .unwrap(); }); } us...
Rust
0
_extractor.rs use super::html_link_extractor::HtmlLinkExtractor; use super::markdown_link_extractor::MarkdownLinkExtractor; use crate::markup::{MarkupFile, MarkupType}; use std::fmt; /// Link found in markup files #[derive(PartialEq, Clone)] pub struct MarkupLink { /// The source file of the link pub source: S...
Rust
0
("\x1b[31;1m"), String::from("\x1b[32;1m"), String::from("\x1b[34;1m"), String::from("\x1b[36;1m"), String::from("\x1b[35;1m"), String::from("\x1b[33;1m"), String::from("\x1b[0m"), ]; let mut color_maps: HashMap<Color, String> = HashMap::new(); keys.iter().zip(values.iter()).for_each(|(&k...
Rust
0
if self.get(a) != 0 { self.pos = self.get(b) as usize } } else { panic!("Invalid jump_if_true(). Expected: Val, Val, found '{:?}' instead", param) } } fn jump_if_false(&mut self, param: Vec<Val>) { if let (Some(a), Some(b)) = (param.get(...
Rust
0
r Comm args"); return; } }; unimplemented!(); } <reponame>wcpannell/s32k1-pacs #[doc = "Register `PARAM` reader"] pub struct R(crate::R<PARAM_SPEC>); impl core::ops::Deref for R { type Target = crate::R<PARAM_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &s...
Rust
0
# kol2testy.py from testy import * from kol2test_spec import ALLOWED_TIME, TEST_SPEC, gentest from copy import deepcopy def copyarg( arg ): return deepcopy(arg) def printarg(*arg): G = arg[0] n = len(G) e = 0 for i in range(n): e += len(G[i]) print(f'V: {n}') print(f'E: {e//2}')...
Python
1
_ => { return Err(constraint_error!( "Unexpected Constraint Type '{:#?}'", self )); } } Ok(value_set) } fn parse_or_resolve_value(value: &String, resolver: &Resolver) -> Result<i128, Error> { ...
Rust
0
rnes_hut' and the metric is 'precomputed', X may be a precomputed sparse graph. y : None Ignored. Returns ------- self : object Fitted estimator. """ self.fit_transform(X) return self @property def _n_features_out(sel...
Python
1
eTokenBurned(AccountId, Hash), } ); decl_error! { /// Errors inform users that something went wrong. pub enum Error for Module<T: Config> { /// Number is too large or less than zero. NumOverflow, /// The minimum value is 1. AmountLessThanOne, /// Amount too large (am...
Rust
0
.geometry.bounding_box.height, ) words_in_line.append(Word(text=clean_word_text, separator='', box=w_box)) full_line_text += clean_word_text if full_line_text: l_box = BoundingBox( ...
Python
1
/// println!("{}", *lazy); /// /// // Prints: /// // ready /// // initializing /// // 92 /// // 92 /// ``` pub struct Lazy<T, F = fn() -> T> { cell: OnceCell<T>, init: Cell<Option<F>>, } #[cfg(feature = "std")] impl<T, F: RefUnwindSafe> RefUnwind...
Rust
0
list: String, } impl Into<PlayListWhere> for PlayListQuery { fn into(self) -> PlayListWhere { PlayListWhere { play_list: (self.play_list), } } } impl Into<PlayListFilter> for PlayListQuery { fn into(self) -> PlayListFilter { PlayListFilter { play_list: (self...
Rust
0
sible(u8); impl SRVCCOperationNotPossible { const NOT_POSSIBLE: u8 = 0u8; } #[derive(Debug, AperCodec)] #[asn(type = "ENUMERATED", extensible = true, lb = "0", ub = "0")] pub struct SRVCCOperationPossible(u8); impl SRVCCOperationPossible { const POSSIBLE: u8 = 0u8; } #[derive(Debug, AperCodec)] #[asn(type = "...
Rust
0
Provider for GoogleProvider { fn authorization_endpoint(&self) -> url::Url { url::Url::parse("https://accounts.google.com/o/oauth2/v2/auth").unwrap() } fn token_endpoint(&self) -> url::Url { url::Url::parse("https://oauth2.googleapis.com/token").unwrap() } fn validate_iss(&self, i...
Rust
0
95a351786dd7a188515173f6928a8af8c9baa4dcff268a4f0f" is the hash of // "0101010101010101010101010101010101010101010101010101010101010202" let input_data: Vec<H256> = gen_merkle_tree_data_2!(); let merkle_tree = MerkleTree::new(&input_data); let proof = merkle_tree.proof(0); assert...
Rust
0
kQueryHandler(self.handle_settings_callback), MessageHandler(filters.AUDIO, self.handle_audio) ], ADD_TYPE_NAME: [ MessageHandler(filters.TEXT & ~filters.COMMAND, self.handle_text_input), CallbackQueryHandler(self.handle_setting...
Python
1
dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); let new_app_templates_dir = cli_dir .join("src") .join("commands") .join("new") .join("templates"); let mut data = "".to_string(); for entry in fs::read_dir(&new_app_templates_dir) .unwrap() .into_iter(...
Rust
0
/// If the string is marked as not owned then this function does not /// do anything. #[no_mangle] pub unsafe extern "C" fn relay_str_free(s: *mut RelayStr) { if !s.is_null() { (*s).free() } } /// Frees a Relay buf. /// /// If the buffer is marked as not owned then this function does not /// do anythin...
Rust
0
# Generated by Django 3.2.11 on 2022-02-04 02:01 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("projects", "0002_auto_20220204_0201"), ("label_types", "0002_rename_relationtypes_relationtype"), ] operat...
Python
1
_hidden,logger=logger,use_ssl=args.use_ssl) topology_model = topology_model.cpu() if load_model: logging.info("Loading Model ... ") topology_model.load_state_dict(torch.load("checkpoint.pt")) if save_model: ...
Python
1
errcodeterrmsgtheaders(RRRRR((sD:\Python27_64\lib\xmlrpclib.pyRs     cCsd|j|j|jfS(Ns<ProtocolError for %s: %s %s>(RRR(R((sD:\Python27_64\lib\xmlrpclib.pyt__repr__s(...
Python
1
{ map.into_iter() .map(|(k, v)| (k.to_string(), v.into())) .collect::<HashMap<String, AttributeField>>() .into() } } impl Attributes { pub fn get_field(&self, field_name: &str) -> Result<&AttributeField> { self.0 .get(field_name) .ok_...
Rust
0
let mut catname: Option<String> = None; let catid = ((rec_attributes & 0xFF) as u8) & CATEGORY_ATTRIBUTE_MASK; 'catsearch: for (x_catid, x_catname) in categories.iter() { if catid == *x_catid { catname = Some(x_catname.clone()); break 'catsearch; } } catname }; // Parse out the d...
Rust
0
ure Week 1 Union-Find Applications (9:22) ########################################################################### # UNION-FIND APPLICATIONS: (00:27) Week 1 Lecture "Union-Find Applications" (1:22) # * Percolation # * Games (Go, Hex) # X Dynamic connectivity # * Least common ancestor # * Equivalence of finite ...
Python
1
sysref_monitor_status = _decode_setup_hold(sysref_setup, sysref_hold) self.log.trace("SYSREF setup: 0x{:X}".format(sysref_setup)) self.log.trace("SYSREF hold: 0x{:X}".format(sysref_hold)) self.log.debug("SYSREF monitor: %s" % SYSREF_MONITOR_MESSAGES[sysref_monitor_status]) # Read t...
Python
1
e_loop:"); for i in 0..list.len() { println!("{}", list[i]); } } /// ------------------------------------------------------ /// for_in_loop /// /// PURPOSE: prints a message about what type of loop it is (for_in_loop), /// then iterates over the provided list, using said loop, and prints /// ...
Rust
0
def foo(arg: *int): ... def foo(arg: yield int): ... def foo(arg: x := int): ...
Python
1
(loss_aug - gamma * (self.model.aug_P - 1/5)) mu_min, mu_max = b.min()-1/5, b.max()-1/5 mu = (mu_min + mu_max) / 2 # bisection method while abs(np.maximum(b-mu, 0).sum() - 1) > 1e-2: if np.maximum(b-mu, 0).sum() > 1: mu_min = mu else: ...
Python
1
crate::cpu::*; impl CPU { // Fetch, decode, dispatch. pub(super) fn dispatch(&mut self, bus: &mut Bus) { let opcode = bus.mem_read(self.mmu.to_physical(self.sr.pc), true); self.sr.pc += 1; // The full 256 opcode values are listed explicitly to allow a jump table to be // gener...
Rust
0
includes, options.depth, params, options.check, options.circular_check) # TODO(mark): Pass |data| for now because the generator needs a list of # build files that came in. In the...
Python
1
amounts).expect("No active revenue box"); let (box_width, box_height) = box_dims(&boxes, hex, &labeller); let net_height = box_height * boxes.len() as f64; // Determine the top-left point of these boxes. let mut origin = coord; ...
Rust
0
not enough parameters"); help(&name); }*/ for arg in args { if arg == "/?" || arg == "-?" || arg.to_lowercase() == "/help" || arg.to_lowercase() == "-help" { help(&name); } if arg ...
Rust
0
ificates\"`*"] pub const wszPROPREQUESTRAWREQUEST: &str = "RawRequest"; #[doc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const wszPROPREQUESTREQUESTID: &str = "RequestID"; #[doc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const wszPROPREQUESTRESOLVEDWHE...
Rust
0
statement.into()); } } impl<'a, T> From<&'a T> for DecoratorSpec where T: Into<DecoratorSpec> + Clone, { fn from(value: &'a T) -> DecoratorSpec { value.clone().into() } } impl From<BuiltInName> for DecoratorSpec { fn from(value: BuiltInName) -> DecoratorSpec { DecoratorSpec::new(va...
Rust
0
# Copyright 2022 The HuggingFace Team. All rights reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
1
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. import _plotly_utils.basevalidators as _bv class VariantValidator(_bv.EnumeratedValidator): def __init__( self, plotly_name="variant", parent_name="contour.contours.labelfont", **...
Python
1
pub fn new() -> Draw; #[wasm_bindgen(method)] pub fn width(this: &Draw, x: u32) -> u32; #[wasm_bindgen(method)] pub fn height(this: &Draw, y: u32) -> u32; #[wasm_bindgen(method)] pub fn clear_screen(this: &Draw); #[wasm_bindgen(method)] pub fn draw_player(this: &Draw, _: c_int, ...
Rust
0
", ) ) else: import_link_section = texts.t( "SUBSCRIPTION_IMPORT_LINK_SECTION", "🔗 <b>Ваша ссылка для импорта в VPN приложение:</b>\\n<code>{subscription_url}</code>", ).format(subscription_url=subscript...
Python
1
eference/working-with-duck-typed-interfaces.html /// [here]: crate::ext::addon::XtermAddon #[wasm_bindgen(extends = Disposable)] #[derive(Debug, Clone)] pub type TerminalAddon; /// This is called when the addon is activated. #[wasm_bindgen(structural, method, js_name = activate)] pub fn act...
Rust
0
tBlendMode (gstate, HPDF_BM_LIGHTEN) HPDF_Page_SetExtGState (page, gstate) draw_circles (page, "HPDF_BM_LIGHTEN", 230.0, PAGE_HEIGHT - 510) HPDF_Page_GRestore (page) # blend-mode=HPDF_BM_COLOR_DODGE HPDF_Page_GSave (page) gstate = HPDF_CreateExtGState (pdf) HPDF_ExtGState_SetBlendMode (gsta...
Python
1
# Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.runtime import Core, Model import torch from typing import Any import logging log = logging.getLogger(__name__) def collect_tensor_names(instance: Model, tensor_type_name: str, out: dict) -> dict: """ @param inst...
Python
1
} #[inline] pub fn push(&mut self, ch: char) { self.inner.push(ch); } #[inline] pub fn push_arg<'s>(&mut self, arg: &Arg<'s>) { match arg { Arg::Int(val) => write!(&mut self.inner, "{}", val).unwrap(), Arg::Float(val) => write!(&mut self.inner, "{}", val...
Rust
0
# Atividade 04: # Contagem Regressiva: # Desenvolva um programa que use um laço while para exibir # uma contagem regressiva de 10 até 1 e, em seguida, exiba # "Feliz Ano Novo!". n = 10 while n > 0: print
Python
1
eg), Intrinsic::Int64Mul => self.gen.emit_mul_int64(dest, lhs_reg, rhs_reg), Intrinsic::Int64Div => { self.gen.set_position(pos); self.gen.emit_div_int64(dest, lhs_reg, rhs_reg) } Intrinsic::Int64Mod => { self.gen.set_positi...
Rust
0
un. Perhaps name it according // to sha or something. let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); let src = out_dir.join("src"); if !duktape_bindings.exists() { let ignored_macros = IgnoreMacros( vec![ "FP_INFINITE".into(), "FP_NAN".int...
Rust
0
, 0.219, 1.179, -2.801, 3.276], [2.259, 0.601, 0.045, 0.979, 4.506, 0.118], [-0.296, -0.896, 0.544, -4.282, 3.544, 6.288], [0.573, -0.96, -3.85, -2.613, -0.461, 4.467], [3.978, -2.229, 0.133, 1.154, -6.544, -0.962], ]; let solution_im = array![ ...
Rust
0
ts = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is gen...
Python
1
.chars().enumerate() { if char == '#' { active_nodes.insert((x as i32, y as i32, 0, 0)); } } } let mut current = active_nodes; let mut next = HashSet::new(); let mut inactive_nodes = HashSet::new(); let mut cycle_count = 0; loop { for &p...
Rust
0
pub static in6addr_allnodesonnode; // pub static in6addr_allroutersonlink; // pub static in6addr_any; // pub static in6addr_linklocalprefix; // pub static in6addr_loopback; // pub static in6addr_multicastprefix; // pub static in6addr_solicitednodemulticastprefix; // pub static in6addr_tered...
Rust
0
} _ => {} } false } fn is_structural_derive(i: &Item) -> bool { // This is a hack to work around the StructuralPartialEq impl // from derive(PartialEq) not being marked with an // automatically_derived attribute. TODO: remove this when // StructuralPartialEq is labeled with the...
Rust
0
import cv2 import numpy as np import matplotlib.pyplot as plt # Load the cover and stego images cover_image_path = 'peppers.tiff' stego_image_path = 'stego_peppers.tiff' cover_image = cv2.imread(cover_image_path, cv2.IMREAD_GRAYSCALE) stego_image = cv2.imread(stego_image_path, cv2.IMREAD_GRAYSCALE) # Function to cal...
Python
1
[0].subscription, Subscription::Remove); } #[cfg(not(feature = "disable-validation"))] #[test] fn test_invalid() { let elem: Element = "<query xmlns='jabber:iq:roster'><coucou/></query>" .parse() .unwrap(); let error = Roster::try_from(elem).unwrap_err(); ...
Rust
0
ements (super method), to check the minimum stock rules and the availability of moves. This function is intended to be run for all the companies at the same time, so we run functions as SUPERUSER to avoid intercompanies and access rights issues. """ try: if use_new_cursor: ...
Python
1
ine() def provide_engine( self, key: Optional[str] = None ) -> Callable[[], Union["Engine", "AsyncEngine"]]: # pragma: no cover """Get the engine for the given key. Args: key: The key to get the engine for. Returns: The engine for the given key. ...
Python
1
>>::Done> + Clone + ProcessSend; type ReduceC: Reducer< <Self::ReduceB as ReducerProcessSend<<Self::ReduceA as ReducerSend<T>>::Done>>::Done, Done = Self, >; fn reducers() -> (Self::ReduceA, Self::ReduceB, Self::ReduceC); // fn from_dist_stream<P>(dist_stream: P, pool: &Pool) -> Self where T: Serialize + Dese...
Rust
0
""" @FileName: kalman.py @Description: Implement kalman @Author: Ryuk @CreateDate: 2021/08/26 @LastEditTime: 2021/09/05 @LastEditors: Please set LastEditors @Version: v0.1 """ import numpy as np import librosa from tqdm import tqdm import soundfile as sf far, sr = librosa.load("./far.wav", sr=16000) near, sr = librosa...
Python
1
); let hook_timer = weechat.get().hook_timer.unwrap(); let hook_ptr = unsafe { hook_timer( weechat.ptr, interval.as_millis() as i64, align_second, max_calls, Some(c_hook_cb), data_ref as *const _...
Rust
0
NSACTION_VERIFY_TIMEOUT: Duration = BLOCK_VERIFY_TIMEOUT; /// The maximum number of concurrent inbound download and verify tasks. /// /// We expect the mempool crawler to download and verify most mempool transactions, so this bound /// can be small. /// /// ## Security /// /// We use a small concurrency limit, to prev...
Rust
0
nal(self): wyckoffs = [ ([0.3, 0.4, 0.45], 24), ([0.3, 0.6, 0.45], 12), ([0.3, 0.4, 0.25], 12), ([0.3, 0.0, 0.0], 12), ([0.3, 0.6, 0.25], 6), ([0.5, 0.0, 0.0], 6), ([1.0 / 3.0, 2.0 / 3.0, 0.45], 4), ([0.0, 0.0, 0.45]...
Python
1
hidden_channels else: res_skip_channels = hidden_channels res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1) res_skip_layer = weight_norm(res_skip_layer, name="weight") self.res_skip_layers.append(res_skip_layer) def forward(sel...
Python
1
#[inline(always)] pub fn comp(&mut self) -> COMP_W { COMP_W { w: self } } #[doc = "Bit 17 - Send Result to Decoder"] #[inline(always)] pub fn decode(&mut self) -> DECODE_W { DECODE_W { w: self } } #[doc = "Bits 18:19 - Enable Storing of Sensor Sample in Result Buffer"] ...
Rust
0
* uT + Tari::from(99u64); assert_eq!(v, MicroTari(99_000_100)); let v = Tari::from(99u64) - 100 * uT; assert_eq!(v, MicroTari(98_999_900).into()); let v = Tari::from(99u64) * 100u64; assert_eq!(v, MicroTari(9_900_000_000).into()); let v = Tari::from(990u64) / 100u64; ...
Rust
0
ntic_model=Critique ) except Exception: logger.exception("Gagal mengkritisi hasil; fallback ekstra via chat schema") crt = await self.llm.chat_completions_parse( messages=messages, pydantic_model=Critique ) return crt # type: igno...
Python
1
::new(1234); /// let b = BigNum::new(-4321); /// a -= &b; /// /// assert_eq!("5555", a.to_string()); /// ``` fn sub_assign(&mut self, rhs: &BigNum) { self.set_move(&*self - rhs); } } impl ops::Mul<&BigNum> for &BigNum { type Output = BigNum; /// Multiplies two number and ma...
Rust
0
from flask import Flask,request,render_template,jsonify from src.pipelines.prediction_pipeline import CustomData,PredictPipeline application=Flask(__name__) app=application @app.route('/') def home_page(): return render_template('index.html') @app.route('/predict',methods=['GET','POST']) def predict_datapoint...
Python
1
al // negative value }; } else { return Err(Box::new(ImgError::new_const(ImgErrorKind::IllegalData,"illegal data in successive approximation".to_string()))) } while zigzag <= se { if zz[zigzag] == 0 { if rrrr == 0...
Rust
0
from django.utils.deprecation import MiddlewareMixin from django.shortcuts import HttpResponse class MyAdd(MiddlewareMixin): def process_request(self,request): print('我是第一个中间件里面的process_request方法') def process_response(self,request,response): print('我是第一个中间件的process_reponse方法') return ...
Python
1
import cellxgene_census import json VERSION = "2023-05-08" with cellxgene_census.open_soma(census_version=VERSION) as census: meta_data = ( census["census_data"]["homo_sapiens"] .ms["RNA"] .var.read( column_names=[ "feature_name", ], ) ) ...
Python
1
None`, it points to an integer where the current NUMA node number will be /// stored. /// /// Note that this information may already be out of date when the syscall returns. See `getcpu(2)` /// for more information. #[cfg_attr(docsrs, doc(cfg(any(target_os = "linux", target_os = "android"))))] #[cfg(linuxlike)] #[inlin...
Rust
0
} #[test] fn comment_err() { assert_err!(g::comment("commentt")); assert_err!(g::comment("comment\n")); assert_err!(g::comment("comment hi\na comment")); assert_err!(g::comment("comment hi\r\na comment")); assert_err!(g::comment("comment hi\ra comment")); } #...
Rust
0
_base_ = [ '../../../_base_/datasets/imagenet/rsb_a3_sz160_4xbs512.py', '../../../_base_/default_runtime.py', ] # model settings model = dict( type='MixUpClassification', pretrained=None, alpha=[0.1, 1.0,], mix_mode=["mixup", "cutmix",], mix_prob=None, # None for random applying mix_ar...
Python
1
à-áè-éì-íò-óù-úɔɛ\u0300-\u0301]', # Luo 'luo': r'[a-pr-wy]', # Luyia 'luy': r'[a-z]', # Latvian 'lv': r'[a-pr-vzāčēģīķļņšūž]', # Laz 'lzz': r'[a-vx-zçğİşǩ\u0306\u030C]', # Maithili 'mai': r'[\u0902-\u0903क-घच-नप-रलव-ह\u093C\u093E-\u0942\u0947-\u0948\u094B-\u094D]', # Masai ...
Python
1
IMAGENET_PATH="./data/imagenet-1k/train" CELEBA_PATH="./data/celeba_hq_256" PARTIPROMPOTS_PATH="./data/partiprompts_1000.txt" WIKIART_PATH='./data/wikiart' MODEL_PATH='./ckpts' # Your model path COND_VALIDITY_PATH_MAPPING = { 'google/vit-base-patch16-224': "facebook/deit-small-patch16-224", "facebook/deit-sm...
Python
1
class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def reorderList(head): if not head or not head.next: return head # Step 1: Find the middle of the linked list slow = fast = head while fast.next and fast.next.next: slow = slow.nex...
Python
1
_watcher(c: Gojo, m: Message): chat_filters = db.get_all_filters(m.chat.id) actual_filters = {j for i in chat_filters for j in i.split("|")} for trigger in actual_filters: pattern = r"( |^|[^\w])" + re_escape(trigger) + r"( |$|[^\w])" match = await regex_searcher(pattern, m.text.lower()) ...
Python
1
import os import sys import numpy as np from sklearn.neighbors import NearestNeighbors from numpy import linalg as la import scipy.io as sio def cart2sph(xyz): xy = xyz[:,0]**2+xyz[:,1]**2 aer = np.zeros(xyz.shape) aer[:,2] = np.sqrt(xy+xyz[:,2]**2) aer[:,1] = np.arctan2(xyz[:,2],np.sqrt(xy)) aer[:...
Python
1
pc, opcode): #01 1101 iiii PC<11:8> = IMM; CF -, SF -?; CC16 return ("mov PC<11:8>, 0x%0.1X" % (opcode & 0xF), "PC<11:8> = IMM; CF -, SF -?") def _cmp_mhl_imm(self, pc, opcode): #01 1110 iiii A = M[HL] - IMM; CF b, SF z; CC32 return ("cmp M[HL], 0x%0.1X" % (opcode & 0xF), "A = M[HL]...
Python
1
; let signal_list = SignalList::from(&physical_stream); assert_eq!(physical_stream.bit_count(), 17); assert_eq!(physical_stream.data_bit_count(), 2 * (3 + 2)); assert_eq!(physical_stream.last_bit_count(), 3); assert_eq!(physical_stream.stai_bit_count(), 1); assert_eq!(ph...
Rust
0