text
string
label_name
string
labels
int64
# # Copyright 2014-2015, 2020 Lars Pastewka (U. Freiburg) # 2014 James Kermode (Warwick U.) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General P...
Python
1
c<CString>, } impl Layers { pub fn new() -> Self { Self { layers: Vec::new(), } } pub fn enable_validation_layers(&mut self) { if cfg!(debug_assertions) { self.layers.push(CString::new("VK_LAYER_LUNARG_standard_validation").unwrap()); self.layers...
Rust
0
) # Ensure a maximal rate of queries to the SUT # Send the query to SUT in round robin # Wait for a response sut_result = self.client_predict(features, s.index) response_array = array.array('B', sut_result.encode('utf-8')) bi = response_array.buffer_info() ...
Python
1
{ Self::One => STR_CONTENT, Self::Two => STR_DESIGN, Self::Three => STR_SETTINGS, Self::Four => STR_PREVIEW, } } fn get_list() -> Vec<Self> { vec![Self::One, Self::Two, Self::Three, Self::Four] } fn get_preview() -> Self { Self::F...
Rust
0
import os import jiant.utils.python.io as py_io def write_configs(config_dict, base_path): os.makedirs(base_path, exist_ok=True) config_keys = [ "task_config_path_dict", "task_cache_config_dict", "sampler_config", "global_train_config", "task_specific_configs_dict", ...
Python
1
types::{Base64VecU8, ValidAccountId, U128}; use near_sdk::serde::{Deserialize, Serialize}; use near_sdk::{ assert_one_yocto, env, log, near_bindgen, AccountId, Balance, PanicOnDefault, PromiseOrValue, }; use shared::{MetadataReference, TokenWithRatio, TokenWithRatioValid}; mod account_info; mod token_set_info; mo...
Rust
0
.iter() .copied() .map(Result::<_, core::convert::Infallible>::Ok) .collect::<Vec<_>>(); let mut strm = PushBack::new(stream::iter(data.iter().copied())); assert_eq!( futures_executor::block_on((&mut strm).collect::<Vec<_>>()...
Rust
0
mut arg: *mut c_void) -> bool { if visitor.is_null() { return false; } return mi_heap_visit_pages(heap as *mut mi_heap_t, &mut mi_heap_visit_areas_page, visitor as *mut _, arg); } // Just to pass arguments pub struct mi_visit_blocks_...
Rust
0
6-bit float in the red channel. RF16(Vec<f16>, Vec<f16>, Vec<f16>, Vec<f16>, Vec<f16>, Vec<f16>), /// 16-bit float in the red and green channel. RgF16( Vec<[f16; 2]>, Vec<[f16; 2]>, Vec<[f16; 2]>, Vec<[f16; 2]>, Vec<[f16; 2]>, Vec<[f16; 2]>, ), /// 16-...
Rust
0
:3], 1): sender = mail['sender'][:20] if mail['sender'] else 'Unknown' subject = mail['subject'][:30] if mail['subject'] else 'No subject' print(f" {i}. {sender}: {subject}...") return len(mails) except Exception as e: ...
Python
1
from openscm.adapters import Adapter from openscm.core.parameterset import ParameterSet def test_adapter_base_class_init(): parametersstub = "Parameters" outputstub = "Parameters" Adapter.__abstractmethods__ = set() adapter = Adapter( # pylint: disable=abstract-class-instantiated parametersst...
Python
1
custom_document_models: Required. Details regarding custom document models. :paramtype custom_document_models: ~azure.ai.formrecognizer.v2023_07_31.models.CustomDocumentModelsDetails :keyword custom_neural_document_model_builds: Required. Quota used, limit, and next reset date/time. ...
Python
1
] pub use crate::grouped::travel_and_places::place_other::ROLLER_COASTER; // SUNRISE 🌅 #[doc(inline)] pub use crate::grouped::travel_and_places::place_other::SUNRISE; // SUNRISE_OVER_MOUNTAINS 🌄 #[doc(inline)] pub use crate::grouped::travel_and_places::place_other::SUNRISE_OVER_MOUNTAINS; // ...
Rust
0
# Time Complexity: O(n) -> iterate through the houses twice, each in O(n) time. # Space Complexity: O(1) -> use a few extra variables, no additional data structures. class Solution: def rob(self, nums: List[int]) -> int: if not nums: return 0 if len(nums) == 1: retur...
Python
1
mtime)?; Ok(()) } pub fn path_to_str<'a>(path: &'a Path) -> Result<&'a str> { Ok(path .to_str() .ok_or(format!("Path is invalid '{}'", path.display()))?) } pub fn contains_file_with_ext(dir_path: &Path, ext: &str) -> bool { if !dir_path.is_dir() { return false; }; if let ...
Rust
0
Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use super::SeedPeersConfigHelpers; use crate::trusted_peers::ConfigHelpers; #[test] fn generate_test_config() { let (_, _, network_peers_config) = ConfigHelpers::gen_validator_nodes(10, None); let _ = SeedPeersConfigHelpers::get...
Rust
0
bytes[..len]).to_string() }<gh_stars>0 use Body; use bytes::Buf; use futures::Poll; #[derive(Debug, Default)] pub struct NoBody; #[derive(Debug, Default)] pub struct NoData; impl Body for NoBody { type Item = NoData; type Error = h2::Error; fn is_end_stream(&self) -> bool { true } fn po...
Rust
0
,samples,library["mp"],args.e,args.l,max_ins_len,args.min_contig,args.skip_assembly,args.r) print("generated clusters in") print(time.time()-t) f=open(prefix+".vcf","w") f.write(vcf_header+"\n") t=time.time() variants=tiddit_variant.main(bam_file_name,sv_clusters,args,library,min_mapq,samples,coverage_da...
Python
1
#-*- coding: UTF-8 -*- ''' 基于相似内容的推荐:余弦相似度 ''' import Dictionary import math import config path="data/netease" class max_queue: ''' 用最大堆实现的优先队列 ''' def __init__(self,a): self.queue=[] self.queue.append([65536,'','']) self.queue.extend(a) self.queue_size=len(a) def ou...
Python
1
f, " csof1"))} if self.csof2() != 0 { try!(write!(f, " csof2"))} if self.csof3() != 0 { try!(write!(f, " csof3"))} if self.csof4() != 0 { try!(write!(f, " csof4"))} if self.csof5() != 0 { try!(write!(f, " csof5"))} if self.csof6() != 0 { try!(write!(f, " csof6"))} if self...
Rust
0
= input[0][i]; let driver = input[1][i]; self.line.set_delay((1.0 / (freq as f64)) / self.per_sample); let v = -(self.line.current() * input[2][i] as f64).tanh(); //self.string_filter.tick(self.line.current()); self.line.tick(v + driver as f64); *r = v as f32;...
Rust
0
wincan.copy(healthbar_left, None, Rect::new(3,10, 300, 40))?; self.wincan.copy(healthbar_right, None, Rect::new(CAM_W as i32-300-3,10, 300, 40))?; let (frame_width, frame_height) = fighter.char_state.sprite.size(); //get curent chararcter state let current_frame = Rect::new( //determins ...
Rust
0
2022_jp("\u{00A5}\u{58FA}", b"\x1B(J\x5C\x1B$B\x54\x64\x1B(B"); } // Half-width Katakana encode_iso_2022_jp("\u{FF61}", b"\x1B$B\x21\x23\x1B(B"); encode_iso_2022_jp("\u{FF65}", b"\x1B$B\x21\x26\x1B(B"); if !cfg!(miri) { // Miri is too slow encode_iso_2022...
Rust
0
nstance=question, prefix=f'question_{question.pk}') answer_forms = [AnswerForm(request.POST, instance=answer, prefix=f'answer_{answer.pk}') for answer in question.answer_set.all()] while len(answer_forms) < 4: answer_forms.append(AnswerForm(request.POST, prefix=f'answer_{len(answer_forms) + ...
Python
1
ate::Unknown(s) => s.as_ref(), } } pub fn values() -> &'static [&'static str] { &["ALARM", "INSUFFICIENT_DATA", "OK"] } } impl AsRef<str> for AlarmState { fn as_ref(&self) -> &str { self.as_str() } } #[non_exhaustive] #[derive( std::clone::Clone, std::cmp::Eq, st...
Rust
0
# Initial state of the stacks stacks = [['Black', 'Blue', 'Pink', 'Green', 'Blue', 'Red', 'Red'], ['Yellow', 'White', 'White', 'Black', 'Yellow', 'Green', 'Green'], ['Yellow', 'Pink', 'White', 'Pink', 'Black', 'Red', 'Black'], [], ['Pink', 'Red', 'Blue', 'White', 'Blue', 'Blue',...
Python
1
) } fn get_nops(&self) -> Vec<usize> { self.boot_code .iter() .enumerate() .filter(|(_, operation)| matches!(operation, Operation::Nop(_))) .map(|(index, _)| index) .collect::<Vec<_>>() } fn get_jmps(&self) -> Vec<usize> { sel...
Rust
0
C_anotherMethod(self, c) } } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct D { pub _base: C, pub ptr: *mut C_MyInt, } #[test] fn bindgen_test_layout_D() { assert_eq!( ::std::mem::size_of::<D>(), 80usize, concat!("Size of: ", stringify!(D)) )...
Rust
0
, // NOTE(dtantsur): change to panic when we support user IDs. _ => unreachable!(), } } /// User name or ID. #[inline] pub fn user(&self) -> &IdOrName { match self.body.auth.identity { protocol::Identity::Password(ref pw) => &pw.user, _ =>...
Rust
0
sh) -> () { &self.certifications.push(certification_id); } pub fn remove_certification(&mut self, certification_id: Hash) -> () { if let Some(pos) = &self.certifications.iter().position(|x| *x == certification_id) { &self.certifications.remove(*pos); } } } im...
Rust
0
pca_dim = 100 exp_name = 'cfa' from pylearn2.datasets.mnist import MNIST from pylearn2.pca import CovEigPCA import theano.tensor as T from theano import function from models import expand import numpy as N from scipy.linalg import eigh from pylearn2.utils import serial import time print 'Loading MNIST train set' t1 =...
Python
1
Type(Type), // Existential } impl_froms!(ImplItem: Const, Type); impl From<Function> for ImplItem { fn from(func: Function) -> ImplItem { ImplItem::Method(func) } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ImplId(pub RawId); impl_arena_id!(ImplId); /// Th...
Rust
0
defaults. .define("CPU_CLIPS_NEGATIVE", "0") .define("CPU_CLIPS_POSITIVE", "0") // Package name and version. .define("PACKAGE", "\"libsamplerate\"") .define("VERSION", &format!("\"{}\"", version)[..]) // Second, actually build the library. ...
Rust
0
end_y: c_double); pub fn eina_bezier_values_get(b: *const Eina_Bezier, start_x: *mut c_double, start_y: *mut c_double, ctrl_start_x: *mut c_double, ctrl_sta...
Rust
0
# Transfer state from previous days for stim_idx in range(n_stimuli): if stim_idx in global_U: model.U[stim_idx] = global_U[stim_idx] model.L[stim_idx] = global_L[stim_idx] model.R[stim_idx] = global_R[stim_idx] model.N[stim_idx] = ...
Python
1
} } use integration_rust::IntegrationFloat; fn func_1<T>(x: T) -> T where T: IntegrationFloat, { x } fn main() { let mut romberg_calc = integration_rust::Romberg::from(func_1, 0.0, 2.0); let res = romberg_calc.calculate(10, 100); println!("{}", res); } use crate::model::response::{OrderData, ...
Rust
0
stamina_drain_amount: f32, /// Captured state of the `water_drain_amount` field pub water_drain_amount: f32, /// Captured state of the `running_state` field pub running_state: bool, /// Captured state of the `sleeping_state` field pub sleeping_state: bool, /// Captured state of the `running_...
Rust
0
tlmState::Completion; context.negotiate_message = Some(NegotiateMessage::new(vec![0x01, 0x02, 0x03])); context.challenge_message = Some(ChallengeMessage::new( vec![0x04, 0x05, 0x06], Vec::new(), [0x00; CHALLENGE_SIZE], 0, )); context.authenticate_message = Some(Authentica...
Rust
0
me(rollup_type_script.clone()).pack()) .build(), }; let mut chain = setup_chain_with_config(rollup_type_script.clone(), rollup_config.clone()).await; let rollup_context = RollupContext { rollup_script_hash, rollup_config, }; let contracts_dep = ContractsCellDep {...
Rust
0
lOrd + Bounded { fn new_dropout_config(&self, probability: f32, seed: u64, ) -> Result<Self::CDROP, ::co::error::Error> { Ok(helper::DropoutConfig{probability, seed}) } // TODO this is supposed to be an in place...
Rust
0
base(BadgeHue::Orange), outline: true, "Orange" } Badge { color: BadgeColor::base(BadgeHue::Yellow), outline: true, "Yellow" } Badge { color: BadgeColor::base(BadgeHue::Lime), outline: true, "Lime" } Badge { color: BadgeColor::base(BadgeHue::Green), outline: true, "Green" } ...
Rust
0
__repr__(self): return f"{self.__class__.__name__}({repr(self.transforms.transforms)})" def __rich_repr__(self): yield "transforms", self.transforms.transforms def __to_config__(self): """See bcos.experiments.utils.sanitize_config for details.""" result = dict( tran...
Python
1
error("Unsupported commit-graph file version: {0}")] UnsupportedVersion(u8), } const TRAILER_LEN: usize = SHA1_SIZE; const MIN_FILE_SIZE: usize = HEADER_LEN + ((MIN_CHUNKS + 1) * CHUNK_LOOKUP_SIZE) + TRAILER_LEN; // Required chunks: OIDF, OIDL, CDAT const MIN_CHUNKS: usize = 3; impl File { /// Try to parse t...
Rust
0
ed_value = builder .query(None, Key::Account(*DEFAULT_ACCOUNT_ADDR), &[]) .unwrap(); let account = account_stored_value.as_account().cloned().unwrap(); let contract_hash_key = account .named_keys() .get(gh_1470_regression::CONTRACT_HASH_NAME) .cloned() .unwrap();...
Rust
0
_wires_1 = GarblingWire::<PlainBit, Wire8Bit>::new(&mut rng); let garbled_value_1 = garbled_wires_1.clone().encode(6); let garbled_wires_2 = GarblingWire::<PlainBit, Wire8Bit>::new(&mut rng); let garbled_value_2 = garbled_wires_2.clone().encode(6); let (_, gates) = garble_add_u8_plain_sc...
Rust
0
def stem_and_leaf(data): stem_leaf_dict = {} for number in data: stem = number // 10 leaf = number % 10 if stem not in stem_leaf_dict: stem_leaf_dict[stem] = [] stem_leaf_dict[stem].append(leaf) for key in stem_leaf_dict: stem_l...
Python
1
kdown( "Código fonte disponível em [https://github.com/DiogoCarapito/text-to-icpc2](https://github.com/DiogoCarapito/text-to-icpc2)" ) with tab_icpc2: descricao("Insira o texto e obtenha o código ICPC2 correspondente") col_text_input_1, col_text_input_2 = st.columns([3, 1]) ...
Python
1
(r"meshes\x\ex_hlaalu_dsteps_02.nif", 0x2E36_1F3C, 0x55B4_2AD1), (r"meshes\x\ex_hlaalu_dsteps_03.nif", 0x2E36_1F3C, 0x55B4_2ED1), (r"meshes\x\ex_hlaalu_wall_up_02.nif", 0x2E36_1F3C, 0x70FA_B797), (r"meshes\x\ex_hlaalu_balcony_02.nif", 0x2E36_1F3C, 0xBDA8_39D2), (r"meshes\x\ex_hlaalu_balcony_01.nif",...
Rust
0
facing: MagentaShulkerBoxFacing::from_snake_case(map.get("facing")?)?, }) } pub fn to_map(&self) -> HashMap<String, String> { let mut m = HashMap::new(); m.insert("facing".to_string(), self.facing.to_snake_case()); m } } impl Default for MagentaShulkerBoxData { fn defaul...
Rust
0
anted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, a...
Rust
0
, value) = entries.next().unwrap(); assert_eq!(key, "a"); assert_eq!(value, 1); let (key, value) = entries.next().unwrap(); assert_eq!(key, "b"); assert_eq!(value, "foo"); assert!(entries.next().is_none()); } #[test] fn object_entries_rev() { let data = object!{ "a" => 1, ...
Rust
0
0") log_window.configure(bg=self.colors['bg']) ttk.Label(log_window, text="История операций", font=("Segoe UI", 16, "bold")).pack(pady=10) # Текстовое поле log_text_full = scrolledtext.ScrolledText(log_window, wrap=tk.WORD, ...
Python
1
import io import os import asyncio import json import re import random from meme_generator import get_meme import plugins from bridge.context import ContextType from bridge.reply import Reply, ReplyType from channel.chat_message import ChatMessage from common.log import logger from plugins import * from config import c...
Python
1
d format is greater than the alpha channel, the /// standard source-over blending math results in an additive blend. Premultiplied = 1, /// Indicates that the transparency behavior is not premultiplied. The /// alpha channel indicates the transparency of the color. Straight = 2, /// Indicates ...
Rust
0
_layer) .with(fmt_layer) .with(ErrorLayer::default()) .init(); color_eyre::config::HookBuilder::default() .add_frame_filter(Box::new(|frames| { let mut displayed = std::collections::HashSet::new(); let filters = &[ ...
Rust
0
elif t == 25: reader_.varint() elif t == 23: reader_.bytes_string() else: continue return data def read_image_danmakus(string: bytes): image_list = [] reader_ = BytesReader...
Python
1
est/test_word2vec.pyttestRNGs!!cCs|jt|jt|j|jtj|j|j|jrl|jtj|j|jn|j r|jtj|j |j nt |jj ddd}|jtj||||dS(NtkeycSs |dj...
Python
1
import logging import torch.nn as nn from ..multitask_head import MultitaskHead from .pointpillars_vit import PointPillarsViT from ...misc.logger import make_logger class PointPillarsViTCNN(nn.Module): def __init__(self, cfg, local_rank=0) -> None: super().__init__() self.cfg = cfg ...
Python
1
oice([0, 1]), "lambda_reg": tune.uniform(0, 1), }, defaults={ "n_trees": 500, "min_leaf_size": 10, "max_depth": 10, "subsample_ratio": 0.7, # "bootstrap": tune.choice([...
Python
1
ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // use std::{env, process}; use paho_mqtt as mqtt; use paho_mqtt_redis::RedisPersistence; //...
Rust
0
BytesReader::verify(&slice[..], compatible)?; } Ok(()) } } #[derive(Debug, Default)] pub struct BytesOptBuilder(pub(crate) Option<Bytes>); impl BytesOptBuilder { pub fn set(mut self, v: Option<Bytes>) -> Self { self.0 = v; self } } impl molecule::prelude::Builder...
Rust
0
} <gh_stars>10-100 use crate::tests::world_tester::*; #[test] fn player_move() { let mut world = TestWorld::new(); let mut expected = world.clone(); world.add_player(20, 20); expected.add_player(21, 20); world.event = Event::Right; // Expected step is directly related to move event expected.status_at(21, 2...
Rust
0
r safe to do Err(inner) } } <gh_stars>0 extern crate core; use core::time; use std::borrow::Borrow; use drive::scan::model::auth::{AuthorizationCode, Token}; use drive::scan::model::query::QueryQrCodeCkForm; use drive::scan::model::{AuthorizationToken, Ok}; use drive::scan::qr::QrCodeScanner; #[tokio::mai...
Rust
0
a7}'), ('\u{a7a9}', '\u{a7a9}'), ('\u{a7b5}', '\u{a7b5}'), ('\u{a7b7}', '\u{a7b7}'), ('\u{a7fa}', '\u{a7fa}'), ('\u{ab30}', '\u{ab5a}'), ('\u{ab60}', '\u{ab65}'), ('\u{ab70}', '\u{abbf}'), ('\u{fb00}', '\u{fb06}'), ('\u{fb13}', '\u{fb17}'), ('\u{ff41}', '\u{ff5a}'), ('\u{10428}', '\u{104...
Rust
0
def average_odds_difference(y_true, y_pred, sensitive_feature): """ Compute Average Odds Difference. Measures the difference in average TPR and FPR between groups. Args: y_true (pd.Series): Ground truth outcomes. y_pred (pd.Series): Predicted outcomes. sensitive_feature (pd.Seri...
Python
1
import openai openai.api_key = 'YOUR API KEY HERE' import re, json from tqdm import tqdm import random def return_random_prompt(text): system_prompt = "你需要仿照给定的句式,尽可能给出多样化的输出。我们将用于人工评估ChatGPT模型对指令的完成情况。要求:\n" # generate random topics topic_list = ["科技", "娱乐", "体育", "金融", "时政", "教育", "医疗", "旅游", "美食", "汽车...
Python
1
"harvester" => { let harvester: Harvester = Creep::new(creep); harvester.run(); } "upgrader" => { let upgrader: Upgrader = Creep::new(creep); upgrader.run(); } _ => { creep.suicide(); } } } ...
Rust
0
::open(".")?; // Act let diffs = repo.get_diff(false); // Assert assert!(diffs.is_none()); Ok(()) } #[sealed_test] fn get_diff_include_untracked_some() -> Result<()> { // Arrange run_cmd!( git init echo changes > file ...
Rust
0
onstant', constant_values=(0, alphabet.eos_idx)) x_word_idx = np.pad(x_word_idx, (0, config.context_char_max - x_word_idx.size), 'constant', constant_values=(0, alphabet.eos_idx)) y_idx = np.pad(y_idx, (0, config.pred_char_max - y_idx.size + 1), 'constant', ...
Python
1
quence[MeasurementWindow]] = None) -> ContextManager['ProgramBuilder']: """Start a new sequence context. The caller has to enter the returned context manager and add the sequenced elements there. Measurements that are added in to the returned program builder are discarded if the sequence is emp...
Python
1
appender use serde_value::Value; use ordered_float::OrderedFloat; use std::cmp::Ordering; use std::collections::{BTreeMap, HashSet}; use std::error::Error; use std::fmt::Write; use log_mdc; use route::pattern::parser::{Parser, Piece}; pub struct Template { value: ValueTemplate, keys: HashSet<String>, } impl ...
Rust
0
o_uri: # print("Помилка: Змінна MONGO_URI не знайдена у файлі .env") # exit() # # # Підключаємося до MongoDB # try: # client = MongoClient(mongo_uri) # db = client.get_database() # Отримуємо доступ до основної бази даних # print("Успішно підключено до MongoDB.") # except Exception as e: # print...
Python
1
TlsConfig>, /// Tuning Params /// Default: None = default. pub tuning_params: Option<KitsuneP2pTuningParams>, } impl Default for QuicConfig { fn default() -> Self { Self { tls: None, tuning_params: None, } } } impl QuicConfig { /// into inner contents w...
Rust
0
builtin-bounds // that the trait does not guarantee: let extra_bounds = impl_param_def.bounds.builtin_bounds - trait_param_def.bounds.builtin_bounds; if !extra_bounds.is_empty() { tcx.sess.span_err( cm.span, fmt!("in method `%s`, ...
Rust
0
= badchar_option() PAYLOAD = RESULT[1][0].decode('string-escape') BADCHAR = r"{0}".format(RESULT[1][1]) # EXPLOIT 2 RESULT = exploit_option(IP,PORT,PREFIX,POSTFIX,ENTERS,OVERFLOW,RETN,PADDING,PAYLOAD,OFFSET) else: COND = False else: INPUTS = raw_input(cyan("\n[+] Please Enter your Badchar : "...
Python
1
# core/perception.py from .interfaces import BrainModule class PerceptionModule(BrainModule): def process(self, data): print("Module de Perception traite les données.") # Implémenter la logique de perception ici return "données_perçues" # core/language.py from .interfaces import BrainMod...
Python
1
let Some(var_2120) = &input.transform_job_definition { let mut object_2121 = object.key("TransformJobDefinition").start_object(); crate::json_ser::serialize_structure_crate_model_transform_job_definition( &mut object_2121, var_2120, )?; object_2121.finish(); ...
Rust
0
, &mut rcc.apb1, ); // Configure Midi let (mut tx, mut rx) = usart.split(); let mut midi_in = MidiIn::new(rx); let mut midi_out = MidiOut::new(tx); loop { if let Ok(event) = block!(midi_in.read()) { midi_out.write(event); } } } #[doc = "Reader of regist...
Rust
0
data: Vec<u8>, /// A sorted vector of indicies from `data` which are used during the fuzz /// case accessed: Vec<usize>, } impl Input { /// Creates a new input from an instruction count, a raw input, and the /// accessed mapping associating `data` bytes to accessed ones pub fn new(instrs:...
Rust
0
print('------------ CONSULTA PREÇO CONVERTIDO -------------') preco = float(input('Insira o valor do produto: R$ ')) dollar = float(5.85) if preco <= 5.00: print(f'Valor R${preco} Produto barato') print(f'No dolar atual custa ${preco / dollar:.2f}') elif preco > 5.00 and preco <= 15.00: print(f'Valor R${preco} Pr...
Python
1
depth_dir = dict() label_dir = dict() for phase in ['train', 'test']: img_dir[phase] = dict() depth_dir[phase] = dict() label_dir[phase] = dict() img_dir['train']['list'], img_dir['train']['dict'] = \ self.list_and_dict_from_file(img_dir...
Python
1
} }; let fq_id = class::ClassType::<'arena>::from_ast_name(alloc, &cname).to_raw_string(); if e.options().emit_class_pointers() > 0 { Ok(( MemberKey::ET(Str::from(fq_id), ReadonlyOp::Any)...
Rust
0
#!/usr/bin/env python3 """The module for Async Generator""" import asyncio import random from typing import Generator async def async_generator() -> Generator[float, None, None]: """ The coroutine will loop 10 times, each time asynchronously wait 1 second, then yield a random number between 0 and 10. ...
Python
1
ates that //! webpki will reject. If you find a certificate that x509-signature rejects //! and webpki rejects, please report it as a bug. //! //! x509-signature was developed for use with //! [libp2p](https://github.com/libp2p), which uses certificates that webpki //! cannot handle. Its bare-bones design ensures tha...
Rust
0
#[structopt( short = "q", long = "quote-type", help = "Quote type", possible_values = &["Linkable", "Unlinkable"], case_insensitive = false )] pub quote_type: String, /// Base URI of intel attestation service (IAS) #[structopt( long = "ias-base-uri", ...
Rust
0
0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. type MyResultPriv<T> = Result<T, u16>; pub type MyResultPub<T> = Re...
Rust
0
oc = "TVD_MODE register accessor: an alias for `Reg<TVD_MODE_SPEC>`"] pub type TVD_MODE = crate::Reg<tvd_mode::TVD_MODE_SPEC>; #[doc = "TVD MODE CONTROL Register"] pub mod tvd_mode; #[doc = "TVD_CLAMP_AGC1 register accessor: an alias for `Reg<TVD_CLAMP_AGC1_SPEC>`"] pub type TVD_CLAMP_AGC1 = crate::Reg<tvd_clamp_agc1::...
Rust
0
none")] muscle_mass: Option<crate::fields::Mass>, #[serde(skip_serializing_if = "Option::is_none")] percent_fat: Option<f64>, #[serde(skip_serializing_if = "Option::is_none")] percent_hydration: Option<f64>, #[serde(skip_serializing_if = "Option::is_none")] physique_rating: Option<u8>, ...
Rust
0
import matplotlib.pyplot as plt import networkx as nx import random # Матриця пропускних спроможностей capacity_matrix = [ [0, 12, 0, 8, 0, 7, 0], [0, 0, 0, 11, 0, 0, 14], [0, 5, 0, 0, 12, 0, 6], [0, 0, 10, 0, 0, 0, 5], [0, 8, 0, 0, 0, 11, 0], [0, 0, 9, 8, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0] ] ...
Python
1
#!/usr/bin/env python3 """ Test complet de tous les modes de FoodOps pour audit pratique. """ import os import sys import subprocess from pathlib import Path def test_mode_simple(): """Test du mode simple (Foodopsmini.py).""" print("🎮 TEST MODE SIMPLE (Foodopsmini.py)") print("=" * 60) try: ...
Python
1
eriods=1, center=False, window=n).apply( lambda x: np.fabs(x - x.mean()).mean()))) return _cci def priceosc(df, n=12, m=26): """ 价格振动指数 PRICEOSC=(MA(C,12)-MA(C,26))/MA(C,12) * 100 """ _c = pd.DataFrame() _c['date'] = df['date'] man = _ma(df.close, n) _c['osc'] =...
Python
1
i,b,d) ) ) | do_parse!( i: ws!(parse_long_ptr_reg) >> add >> d: ws!(parse_const) >> add >> b: ws!(parse_long_ptr_reg) >> ((i,b,d)) ) | do_parse!( d: ws!(parse_const) >> add >> i: ws!(parse_long_ptr_reg) >> add >> b: ws!(parse_long_ptr_reg...
Rust
0
) raise e except RetryError as e: logger.debug(f"Retry error: {e}") raise InstructorRetryException( e.last_attempt._exception, last_completion=response, n_attempts=attempt.retry_state.attempt_number, #! deprecate messages s...
Python
1
j_bbox_dict elif self.prompt == 'click': pt_dict[frame_index - starting_frame] = diff_obj_pt_dict point_label_dict[frame_index - starting_frame] = diff_obj_point_label_dict image_meta_dict = {'filename_or_obj':name} if self.prompt == 'bbox': retu...
Python
1
trait AmendDoggyness : Outspoken { fn bark(&self) -> &str { "wuff" } } impl<T> AmendDoggyness for T where T: Outspoken {} } #[test] fn outspoken_from_stackoverflow() { trait Outspoken { fn speak(&self) -> String; } impl<T> Outspoken for T where T: fmt::Debug ...
Rust
0
dd_subplot(1, len(images), i + 1).set_title(titles[i]) _ = plt.imshow(images[i]) plt.axis("off") plt.show() def infer(original_image): image = keras.utils.img_to_array(original_image) image = image.astype("float32") / 255.0 image = np.expand_dims(image, axis=0) output_image = zero_...
Python
1
algorithm for symmetric encryption is XChaCha20 with a Poly1305 AEAD //! construction (XChaCha20Poly1305). //! //! The `StreamId` is computed by taking the 32-byte secret key and hashing it with BLAKE2b, with //! the parameters: no key, no salt, and a persona set to "fog-crypto-sid". 32 bytes of the output //! hash are...
Rust
0
t_mapped_keys): pass elif any_word_in_key(key, mlp_router_keys): val = np.concatenate(vals, axis=1) save_val(val, saved_dir, trt_llm_key) elif any_word_in_key(key, mlp_fc_expert_keys): cat_dim = -1 val = np.concatenate(vals, axis=cat_dim) w1, w3 = np.split(val, ...
Python
1
} } } impl ProcessSyscallHandler for Handler { fn arch_prctl(&mut self, code: i32, addr: u64) -> sallyport::Result { self.trace("arch_prctl", 2); match code { ARCH_SET_FS => { // FIXME: check `addr` value unsafe { wrfsbase...
Rust
0
from odoo import fields, models class NcmCategory(models.Model): _name = 'l10n_br.ncm.category' _description = "Categoria de NCM para importar" name = fields.Char(string="Código")
Python
1