text
string
label_name
string
labels
int64
-> *mut ANativeWindow; } extern "C" { pub fn ANativeWindow_toSurface(env: *mut JNIEnv, window: *mut ANativeWindow) -> jobject; } pub const OperandCode_ANEURALNETWORKS_FLOAT32: OperandCode = 0; pub const OperandCode_ANEURALNETWORKS_INT32: OperandCode = 1; pub const OperandCode_ANEURALNETWORKS_UINT32: OperandCode = 2...
Rust
0
20, pady=(20,10), fill="x") def save_config(): self.run_config = { "command": command_var.get(), "args": args_var.get(), "working_dir": working_dir_var.get(), "description": description_var.get() } self....
Python
1
len()); for (value, vec) in self.iter().zip(vec.iter_mut()) { BinaryWrite::write_scalar(vec, &value)?; } Ok(()) } } impl GroupHash for StringColumn { fn serialize(&self, vec: &mut Vec<Vec<u8>>) -> Result<()> { assert_eq!(vec.len(), self.len()); for (value, ve...
Rust
0
-2, 2]): # the height range is the position offset from the center height of the grid for _ in range(nb_loops): # Create the parameters for the random cylinder origin = self.random_in_range(self.origin_range) origin[2] = (self.origin_range[1, 2] + self.origin_range[0,...
Python
1
=> &[LowDutyCycleDirectedAdvertisingState, ConnectionStateSlaveRole], 41 => &[InitiatingState, ConnectionStateSlaveRole], _ => &[], } } /// This function will return all the supported states /// /// The returned supported states will be order...
Rust
0
+= loss.detach() loss.backward() if ddp: dist.all_reduce(loss_accum, op=dist.ReduceOp.AVG) norm = torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) # determine and set the learning rate for this iteration lr = get_lr(step) for param_group in optimizer.param_groups: par...
Python
1
ts)), ) srefs = {off} hrefs = {ref for ref in hrefs if ref >= off} asts = deque() if coff > min(entries.keys()): yield '\t}' l_vars.clear() yield '' # new line yield f'\tverb {semantic_key(entries[coff],...
Python
1
nertia') inertia_errors = [] for i in range(len(inertia_error_tensors)): inertia_errors.append(la.norm(inertia_error_tensors[i])) #methods_mass_errors.append(mass_errors) methods_com_errors.append(com_errors) methods_inertia_errors.append(inertia_errors) #labels...
Python
1
both sides. // // REFERENCES // https://en.wikipedia.org/wiki/Prime_number#Trial_division // https://en.wikipedia.org/wiki/Primality_test // https://stackoverflow.com/q/5811151/183120 if n <= 1 { return false; } // test clean division with existing primes if self ...
Rust
0
and unsealing. It derives a key from the secret, /// which takes a nontrivial amount of time, so it should be created once and re-used for the given /// client_key. pub(super) struct Cryptor { key: aead::LessSafeKey, rng: rand::SystemRandom, } impl Cryptor { pub(super) fn new(client_key: Uuid, secret: &Se...
Rust
0
Some(DemocracyConfig { launch_period: 10 * MINUTES, // 1 day per public referendum voting_period: 10 * MINUTES, // 3 days to discuss & vote on an active referendum minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum public_delay: 10 * MINUTES, max_lock_periods: 6, }...
Rust
0
# pyke.krb_compiler.scanner_tables.py. This file automatically created by PLY (version 3.3). Don't edit! _tabversion = '3.3' _lextokens = {'AS_TOK': 1, 'LP_TOK': 1, 'FOREACH_TOK': 1, 'TAKING_TOK': 1, 'PYTHON_TOK': 1, 'NUMBER_TOK': 1, 'DEINDENT_TOK': 1, 'STEP_TOK': 1, 'EXTENDING_TOK': 1, 'ASSERT_TOK': 1, 'ANONYMOUS...
Python
1
one_of(&[T::Comma, terminator]).span(span); }, |p| p.parse_meta().ok(), ) } } #[cfg(test)] mod tests { use super::*; use crate::parse::test_utils::assert_parse; use crate::parse::Parse; #[test] fn can_parse_meta() { assert_parse("foo", |itn| ast::Meta {...
Rust
0
""" Milvus向量数据库管理器 负责向量数据的存储、检索和管理 """ import yaml import logging import numpy as np from typing import Optional, Dict, Any, List, Union from pymilvus import ( connections, Collection, DataType, FieldSchema, CollectionSchema, utility, Index, db ) from pymilvus.exceptions import MilvusException import json cla...
Python
1
placed = manifest_text.replace(&format!("$({}-namespace)", MAGIC_NUM), &self.config().namespace()); fs::write(manifest_path, replaced).map_err(|e| { FileError(format!( "write android dest project AndroidManifest error {:?}", e ...
Rust
0
vice="cuda") gs_cam.full_proj_transform = proj @ view_mat # gs_cam.full_proj_transform[:2,:]*=-1.0 with torch.no_grad(): results = render( gs_cam, gs_model, pipe=pipe, bg_color=torch.tenso...
Python
1
(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for ProgressType { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum QOSType { ...
Rust
0
_sub( &self, request: Request<RtFindOneByClaimsSubReq>, ) -> Result<Response<RtRes>, Status> { let parent_context = opentelemetry::global::get_text_map_propagator(|propagator| { propagator.extract(&MetadataMap(request.metadata())) }); let span = Span::current(); ...
Rust
0
iled to CSS and placed //! in the build directory. This can be configured by overriding: //! [`BuildArgs::build_sass_from_dir`], [`BuildArgs::sass_lookup_directories`], //! [`BuildArgs::sass_options`] or completely overriden in the [`Hooks::post_build`] hook. //! `sass-rs` is re-exported in the prelude ...
Rust
0
# terminate:结束;停止;终结 # Qus:为什么self.stream and self.audio会有内置函数?他们不是上面弄刚设置None空对象吗?下面也是空对象呀 #because:在_monitor_audio()方法中:self.audio = pyaudio.PyAudio()创建一个新的 PyAudio 对象(实例), # self.stream = self.audio.open()使得self.stream同样具有该对象属性 self.audio = None self.stream ...
Python
1
val, modifier.map(|m| format!(" {}", m)).unwrap_or_default() ), SelectorPart::PseudoElement { ref name, ref arg } => { write!(out, "::{}", name)?; if let Some(ref arg) = *arg { if out.alternate() { ...
Rust
0
) print(len(unique_list)) unique_list.sort(reverse=True) return unique_list if __name__ == '__main__': # merge target_file = r"/home/workdir/tracer/fuzz_tool/conf/test_pass2.txt" target_file1 = r"/home/workdir/tracer/fuzz_tool/conf/mlir_opt.txt" with open(target_file, 'r',encoding="utf-8...
Python
1
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Graphics.Printing.Workflow") try: import winrt.windows.applicationmodel.activation except: pass try: import winrt.windows.foundation excep...
Python
1
measure: bool, count: u32, address: String, ip: String, pace: u64, initial_storage: Option<PathBuf>, ) -> Self { Self { block0_hash, measure, count, address, ip, pace, initial_stor...
Rust
0
'''Write a Python function to sum all the numbers in a list. Sample List : (8, 2, 3, 0, 7) Expected Output : 20''' def sum(n): t=0 for x in n: t+=x return t print(sum((8,2,3,0,7)))
Python
1
def solve(grid): h=len(grid);w=len(grid[0]) coords3=[(y,x) for y in range(h) for x in range(w) if grid[y][x]==3] ys=[y for y,x in coords3]; xs=[x for y,x in coords3] oy,by=min(ys),max(ys); ox,bx=min(xs),max(xs) bxmin, bxmax, bymin, bymax = ox, bx, oy, by for y in range(h): for x in range...
Python
1
temp = eval_depth(depth_pred, depth_trgt) if i == 0: metrics_depth = temp else: metrics_depth = {key: value + temp[key] for key, value in metrics_depth.items()} # placeholder color_im = np.repeat(depth_pred[:, :, np.newaxis] ...
Python
1
msg = "todo" raise NotImplementedError(msg) return self._from_call( lambda _input: CoalesceOperator(_input, ConstantExpression(value)), "fill_null", returns_scalar=self._returns_scalar, ) def cast( self: Self, dtype: DType | type[D...
Python
1
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //! Cell-related errors. use std::fmt; /// Error when borrow failed. #[derive(Debug, Clone, PartialEq)] pub(crate) enum ObjectBorrowErr...
Rust
0
# Copyright 2022 the Regents of the University of California, Nerfstudio Team and contributors. 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....
Python
1
>, } /* * * TurboJPEG instance handle */ pub type tjhandle = *mut libc::c_void; /* * * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one * chrominance component for every 4x1 block of pixels in the source image. * JPEG images compressed with 4:1:1 subsampling will be almost exactly the *...
Rust
0
: if user.user_id in sql_data_by_user_id: sql_data = sql_data_by_user_id[user.user_id] user_data = UserData(sql_data.data, user, domain, profile_id=sql_data.profile_id) else: user_data = UserData({}, user, domai...
Python
1
(max_lr, group["lr"]) weight_decay_value = None for group in optimizer.param_groups: if group["weight_decay"] > 0: weight_decay_value = group["weight_decay"] if log_writer is not None: log_writer.update(min_lr=min_lr, head="opt") log_writer.up...
Python
1
loper.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEvent`, `FocusEventInit`*"] pub fn new_with_focus_event_init_dict( type_arg: &str, focus_event_init_dict: &FocusEventInit, ) -> Result...
Rust
0
acc_a2i, acc_top1_i2a = valid_acc(net, te_img_que_v, te_aud_que_v, te_que_img_label, te_que_aud_label, top=1) print(f"Top1 Accuracy for audio search image (out-classes): {acc_a2i}") print(f"Top1 Accuracy for image search audio (out-classes): {acc_top1_i2a}") ### top1 if tr_acc_a2...
Python
1
() == t_size - i as usize - 1); } // t.print(); t.check_nodes(); } #[test] fn test_rb_remove_leaf_black() { let mut t: TreeRb<isize, isize> = TreeRb::new(); for i in 0..10 { t.insert(i, i); } // t.print(); t.check_nodes(); let t_size = t.len(); let mut count_remove = 0; ...
Rust
0
# -*- coding: utf-8 -*- """ Facade for all models classes """ from typing import Union from torch.nn import Module from . import ClassificationFactory from .backbones.backbone_factory import BACKBONES import logging logging.basicConfig(level=logging.INFO) class ModelFacade: """ Class realize facade pa...
Python
1
app.get("/") async def index(): if UI_TYPE == "base": html_content = open("static/index.html").read() elif UI_TYPE == "screen": html_content = open("static/index-screen.html").read() rtc_configuration = await get_rtc_credentials(provider=TURN_PROVIDER) if APP_MODE == "deployed" else None ...
Python
1
NOW_INSTANCE_NAME}/v_plugin/{pluginId}", "Partition": awsPartition, "Region": awsRegion, "Details": { "Other": { "ServicenowInstance": SNOW_INSTANCE_NAME, "SysId": pluginId, ...
Python
1
""" Write a function to find the pairwise addition of the neighboring elements of the given tuple. assert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18) """ def add_pairwise(t): """ >>> add_pairwise((1, 5, 7, 8, 10)) (6, 12, 15, 18) >>> add_pairwise((1, 2, 3, 4, 5)) (3, 5, 7, 9) >>> add_pai...
Python
1
) @{c80dxqcvkur: '', ki3q25zxlst: p1odc22ev1r, 0.0: None, ikim7dqnlkh: ''} def zkggcz5f5fy(ua9930tox69=0.0, cng7db6y7hq=None, n7018dj_d3m: rdmfpini19q=False, eebs91f1c06: k4ybk0j27jc=0, jppije4vt2a=b'', jyywok37sez=0.0, ox4m6jivtli: wri7cd01sv2='', x_rwbc3rukh=None): """# strain_batteries_message -> battery_recipie...
Python
1
0 >> 7) & 0b1111111 } /// 成る手が否か #[inline] pub fn is_nari(&self) -> bool { (self.0 & 1 << 14) != 0 } /// 獲った駒 #[inline] pub fn obtained(&self) -> Option<ObtainKind> { let o:u32 = self.0 >> 15; if o == 0 { None } else { Some(ObtainKind::kind_from(o-1)) } } } /// 持ち駒を置く手 #[de...
Rust
0
aavsop87::VSOP87Coefficient { a: 0.00000000006, b: 3.14159265359, c: 0.00000000000 } ]; const G_VSOP87_A_VENUS: [aavsop87::VSOP87Coefficient2; 3] = [ aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87_A0_VENUS }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87_A1_...
Rust
0
) -> bool>, pub crtc_set_cursor: Option<unsafe extern "C" fn(_: *mut wlr_drm_backend, _: *mut wlr_drm_crtc, _: *mut gbm_bo) -> bool>, pub crtc_move_cursor: Option<unsafe ex...
Rust
0
es.NODE_ID_OPTION.keyword: NODE_ID} self.strategy.retrieve_schedules(kwargs) # Verify self.api.list_schedules.assert_called_once_with(sync_schedules.SYNC_OPERATION, NODE_ID) def test_update(self): # Test schedule_id = 'abcdef' kwargs = {sync_schedules.NODE_ID_OPTION...
Python
1
print("hello world!") print("hello again!") print("hello again again!")
Python
1
egister_data = register_data | data self.set_config(register_data) def analog_read(self, channel): """ Reads the analog voltage in Volts """ config = None # Variable declaration datum_a = None # Variable declaration datum_b = None # Variable declaration ...
Python
1
//! Using a minimum number of digits less than 5 risks the possibility of stripping demangled name //! components with a similar pattern. For example, some closures instantiated multiple times //! include their own disambiguators, demangled as non-hashed zero-based indexes in square brackets. //! These disambiguators ...
Rust
0
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-present Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram 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 F...
Python
1
add(gap); }); } } pub fn update_file_keys_count_fee() { let files_count = Self::files_count(); if files_count > FILES_COUNT_REFERENCE { // TODO: Independent mechanism <FileKeysCountFee<T>>::mutate(|file_keys_count_fee| { let gap = (T::...
Rust
0
import FWCore.ParameterSet.Config as cms # Use compressiong settings of TFile # see https://root.cern.ch/root/html534/TFile.html#TFile:SetCompressionSettings # settings = 100 * algorithm + level # level is from 1 (small) to 9 (large compression) # algo: 1 (ZLIB), 2 (LMZA) # see more about compression & performance: ht...
Python
1
on as e: print(f"Error checking naming conventions: {e}") return errors def _check_required_patterns(self, content: str) -> List[str]: """Check for presence of required code patterns""" errors = [] try: # Simple text-based pattern checking ...
Python
1
# coding=utf-8 # Copyright 2025 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
Python
1
# torch import torch import torch.optim import torch.utils.data # built-in import numpy as np # Taken from https://github.com/tscohen/gconv_experiments/tree/master/gconv_experiments (Cohen & Welling, 2016) def preprocess_mnist_data(train_data, test_data, train_labels, test_labels): train_mean = np.mean(train_data...
Python
1
counterflow flame. Two opposed jets of the same composition shooting into each other. """ __slots__ = ('reactants', 'flame', 'products') def __init__(self, gas, grid=None, width=None): """ :param gas: `Solution` (using the IdealGas thermodynamic model) used to ev...
Python
1
import json import os from pathlib import Path configkey = ["BANKLEVEL"] CONFIG = { "BANKLEVEL" : { #钱庄等级参数。savemax:当前等级可以存储上限,levelup:升级钱庄等级消耗的灵石数量,interest:每小时给与的利息,level:当前等级会员的名称 "1":{"savemax":100000,"levelup":20000,'interest':0.002,"level":"普通会员"}, "2":{"savemax":200000,"levelup":40000,'interest'...
Python
1
} impl ToStr<$signed> { pub const fn output_len(&self) -> usize { let x = self.0; let abs_len = ToStr(x.unsigned_abs()).output_len(); abs_len + (x < 0) as usize } pub const fn const_eval<const N: usize>(&self) -> StrBuf<N...
Rust
0
Project Types", ) def find_project_types_stored(): all_ada_sources = [ x for x in GPS.Project.root().sources(recursive=True) if x.language().lower() == "ada" ] for source_file in all_ada_sources: flag_s...
Python
1
"audio_input", user_key=key, form_id=current_form_id(self.dg), dg=self.dg, label=label, help=help, width=width, ) audio_input_proto = AudioInputProto() audio_input_proto.id = element_id audio_input_proto...
Python
1
10]); root } /// Determine whether two trees are equal by recursing into all branches fn trees_equal(a: &RcPath, b: &RcPath) -> bool { if a != b { return false; } if let Some(a_children) = &a.borrow().children { if let Some(b_children) = &b.borrow().children { if a_children.len() != b_children.le...
Rust
0
# SPDX-FileCopyrightText: 2022 PeARS Project, <community@pearsproject.org>, # # SPDX-License-Identifier: AGPL-3.0-only '''Spider code, heavily influenced by http://www.netinstructions.com/how-to-make-a-web-crawler-in-under-50-lines-of-python-code/.''' from html.parser import HTMLParser from urllib.request import u...
Python
1
#!/usr/bin/env python3 import numpy as np sensitivity = __import__('1-sensitivity').sensitivity if __name__ == '__main__': confusion = np.load('confusion.npz')['confusion'] np.set_printoptions(suppress=True) print(sensitivity(confusion))
Python
1
unreachable!("CucumberEvent::Finished must be fired") } /// Convenience function to run all tests and exit with error code 1 on failure. pub async fn run_and_exit(self) { let code = if self.run().await.failed() { 1 } else { 0 }; std::process::exit(code); } } use crate::{Bytes, c...
Rust
0
} } } <filename>src/spawner/template.rs use crate::prelude::*; use legion::systems::CommandBuffer; use macroquad::rand::ChooseRandom; use nanoserde::DeRon; #[derive(Clone, Debug, DeRon)] pub struct Template { pub entity_type: EntityType, pub levels: Vec<usize>, pub frequency: i32, pub name...
Rust
0
E_DATA: &str = "certificate-data"; const ARG_PRIVATE_KEY_FILE: &str = "private-key-file"; const ARG_PRIVATE_KEY_DATA: &str = "private-key-data"; const ARG_PROVISIONER_PUBLIC_KEY_FILE: &str = "provisioner-public-key-file"; const ARG_PROVISIONER_PUBLIC_KEY_DATA: &str = "provisioner-public-key-data"; const ARG_DELEGATION_...
Rust
0
- address //! //! The IP address for which the port mapping should be added. This field can //! be empty, in which case every connected interface will be tried, until one //! gateway reports success. Useful if the IP address is dynamic and not //! consistent over reboots. //! //! Fill in an IP ad...
Rust
0
nterpolated from samples at 2 ms intervals (average). #[inline] pub fn envelope<E, R>(f: E) -> An<Envelope<f64, f64, E, R>> where E: Fn(f64) -> R, R: ConstantFrame<Sample = f64>, R::Size: Size<f64>, { An(Envelope::new(0.002, DEFAULT_SR, f)) } /// Control envelope from time-varying function `f(t)` with ...
Rust
0
plugin_mut().as_ref().expect("plugin was not initialized") } } } use crate::server::{Error, StoreAddrResolver}; use kvproto::kvrpcpb::{ GetCommittedIndexAndTsRequest, GetCommittedIndexAndTsResponse, ReadIndexRequest, }; use kvproto::tikvpb; use kvproto::tikvpb::TikvClient; use grpcio::{ChannelBuilder,...
Rust
0
IVE_LOCATION); p.bump(SyntaxKind::VARIABLE_DEFINITION_KW); } "SCHEMA" => { let _g = p.start_node(SyntaxKind::DIRECTIVE_LOCATION); p.bump(SyntaxKind::SCHEMA_KW); } "SCALAR" => { let _g = p.start_node(SyntaxKin...
Rust
0
ertToPointerRoot: i32 = xlib::RevertToPointerRoot; pub const CurrentTime: u64 = xlib::CurrentTime; pub const FocusChangeMask: i64 = xlib::FocusChangeMask; pub const PropertyChangeMask: i64 = xlib::PropertyChangeMask; pub fn mod_masks() -> u32 { let ret = CONFIG .key_bindings .iter() .filt...
Rust
0
import re from functools import partial def process_docs(dataset, subject): return dataset.filter(lambda x: x["category"] == subject) def fewshot_to_text(example): text = example["cot_content"].removeprefix("A: Let's think step by step.").strip() return re.sub(r"The answer is \(([A-Z])\)\.", r"The best ...
Python
1
Batch<Item = Mbuf> { batch.filter(|_p| false) } #[capsule::bench(mempool_capacity = 511)] fn filters_batch(c: &mut Criterion) { let mut group = c.benchmark_group("combinators::filter"); group.bench_function("combinators::filter_true", |b| { let s = any::<Mbuf>(); b.iter_proptest_combinato...
Rust
0
D, 0xA0, 0x06, 0xDB, 0x7E, 0x08, 0x67, 0x59, 0x16, 100} DEFINE_PROPERTYKEY! {PKEY_Identity_QualifiedUserName, 0xDA520E51, 0xF4E9, 0x4739, 0xAC, 0x82, 0x02, 0xE0, 0xA9, 0x5C, 0x90, 0x30, 100} DEFINE_PROPERTYKEY! {PKEY_Identity_UniqueID, 0xE55FC3B0, 0x2B60, 0x4220, 0x91, 0x8E, 0xB2, 0x1E, 0x8B, 0xF1, 0x60, 0x16, 100} DEF...
Rust
0
't Txid>, { let txs_string: Result<Vec<String>, Error> = impl_batch_call!(self, txids, transaction_get); txs_string? .iter() .map(|s| Ok(Vec::<u8>::from_hex(s)?)) .collect() } fn batch_block_header_raw<'s, I>(&self, heights: I) -> Result<Vec<Vec<u8>>, Err...
Rust
0
from couchers.proto import ( account_pb2_grpc, admin_pb2_grpc, api_pb2_grpc, auth_pb2_grpc, blocking_pb2_grpc, bugs_pb2_grpc, communities_pb2_grpc, conversations_pb2_grpc, discussions_pb2_grpc, donations_pb2_grpc, events_pb2_grpc, groups_pb2_grpc, jail_pb2_grpc, m...
Python
1
S']._serialized_end=1442 _globals['_TRANSFORMERPARAMETERS_ATTENTIONMASKTYPE']._serialized_start=1444 _globals['_TRANSFORMERPARAMETERS_ATTENTIONMASKTYPE']._serialized_end=1504 _globals['_TRANSFORMERPARAMETERS_ACTIVATION']._serialized_start=1506 _globals['_TRANSFORMERPARAMETERS_ACTIVATION']._serialized_end=1576 ...
Python
1
M_0': [480, 360], 'zS4G-dKS3dg_0': [640, 360], 'zU0g6JCyxAs_2': [480, 360], 'zU9O4EpnP8g_0': [320, 240], 'zUYNrm52mG8_0': [1280, 720], 'zVVQ63dPpe4_2': [1280, 720], 'zW4j5HFdFCE_1': [480, 360], 'zW9G9_luulU_6': [1280, 720], 'zW9G9_luulU_8': [1280, 720], 'zWQQBElMPYI_0': [480, 360], 'zX70EOhK1IA_0': [480, 360], 'zX70EOh...
Python
1
ron, str( ... "Please set MALT_PARSER in your global environment, e.g.:\n" ... "$ export MALT_PARSER='/home/user/maltparser-1.9.2/'") >>> >>> assert 'MALT_MODEL' in os.environ, str( ... "Please set MALT_MODEL in your global environment, e.g.:\n" ... "$ export MALT_MODEL='/home/user/engmalt.linea...
Python
1
checkers(&mut checkers, self.all); SentryLogsStatsExecutor::new(checkers) } pub fn exec(self) -> Result<(), Error> { let mut checker = self.build_checkers(); let logs_reader = open_file_read(&Some(self.file))?; let logs: Vec<RawLog> = serde_json::from_reader(logs_reader)?; ...
Rust
0
!can_have_body { url.set_query(Some(&body)); } let rb = client.client.request(self.method, url) .basic_auth(client.ikey.clone(), Some(signature)) .header("Date", self.date.to_rfc2822()) .header("User-Agent", concat!("duo-auth-rs/", env!("CARGO_PKG_VERSION...
Rust
0
) time.sleep(2) break except Exception as e: print(f"Error processing row: {e}") driver.back() WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.CSS...
Python
1
()); Some(()) } fn make_discriminant() -> Option<ast::Expr> { Some(make::expr_path(make::ext::path_from_idents(["core", "mem", "discriminant"])?)) } <gh_stars>0 use crate::coord::CoordState; use crate::test_utils::CheckCtx; // -----------------------------------------------------------------------------------...
Rust
0
THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHE...
Rust
0
ype::Image) } Some("matte/noise") => { lambertian::load_from_json(&values[id][i], TextureType::Noise) } Some("metal/constant") => { metal::load_from_json(&values[id][i], TextureType::Constant) ...
Rust
0
} else if bytes.as_ref()[0..std::mem::size_of::<DummyRecord>()] .iter() .any(|x| context.disallowed[*x as usize]) { Err(()) } else { parse_dummy_rec(bytes) } } } // // Stateful context records //...
Rust
0
tinue; } let idx: SectorIdx = sliced[0].parse().unwrap(); let ts: u64 = sliced[1].parse().unwrap(); let wr: u8 = sliced[2].parse().unwrap(); match metadata[(idx % WORKERS_NUM) as usize].entry(idx.clone()) { Entry::Occupied(mut o) => { ...
Rust
0
MeansInit::Random, KMeansInit::KMeansPlusPlus, KMeansInit::KMeansPara, ] { // First clustering with one iteration let dataset = DatasetBase::from(data.clone()); let model = KMeans::params_with(3, rng.clone(), dist_fn.clone()) .n_runs(1)...
Rust
0
], ))) } pub fn isinf_load( builder: &mut ModelBuilder, invocation: &ResolvedInvocation, ) -> TractResult<TVec<OutletId>> { let input = invocation.named_arg_as(builder, "input")?; let detect_positive = invocation.named_arg_as(builder, "detect_positive")?; let detect_negative = invocation.nam...
Rust
0
from django.test import TestCase from ..models import Address, Country, State, Locality from ..services import ArcGISGeocodingService class ArcGISGeocodingServiceTest(TestCase): def test_parse_success(self): """ Test the successful parsing of an address using ArcGISGeocodingService. """ ...
Python
1
f.write(f"计划失败,返回代码: {plan_process.returncode}\n") controller_ref.logger.error(f"Terraform计划失败: {stderr}") # 更新状态为失败 controller_ref.deploy_model.update_deployment_status( deploy_id...
Python
1
](x) # outs.append(x_out) return x, feature_out class TransposedConvLayer(nn.Module): def __init__(self, dim_in, dim_out, head, r): super(TransposedConvLayer, self).__init__() self.transposed1 = nn.ConvTranspose3d(dim_in, dim_o...
Python
1
class TreeNode: def __init__(self, data): self.data = data self.children = [] def add_child(self, child_node): self.children.append(child_node) def display_hierarchy(self, level=0): print(" " * level + self.data) for child in self.children: child.displa...
Python
1
from tests import expect import pytest @pytest.mark.swag_ui def test_add_to_cart_button(swag_ui, app_config, reporter): """ This test verifies the functionality of add to cart button. It finds the first item on the list, clicks on add to cart button and verifies it changes to 'Remove' and the item is ...
Python
1
) { let bytes: Vec<u8> = self.pk_to_key_slice(); context.update(&bytes); } } impl Serialize for RistrettoCurvPoint { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, { let bytes = self.pk_to_key_slice(); let bytes_as_bn = BigI...
Rust
0
# Importing Streamlit for building the web-based interactive application framework import streamlit as st # Function to Display Model Performance def display_hybrid_model_performance(): # Basic HTML table without additional styling html_content = """ <h5>Regression Model Performance Overview</h5> <p>T...
Python
1
} pub fn disable_edns(&self) { self.edns.store(false, Ordering::Relaxed); } pub fn prepare_message(&self, query: &mut QueryBuilder) { query.revert_additional(); if self.does_edns() { let use_dnssec = query.use_dnssec(); query.add_opt(|opt| { ...
Rust
0
in range(nB): vec = np.subtract(candB[j][:2], candA[i][:2]) #两点之间的坐标向量 norm = math.sqrt(vec[0] * vec[0] + vec[1] * vec[1])## 向量的模 if norm == 0: continue vec = np.divide(vec, norm)## 单位向量 ##一个资态...
Python
1
.refigure_point_types(); let mut kurbo_vec = vec![]; for (pi, point) in self.iter().enumerate() { kurbo_vec.push(match point.ptype { PointType::Move => PathEl::MoveTo(point.as_kpoint()), PointType::Line => PathEl::LineTo(point.as_kpoint()), Po...
Rust
0
""" ================== Histogram matching ================== This example demonstrates the feature of histogram matching. It manipulates the pixels of an input image so that its histogram matches the histogram of the reference image. If the images have multiple channels, the matching is done independently for each cha...
Python
1
} } mod ranged { use super::*; #[tokio::test] async fn from_block_0_to_1() { // zcashd: pass let range = (0, 1); let response = run_test_case(GetHeaders::from_indices(range.0, Some(range.1))) .await .unwrap(); let expected = Response::headers_wi...
Rust
0