text
string
label_name
string
labels
int64
heck_work() else: msg = "Checking for work." logger.info(msg) work = self.service.queue_pull("snowflake") if work: self.do_work(work) time.sleep(self.SleepCycle) finally: ...
Python
1
| e.to_string())? .try_into() .map_err(|e: ErrorTryFromEnum<_, _>| e.to_string())?; if permission_token.name != CAN_SET_KEY_VALUE_IN_ASSET_DEFINITION.clone() { return Err( "Grant instruction is not for set key value in asset definition permission." ...
Rust
0
} for other in &self.state[&req.turn.parent].reserved { if map.get_t(other.turn).conflicts_with(turn) { return false; } } true } fn detect_conflict_cycle( &self, car: CarID, pair: (&BTreeMap<CarID, Car>, &BTreeMap<Traversab...
Rust
0
![], vec![], ); assert!(build_tree_result.tree.is_some()); let tree = build_tree_result.tree.unwrap(); model.set(V2ComponentTree::new(tree, build_tree_result.errors))?; Ok(model) } fn zbi(root_component_url: Option<String>) -> Zbi { let mut bootfs: H...
Rust
0
confidence = f"fallback_similarity_{best_ratio:.3f}" print(f"Using fallback match with ratio {best_ratio:.4f}") else: print("Match ratio too low, cannot confidently match") if not matching_task: # Write ...
Python
1
iary_logits = nn.functional.interpolate( auxiliary_logits, size=pixel_values.shape[2:], mode="bilinear", align_corners=False ) loss = None if labels is not None: # compute weighted loss loss_fct = CrossEntropyLoss(ignore_index=self.config.loss_ignore_...
Python
1
import os import inc.google_drive_downloader scripts_dir = os.path.dirname(os.path.realpath(__file__)) root_dir = scripts_dir + "/.." dest_dir = root_dir + "/neural_network/bin/data" files = [("12h64ld1wTxuz12o35eWWmtQVA2V9-QMk", "flights_by_cell_day_spot.pkl.zip"), ("15IeY97EmMvR-wDAsZunlWoAp7ePkId4v", "flights_...
Python
1
ng_t, pub st_mtime_nsec: __kernel_ulong_t, pub st_ctime: __kernel_ulong_t, pub st_ctime_nsec: __kernel_ulong_t, pub __unused: [__kernel_long_t; 3usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __old_kernel_stat { pub st_dev: crate::ctypes::c_ushort, pub st_ino: crate::ctypes::c_ushort, pub st_mode: crate:...
Rust
0
def is_odd_even(number: int): if (number // 2) * 2 == number: print("Even") else: print("Odd") is_odd_even(2) is_odd_even(3) is_odd_even(100)
Python
1
. Var(VarId), /// A unary operation. Unop(Unop, Box<Expr>), /// A binary operation. Binop(Binop, Box<Expr>, Box<Expr>), /// A tuple constructor. Tuple(Box<[Expr]>, Box<Type>), /// An index operation `(index a i h): T` where `a: (array T n)`, /// `i: nat`, and `h: i < n`. Index(Box<Expr>, Rc<PureExpr...
Rust
0
element -- the element index (integer) """ pass @abstractmethod def get_element_worldtf(self, element): """ Get the world transformation for the specified dataset element (4 x 4 torch tensor). Arguments: element -- the element index (integer) """ ...
Python
1
: self } } #[doc = "Bit 1 - clear sleep reject interrupt enable"] #[inline(always)] pub fn slp_reject_int_ena_w1tc(&mut self) -> SLP_REJECT_INT_ENA_W1TC_W { SLP_REJECT_INT_ENA_W1TC_W { w: self } } #[doc = "Bit 3 - clear RTC WDT interrupt enable"] #[inline(always)] pub fn rtc_wdt_...
Rust
0
(invalid_hex_short)); assert!(!_is_hex(invalid_hex_chars)); } #[test] fn test_iso_to_bytes() { // Valid non-XRP let usd_iso_bytes = _iso_to_bytes(USD_ISO).unwrap(); // Valid XRP let xrp_iso_bytes = _iso_to_bytes(NATIVE_CODE).unwrap(); // Error case le...
Rust
0
, ): """ Send an API call to a Pritunl server. Taken from https://pritunl.com/api and adapted to work with Ansible open_url """ auth_timestamp = str(int(time.time())) auth_nonce = uuid.uuid4().hex auth_string = "&".join( [api_token, auth_timestamp, auth_nonce, method.upper(), path] ...
Python
1
>= 0 && jj < (NGRID as isize) { if grid[ii as usize][jj as usize] != -1 { // flashed grid[ii as usize][jj as usize] += 1; } } } fn flash(grid: &mut [[i32;NGRID];NGRID]) -> usize { let mut nflash = 0; // flash! ah-ahhh for i in 0..NGRID { for j in 0..NGRID { ...
Rust
0
let bytes: Bytes = "(3492890328409238509324850943850943825024385\r\n".into(); decode_and_verify_some(&bytes, &expected); decode_and_verify_padded_some(&bytes, &expected); } #[test] fn should_decode_null() { let expected = (Some(Frame::Null), 3); let bytes: Bytes = "_\r\n".into(); decode_a...
Rust
0
num): (u16, u16)) { let s = UnsafeOnce!(Shader, { Shader::pure((gui__pos_col_tex_vs, gui__col_tex_ps)) }); let t = unsafe { &*self.tex }.tex.Bind(sampler()); let _ = Uniforms!(s, ("src", &t)); b.Draw((num, offset, gl::TRIANGLES)); } fn vert_count(&self) -> u32 { 16 } fn ordered(&self) -> bool { S::TY...
Rust
0
}<reponame>SickanK/discord-bot-rust<filename>src/discord/interface/gateway/activity.rs pub mod activity_assets; pub mod activity_button; pub mod activity_flags; pub mod activity_party; pub mod activity_secrets; pub mod activity_timestamp; pub mod activity_type; use crate::discord::{interface::emoji::Emoji, sno...
Rust
0
/api/v2/meta/axiosRequestMake-POST': { 'parameters': [ { 'name': 'xc-auth' }, ] }, '/api/v2/meta/connection/select-POST': { 'parameters': [ ] }, '/api/v2/meta/connection/test-POST': { 'parameters': [ { ...
Python
1
solana_runtime::system_instruction_processor=info,\ solana_program_test=info,\ solana_bpf_loader_program=debug"; // for - Program ... consumed 5857 of 200000 compute units trait AddPacked { fn add_packable_account<T: Pack>( &mut self, pubkey: Pubkey, a...
Rust
0
nterp1d(inds[good], A[good],fill_value="extrapolate",bounds_error=False,kind='cubic') B = np.where(np.isfinite(A),A,f(inds)) return B x = fill_nan(x) y = fill_nan(y) z = fill_nan(z) out = np.stack((x,y,z),axis=1) ''' #Manually adjust values here if needed import sys np.set_printoptions(threshold=sys.maxsize) out[0]...
Python
1
"), (0x02, "bn-BD")]), (0x46, "pa", &[(0x01, "pa-IN"), (0x02, "pa-PK")]), (0x47, "gu", &[(0x01, "gu-IN")]), (0x48, "or", &[(0x01, "or-IN")]), (0x49, "ta", &[(0x01, "ta-IN"), (0x02, "ta-LK")]), (0x4a, "te", &[(0x01, "te-IN")]), (0x4b, "kn", &[(0x01, "kn-IN")]), (0x4c, "ml", &[(0x01, "ml-IN")]...
Rust
0
] batch_crop_imgs, track_bboxes = prepare_crop_imgs( { 'boxes': track_result['track_bboxes'], 'img_metas': img_metas }) pred_embeddings = reid_model(batch_crop_imgs)['img_feature'] ...
Python
1
exec(open("./Modified_data/realtime.py").read()) # Variable Server Data should be copied at top of frame. trick.var_set_copy_mode(2) dyn.contact.nballs = 3 dyn.contact.balls = trick.TMM_declare_var_1d("Ball*", dyn.contact.nballs) # x, y, vx, vy, r, mass dyn.contact.b...
Python
1
4字节 // let var5 = 0x_1234_ABCD;//使用下划线提高了阅读体验 表示十六进制数 let x : i32 = 9; println!("9 power 3 = {}", x.pow(3)); //复合数据类型 //tuple 指的是元组类型 // let a = (1i32, false); //元组中包含两个元素,第一个是i32类型,第二个是bool类型 // let b = ("a", (1i32,2i32));//元组中包含两个元素,第二个元素本身也是元组,它里面还包含了...
Rust
0
t field = readin(t); let mut count = 0; loop { count += 1; let (new, changed) = step(&field); if !changed { break; } field = new; } assert_eq!(6, count); assert_eq!(37, field.occupied()); let i = include_str!("input.txt"); let mut count = ...
Rust
0
#!/usr/bin/env python3 # Copyright 2022 Open Source Robotics Foundation, Inc. # # 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 re...
Python
1
"""API route definitions.""" from typing import Final # API version prefix CURRENT_API_VERSION: Final = "/v0" class Routes: """API route definitions.""" class System: """System routes (non-versioned).""" HEALTH = "/health" SENTRY_DEBUG = "/sentry-debug" class Webhooks: ...
Python
1
fn partial_read() { use os; use io::pipe::PipeStream; let os::Pipe { reader, writer } = unsafe { os::pipe().unwrap() }; let out = PipeStream::open(writer); let mut input = PipeStream::open(reader); let (tx, rx) = channel(); spawn(proc() { let mut out ...
Rust
0
type="buttons", showactive=False, buttons=[ dict( label="Play", method="animate", args=[ None, { "frame": {"...
Python
1
pub fn builder() -> AnimationClipBuilder { // AnimationClipBuilder::new() // } // pub fn get_curve<T: 'static>( // &self, // key: impl Into<Cow<'static, str>>, // ) -> Result<Arc<dyn Curve<Output = T>>, GetCurveError> { // self.curves // .get(&key.into()) //...
Rust
0
(); json.kind = ObjectKind::Ordinary; let prototype = ValueData::new_obj(Some(global)); prototype.set_field_slice("parse", to_value(parse as NativeFunctionData)); prototype.set_field_slice("stringify", to_value(stringify as NativeFunctionData)); let json_value = to_value(json); json_value.set_...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import shutil import subprocess import sys ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__), "../../../")) def main(): sys.path.append(ROOT) from build import DIST, DIST_FILENAME if shutil.which("poetry") is None: print(" * ...
Python
1
#[serde(rename = "negateCondition", default, skip_serializing_if = "Option::is_none")] pub negate_condition: Option<bool>, #[serde(rename = "matchValue")] pub match_value: Vec<String>, #[serde(default, skip_serializing_if = "Vec::is_empty")] pub transforms: Vec<TransformType>, } pub mod match_cond...
Rust
0
[structopt(raw(required = "true"))] /// id of the phy to query phy_id: u16, #[structopt(raw(required = "true"))] country: String, }, #[structopt(name = "clear-country")] /// sets the phy's country code to world-safe value ClearCountry { #[structopt(raw(required = ...
Rust
0
from django.views.generic import TemplateView from django.contrib.auth.mixins import LoginRequiredMixin class IndexView(LoginRequiredMixin,TemplateView): template_name = "index.html" def get_context_data(self, **kwargs): context = super().get_context_data() return context
Python
1
Path::new("arepa.txt"), Path::new("empanada.txt"), Path::new("taquiza.txt"), ], PathBuf::from(&expected_copies_path) )); }use syn::{DeriveInput, Data, Error}; use syn::Ident; use syn::export::Span; /// `precondition` checks all invariants for the Struct structure that the...
Rust
0
se std::hashmap::HashMap; use std::result; use std::vec; use syntax::ast::{MutImmutable, MutMutable}; use syntax::ast; use syntax::codemap; use syntax::codemap::Span; use util::common::indent; use util::ppaux::{bound_region_to_str, ty_to_str, trait_ref_to_str, Repr}; pub mod doc; pub mod macros; pub mod combine; pub m...
Rust
0
fn define_views(schema: &mut #core::schema::Schematic) -> Result<(), #core::Error> { #( schema.define_view(#views)?; )* Ok(()) } #encryption } #serialization } .into() } #[derive(Attribute)] #[attribute(ident = "view")] #[attr...
Rust
0
if seq_poses.shape[2] < 1: continue # De-center the translation seq_trans = seq_poses[:, n_joint] seq_poses[:, n_joint] = seq_trans - np.mean(seq_trans, 1, keepdims=True) # Parse category label information fo...
Python
1
Selection; impl<S> X11ClipboardContext<S> where S: Selection, { pub fn new() -> Result<X11ClipboardContext<S>, Box<dyn Error>> { Ok(X11ClipboardContext(X11Clipboard::new()?, PhantomData)) } } impl<S> ClipboardProvider for X11ClipboardContext<S> where S: Selection, { fn get_contents(&mut se...
Rust
0
0x87654321); lru_cache.insert_no_exists(key, value, h); } assert_eq!(lru_cache.table.len, CACHE_CAP); for i in 0..CACHE_CAP { let key = i.to_string(); let h = murmur_hash(key.as_bytes(), 0x87654321); let tracker = lru_cache.look_up(&key, h); ...
Rust
0
elf._result is None: _prediction_tensor = torch.cat(self._predictions, dim=0) _target_tensor = torch.cat(self._targets, dim=0) ws = idist.get_world_size() if ws > 1: # All gather across all processes _prediction_tensor = cast(torch.Tensor,...
Python
1
import random import numpy as np import matplotlib.pyplot as plt from matplotlib import font_manager # 设置中文字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 用黑体显示中文 plt.rcParams['axes.unicode_minus'] = False # 正常显示负号 def sample_inspection(population_size, sample_size, true_defect_rate): defects = sum(random.ra...
Python
1
ing::Equal => { // equal to first left, now all the second are before current first left for index in sec_left_index..sec_right_index { mids.push((index, fir_left_index)); } break; } } } } } let mids_count = mids.len(); let mut result = Elements::with_capacity...
Rust
0
tDeprecatedSaveFixImports(_DeprecationTestCase): # Deprecated in Numpy 2.1, 2024-05 message = "The 'fix_imports' flag is deprecated and has no effect." def test_deprecated(self): with temppath(suffix='.npy') as path: sample_args = (path, np.array(np.zeros((1024, 10)))) self....
Python
1
week_period!($w) + day_period!($d) ); ($y:expr, $m:expr, $w:expr, $d:expr, $h:expr) => ( year_period!($y) + month_period!($m) + week_period!($w) + day_period!($d) + hour_period!($h) ); ($y:expr, $m:expr, $w:expr, $d:expr, $h:expr, $min:expr) => ( year_period!($y) + month_period!($m) + week_period!($w) + day_pe...
Rust
0
Out of the question.", "Huh? No.", "Nah.", "Naw.", "Not likely.", "No way, José.", "Not in a million years.", "I would love to, but unfortunately... no.", "Certainly not.", "NEGATORY.", "Nuh-uh.", "Not in my house!", ] POSITIVE_REPLIES = [ "Yep.", "Absolutely!", ...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType class GetByTalentInterviewRequest(BaseRequest): def __init__(self) -> None: super().__ini...
Python
1
#!/usr/bin/env python # # Copyright (C) 2019 The Android Open Source Project # # 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 req...
Python
1
im_crop_padded, 1.0 def resize_sample_target(im, output_sz=None): """ Resize the image args: im - cv image output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done. returns: cv image - extracted crop float - the factor ...
Python
1
""" Simple Global Logging Library A simple Python logging wrapper library that enables global logging configuration across your entire project with automatic file output and stdout capture capabilities. """ from simple_global_logging.core import ( setup_logging, setup_logging_with_stdout_capture, get_log...
Python
1
&mut render_context, &mut ctx); ctx.timer += 1; if ctx.timer > 60 * 100 { ctx.timer = 0; ctx.state = Some(Game); } }, Some(Game) => { renderer::render(&display, &mut render_context, gv.view()...
Rust
0
) { self.is_generic = true; } } } visit::visit_path(self, path) } fn visit_macro(&mut self, _: &Macro) {} } struct FieldVisitor<'a> { /// Type parameters defined ...
Rust
0
VERSION) pub fn _SC_2_VERSION<'env>(env: &'env __jni_bindgen::Env) -> i32 { unsafe { let (class, field) = env.require_class_static_field("android/system/OsConstants\0", "_SC_2_VERSION\0", "I\0"); env.get_static_int_field(class, field) } } ...
Rust
0
import streamlit as st # Page config st.set_page_config(initial_sidebar_state="collapsed") st.switch_page("pages/Store_Dataset.py") st.set_page_config(page_title="Q1RAM App Suite", layout="wide") # Centered logo and title col1, col2, col3 = st.columns([3,1,3]) # with col1: # st.markdown("try") with col2: st.m...
Python
1
# # # This source file is part of ELINA (ETH LIbrary for Numerical Analysis). # ELINA is Copyright © 2021 Department of Computer Science, ETH Zurich # This software is distributed under GNU Lesser General Public License Version 3.0. # For more information, see the ELINA project website at: # http://elina.ethz.ch #...
Python
1
return predicates::is_signed_int(imm, 32, 0); } unreachable!(); } fn recipe_predicate_dynrexop1icscc_ib(_: crate::settings::PredicateView, inst: &ir::InstructionData) -> bool { if let crate::ir::InstructionData::IntCompareImm { imm, .. } = *inst { return predicates::is_signed_int(imm, 8, 0); } ...
Rust
0
"number of threads: ", threads, "\n") if planner_3d is not None: if args.overwrite_plans is not None: assert args.overwrite_plans_identifier is not None, "You need to specify -overwrite_plans_identifier" exp_planner = planner_3d(cropped_out_dir, preprocessing_output_...
Python
1
s and it might be desirable to skip them when listing files. */ require_literal_leading_dot: bool } impl MatchOptions { /** * Constructs a new `MatchOptions` with default field values. This is used * when calling functions that do not take an explicit `MatchOptions` parameter. * * Thi...
Rust
0
_icon_info_get_attach_points(icon_info: *mut GtkIconInfo, points: *mut *mut gdk::GdkPoint, n_points: *mut c_int) -> gboolean; #[cfg(any(feature = "v3_10", feature = "dox"))] pub fn gtk_icon_info_get_base_scale(icon_info: *mut GtkIconInfo) -> c_int; pub fn gtk_icon_info_get_base_size(icon_info: *mut GtkIconI...
Rust
0
x = torch.tensor([tokens + [0] * 97], dtype=torch.long, device=device) # pad to 100 boundaries = torch.zeros(1, 15, 2, dtype=torch.long, device=device) valid_patches = torch.zeros(1, 15, dtype=torch.bool, device=device) boundaries[0, 0] = torch.tensor([0, len(tokens)]) ...
Python
1
#!/usr/bin/env python3 from migen import * from litex.soc.integration.soc_core import * from litex.soc.integration.builder import * from litex.soc.cores.clock import S6PLL from liteeth.phy.s6rgmii import LiteEthPHYRGMII from liteeth.core import LiteEthUDPIPCore from liteeth.frontend.etherbone import LiteEthEtherbone...
Python
1
if department == &dept { employee_list.push(&name[..]) } } employee_list.sort(); print_employees(employee_list, &dept); } Command::Exit => { println!("Exiting ...
Rust
0
as *const Self) as *const u8).add(712usize) as *const crate::Reg<fcclkselx6::FCCLKSELX6_SPEC>) } } #[doc = "0x2c8 - Flexcomm Interface 6 clock source select for Fractional Rate Divider"] #[inline(always)] pub fn fcclksel6(&self) -> &crate::Reg<fcclksel6::FCCLKSEL6_SPEC> { ...
Rust
0
QCoreApplication.translate("EnemyAttributeRandomizer", u"Energy", None)) self.label_4.setText(QCoreApplication.translate("EnemyAttributeRandomizer", u"<html><head/><body><p>While this is enabled, game output type is limited to '.iso'.</p><p>If you change the minimum and maximum values for size, while also havin...
Python
1
mul_pair) } pub(crate) fn random_mul_params_a_non_zero_ext2<R: Rng>( limbs: usize, group_size_limbs: usize, num_mul_points: usize, rng: &mut R ) -> (JsonMnt4PairingCurveParameters, JsonG1PointScalarMultiplicationPair, JsonG2PointScalarMultiplicationPair) { let one = BigUint::from(1u64); le...
Rust
0
from django.db.models.signals import pre_delete, post_delete, post_save, pre_save from django.dispatch import receiver from projects.tasks import delete_file_task from .models import Project, Image, PublishingRule, Comment from zubhub.models import Hero, AdminSettings from django.conf import settings @receiver(post_s...
Python
1
; pub const PSA_ECC_FAMILY_SECT_K1: psa_ecc_curve_t = 39; pub const PSA_ECC_FAMILY_SECT_R1: psa_ecc_curve_t = 34; pub const PSA_ECC_FAMILY_SECT_R2: psa_ecc_curve_t = 43; pub const PSA_ECC_FAMILY_BRAINPOOL_P_R1: psa_ecc_curve_t = 48; pub const PSA_ECC_FAMILY_MONTGOMERY: psa_ecc_curve_t = 65; pub const PSA_DH_FAMILY_RFC7...
Rust
0
iuu3n4dli5p (lb0euagdw5w): iwiazqy9ddy = False from zxdt3tj8jt0 import um6p1tiu017 as y61b5srduuq, cnh5jfarwrd @[jrrcao0lt9w, 0.0, tp5b_7vplhg, frdj9_dklu_, 0, ''] @lambda mt7rvvlg75m, encz0y4my2m, kjt5wbgz971, atg4jcj52ug, yov7c5q7wqy, kb5lbel7vwp, s9ju0tf29z7, dcx5cr415xy, wnkvv7bvxif, i7fwsphb341: wss7wgqc90...
Python
1
b_orig) ) _mesh.fix_normals() _mesh.fill_holes() except: _mesh = trimesh.PointCloud(vertices=points).convex_hull return _mesh @staticmethod def get_grasp_augs( num_rotations: int = 8, num_translations: int = 3, ) -> jaxlie.SE...
Python
1
# Copyright 2024 BigCode and The HuggingFace Inc. 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 requ...
Python
1
} } impl flatbuffers::Push for MessageBody { type Output = MessageBody; #[inline] fn push(&self, dst: &mut [u8], _rest: &[u8]) { flatbuffers::emplace_scalar::<MessageBody>(dst, *self); } } #[allow(non_camel_case_types)] const ENUM_VALUES_MESSAGE_BODY:[MessageBody; 12] = [ MessageBody::NONE,...
Rust
0
Config::with( buffer_size, 1, 0, Duration::from_secs(1), None, Duration::from_secs(1), ); let (envelope_tx, envelope_rx) = mpsc::channel(buffer_size.get()); let (agent, agent_proc) = provider.run( AgentParameters::new(AgentConfig, exec_config, uri.clon...
Rust
0
for k in 0..group_size { println!("DST: {:?}, {}, {}", dst, k, group_size); // TODO: Crash happening here, // dst is size 0. Investigate. dst[k as usize] = (get_bits(bs, ba) as i32 - half) as f32; ...
Rust
0
e_x_1 outedge_y = gridedge_x_outedge_y_0+gridedge_x_outedge_y_1+gridedge_z_outedge_y_0+gridedge_z_outedge_y_1 outedge_z = gridedge_x_outedge_z_0+gridedge_x_outedge_z_1+gridedge_y_outedge_z_0+gridedge_y_outedge_z_1 boundary_x_flag = (outedge_x==1).int() boundary_y_flag = (outedge_y==1).in...
Python
1
Err(e) }, }; match self.field_bool.get_buf_to_store(Some(57)) { Ok(mut buf) => { buffer.append(&mut buf); } Err(e) => { return Err(e) }, }; Ok(buffer) } } impl PackingStruct for StructExampleC { } #[derive(Debug, Clone, PartialEq)] pub struct StructExampleD ...
Rust
0
::BenchmarkingState; const MIN_BLOCKS_TO_KEEP_CHANGES_TRIES_FOR: u32 = 32768; /// Default value for storage cache child ratio. const DEFAULT_CHILD_RATIO: (usize, usize) = (1, 10); /// DB-backed patricia trie state, transaction type is an overlay of changes to commit. pub type DbState<B> = sp_state_machine::TrieBacke...
Rust
0
annel // squeeze_radio), op_channel, kernel_size=group_kernel_size, stride=1, padding=group_kernel_size // 2, groups=min(group_size, max(1, up_channel // squeeze_radio)) ) self.PWC1 = nn.Conv2d(max(1, up_channel // squeeze_radio), op_chann...
Python
1
-05, 4.2564e-05, 0.0], [0.091641, 0.14158, 0.20729]), measure_ss!("Sprite", [6.0306e-06, 6.4139e-06, 6.5504e-06], [0.001886, 0.0018308, 0.0020025]), measure_ss!("Gatorade", [0.0024574, 0.003007, 0.0037325], [0.024794, 0.019289, 0.008878]), measure_s...
Rust
0
on-optimistic stream, function `wait_for_connection` /// must be called after to make sure CONNECTED is received. pub(crate) fn new(reader: StreamReader, target: StreamTarget) -> Self { let r = DataReader { state: Some(DataReaderState::Ready(DataReaderImpl { s: reader, ...
Rust
0
open("fuzz/corpus/%s_%s" % (os.path.basename(fname), hex_code), 'w') if (arch, mode) not in mc_modes: print "fail", arch, mode fout.write(unichr(mc_modes[(arch, mode)])) fout.write(hex_data) fout.close() if __name__ == '__main__': if len(sys.argv) == 1: fnames ...
Python
1
NFFT = 512 mag_frames = np.absolute(np.fft.rfft(frames, NFFT)) # Magnitude of the FFT pow_frames = (1.0 / NFFT) * (mag_frames**2) # Power Spectrum # Log filter banks nfilt = 40 low_freq_mel = 0 high_freq_mel = 2595 * np.log10( ...
Python
1
### ✅ **Example Usage** - **Zone:** MAIN_ENTRANCE - **Sequence:** C P F V - **Result:** Access Granted ✅ ### ❌ **Common Errors** - Wrong symbol order → Access Denied - Invalid s...
Python
1
docs/stable/user_guide/timeseries.html#timeseries-offset-aliases :param ds_data: a dataframe that has 1 column 'ds' indicating date. """ if self.internal.model is None: raise RuntimeError( "You must call fit or restore first before calling predict!") return se...
Python
1
) = *self; return scalar; } #[inline(always)] pub fn width(&self) -> Width { let Format(_, width) = *self; return width; } #[inline(always)] pub fn elements(&self) -> usize { return self.width().elements(); } #[inline(always)] pub fn byte_size(&self) -> usize { return match *s...
Rust
0
(), scope, &[Argument::new("file", file), Argument::new("line", line)], ) } /// Helper that combines checking if the category is enabled with writing an instant trace event /// type. /// /// The `name` is formatted using the format macro in the second form of this macro. /// /// # Example /// ``` /...
Rust
0
ize - 155])), 224..=251 => Err(RuntimeError::InvalidCharacterCode(idx)), // Not defined in V1..=V3. _ => Err(RuntimeError::InvalidCharacterCode(idx)), } } // Table 1: default Unicode translations (see S 3.8.5.3) const DEFAULT_UNICODE_TABLE: &[char] = &[ 'ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß', '»', '...
Rust
0
\xcbB%l\xf3]Q[\x11\x96\ 6(a~\x80\xdb,\x82\xbd\xbd\x91\xb0\xf1+O\xf1\ Q\x16ZJ\x95\xadK\xe8w\x1b\x9e\xd0\x0f\x86\xcfV\ a\xbb\xa2\xb0\xd7\xaf\x0d\x8a\x91\xa0\x18\x09\x8a\xf1\x03\xca\ S\x82b$(&\x06F\x80\x18\x16\x22\xbe\x0c\x88_\ Q\xdad0\xb1c\xf9\x92\xa2\x9c\xb0]a I\x93\ \xa0\x98\x1c\x99\x83\x1f\xce}\xf4\xe2\xa0\x96\xb6\x9d...
Python
1
), Decision::P3Conflict), Decision::I7Put => Transition::Branch(Decision::I4HasMovedPermanently, Decision::K7ResourcePreviouslyExisted), Decision::I12IfNoneMatchExists => Transition::Branch(Decision::I13IfNoneMatchStarExists, Decision::L13IfModifiedSinceExists), Decision::I13IfNoneMatchStarExist...
Rust
0
photosCount'] = attractionModel.getAttractionPhotosCount(a['provinceId'],a['clusterId']) # 获取此景点中的一张照片 tempPhotoId = attractionModel.getAttractionPhotoIds(tempDict['provinceId'], tempDict['clusterId'], 1, 1) tempPhoto = photoModel.getPhotoById(tempPhotoId[0]) tempDict[...
Python
1
ck to return the virtual_table mock_super_store_async.return_value = virtual_table # WHEN I store the VirtualTable result = await virtual_table.store_async(synapse_client=self.syn) # THEN I expect the super().store_async method to be called mock_super_store_...
Python
1
struct Buu { wants_candy: Option<bool>, width: Option<i16>, amount_eaten: Option<i32>, amount_want_to_eat: Option<i64>, speed: Option<f32>, weight: Option<f64>, catchphrase: Option<String>, stomach_contents: Option<Vec<...
Rust
0
let mut all_results = vec![]; let start_ns = time::precise_time_ns(); b.iter(|| { let results = program.exec_query("job_1b"); all_results.push(results); }); let end_ns = time::precise_time_ns(); println!("Run took {:?}", (end_ns - start_ns) as f64 / 1_000_000.0); println!("r...
Rust
0
let storages = STORAGES.lock().unwrap(); let depot = storages.get(&self.loc).unwrap(); depot.addr_map.get(id).cloned().ok_or(Error::NotFound) } fn put_address(&mut self, id: &Eid, addr: &[u8]) -> Result<()> { let mut storages = STORAGES.lock().unwrap(); let depot = stor...
Rust
0
) def get_statistics(self) -> Dict[str, Any]: """Get statistics about request-response operations.""" with self._lock: pending_count = len(self.pending_requests) oldest_request = None if self.pending_requests: oldest_timestamp = m...
Python
1
sp_playlist = spotify.ffi.cast("sp_playlist *", 43) lib_mock.sp_playlistcontainer_get_unseen_tracks.return_value = 0 tracks = spotify.PlaylistUnseenTracks( self.session, sp_playlistcontainer, sp_playlist ) with self.assertRaises(IndexError) as ctx: tracks...
Python
1
d_app, app_user, app_user_notification.hash, notification) elif app_user.apn_device_token is not None: apn.send(selected_app, app_user, app_user_notification.hash, notification) elif app_user.web_push_endpoint is not None: subscription_info = { 'endpoint': app_use...
Python
1
b struct IpsecItfDump { pub client_index : u32, pub context : u32, pub sw_if_index : InterfaceIndex, } #[derive(Debug, Clone, Serialize, Deserialize, VppMessage)] #[message_name_and_crc(ipsec_itf_details_548a73b8)] pub struct IpsecItfDetails { pub context : u32, pub itf : IpsecItf, } #[derive(Debug, Clo...
Rust
0
m/fees, https://pro.coinbase.com/orders/fees fees: Fees { maker: 0.005, taker: 0.005, }, precision: Precision { tick_size: m.quote_increment.parse::<f64>().unwrap(), lot_size: m.base_increment...
Rust
0