text
string
label_name
string
labels
int64
import torch.nn as nn ACT_LAYERS = { 'relu': nn.ReLU(), 'leaky_relu': nn.LeakyReLU(0.1), 'sigmoid': nn.Sigmoid(), 'softplus': nn.Softplus(), 'tanh': nn.Tanh(), 'elu': nn.ELU(), 'gelu': nn.GELU(), None: nn.Identity(), } class AttentionOutput(nn.Module): def __init__(self, d_model, ...
Python
1
>; type Block = frame_system::mocking::MockBlock<Test>; // For testing the pallet, we construct most of a mock runtime. This means // first constructing a configuration type (`Test`) which `impl`s each of the // configuration traits of pallets we want to use. // Configure a mock runtime to test the pallet. frame_supp...
Rust
0
ult utf-8)') return parser def _error(msg): """Print msg and optionally exit with return code exit_.""" sys.stderr.write('[ERROR] {}\n'.format(msg)) return 1 def main(args=None): parser = create_parser() args = parser.parse_args(args) if args.filename == '-': # read from stdin ...
Python
1
.exists(dest_vis_folder): os.makedirs(dest_vis_folder) anim_gt_head_seq_path = os.path.join(dest_vis_folder, "validation_head_traj.gif") anim_pred_head_seq_path = os.path.join(dest_vis_folder, "train_head_traj.gif") anim_cmp_seq_path = os.path.join(des...
Python
1
input_dtype = np.float64 elif 'int64' in input_type: input_dtype = np.int64 elif 'int32' in input_type: input_dtype = np.int32 else: raise ValueError(f'Unsupported ONNX datatype {input_type}') input_data = np.random.rand(*input_tensor.sha...
Python
1
AuthKeyGenError> { let Step2 { nonce, server_nonce, new_nonce, } = data; let server_dh_params = <tl::functions::ReqDHParams as RPC>::Return::from_bytes(&response)?; // Step 3. Factorize PQ and construct the request for DH params. let server_dh_params = match server_dh_param...
Rust
0
plicit_quintuples def id_string(self): if self.id < 10: return "0" + str(self.id) else: return str(self.id) def define_operation(self, scan_symbol, print_symbol, target_state, verbosity): self.operations[scan_symbol] = Operation(print_symbol, target_state, verbo...
Python
1
i = m; while i < n { dot += x[i] * y[i]; i += 1; dot += x[i] * y[i]; i += 1; dot += x[i] * y[i]; i += 1; dot += x[i] * y[i]; i += 1; dot += x[i] * y[i]; i += 1; } } else { ...
Rust
0
t(":")[1] if df_inversions.loc[df_inversions["GT"].notnull(), "GT"].any() else None) #list_programs = [(x.split(",")) for x in bed_merged["ID_PROGRAM"]] n_programs = [] programs = [] for x in bed_merged["ID_PROGRAM"]: ids_ind = (x.split(",")) ind_prog = [x[0] for x in id...
Python
1
# Arquivo __init__.py para tornar o diretório um pacote Python from .models import CompostoPneu, Stint from .optimizer import F1StrategyOptimizer __all__ = ['CompostoPneu', 'Stint', 'F1StrategyOptimizer']
Python
1
from .common import InfoExtractor from .rtvcplay import RTVCKalturaIE class SenalColombiaLiveIE(InfoExtractor): _WORKING = False _VALID_URL = r'https?://(?:www\.)?senalcolombia\.tv/(?P<id>senal-en-vivo)' _TESTS = [{ 'url': 'https://www.senalcolombia.tv/senal-en-vivo', 'info_dict': { ...
Python
1
_index = self.vertices.len() as VertexIndex; let quad_indices = [ quad_vertex_index, quad_vertex_index + 1, quad_vertex_index + 2, quad_vertex_index + 2, quad_vertex_index + 3, quad_vertex_index, ]; self.vertices.extend_fro...
Rust
0
, because this iterator goes on forever and thusly /// does not need to return an `Option<Item>`. pub(crate) fn next(&mut self) -> VirtualRegister { let next_val = self.next_register; self.next_register += 1; VirtualRegister::Virtual(next_val.to_string()) } pub(crate) fn get_labe...
Rust
0
::MDB_env) -> Result<RwTxn<'static, T>> { let mut txn: *mut ffi::MDB_txn = ptr::null_mut(); unsafe { mdb_result(ffi::mdb_txn_begin(env, ptr::null_mut(), 0, &mut txn))? }; Ok(RwTxn { txn: RoTxn { txn, _phantom: marker::PhantomData }, _parent: marker::PhantomData, ...
Rust
0
mage import annotator.oneformer.detectron2.data.datasets # noqa # add pre-defined metadata from annotator.oneformer.detectron2.utils.visualizer import Visualizer logger = setup_logger(name=__name__) meta = MetadataCatalog.get(sys.argv[3]) dicts = load_lvis_json(sys.argv[1], sys.argv[2], sys.argv[...
Python
1
reporter_share_den), ) } use crate::helper::{deadlock_detection, wait_for_exit}; use ckb_app_config::{BlockAssemblerConfig, ExitCode, RunArgs}; use ckb_build_info::Version; use ckb_chain::chain::ChainService; use ckb_jsonrpc_types::ScriptHashType; use ckb_logger::info_target; use ckb_network::{ BlockingFlag, CK...
Rust
0
{ corner.flip(); } let offset = corner.borders().iter().position(|border| border == &top.right()[0]).unwrap(); for _ in 0..((offset+2)/2) { corner.rotate(); } fill_at(&corner.grid, &mut big_grid, 20, 0); } if let Some(offset) = corner.borders().iter().position(|border| border ==...
Rust
0
if itag in (self.video_mp4_itag + self.video_webm_itag): self.itag_list.append(itag) width = param['width'] height = param['height'] quality = str(width)+'x'+str(height) self.itag_quality[itag] = quality # codec...
Python
1
return None; } tts[0].maybe_lit() } _ => None, } } /// Returns an AST string literal. pub fn maybe_str(&self) -> Option<ast::Lit> { match *self { TokenTree::Token(sp, Token::Literal(Lit::Str_(s), _)) => ...
Rust
0
charset"), UnarchiveError::InvalidFormData => write!(f, "Server returned error invalid_form_data"), UnarchiveError::InvalidJson => write!(f, "Server returned error invalid_json"), UnarchiveError::InvalidPostType => write!(f, "Server returned error invalid_post_type"), Una...
Rust
0
import subprocess def get_software_from_wmic(): """Get installed software using WMIC command""" try: result = subprocess.run( ["wmic", "product", "get", "Name,Version,Vendor,InstallDate"], capture_output=True, text=True, check=True ) lines = result.stdou...
Python
1
27 301,27 413,28 654,28 935,30 131,32 149,32 515,31 629 12,Vallauris,Alpes-Maritimes,--,Provence-Alpes-Côte d'Azur,26 672,26 618,26 302,27 465,30 610,25 773,24 325,21 205,17 182,12 880 13,Vierzon,Cher,Sous-préfecture,Centre-Val de Loire,25 903,26 365,27 050,27 113,28 147,29 719,32 235,34 209,35 699,33 775 14,Alençon,Or...
Python
1
, inp: crate::model::IntelligentTieringConfiguration, ) -> Self { self.inner = self.inner.intelligent_tiering_configuration(inp); self } /// <p>Container for S3 Intelligent-Tiering configuration.</p> pub fn set_intelligent_tiering_configuration( ...
Rust
0
OHIDManagerSetInputValueMatchingMultiple( manager: IOHIDManagerRef, multiple: CFArrayRef, ); pub fn IOHIDManagerSaveToPropertyDomain( manager: IOHIDManagerRef, applicationID: CFStringRef, userName: CFStringRef, hostName: CFStringRef, options: IOOptionBits...
Rust
0
nput_data_csv" assert os.path.join(base_dir, "raw_data", safe_source_id, "vorig", f"{param_hash}.feather") == path # --- Test build_computation_path --- def test_build_computation_path_helper(base_dir): """Tests the computation path helper function.""" params = {"alpha": 0.1} inputs = ["hash1", "hash2...
Python
1
-6.0, 4.0, 100.0, 100.0, 7.0] ); assert_eq!(path.x, path.y); assert_eq!(path.segments.len(), 1); assert_eq!(path.segments[0].length, 9); } } <filename>src/stream.rs /* * PCG Random Number Generation for Rust * * Copyright 2015 <NAME> <<EMAIL>> * * Licensed under the Apache Lice...
Rust
0
64 => Ok(AtomType::F64), _ => Err(Error::Unsupported(format!("wasmparser type {:?}", a))), } } <gh_stars>10-100 use crate::{err::ExplainErr, utils}; pub fn explain(code: u32) -> Result<&'static str, ExplainErr> { let lints = utils::lint_map(); match code { 0 => Ok("syntax error"), _...
Rust
0
and_then(|resp| { if resp.code.eq("OK") { Ok(()) } else { Err(Error::Internal(resp.message)) } }) } } #[derive(Deserialize, Debug, Default)] #[serde(default)] struct SmsResponse { #[serde(rename = "Message")] ...
Rust
0
f speaker similarity - how closely to match speaker identity and speech style. temperature: Temperature for sampling applied to both LLMs (first & second stage) returns: path to speech .wav file """ text = normalize_text(text) spk_ref_path = get_cached_file(spk_ref_path) ...
Python
1
c13c21432ca1ba33"), aad: &hex!("454f447433f0948581956c4be1b19d932e89b492"), ciphertext: &hex!("1cb45aac5def93daef806b781e"), tag: &hex!("f4b0723c89607b66c392049ba042db63"), }, TestVector { key: &hex!("<KEY>"), nonce: &hex!("196c4addb84a58beb3674a7a"), plaintext: &...
Rust
0
_ready(cx) .map_err(|_| MiniDSPError::TransportClosed) } fn start_send(self: Pin<&mut Self>, item: Bytes) -> Result<(), Self::Error> { self.project() .device_tx .start_send(item) .map_err(|_| MiniDSPError::TransportClosed) } fn poll_flush(self: P...
Rust
0
# Example for create a server that delay the response see prog_s.delay(500000); command from trex.astf.api import * import argparse # we can send either Python bytes type as below: http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows...
Python
1
} if self.buffer.len() < part_start { return ParseResult::NotReady; } match twoway::find_bytes(&self.buffer[part_start..], boundary) { Some(i) => { // We've found an entire part, snap it of and return it. self.buffer.advance(part_start);...
Rust
0
_globals)] const _expected_dx_perspective_lh : Matrix4<f32> = Matrix4 { x : Vector4::<f32>::new(0.803333104, 0.0, 0.0, 0.0), y : Vector4::<f32>::new(0.0, 1.42814779, 0.0, 0.0), z : Vector4::<f32>::new(0.0, 0.0, 1.00100100, 1.0), w : Vector4::<f32>::new(0.0, 0.0, -0.100100100, 0.0), }; // DirectX is left-han...
Rust
0
xtBundle { style: Style { align_self: AlignSelf::FlexEnd, position_type: PositionType::Absolute, position: Rect { top: Val::Percent(0.0), right: Val::Percent(2.0), ...
Rust
0
, WarmUp, UnknownValue(u64), } impl From<FieldContent> for ExerciseCategory { fn from(field: FieldContent) -> Self { if let FieldContent::UnsignedInt16(enum_value) = field { match enum_value { 0 => ExerciseCategory::BenchPress, 1 => ExerciseCategory::Calf...
Rust
0
ontrada = 0 # Verifico si hay energía en la posición que caí for j in range (len(arrayEnergia)): if dondeestoy == arrayEnergia[j][1]: energiaencontrada = arrayEnergia[j][2] print("en la posiión hay energía: " + str(energiaencontrada)) arrayEnergia[j][2] = arrayEnergia[j][2] // 2 break a...
Python
1
nt MUST NOT be emitted outside of a mint process. #[ink(event)] #[metis(erc777)] pub struct Minted { #[ink(topic)] pub operator: AccountId, #[ink(topic)] pub to: AccountId, pub amount: Balance, pub data: Vec<u8>, pub operator_data: Vec<u8>, } ...
Rust
0
Type::BigInt, bigint_slice).unwrap(); assert_eq!(bigint_serialized, CqlValue::BigInt(4)); } #[test] fn test_list_from_cql() { let my_vec: Vec<CqlValue> = vec![CqlValue::Int(20), CqlValue::Int(2), CqlValue::Int(13)]; let cql: CqlValue = CqlValue::List(my_vec); let decoded = ...
Rust
0
ler))*; handlers } } } pub fn build_event_handlers() -> EventHandlers { event_handlers! { on_block_update_notify_adjacent, on_block_break_broadcast_effect, on_block_update_broadcast, on_block_update_notify_lighting_worker, on_block_break_drop_loot, ...
Rust
0
# -*- coding: utf-8 -*- """ @brief test log(time=13s) """ import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import add_missing_development_version, skipif_travis class TestNotebook1237Coverage7_201712(unittest.TestCase): def setUp(self): add_missing_development_versi...
Python
1
2, 1)); assert!(is_aligned(3, 1)); assert!(is_aligned(4, 1)); assert!(is_aligned(5, 1)); assert!(is_aligned(6, 1)); assert!(is_aligned(7, 1)); assert!(is_aligned(8, 1)); } #[test] fn aligned_2() { assert!(is_aligned(0, 2)); assert!(!is_aligned...
Rust
0
let filepath = pathbuf.to_str().expect("Cannot make filepath,").to_string(); std::fs::DirBuilder::new() .create(&filepath) .expect("Cannot create temporary directory."); closure(filepath.clone()); std::fs::remove_dir(&filepath).expect("Failed removing temporary file."); } #[cfg(test)] ...
Rust
0
"""Tests for the Elgato sensor platform.""" import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr, entity_registry as er pytestmark = [ pytest.mark.parametrize("device_fixtures", ["key-light-mini"]), py...
Python
1
- scaled_mask)) masked_effect -= outlines masked_effect[masked_effect > (255 - outlines)] = 0 masked_effect = cv2.blur(masked_effect, (3, 3)) final += cv2.cvtColor(masked_effect, cv2.COLOR_GRAY2BGR) # for result in results: # if result.boxes is None: # break # for box ...
Python
1
#!/usr/bin/env python3 import tkinter as tk from tkinter import ttk class AddressBookApp(tk.Frame): def __init__(self, master=None): super().__init__(master) self.master.title('Address Book') self.pack() self._create_widgets() def _create_widgets(self): tree_view_entr...
Python
1
instance(s, str): raise TypeError('{!a} is not a str'.format(s)) s_lowercased = s.lower() try: return str_to_bool.LOWERCASE_TO_BOOL[s_lowercased] except KeyError: raise ValueError(str_to_bool.PUBLIC_MESSAGE_PATTERN.format( ascii_str(s)).rstrip('.')) from None str_to_bool...
Python
1
(result, error) } #[repr(C)] #[derive(Copy, Clone)] pub struct Ipv6([u8; 16]); impl TryFrom<Ipv6> for RIpv6 { type Error = CError; fn try_from(ipv6: Ipv6) -> Result<Self> { Self::new(ipv6.0.to_vec()).into_result() } } impl From<RIpv6> for Ipv6 { fn from(ipv6: RIpv6) -> Self { Self(ipv6.ip().try_into...
Rust
0
), NOP(u16), UNKNOWN(u16), } /* parse a big endian, 2-byte opcode into its corresponding CHIP-8 instruction. */ pub fn parse_opcode(bytes: u16) -> Instruction { match bytes & 0xF000 { 0x0000 => match bytes & 0x00FF { 0x00E0 => Instruction::ClearScreen, 0x00EE => Inst...
Rust
0
it { fn from(val: Vec<u64>) -> Self { Self::UInt64List(val) } } impl From<f32> for EncoderLit { fn from(val: f32) -> Self { Self::Float(val) } } impl From<Vec<f32>> for EncoderLit { fn from(val: Vec<f32>) -> Self { Self::FloatList(val) } } impl From<f64> for EncoderLit...
Rust
0
+ SendSyncRefUnwindSafeDrain<Err = Never, Ok = ()>, T: SendSyncRefUnwindSafeKV + 'static, { Logger { drain: Arc::new(drain) as Arc<SendSyncRefUnwindSafeDrain<Ok = (), Err = Never>>, list: OwnedKVList::root(values), } } /// Build a root `Logge...
Rust
0
#!/usr/bin/env python """ Handover example supported by bgscan (Background scanning) and wmediumd. ieee 802.11r can be enabled adding the parameters below: ieee80211r='yes' mobility_domain='a1b2' e.g. ap1 = net.addAccessPoint('ap1', ..., ieee80211r='yes', mobility_domain='a1b2',...) Consider https://w1.fi/cgit/hos...
Python
1
odedecode)rrr,r,r-_encode_hostnames  zSSLContext._encode_hostnameFTc Cs|jj|||||||dS)N)sock server_sidedo_handshake_on_connectsuppress_ragged_eofsserver_hostnamecontextsession)sslsocket_class_create)rrrrrrrr,r,...
Python
1
import os import typing from pathlib import Path from unittest.mock import Mock import numpy as np from kwave.kgrid import kWaveGrid from kwave.utils.conversion import tol_star from tests.matlab_test_data_collectors.python_testers.utils.record_reader import TestRecordReader class kGridMock(Mock): @property ...
Python
1
pulse_cfg.cancel_alpha_phs n_bands = pulse_cfg.n_bands band_sep = pulse_cfg.band_sep phs_0_pt = pulse_cfg.phs_0_pt pulse_in = rf.slr.dzrf( n=n_samples, tb=time_bw_product, ptype=ptype, ftype=ftype, d1=d1, d2=d2, cancel_alpha_phs=cancel_alpha_phs,...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from fairseq.modules import ( LayerNorm, TransformerEncoderLayer, TransformerDecoderLayer ) from . import build_monotonic_attenti...
Python
1
ecksum(&decrypted) { return Ok(None) } let op = decrypted[0]; let value = (decrypted[1] as u32) << 8 | (decrypted[2] as u32); let ret = match op { CODE_CO2 => Some(Measurement::CO2(value)), CODE_TEMPERATURE => Some(Measurement::from_raw_temperature(value)), _ => None }; Ok(ret) } fn run(...
Rust
0
import numpy as np from tqdm import tqdm from glob import glob import os import json import pickle prompt = '[REFERENCE_INPAINTING]' overlap = [0.4, 0.7] root_path = 'data/megadepth' # this should be the megadepth image folder train_info_path = 'data/megadepth/index/scene_info_0.1_0.7' test_info_path = 'data/megadepth...
Python
1
from typing import Dict, List class MissionWeight: def __init__(self, previous_missions: Dict[int, List[int]], current_week: int): self.previous_missions = previous_missions self.current_week = current_week def edge_cost(self, u_from: int, u_to: int, scale: int = 1000) -> int: # 두 유저의...
Python
1
reateGLES2(isize flags); //void nvgDeleteGLES2(struct NVGcontext* ctx); //#if defined NANOVG_GLES3 //pub fn nvgCreateGLES3(flags: c_uint) -> *mut NVGcontext; //pub fn nvgDeleteGLES3(ctx: *mut NVGcontext); pub fn stbi_write_png(filename: *const c_char, w: c_int, h: c_int, comp: c_int, data: *cons...
Rust
0
assert(c == a + b); assert(c == a); // FAILS } } => Err(err) => assert_one_fails(err) } test_verify_with_pervasive! { #[test] test_spec_fn code! { #[spec] fn f1(i: int, j: int) -> bool { i <= j } #[spec] fn f2(i: int, j: int) ...
Rust
0
olume in millions vmax = volume.max() poly = ax2t.fill_between(r.index, volume, 0, label='Volume', facecolor=fillcolor, edgecolor=fillcolor) ax2t.set_ylim(0, 5 * vmax) ax2t.set_yticks([]) # compute the MACD indicator fillcolor = 'darkslategrey' nslow = 26 nfast = 12 nema = 9 emaslow, emafast,...
Python
1
emb_dim]) # MLP to create weights for relative positions self.mlp_pos_weight = MLP([emb_dim, emb_dim, self.pos_weight_dim]) # MLP to update node features self.mlp_upd_h = MLP([2 * emb_dim, emb_dim, emb_dim]) def forward(self, h, pos, edge_index, edge_attr): # Propagate posi...
Python
1
eneration_output = self.generate( pixel_values=pixel_values, input_ids=input_ids, attention_mask=attention_mask, **generation_config ) response = tokenizer.batch_decode(generation_output, skip_special_tokens=True)[0] response = response.split(templ...
Python
1
te a random temporal directory for it. Defaults to None. Returns: list or None: The collected results. Examples: >>> # distributed environment >>> # We have 2 process groups, 2 ranks. >>> import mmengine.dist as dist >>> if dist.get_rank() == 0: ...
Python
1
| ErrorKind::InvalidData)?) } // generate url // pub fn url_for(&self) {} /// Next middleare pub fn next<'a>(mut self) -> BoxFuture<'a, Response> { if self.middleware.is_empty() { Box::pin(async { hyper::Response::new(Body::empty()) }) } else { Box::pin(asyn...
Rust
0
import pickle from spacy.lang.th import Thai from ...util import make_tempdir def test_th_tokenizer_serialize(th_tokenizer): tokenizer_bytes = th_tokenizer.to_bytes() nlp = Thai() nlp.tokenizer.from_bytes(tokenizer_bytes) assert tokenizer_bytes == nlp.tokenizer.to_bytes() with make_tempdir() as...
Python
1
teristics(), 0x4000, &mut characteristics, "IMAGE_FILE_UP_SYSTEM_ONLY"); add_if_includes(file_header.characteristics(), 0x8000, &mut characteristics, "IMAGE_FILE_BYTES_REVERSED_HI"); println!( " FILE HEADER VALUES machine : {:#06X} ({}) number of sections : {:#010...
Rust
0
&self.0 } } #[doc = "Field `MASK` writer - Address mask value"] pub struct MASK_W<'a> { w: &'a mut W, } impl<'a> MASK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03ff << 1)) | ((value ...
Rust
0
raw(screen) for b in bees: b.behave(flowers) #стратегический + тактический уровень for b in bees: b.sim(dt) #исполнительный уровень if all(b.state==2 for b in bees): if all(b.target is not None for b in bees): #после разведки qq=[b.metric for b in bees] ...
Python
1
ntoIterator<Item=A>, A: AsRef<str>>(&mut self, names: I) -> &mut Self { self.facets = Some(names.into_iter().map(|s| s.as_ref().to_string()).collect()); self } pub fn candidates(&mut self, candidates: RoaringBitmap) -> &mut Self { self.candidates = Some(candidates); self } ...
Rust
0
'Кутузова', 'Лазо Сергея', 'Лайоша Гавро', 'Ластовского', 'Ленина', 'Ленинская', 'Луначарского', 'Майорова Михаила', 'Маршала Буденного', 'Маршала Тухачевского', 'Мате Залки', 'Машина Михаила', 'Мильчакова Александра...
Python
1
tile_move.map_y == 0 || self.level.front_tile(tile_move.map_x, tile_move.map_y-1) != Tile::EmptyPiece || self.level.back_tile(tile_move.map_x, tile_move.map_y-1) == Tile::EmptyPiece { delta.y = 0.0; hit = hit | 0x08; } ...
Rust
0
''' Cây là một tập gồm 1 hay nhiều nút T, trong đó có một nút đặc biệt Bậc của một nút là số lượng cây con của nút đó. Nếu bật của một nút bằng 0 thì nút đó là nút lá (leaf node) Bậc của một cây: là bậc lớn nhất của các nút trong cây. Cây có n bậc thì gọi là cây n-phân Nút gốc: là nút không có nút cha Nút lá: là n...
Python
1
predict_x = predict[:, :-6] predict_X = predict_x.reshape((predict_x.shape[0], 1, predict_x.shape[1])) return predict_X predict_X = data(scaler,predict) predict_value = ['Tempf','P','Core','Mflow','Pre','L_Mf'] #预测与数据后处理 手动循环更新数据 model = keras.models.load_model('F:\Reactor_LSTM\RU...
Python
1
7px; background: #FFFFFF;">&nbsp;</span> pub const WHITE: Rgb = Rgb(1.0, 1.0, 1.0); /// <span style="border: 1px solid black; padding: 0 7px; background: rgb(87, 87, 87);">&nbsp;</span> pub const DARK_GREY: Rgb = Rgb(1.0, 0.0, 0.0); /// <span style="border: 1px solid black; padding: 0 7px; background: rgb(160, 160, 16...
Rust
0
.send_command(0., 0., drive as f32) .expect("Failed talking to robot"); last_update = std::time::Instant::now(); } else if x.abs() > deadzone || y.abs() > deadzone || yaw.abs() > deadzone { remote .send_comma...
Rust
0
void}; use libc::{O_NONBLOCK, O_RDONLY, O_NOCTTY, O_CLOEXEC, FIONREAD, FIOCLEX}; use libc::{MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL, MADV_WILLNEED, MADV_DONTNEED}; use std::ffi::CString; use std::mem; /// The architecture number for x86. #[cfg(target_arch="x86")] const ARCH_NR: u32 = AUDIT_ARCH_X86; /// The architec...
Rust
0
data outside of any segment"), AsmErrorKind::WriteInBssSegment => write!(f, "attempt to write in bss segment (zeroed at runtime)"), AsmErrorKind::InstructionOutsideOfTextSegment => write!(f, "attempt to write instructions outside of text segment (not executable)"), AsmErrorKind::Il...
Rust
0
import os import argparse parser = argparse.ArgumentParser() parser.add_argument('--img_dir', type=str) parser.add_argument('--out_dir', type=str) args = parser.parse_args() img_dir = args.img_dir out_dir = args.out_dir sub_dirs = sorted(os.listdir(img_dir)) for sub_dir in sub_dirs: output_sub = os.path.join...
Python
1
ttps://example.com/image37.jpg", "rating": 3.9, "reviews": 500, "stock": 200, "sales": 700, "description": "经济实用型手机", }, { "name": "小米米家电器套装", "price": 3000, "brand": "小米", "category": "家电", "image": "https://example.com/image38.jpg...
Python
1
اد تصاویر: {image_count} لطفاً موارد زیر را بررسی کنید: - تصویر واضح و قابل خواندن باشد - اتصال اینترنت شما پایدار باشد - دوباره تلاش کنید یا تصویر را به صورت جداگانه ارسال کنید اگر مشکل ادامه داشت، می‌توانید متن درخواست خود را بدون تصویر ارسال کنید.""" # Task Entry Prompts TASK_ENTRY_PROMPT = "لطفا ساعت ورود به شرک...
Python
1
lf.text = text self.__lower = lower self.__words = _words self.__postags = _postags self.__wakati = wakati self.__postagging = postagging @property def words(self): if self.__words is None: self.__words = self.__wak...
Python
1
let contiguous_range = find_contiguous_range(numbers, target); let min = contiguous_range.iter().min().unwrap(); let max = contiguous_range.iter().max().unwrap(); min + max } fn find_contiguous_range(numbers: &[i64], target: i64) -> &[i64] { let mut current_sum = numbers[0]; let mut bottom =...
Rust
0
# -*- coding: UTF-8 -*- #/** # * Software Name : pycrate # * Version : 0.4 # * # * Copyright 2019. Benoit Michau. P1Sec. # * # * This library is free software; you can redistribute it and/or # * modify it under the terms of the GNU Lesser General Public # * License as published by the Free Software Foundation; either #...
Python
1
pca_type == "pca": nprint("Doing PCA reduction") pca_matrix = pca_reduction(pca_dim, fdt_matrix) else: pca_matrix = melodic_incremental_group_pca(fdt_matrix, pca_dim, pca_dim) components = ica_decomp(parameters, pca_matrix, fdt_matrix) if signflip: ...
Python
1
from ops.data import OpsClass, OpsField, DszObject, DszCommandObject, cmd_definitions import dsz if ('delete' not in cmd_definitions): dszdelete = OpsClass('deletionitem', {'file': OpsField('file', dsz.TYPE_STRING), 'delay': OpsField('delay', dsz.TYPE_BOOL), 'statusvalue': OpsField('statusvalue', dsz.TYPE_INT), 's...
Python
1
ery!(" SELECT DISTINCT(i.type_id), i.name FROM schematic_material sm JOIN item i ON i.type_id = sm.type_id WHERE sm.is_input = FALSE ORDER BY i.name ") .fetch_all(&self.pool) .await? ...
Rust
0
CTION_SETNULL: char = 'n'; pub const FKCONSTR_ACTION_SETDEFAULT: char = 'd'; /* Foreign key matchtype codes */ pub const FKCONSTR_MATCH_FULL: char = 'f'; pub const FKCONSTR_MATCH_PARTIAL: char = 'p'; pub const FKCONSTR_MATCH_SIMPLE: char = 's'; /* Internal codes for partitioning strategies */ ...
Rust
0
aggregated_category_probabilities.append( category_probabilities) # sort the probabilities in descending order pred_indices = torch.stack(aggregated_category_probabilities ).argsort(descending=True).numpy() result['pred_ca...
Python
1
k times work-size is a huge part of the total work, the remaining work is done with less threads. pub const INIT_WORK_SIZE: usize = 50; pub const WORK_SIZE_PLUS: usize = 30; pub const WORK_SIZE_MINUS: usize = 10; pub const NUM_THREADS: usize = 4; pub const IS_ERR_WHEN_METRIC_IS_ZERO: bool = true; ...
Rust
0
iow!(b'c', 18, 0x48); #[repr(u32)] #[derive(Debug, FromPrimitive)] pub enum BinderDriverCommandProtocol { Transaction = BC_TRANSACTION, Reply = BC_REPLY, AcquireResult = BC_ACQUIRE_RESULT, FreeBuffer = BC_FREE_BUFFER, IncRefs = BC_INCREFS, Acquire = BC_ACQUIRE, Release = BC_RELEASE, Dec...
Rust
0
# -*- coding: utf-8 -*- # By 斯文beast svenbeast.com import os import re import base64 import uuid import subprocess import requests import sys import threadpool from Crypto.Cipher import AES from ..main import Idea requests.packages.urllib3.disable_warnings() JAR_FILE = 'moule/ysoserial.jar' @Idea.plugin_register('C...
Python
1
(if, elif, else) they check if something is true or false and based on that, they run certain parts of the code. control statements: these are bigger group. they include conditional statements and also things l like loops (for, while) and commands that stops or change that how the program runs (break, continue, retur...
Python
1
s::Action::RequestStatus => { let (mytx, myrx) = mpsc::channel(); tx.send(InternalAction::RequestStatus(mytx)).unwrap(); let status = myrx.recv().unwrap(); let status_json = json::encode(&status).unwrap(); return MessageResponse::Response(status_json); } webtypes::Action::Status(_) => { //shouldnt...
Rust
0
// [0] } #[doc="Returns true if CLRENA != 0"] #[inline] pub fn test_clrena<I: Into<::bobbin_bits::R32>>(&self, index: I) -> bool{ self.clrena(index) != 0 } #[doc="Sets the CLRENA field."] #[inline] pub fn set_clrena<I: Into<::bobbin_bits::R32>, V: Into<::bobbin_bits::U1>>(mut self, in...
Rust
0
# SPDX-FileCopyrightText: 2025 German Aerospace Center, Gabriel Möring-Martínez # SPDX-License-Identifier: MIT import pandas as pd from src.load_data_and_prepare_inputs.dimension_names import * def replace_survival_rates_with_country_specific_csp(survival_rates, country_label): """ Replaces the survival rat...
Python
1
if False count of linked records """ from rero_ils.modules.acquisition.acq_orders.api import AcqOrdersSearch from rero_ils.modules.holdings.api import HoldingsSearch acq_orders_query = AcqOrdersSearch().filter("term", vendor__pid=self.pid) hold_query = HoldingsSea...
Python
1
min_heap.push(Reverse(i.clone())); }, _ => {} } }, _ => {} } } let mut bottomk = vec![]; for i in num_...
Rust
0
lah",anchor=W,width=100) tabel_data.column("Kategori",anchor=W,width=150) tabel_data.column("Tanggal Masuk",anchor=W,width=150) tabel_data.column("Tanggal Keluar",anchor=W,width=150) tabel_data.heading("Id barang",text="Id barang",anchor=W) tabel_data.heading("Nama Barang",text="Nama Barang",anchor=W) tabel_data.headi...
Python
1