text
string
label_name
string
labels
int64
eam<'_>) -> syn::parse::Result<Self> { let span = input.span(); let args = Punctuated::parse_separated_nonempty_with(input, Expr::parse)?; let _: Token![;] = input.parse()?; let name: LitStr = input.parse()?; Ok(Self { args, name, span }) } } pub(crate) fn inner(args: Token...
Rust
0
in self.trail.drain(new_trail_len..) { // println!(" Backtracking {:?}", var); self.substitution[lit.var_id()] = Unknown; self.lit_heuristic.re_add(lit.var_id()); // Replace is for debugging purposes let reason_cid = mem::replace(&mut self.reasons[lit.var_id...
Rust
0
// print!("current state after setfilepointer {}\n", context.input_offset); return true; } BreakPoint::X86usercreatefile => { _worker.mod_reg(Register::Rsp, |x| x + 0x20); _worker.set_reg(Register::Rip, return_address as u64); _worker.set_reg(Register::Rax...
Rust
0
from stix_shifter_utils.modules.base.stix_translation.empty_query_translator import EmptyQueryTranslator import re from datetime import datetime, timedelta START_STOP_PATTERN = r"\s?START\s?t'\d{4}(-\d{2}){2}T\d{2}(:\d{2}){2}(\.\d{1,3})?Z'\sSTOP\s?t'\d{4}(-\d{2}){2}T\d{2}(:\d{2}){2}(\.\d{1,3})?Z'\s?" class QueryTran...
Python
1
d Voronoi vertices: circumcenters of these 4 tetrahedra. self.assertEqual(v_vertices.shape[0], 4, "Expected 4 unique Voronoi vertices.") # Test the Voronoi cell for the central point (index 4) central_cell_faces = cells_faces[4] # This cell should be a closed polyhedron (a tetr...
Python
1
nager(Object<ffi::SoupAuthManager, ffi::SoupAuthManagerClass>); match fn { type_ => || ffi::soup_auth_manager_get_type(), } } pub const NONE_AUTH_MANAGER: Option<&AuthManager> = None; pub trait AuthManagerExt: 'static { #[cfg(any(feature = "v2_58", feature = "dox"))] #[cfg_attr(feature = "dox...
Rust
0
t loss *= valid_weight if (valid_weight > 0).float().sum() > 0: if self.cfg.LOSS_REDUCTION['mm']['refs-reg'] == 'mean': loss = loss.sum() / (valid_weight > 0).float().sum() elif self.cfg.LOSS_REDUCTION['mm']['refs-reg'] == 'sum': loss = loss.sum() ...
Python
1
th.log10(d) except OverflowError: raise RuntimeError('AutoLocator illegal data interval range') fld = math.floor(ld) base = 10 ** fld #if ld==fld: base = 10**(fld-1) #else: base = 10**fld if d >= 5 * base: ...
Python
1
4) }}; (@op => $op:ident, $inputs:expr, $arg1:expr, $arg2:expr, $arg3:expr, $arg4:expr, $arg5:expr) => {{ let (arg1, arg2, arg3, arg4, arg5) = *$inputs; $op(arg1, arg2, arg3, arg4, arg5) }}; (@op => $op:ident, $inputs:expr, $arg1:expr, $arg2:expr, $arg3:expr, $arg4:expr, $arg5:expr, $arg...
Rust
0
'a> { pub fn new(typeface: &'a Typeface, request: &TypefaceRequest) -> TypefaceAndLangScore<'a> { let request_languages: Vec<LocaleId> = match request.query.as_ref().and_then(|query| query.languages.as_ref()) { Some(languages) => languages.iter().map(LocaleId::clone).collect(), ...
Rust
0
_eq!(result, expected); } } <filename>src/main.rs use moniker::{Var, Scope, Binder, FreeVar, Ignore}; use termcolor::{ColorChoice, StandardStream}; use std::{io::Result, rc::Rc}; use some_embedded_scripting_language::{expr::Expr, cont_expr::{KExpr, self}, literals::Literal}; pub fn main() -> Result<()> { expr...
Rust
0
持仓""" THOST_FTDC_PSD_History = 50 """历史持仓""" class TThostFtdcPositionDateTypeType(Enum): """持仓日期类型类型""" THOST_FTDC_PDT_UseHistory = 49 """使用历史持仓""" THOST_FTDC_PDT_NoUseHistory = 50 """不使用历史持仓""" class TThostFtdcTradingRoleType(Enum): """交易角色类型""" THOST_F...
Python
1
numerous helper functions that are used in the paper but not available //! in Rust (or at least in core). Our version is additionally complicated by the need to handle //! overflow and underflow and the desire to handle subnormal numbers. Bellerophon and //! Algorithm R have trouble with overflow, subnormals, and unde...
Rust
0
from django.apps import AppConfig from django.db.models.signals import post_delete class ThumbnailAppConfig(AppConfig): name = "saleor.thumbnail" def ready(self): from .models import Thumbnail from .signals import delete_thumbnail_image post_delete.connect( delete_thumbna...
Python
1
OVUPS_STORE)); e.enc_32_64(bound_store, rec_fstDisp32.opcodes(&MOVUPS_STORE)); // Load let bound_load = load.bind(vector(ty, sse_vector_size)).bind(Any); e.enc_32_64(bound_load.clone(), rec_fld.opcodes(&MOVUPS_LOAD)); e.enc_32_64(bound_load.clone(), rec_fldDisp8.opcodes(&MOVUPS_...
Rust
0
# If this is a bomb trigger, run once gas hits zero elif self.bomb_trigger and will_run and self.gas_remaining == 0: self.ran = True # If this is a normal trigger and we still have gas remaining, run and # decrement the gas elif will_run and self.gas_remaining > 0: ...
Python
1
xt in request/response bodies. Rust uses //! utf-8 for `String` and assumes text bodies should be encoded as //! utf-8. Using the `content-type` we can change how hreq handles //! both requests and responses. //! //! ## Example sending an iso-8859-1 encoded body. //! //! ```no_run //! use hreq::prelude::*; //! //! // T...
Rust
0
''' Almacenar los nombres de 5 productos y sus precios. Utilizar una lista y cada elemento una tupla con el nombre y el precio. Desarrollar las funciones: 1) Cargar por teclado. 2) Listar los productos y precios. 3) Imprimir los productos con precios comprendidos entre 10 y 15. ''' #FUNCTIONS de...
Python
1
'''mcibi_deeplabv3_resnet101os8_ade20k''' import os import copy from .base_cfg import SEGMENTOR_CFG from .._base_ import DATASET_CFG_ADE20k_512x512, DATALOADER_CFG_BS16 # deepcopy SEGMENTOR_CFG = copy.deepcopy(SEGMENTOR_CFG) # modify dataset config SEGMENTOR_CFG['dataset'] = DATASET_CFG_ADE20k_512x512.copy() # modify...
Python
1
args")); assert!(errs[6].contains("continue args mismatch: 'halt' expects 1 args")); } #[test] fn test_undefined_capture() { let errs = parse_check("(program halt (letfun (f r (x) (a b) (cont r x)) (cont halt 0)))"); assert_eq!(errs.len(), 1); assert!(errs[0].contains("undefined c...
Rust
0
h, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ...
Rust
0
', 'Ṙ', '᧓', '𝢷', '🀩', '𑴭', 'ᇢ', '𝈾', '洞', '𔔸', '☍', '\u{1fba7}', '𛰚', '⺐', '𘩲', '𘡚', '〹', '𔓞', '參', 'ꂭ', '𝐺', '𝡃', 'ゕ', '𓆶', '⦡', 'ᰉ', '⢁', 'ག', '𛰉', '𛰋', '𐠴', '⒋', '﨨', '㎃', 'ꠞ', '𑂧', 'Ⲡ', '𔑇', 'ᄃ', '\u{11902}', '\u{1d181}', '𐧠', '𒍍', '\u{1fb2d}', '𑈎', 'ᄻ', '𝙚', '┸', '𓃯', '\u{1ba...
Rust
0
GetProperty = 0x07, ReceiveSbFile = 0x08, Execute = 0x09, Call = 0x0A, Reset = 0x0B, SetProperty = 0x0C, EraseFlashAllUnlock = 0x0D, FlashProgramOnce = 0x0E, FlashReadOnce = 0x0F, FlashReadResource = 0x10, ConfigureMemory = 0x11, ReliableUpdate = 0x12, GenerateKeyBlo...
Rust
0
Block { 1073762400 as *const _ } } impl Deref for PMU3 { type Target = pmu0::RegisterBlock; fn deref(&self) -> &pmu0::RegisterBlock { unsafe { &*PMU3::ptr() } } } #[doc = "Peripheral Management Unit"] pub struct PMU4 { _marker: PhantomData<*const ()>, } unsafe impl Send for PMU4 {} i...
Rust
0
import sys import shutil import os from datasets.VisA import Visa_dataset from datasets.MVTec import Mvtec_dataset from datasets.BTAD import BTAD_dataset from datasets.MPDD import MPDD_dataset from datasets.MVTec3D import Mvtec3D_dataset from datasets.RESC import RESC_dataset from datasets.BrasTS import BrasTS_dataset ...
Python
1
# Copyright (c) 2008 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
Python
1
("Ledger should only contain well formed data"); entry }) .collect() } fn get_cf_options() -> Options { let mut options = Options::default(); options.set_max_write_buffer_number(32); options.set_write_buffer_size(MAX_WRITE_BUFFER_SIZE); op...
Rust
0
ake of examples #[allow(unused_variables)] // Allow unused assignments for the sake of examples #[allow(unused_assignments)] // Allow non snake case variables #[allow(non_snake_case)] // Allow unused mutable variables #[allow(unused_mut)] pub fn main() { // the 'let' keyword: // create a variable and assign // dat...
Rust
0
"strength": "قوي" if abs(corr_value) > 0.7 else "متوسط" }) return { "correlation_matrix": correlation_matrix.round(3).to_dict(), "strong_correlations": strong_correlations, "correlations_count": len(strong_correlations) ...
Python
1
Vec<Fr>>, circuit: &Circuit, rng: &mut R, ) -> bool { assert_eq!(witnesses.len(), inputs.len()); let (proof, outputs) = HyraxProof::prover(params, witnesses, inputs, circuit, witnesses.len(), rng); println!("hyrax_zk_gkr -- generate proof...ok"); let result = proof.verify(params, &output...
Rust
0
step in range(num_steps): offset_range = train_labels.shape[0] - batch_size offset = (step * batch_size) % offset_range batch_data = train_dataset[offset:(offset + batch_size), :] batch_labels = train_labels[offset:(offset + batch_size), :] feed_dict = {tf_tr...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2022 Google LLC. 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 requir...
Python
1
pub const R_390_TLS_TPOFF: ::libc::c_uint = 56; pub const R_390_20: ::libc::c_uint = 57; pub const R_390_GOT20: ::libc::c_uint = 58; pub const R_390_GOTPLT20: ::libc::c_uint = 59; pub const R_390_TLS_GOTIE20: ::libc::c_uint = 60; pub const R_390_IRELATIVE: ::libc::c_uint = 61; pub const R_390_NUM: ::libc::c_uint = 62;...
Rust
0
cmd, &args, 0) } } // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (th...
Rust
0
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import confusion_matrix def plot_training_loss_history(loss_history, interval=10): iterations = [i * interval for i in range(len(loss_history))] plt.figure(figsize=(8, 5)) plt.plot(iterations, loss_history, label...
Python
1
during on_trading_iteration() to test backtest behavior""" def initialize(self): self.sleeptime = "1D" def on_trading_iteration(self): raise RuntimeError("Intentional error in on_trading_iteration() for testing") class LiveResilienceTestStrategy(Strategy): def __init__(self, *args, ...
Python
1
import numpy as np def getCor(cov): d = np.diag(cov)**-0.5 return d[:, None] * cov * d def seqs2cov(inputs): inputs = np.array(inputs) inputcov = inputs @ inputs.T / len(inputs[0]) inputidxs = [0] for seq in inputs: inputidxs.append(inputidxs[-1] + len(seq)) inputidxs.pop() ...
Python
1
, -75, -69, -65, -72, -74, -71, -63, -71, -71, -71, -60, -71, -70, -70, -61, -71, -70, -70, -59, -74, -70, -75, -63, -76, -70, -80, -62, -57, -58, -62, -59, -57, -56, -62, -56, -59, -54, -64, -55, -60, -54, -65, -52, -61, -54, -67, -53, -62, -54, -68, -53, -64, -56, -71, -55, -67, -56, -75, -77, -77, -8...
Rust
0
tr("brokers") .unwrap_or_else(|| "localhost:9092".to_owned()) .split(',') .map(|s| s.trim().to_owned()) .collect(), topic: m.opt_str("topic").unwrap_or_else(String::new), group: m.opt_str("group").unwrap_or_else(String::new), ...
Rust
0
# sum(p5, gp(p4_out, p3_out)) -> p5_out stage['gp_43_5'] = GPCell(with_conv=False) stage['sum_55_5'] = SumCell(out_channels, norm_cfg=norm_cfg) # sum(p7, gp(p5_out, p4_2)) -> p7_out stage['gp_54_7'] = GPCell(with_conv=False) stage['sum_77_7'] = SumC...
Python
1
r); let rest = split1.next().unwrap(); if rest != "no other bags." { let contents = rest.split(", "); for part in contents { let part_color = part .split(" bag") .next() .unwrap() .spl...
Rust
0
} else { //! // .......... //! Err(eg!("error occur")) //! } //! } //! //! fn branch_is_found(&self, branch: &str) -> bool { //! let br = BranchName(branch.as_bytes()); //! self.branch_exists(br) //! } //! //! fn new_branch(&mut self, branch: &str...
Rust
0
from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, smuggle_url, strip_or_none, ) class TVAIE(InfoExtractor): _VALID_URL = r'https?://videos?\.tva\.ca/details/_(?P<id>\d+)' _TESTS = [{ 'url': 'https://videos.tva.ca/details/_5596811470001', 'info_...
Python
1
t_8['m_point'] = round(m_point_8,3) print("\n Point atm", point_atm) print("\nPoint 1", point_1) print("\nPoint_2", point_2) print("\nPoint 13", point_13) print("\nPoint 16", point_16) print("\nPoint 18", point_18) print("\nPoint_21", point_21) print("\nPoint_24", point_24) print("\nPoint_25", point_25) print("\nPoin...
Python
1
(&self.post_routes), Method::PUT => Some(&self.put_routes), Method::PATCH => Some(&self.patch_routes), Method::DELETE => Some(&self.delete_routes), Method::HEAD => Some(&self.head_routes), Method::OPTIONS => Some(&self.options_routes), Method::CONN...
Rust
0
""" Author: Chenhongyi Yang """ import torch import torch.nn as nn from mmcv.cnn import build_norm_layer from mmcls.gpvit_dev.models.utils.attentions import LightAttModule from mmcls.models.builder import NECKS @NECKS.register_module() class GroupNeck(nn.Module): def __init__(self, embed_dims, ...
Python
1
"Account": { "friends": {}, "name": "FLauncher_Player" }, "Servers": {} } if not config_path.exists(): with open(config_path, 'w', encoding='utf-8') as config_file: json.dump(co...
Python
1
en": self.token, # "firmId": "testUser", # "userId": "11111111101" # } # # with self.client.post( # "/NCTSTraderApi/trader/getUnReadMessagesList", # Update the endpoint if needed # json=body, # Set the request body # ...
Python
1
import os import pytest from conftest import GITHUB_ACTIONS from deep_translator import GoogleTranslator from lingua import IsoCode639_1 from llama_index.llms.groq import Groq from src.translation import _detect_language, _translate, get_language_detector from translators.llm import LLMTranslator from translators.opu...
Python
1
thiserror::Error; use super::Validator; #[derive(Clone, Debug, PartialEq)] pub struct LocalPart(String); impl std::fmt::Display for LocalPart { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } impl std::str::FromStr for LocalPart { type Err = InvalidLocalPart; f...
Rust
0
def main(): word = input("Input: ") print("Output: ", shorten(word)) def shorten(word): vowels = ["a", "A", "e", "E", "i", "I", "o", "O", "u", "U"] for vowel in vowels: word = word.replace(vowel, "") return word if __name__ == "__main__": main()
Python
1
__assertion: *const ::std::os::raw::c_char, __file: *const ::std::os::raw::c_char, __line: ::std::os::raw::c_uint, __function: *const ::std::os::raw::c_char, ); } extern "C" { pub fn __assert_perror_fail( __errnum: ::std::os::raw::c_int, __file: *const ::std::os:...
Rust
0
parsed_command = parse_json(command) if parsed_command is None: return "Invalid input format. Input a json string with keys: source (str) and query (str)." source = parsed_command["source"] query = parsed_command["query"] if self.injected_only: on_now = [] ...
Python
1
'''fastfcn_encnet_resnet50os32_cityscapes''' import os from .._base_ import REGISTERED_SEGMENTOR_CONFIGS, REGISTERED_DATASET_CONFIGS, REGISTERED_DATALOADER_CONFIGS # deepcopy SEGMENTOR_CFG = REGISTERED_SEGMENTOR_CONFIGS['FASTFCN_SEGMENTOR_CFG'].copy() # modify dataset config SEGMENTOR_CFG['dataset'] = REGISTERED_DATA...
Python
1
"собака"}' response = self.client.post("/test_client_regress/parse_unicode_json/", json, content_type="application/json; charset=utf-16") self.assertEqual(response.content, json.encode('utf-16')) def test_unicode_payload_non_utf(self): "A non-ASCII unico...
Python
1
p in $e { f.write_fmt($crate::xml!{$($body)*})?; } Ok(()) }),; $($tail)*) }; // term (; concat!($($fmt:expr,)*), $($args:expr,)*;) => { format_args!(concat!($($fmt,)*) $(,$args)*) }; } #[doc(hidden)] #[macro_export] macro_rules! _format_tag2_ { (; concat!($($fmt:expr,)*), $($args:expr,)*; > $($tail:tt)*) => { ...
Rust
0
sprint!(" Instruction Pointer: {:#x}", a.rip); /* if !err.contains(PageFaultError::US) { kcb::try_get_kcb().map(|k| { sprintln!( " (in ELF: {:#x})", faulting_address - k.kernel_args().kernel_elf_offset.as_usize() ) }); } else { ...
Rust
0
/", "lib/", "scripts/", "sound/", "tools/", "usr/", "virt/", ]; for cur_dir in linux_dirs { match path.find(cur_dir) { Some(pos) => return &path[pos..], _ => () } } path } impl<'a> Iterator for Addrs<'a> { type Item = QueryType; fn next(&mut self) -> O...
Rust
0
# mypy: allow-untyped-defs import copy import warnings from torch.utils.data.datapipes.datapipe import MapDataPipe __all__ = ["SequenceWrapperMapDataPipe"] class SequenceWrapperMapDataPipe(MapDataPipe): r""" Wraps a sequence object into a MapDataPipe. Args: sequence: Sequence object to be wrap...
Python
1
>>, eg: StaticEventGroup<System>, } impl<System: SupportedSystem> App<System> { pub const fn new<C, D: Driver<Self>>(b: &mut Cfg<C>) -> Self where C: ~const traits::CfgBase<System = System> + ~const traits::CfgTask + ~const traits::CfgEventGroup + ~const traits::...
Rust
0
ذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي."#; const LIGHT_GREY: Color = Color::grey8(0xF0); pub fn draw<R: RenderContext>(rc: &mut R) -> Result<(), Error> { rc.clear(None, Color::WHITE); let text = rc.text(); let en_leading = text .new_text_layout(SAMPLE...
Rust
0
"height": 512, }, unit_overrides=[openpose_unit] + [ { "image": img, "module": s.module, ...
Python
1
::ReportDelay { device, group_addr } } fn new_v1_router_present(device: D) -> IgmpTimerId<D> { IgmpTimerId::V1RouterPresent { device } } } /// A handler for IGMP timer events. /// /// This type cannot be constructed, and is only meant to be used at the type /// level. We implement [`TimerHandler`]...
Rust
0
vec!["0".to_string(), "1".to_string()], x: vec![1, 2], y: vec![1, 2], delay: 0, sprite: Vec::new(), orgin: map::new(), }; let mut a = x.setup(); //load("./maps/map.rmap")load("./maps/map.rmap") f.load_map(to_map(" \n".to_string())); let player = f.find_X("@".to...
Rust
0
e, concat!("Alignment of ", stringify!(fmx_BinaryData)) ); } #[repr(C)] #[derive(Debug)] pub struct fmx_BinaryDataAutoPtr { pub _base: std_auto_ptr<fmx_BinaryData>, } pub type fmx_BinaryDataAutoPtr_UpCaster = fmx_BinaryDataAutoPtr; #[test] fn bindgen_test_layout_fmx_BinaryDataAutoPtr() { assert_eq!(...
Rust
0
} _ => (), } }) .expect("Could not create watcher"); watcher .watch(root.clone(), notify::RecursiveMode::Recursive) .expect("Could not configure watcher recursively") println!("Watching for changes in {:?}", root); ...
Rust
0
tor => subcompositor, WlShell => shell, XdgWmBase => shell, ZxdgShellV6 => shell, ZxdgDecorationManagerV1 => decoration_manager, ZwpRelativePointerManagerV1 => relative_pointer_manager, ZwpPointerConstraintsV1 => pointer_constraints, ZwpTextInputManagerV3 => text_...
Rust
0
false, Ordering::Release); inner.queue.waker().wake(); } } impl<T: Send + Sync> Sender<T> { /// Attempt to send a value into the channel (this will fail if the receiver has been dropped). pub fn try_send(&mut self, value: T) -> Result<(), error::SendError<T>> { let Sender(inner) = self; ...
Rust
0
'static str { static NAME: &'static str = "Origin"; NAME } fn parse_header(raw: &[Vec<u8>]) -> crate::Result<Origin> { from_one_raw_str(raw) } } impl FromStr for Origin { type Err = crate::Error; fn from_str(s: &str) -> crate::Result<Origin> { let idx = match s.fin...
Rust
0
@api_view(["GET"]) def generate_key(request): account = Account.create() private_key = account.privateKey.hex() address = account.address result = { 'private_key': private_key, 'address': address } return JsonResponse({'valid': True, 'message': result})
Python
1
XFLAG_APPEND: i32 = 0x0000_0010; /// all writes synchronous pub const FS_XFLAG_SYNC: i32 = 0x0000_0020; /// do not update access time pub const FS_XFLAG_NOATIME: i32 = 0x0000_0040; /// do not include in backups pub const FS_XFLAG_NODUMP: i32 = 0x0000_0080; /// create with rt bit set pub const FS_XFLAG_RTINHERIT: i32 = ...
Rust
0
xt, Poll}; use ndless::prelude::*; struct WakerData { waker: AtomicWaker, done: Cell<bool>, } #[derive(Default)] pub(crate) struct YieldListener { wakers: RefCell<Vec<Rc<WakerData>>>, } impl YieldListener { pub(crate) fn poll(&self) { let mut wakers = self.wakers.borrow_mut(); wakers.retain(|waker| Rc::stro...
Rust
0
labels. num_filter: The number of the qubits which the quantum circuit contains. kernel_size: The size of the kernel, which means the number of the qubits. circuit_depth: The depth of the quantum circuit, which means the number of repetitions of the circuit template. padding: The padding...
Python
1
es.Scene, 'shader_generator_settings'): del bpy.types.Scene.shader_generator_settings if hasattr(bpy.types.Scene, 'grid_settings'): del bpy.types.Scene.grid_settings if hasattr(bpy.types.Scene, 'annotation_properties'): del bpy.types.Scene.annotation_properties if hasattr(bpy.types.S...
Python
1
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(...
Python
1
dynheader.member, Some("Member".to_owned())); let strs: Vec<String> = msg.body.parser().get().unwrap(); assert_eq!(strs[0], "ABCD"); assert_eq!(strs[1], "EFGH"); let msg = rpc_con .wait_signal(Timeout::Duration(std::time::Duration::from_millis(10))) .unwrap(); assert_eq!( ms...
Rust
0
, SetAttribute(CAttribute::NoItalic)))?; } if removed.contains(Modifier::UNDERLINED) { map_error(queue!(w, SetAttribute(CAttribute::NoUnderline)))?; } if removed.contains(Modifier::DIM) { map_error(queue!(w, SetAttribute(CAttribute::NormalIntensity)))?; } ...
Rust
0
} #[derive(Debug, Deserialize)] struct CargoToml { package: Package, } let path = project_root.join("Cargo.toml"); let bytes = fs::read(&path).map_err(|cause| Error::ReadFailed { path: path.clone(), cause, })?; let car...
Rust
0
st_execution_context_parse() { assert_eq!( TestExecutionContext::Process, TestExecutionContext::parse(Ident::new("process", Span::call_site())).unwrap() ); assert_eq!( TestExecutionContext::Process, TestExecutionContext::parse(Ident::new("Process",...
Rust
0
""" Copyright (C) 2021 Marcin Rybacki This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received...
Python
1
= r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PWM_3_GENB_ACTCMPBDW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Do nothing"] #[inline(always)] pub fn pwm_3_genb_actcmpbd_none(self) -> &'a mut W { self.variant...
Rust
0
td)") rmse, indiv_rmse, dist_rmse = collect_results_rmse(results_path, name_filter='', patch_type=pt) print('RMSE between Torch and ONNX models (overall):', rmse) print('RMSE between Torch and ONNX models by lead vehicle distance (m):') for j in range(1, len(bounds)): print(f...
Python
1
# -*- coding: utf-8 -*- import graphene import graphene.relay as relay from app.customfields.models import CustomField from app.customfields.schema import CustomFieldType from app.customfields.scalars import CustomPropScalar from app.authorization.fields import AuthConnectionField from app.authorization.permissions i...
Python
1
, 'Ruso': 154000000, 'Japonés': 128000000, 'Lahnda': 119000000 } resultado = idiomas_mas_hablados() print(resultado) # 23 Países más poblados def paises_mas_poblados(): return { 'China': 1439323776, 'India': 1380004385, 'Estados Unidos': 331002651, 'Indon...
Python
1
conv_args=self.conv_args, expansion=self.expansion, use_res=self.use_res )) return nn.Sequential(*layers) def forward_cls_feat(self, p0, f0=None): if hasattr(p0, 'keys'): p0, f0 = p0['pos'], p0.ge...
Python
1
from enum import Enum from typing import Union, Literal from pydantic import BaseModel class TransactionLogEntryType(str, Enum): tfsm_pull = "TFSM_PULL" tfsm_delete = "TFSM_DELETE" tfsm_push = "TFSM_PUSH" unvrsl_tmp_push = "UNVRSL_PUSH" unvrsl_tmp_delete = "UNVRSL_DELETE" echo = "ECHO" in...
Python
1
import requests import json def test_fetch_travel_data(): url = "http://localhost:5000/api/fetch-travel-data" payload = { "departure_id": "PEK", "arrival_id": "AUS", "outbound_date": "2024-05-15", "return_date": "2024-05-22", "hotel_query": "Hotels in Austin" } ...
Python
1
class GPolyDecoder(object): def decode(self, encodedString): index = 0 length = len(encodedString) lat = 0 lng = 0 poly_lines = [] while index < length: b = 0 shift = 0 result = 0 while True: char = enco...
Python
1
/ Endpoints for Clones pub struct ClonesGroup<'a> { pub(crate) esi: &'a Esi, } #[derive(Debug, Deserialize)] #[allow(missing_docs)] pub struct CloneHome { pub location_id: u64, pub location_type: String, } #[derive(Debug, Deserialize)] #[allow(missing_docs)] pub struct JumpClone { pub implants: Vec<u6...
Rust
0
able-based unique, therefore does NOT sort. Returns ------- Series Unique values for each of the grouped values. See Also -------- Series.unique : Return unique values of Series object. Examples -------- >>> df = pd.DataFrame([('Chih...
Python
1
.next().children()[1].children()[0])); assert_eq!(id, id.children()[0].children()[0].max_tile(&id.next())); assert_eq!(id, id.children()[0].children()[0].children()[0].max_tile(&id.next())); // Check that the tile size is decreased when necessary. ...
Rust
0
ee_walker_iter_descendants(self): """Test use CreateTreeWalker inside iter_descendants method""" with mock.patch.object(IUIA().iuia, 'CreateTreeWalker', wraps=IUIA().iuia.CreateTreeWalker) as mock_create: UIAElementInfo.use_raw_view_walker = False next(self.ctrl.i...
Python
1
, span, match_type: Type::infer().kind.spanned(span) } } #[cfg(test)] pub fn with_type(self, ty: Type) -> Pattern { Pattern { kind: self, span: Span::empty(), match_type: ty } } pub fn with(self, span: Span, ty: Type) -> Pattern { Pattern { kind: self, span, match_type: ty.kind.spanned(span) } } } #[derive...
Rust
0
::historical_root(proof.session).is_some()); assert!(Session::current_index() > proof.session); // proof-checking in the next session is also OK. assert!(Historical::check_proof((DUMMY, &encoded_key_1[..]), proof.clone()).is_some()); set_next_validators(vec![1, 2, 5]); force_new_session(); System::...
Rust
0
ge_properties", lambda x, y: True) monkeypatch.setattr(image_verify.Cosign, "verify", lambda *args, **kwargs: True) diff_needed = image_verify.diff_needed(".") assert diff_needed == { "tag": mock_old_img_json["Tag"], "commit_sha": mock_old_img_json["Commit"], "digest": mock_old_img_j...
Python
1
("ch.el = {:?}", ch.el); let mut y = vec![0.0; 3]; let b = vec![-4.0, 2.0, 4.0]; let res = ch.solve(&b, &mut y); assert!(res.is_ok()); println!("y = {:?}", y); assert!((y[0] + 1.0).abs() < 1e-5); assert!((y[1] - 2.0).abs() < 1e-5); assert!((y[2] - 3.0).abs...
Rust
0
get_cursor_image_reply) } /// Advances a `xcb_xfixes_region_iterator_t` iterator by 1 element. #[inline] pub unsafe fn xcb_xfixes_region_next(&self, i: *mut xcb_xfixes_region_iterator_t) { sym!(self, xcb_xfixes_region_next)(i) } /// Returns `true` iff the symbol `xcb_xfixes_region_next...
Rust
0
Units of Least Precision) floating point representations. /// Differing signs are always unequal with this method, and zeroes are only /// equal to zeroes. Use approx_eq() from the ApproxEq trait if that is more /// appropriate. #[inline] fn approx_ne_ulps(&self, other: &Self, ulps: <Self::Flt as Ul...
Rust
0
cpg_handle, guarantee.to_c(), &c_iovec, 1) }; if res == ffi::CS_OK { Ok(()) } else { Err(CsError::from_c(res)) } } /// Type of iteration for [CpgIterStart] #[derive(Copy, Clone)] pub enum CpgIterType { NameOnly = 1, OneGroup = 2, All = 3, } // Iterator based on info...
Rust
0
max_str_width`]: #method.max_str_width fn max_str_width_nocr(s: &str, max_width: u32) -> (u32, &str); /// Measures a sequence of spaces in a line with a determinate maximum width. /// /// Returns the width of the spaces that fit into the given space and the number of spaces that /// fit. fn max...
Rust
0