text
string
label_name
string
labels
int64
2024-01-01 11:00:00') """ ) # Test that different handlers can work with same source replace_handler = ReplaceTransformHandler(duckdb_engine) append_handler = AppendTransformHandler(duckdb_engine) upsert_handler = UpsertTransformHandler(duckdb_engine) replace_st...
Python
1
from .. import IconBase class IconMailWarning(IconBase): class_name = "lucide lucide-mail-warning" svg_data = { "attrs": { "width": "24", "height": "24", "view_box": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke_width": "2", "stroke_...
Python
1
/// ``` /// use piet::{LineJoin, StrokeStyle}; /// /// const CONST_STLYE: StrokeStyle = StrokeStyle::new() /// .dash_pattern(&[5.0, 1.0, 2.0]) /// .line_join(LineJoin::Round); /// /// let style = StrokeStyle::new() /// .dash_pattern(&[10.0, 5.0, 2.0]) /// .dash_offset(5.0); /// /// ``` /// /// [PLRMv3]:...
Rust
0
dst_offset=0, offload_size=50, async_loader=loader, ) task2 = async_offload_with_offset( src_tensor=data1, dst_tensor=data2, src_offset=50, dst_offset=50, offload_size=50, async_loader=loader, ) ...
Python
1
url: Uri, remote_insecure: bool) -> Result<Https> { let dest = match url.path().rsplit('/').next() { Some(d) => d, None => { return Err(anyhow!( "Cannot find infer name of the remote file by looking at {}", url.path() )) } }; Ok(Https { destinatio...
Rust
0
h=hparams.beam_width, tgt_eos=hparams.eos) # Change file name to indicate the file writing is completed. tf.gfile.Rename(output_infer, output_infer_done, overwrite=True) # Job 0 is responsible for the clean up. if jobid != 0: return # Now write all translations with codecs.getwriter("...
Python
1
sition.at(Square::from(file, rank)).0 != Piece::Nil { return; } } // King cannot be in check, pass through check, or end up in check if CASTLE_PERF_TEST_ALL_ATTACKS { let attacked_squares = self.attacked_squares(position, color.other()); let relevant_squares = Bitboard::from(rank) ...
Rust
0
::CustomError; // TODO: add link to docs // Parsing Errors pub const ERROR_PARENTHESES: &str = "list elem type ( ... ) not found"; pub const ERROR_PARENTHESES_END: &str = "invalid argument expect one ',' between each argument or ')' to end the list"; pub const ERROR_NUMBER_AS_IDENT: &str = "Int/Float can't be use...
Rust
0
ent_id, g.alice_knows_bob), (2, g.carol_dislikes_bob.element_id, g.carol_dislikes_bob), ): with pytest.raises(KeyError): assert g.graph.relationships[id_] == rel # type: ignore assert g.graph.relationships[element_id] == rel if not legacy_id: with pytest.rais...
Python
1
bano", &bano_id].iter().collect(); fs::create_dir_all(path.clone()) .await .context(error::TokioIOError)?; let filename = format!("bano-{}.csv", item_id); path.push(filename.clone()); info!(logger, "Downloading bano to {}", path.display()); // FIXME lot's of hardcoded values... ...
Rust
0
alued numpy array # ComplexNumpyMatrix holds a complex-valued numpy array in a real pg matrix # NumpyMatrix # # %%% # Matrix generators # ----------------- # Often, several matrices or even the same one have to be combined. # RepeatHMatrix, RepeatVMatrix, RepeatDMatrix hold a single matrix that is # repeated horizonta...
Python
1
end_from_slice(message_id.as_bytes()); sig_data } <reponame>arjanz/subwasm use log::debug; use std::{fmt::Display, str::FromStr}; /// A Filter struct initially planned to filter module/call /// While module is implemented, the filter on call is not and /// if we filter on call, we may want to also filter on events...
Rust
0
ed under the [W3C Document License][link-license-w3c]. //! - [Web Application Manifest - Application Info (W3C Editor's Draft)][link-w3c-manifest-app-info] by W3C and Editors is licensed under the [W3C Document License][link-license-w3c]. //! - [The Screen Orientation API (W3C Working Draft)][link-w3c-orientation] by W...
Rust
0
d: u16) -> Self { let hour = (encoded >> 11) as u8; let min = ((encoded >> 5) & 0x3F) as u8; let sec = ((encoded & 0x1F) * 2) as u8; Time::default() .with_hour(hour) .with_minute(min) .with_second(sec) } /// Constructs a copy of `self` modifie...
Rust
0
)).unwrap(); for buf in &self.buffers { let duration = buf[self.rows_written]; self.file.as_mut().unwrap().write_all(&format!("{}",duration.as_millis()).as_bytes()).unwrap(); self.file.as_mut().unwrap().write_all(b",").unwrap(); } self.file.as_mut().unwrap().write_all(b"\n").unwrap(); self.file.a...
Rust
0
''' Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers all characters in T, return the empty string "". If there are multipl...
Python
1
("This failed"); } } */ #[derive(Debug, StructOpt)] #[structopt(name = "Abbreviate", about = "Abv-rs options")] struct Opt { /// Activate debug mode // short and long flags (-d, --debug) will be deduced from the field's name #[structopt(short, long)] debug: bool, /// Set lenght of the output ...
Rust
0
T=int(input()) for _ in range(T): print("yes")
Python
1
def _load_state_dict_into_model(model_to_load, state_dict): state_dict = state_dict.copy() error_msgs = [] def load(module: torch.nn.Module, prefix=''): args = state_dict, prefix, {}, True, [], [], error_msgs module._load_from_state_dict(*args) for name, child in module._modules.ite...
Python
1
if !preprocess_result.success() { println!("Preprocessing failed"); std::process::exit(1); } // Run svd2rust let svd2rust_output = Command::new("svd2rust") .arg("-i").arg(svd_out_filename) .output().unwrap(); if !svd2rust_output.status.success() { println!("...
Rust
0
template_system_papers_summary = """ Eres un modelo avanzado de inteligencia artificial especializado en la lectura y análisis de papers académicos. Tu tarea es generar un resumen conciso y claro que capture los puntos más relevantes del documento. Sigue estas instrucciones: 1. **Identifica la estructura del paper*...
Python
1
r substitution")] #[test_case("{{operation}}", "some_identity", "some_operation", "some_resource", "some_operation"; "operation var substitution")] #[test_case("{{identity}}", "some_identity", "some_operation", "some_resource", "so...
Rust
0
class Solution: def kthCharacter(self, k: int) -> str: string = "a" while len(string) < k: new_part = "" for c in string: if c == 'z': new_part += 'a' else: new_part += chr(ord(c) + 1) string ...
Python
1
impl PvfCheckerSubsystem { pub fn new(enabled: bool, keystore: SyncCryptoStorePtr, metrics: Metrics) -> Self { PvfCheckerSubsystem { enabled, keystore, metrics } } } impl<Context> overseer::Subsystem<Context, SubsystemError> for PvfCheckerSubsystem where Context: SubsystemContext<Message = PvfCheckerMessage>, Co...
Rust
0
accelerator.wait_for_everyone() unwrapped_model = accelerator.unwrap_model(model) unwrapped_model.save_pretrained(args.output_dir, save_function=accelerator.save) if (args.push_to_hub and epoch < args.num_train_epochs - 1) and accelerator.is_main_pro...
Python
1
password = str(input("enter password: ")) password2 = str(input(" repeat password: ")) if password2 == password: print('password is correct') else: print('password incorrect')
Python
1
import matplotlib.pyplot as plt import numpy as np MTU = 1500 def session_spectogram(ts, sizes, name=None): plt.scatter(ts, sizes, marker='.') plt.ylim(0, MTU + 100) plt.xlim(ts[0], ts[-1]) # plt.yticks(np.arange(0, MTU, 10)) # plt.xticks(np.arange(int(ts[0]), int(ts[-1]), 10)) plt.title(name...
Python
1
i,i-i.i/i0i1i3iiiiiiiiiiiiiiiiiiiiiiiiiiiiiitContinuesSwitching ProtocolstOKtCreatedtAcceptedsNon-Authoritative Informations No Contents Reset ContentsPartial ContentsMult...
Python
1
Format = wgpu::TextureFormat::Rgba16Sint; } impl<'a> WithDeviceQueuePair for (&'a wgpu::Device, &'a wgpu::Queue) { fn with_device_queue_pair<F, O>(self, f: F) -> O where F: FnOnce(&wgpu::Device, &wgpu::Queue) -> O, { let (device, queue) = self; f(device, queue) } } impl<'a> Wit...
Rust
0
ellable = gio::Cancellable::new(); let send = Fragile::new(send); let obj_clone = Fragile::new(obj.clone()); obj.run_javascript( &script, Some(&cancellable), move |res| { let obj = obj_clone.into_inner(); ...
Rust
0
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLES2 import _types as _cs # End users want this... from OpenGL.raw.GLES2._types import * from OpenGL.raw.GLES2 import _errors from OpenGL.constant import Constant as _C import...
Python
1
#交易所代码, char[9] class SyncingInstrumentMarginRate(BaseStruct): #正在同步中的合约保证金率 def __init__(self, InstrumentID='', InvestorRange=IR_All, BrokerID='', InvestorID='', HedgeFlag=HF_Speculation, LongMarginRatioByMoney=0.0, LongMarginRatioByVolume=0.0, ShortMarginRatioByMoney=0.0, ShortMarginRatioByVolume=0.0, IsRelative...
Python
1
edPtr::null(), _marker: PhantomData } } #[inline] pub const fn cast<U>(self) -> Unprotected<U, R, N> { Unprotected { inner: self.inner.cast(), _marker: PhantomData } } impl_from_ptr_for_nullable!(); impl_from_non_null!(); #[inline] pub fn is_null(self) -> bool { self.i...
Rust
0
Pos: u32 = 8; pub const USART_CR2_LBCL_Msk: u32 = 256; pub const USART_CR2_LBCL: u32 = 256; pub const USART_CR2_CPHA_Pos: u32 = 9; pub const USART_CR2_CPHA_Msk: u32 = 512; pub const USART_CR2_CPHA: u32 = 512; pub const USART_CR2_CPOL_Pos: u32 = 10; pub const USART_CR2_CPOL_Msk: u32 = 1024; pub const USART_CR2_CPOL: u32...
Rust
0
)] pub struct Block(pub Vec<WithLoc<Stmt>>); impl Deref for Block { type Target = Vec<WithLoc<Stmt>>; fn deref(&self) -> &Self::Target { &self.0 } } impl DerefMut for Block { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl Display for Block { fn fmt(&self,...
Rust
0
assert!(num_bins > 0); if min < 0.0 && max <= 0.0 { (min.abs() - max.abs()) / num_bins as f64 } else if min < 0.0 && max > 0.0 { (min.abs() + max) / num_bins as f64 } else if min >= 0.0 && max > 0.0 { (max - min) / num_bins as f64 } else { panic!("oops! shouldn't ge...
Rust
0
c1f31e53bd9603c2d17be416c5e44 /// 26ee4a737f73b6f952ab5e57926fa701848e0a235a0a398300c65759fc4518315 /// 1f2f082d4dcb5e37cb6290012d96f8819c547ba8a4000002f962140000000002a const OMEGA: Fq = field_new!( Fq, BigInteger768([ 9193734820520314185, 15390913228415833887, ...
Rust
0
) ///when the file cannot be opened. /// ///Returns [`CodesError::LibcNonZero`] with [`errno`](errno::Errno) information ///when the stream cannot be created from the file descriptor. /// ///Returns [`CodesError::Internal`] with error code ///when internal [`codes_handle`](eccodes_sys::codes...
Rust
0
ER_NDX_GLOBAL, }; VersionIndex(version_index) } /// Return version information for a given symbol version index. /// /// Returns `Ok(None)` for local and global versions. /// Returns `Err(_)` if index is invalid. pub fn version(&self, index: VersionIndex) -> Result<Option<&Versi...
Rust
0
path(os.path.join(lib_dir, 'taxi', 'src')) def process_f_files(files): lst = {} for f in files: if f[-2:].lower() == '.f': with open(f, 'r') as fp: l = fp.read().split() for f in process_f_files([os.path.join(os.path.dirname(f), x) for x in l]): ...
Python
1
# Copyright 2024-2025 ModelCloud.ai # Copyright 2024-2025 qubitium@modelcloud.ai # Contact: qubitium@modelcloud.ai, x.com/qubitium # # 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...
Python
1
7, 0x47, 0xde, ], [ 0x29, 0x23, 0xbe, 0x84, 0xe1, 0x6c, 0xd6, 0xae, 0x52, 0x90, 0x49, 0xf1, 0xf1, 0xbb, 0xe9, 0xeb, 0xb3, 0xa6, 0xdb, 0x3c, 0x87, 0x0c, 0x3e, 0x99, 0x24, 0x5e, 0x0d, 0x1c, 0x06, 0xb7, 0x47, 0xde, 0x5d, 0x83, 0x31, 0x26, 0x56, 0x0c, ...
Rust
0
parameters::LmotsAlgorithm::LmotsW4, Sha256_192 ); generate_test!( lmots_sha256_n16_w4_verify_test, parameters::LmotsAlgorithm::LmotsW4, Sha256_128 ); generate_test!( lmots_sha256_n32_w8_verify_test, parameters::LmotsAlgorithm::LmotsW8, S...
Rust
0
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
Python
1
roup: "Flags", subgroup: "country-flag", is_variant: false, variants: &[], annotations: &[], }; #[doc = "🇿🇼"] pub const FLAG_ZIMBABWE: crate::Emoji = crate::Emoji { glyph: "🇿🇼", codepoint: "1F1FF 1F1FC", status: crate::Status::FullyQualified, introduction_version: 2f32, name: "fl...
Rust
0
rch.sum(noisy_wav ** 2.0)).to(device) noisy_wav = (noisy_wav * norm_factor).unsqueeze(0) noisy_amp, noisy_pha, noisy_com = mag_pha_stft(noisy_wav, configs.n_fft, configs.hop_size, configs.win_size, configs.compress_factor) amp_g, pha_g, com_g = model(noisy_amp, noisy_pha)...
Python
1
import time class Foo: def method0(self): pass def method1(self): pass def method2(self): pass def method3(self): pass def method4(self): pass def method5(self): pass def method6(self): pass def method7(self): pass def method8(self): pass def method9(sel...
Python
1
/// Marks that this boxed struct has a specific constant type tag /// /// For example, [`Vector<Str>`] is `ConstTagged` because it always has a type tag of `Vector`. As /// a counterexample, [`Num`] is not because it could either have an `Int` or `Float` type tag. /// /// In mathematical terms this can be thought of as...
Rust
0
ating shift left unsigned #[inline] #[target_feature(enable = "neon")] #[cfg_attr(test, assert_instr(sqshlu, N = 2))] #[rustc_legacy_const_generics(1)] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub unsafe fn vqshlus_n_s32<const N: i32>(a: i32) -> u32 { static_assert_imm5!(N); simd_extract(vqshlu_...
Rust
0
# -*- coding: utf-8 -*- from odoo import api, fields, models, _ class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' is_control_button_side_bar = fields.Boolean( related="pos_config_id.is_control_button_side_bar", readonly=False )
Python
1
# combining all the graph above graph = pynini.union( pynutil.add_weight(graph_hundredbillion, -2.0), pynutil.add_weight(graph_tenbillion, -1.9), pynutil.add_weight(graph_billion, -1.8), pynutil.add_weight(graph_hundredmillion, -1.7), pynutil....
Python
1
call_info", ()).await; let agent_info_1: AgentInfo = conductor.call(&alice, "agent_info", ()).await; assert_eq!(agent_info_1.chain_head.1, call_info_1.as_at.1 + 1,); } } use crate::{ common_ng::{ rand_name, server_fixture::{ServerFixture, ServerType, TestConfig}, }, maybe...
Rust
0
fn main() -> ! { // Get access to the device's peripherals. Since only one instance of this // struct can exist, the call to `take` returns an `Option<Peripherals>`. // If we tried to call the method a second time, it would return `None`, but // we're only calling it the one time here, so we can safely...
Rust
0
t.run(args=[url, str(120), str(130)]) r.check_exit_code(0) # the python websocket server does not like 'large' control frames def test_20_06_data_large(self, env: Env, ws_echo, repeat): client = LocalClient(env=env, name='ws-data') if not client.exists(): pytest.skip(f'examp...
Python
1
# coding: utf-8 from django.conf import settings from django.contrib import admin from django.db import models from django.utils.timezone import now from trench.admin import MFAMethod as TrenchMFAMethod from trench.admin import MFAMethodAdmin as TrenchMFAMethodAdmin from kobo.apps.openrosa.apps.main.models import User...
Python
1
ores) } pub fn allocate_memory(&mut self, memory: f32) { self.memory.allocate(memory) } pub fn free_memory(&mut self, memory: f32) { self.memory.free(memory) } pub fn free_cores(&mut self, cores: f32) { self.cores.free(cores) } } <reponame>farrel/tuple-space-server...
Rust
0
#!/usr/bin/env python # This file is part of creddump. # # creddump is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # creddump is di...
Python
1
ms.insert("Sinh_mba", 0x1000db9); keysyms.insert("Sinh_ya", 0x1000dba); keysyms.insert("Sinh_ra", 0x1000dbb); keysyms.insert("Sinh_la", 0x1000dbd); keysyms.insert("Sinh_va", 0x1000dc0); keysyms.insert("Sinh_sha", 0x1000dc1); keysyms.insert("Sinh_ssha", 0x1000dc2); keysyms.insert("Sinh_sa", 0x1000dc3); k...
Rust
0
_sequence[:, 0] t_ave_pred = predicted_sequence[:, 1] scaler = test_dataset.scaler dummy = np.zeros((len(full_time), 5)) dummy[:, 0] = full_time full_time_original = scaler.inverse_transform(dummy)[:, 0] dummy[:, 1] = full_t_min full_t_min_original = scaler.inver...
Python
1
` returns `e1, ..., en` from the current function. Return, } /// A parsed call-like expression. #[derive(Debug)] pub enum CallKind { /// A user-defined constant. Const(Symbol), /// A user-defined global variable. Global(Symbol), /// An application of an [`NAryCall`] to zero or more arguments. NAry(NAryCa...
Rust
0
from sqlalchemy import ( Column, Integer, String, Date, ForeignKey, Float, ) from sqlalchemy.orm import DeclarativeBase from sqlalchemy.dialects.mysql import BIT class Base(DeclarativeBase): pass class Fresadora(Base): __tablename__ = "FRESADORA" numero = Column(Integer, Fore...
Python
1
import numpy as np def make_grid_plain(input): """Make 2D grid from list of lists""" return "\n".join(["".join(map(str, row)) for row in input]) def make_grid_csv_english_words(input): """Make 2D grid from list of lists, comma separated numbers""" # e.g. # one, one, one # eight, one, three ...
Python
1
ignal.wait() # 重点!!这里的 my_id 要修改一下,不然会跟 上一层的 dealer_id 重合,导致 rbc过程失效 member_list = [dealer_id] for i in range(self.n): member_list.append(self.n * (self.rand_instance.mpc_instance.layer_ID) + i) if self.my_id < dealer_id: asyncio.create_task( optqrb...
Python
1
(); let g = g[(m + i - j) % m].clone(); r = r + f * g; } assert_eq!(h, r); } } #[test] fn it_works() { let k = 4; let n = pow(3, k); let mut f_orig = vec![0; n]; OsRng.fill_bytes(&mut f_orig); let f_orig...
Rust
0
mor_pipeline::{Event, EventId}; use tremor_script::{literal, Value, ValueAndMeta}; use value_trait::ValueAccess; /// Find free TCP host:port for use in test server endpoints pub(crate) async fn find_free_tcp_endpoint_str() -> String { let port = find_free_tcp_port().await.unwrap_or(65535); format!("localhost:{...
Rust
0
<H, N>> Future for BackgroundRound<H, N, E> where H: Clone + Eq + Ord + ::std::fmt::Debug, N: Copy + BlockNumberOps + ::std::fmt::Debug, { type Item = BackgroundRoundChange<H, N, E>; type Error = E::Error; fn poll(&mut self) -> Poll<Self::Item, E::Error> { self.task = Some(::futures::task::current()); self.i...
Rust
0
from odoo import fields, models, api class AccountMove(models.Model): _inherit = 'account.move' eletronic_doc_id = fields.Many2one('eletronic.document', string="Nota Fiscal") def _recompute_payment_terms_lines(self): return super(AccountMove, self.with_context(eletronic_doc_id=self.eletronic_doc...
Python
1
MUX_CTRL"] pub hci_pinmux_ctrl: HCI_PINMUX_CTRL, #[doc = "0x2a4 - WL_PINMUX_CTRL"] pub wl_pinmux_ctrl: WL_PINMUX_CTRL, #[doc = "0x2a8 - BT_PINMUX_CTRL"] pub bt_pinmux_ctrl: BT_PINMUX_CTRL, #[doc = "0x2ac - PWM_PINMUX_CTRL"] pub pwm_pinmux_ctrl: PWM_PINMUX_CTRL, _reserved19: [u8; 16usize]...
Rust
0
b struct PxArticulationLink<L, Geom: Shape> { pub(crate) obj: physx_sys::PxArticulationLink, phantom_user_data: PhantomData<(L, Geom)>, } unsafe impl<L, Geom: Shape> UserData for PxArticulationLink<L, Geom> { type UserData = L; fn user_data_ptr(&self) -> &*mut std::ffi::c_void { &self.obj.user...
Rust
0
's>(context: &'c mut Context) -> ChapterIterMut<'s> { ChapterIterMut { context, current: 0, } } } impl<'a> Iterator for ChapterIterMut<'a> { type Item = ChapterMut<'a>; fn next(&mut self) -> Option<<Self as Iterator>::Item> { unsafe { if self.cu...
Rust
0
value is discarded, and will run in the current execution context. These futures are /// more complex to schedule than `future_desync` futures, but the callback function has a shorter lifespan making it easier /// to use when borrowing values. /// pub fn future_sync<'a, TFn, TFuture>(queue: &Arc<JobQueue>, job: TFn) ...
Rust
0
s/blob/develop/rules/committing/commit-message-format/tpope-commit-message-format.md>\n", verbose: "[Info] Included tpope commit message format rule", }, ] } pub fn any_committing(arguments: &ArgMatches) -> bool { committing(&arguments).iter().map(|x| x.flag).any(|x| x) } <filename>src/util...
Rust
0
def iteration_generator_wrapper(self, gen, mode='train'): for g in gen: self.start_iteration(mode=mode) yield g self.end_iteration(mode=mode)
Python
1
nse of that we're dealing with, I've taken the example filter # from earlier (cutoff = 1 kHz, Q = 10, nonlinearity = $\tanh$), and plotted # it's harmonic response for a 100 Hz, and a 2kHz sine wave. #%% fs = 44100 b, a = adsp.design_LPF2 (1000, 10, fs) filter = NLFeedback() filter.setCoefs (b, a) filter.fb_lambda = ...
Python
1
T: crate::core::Actor<crate::core::NullSupervisor>, { type ConfigType = super::JSONConfig; } struct Solution {} impl Solution { pub fn spiral_order(matrix: Vec<Vec<i32>>) -> Vec<i32> { let mut x_start = 0; let mut x_end = matrix[0].len() - 1; let mut y_start = 0; let mut y_en...
Rust
0
from time import sleep from binance import ThreadedWebsocketManager btc_price = {'error':False} def btc_trade_history(msg): if msg['e'] != 'error': print(msg['c']) btc_price['last'] = msg['c'] btc_price['bid'] = msg['b'] btc_price['last'] = msg['a'] btc_price['error'] = Fals...
Python
1
id: response.backing_asset_id, }) } Err(RobloxApiError::ResponseError { status: StatusCode::TOO_MANY_REQUESTS, .. }) => Err(Error::RateLimited), Err(err) => Err(err.into()), } } } } pub struct Non...
Rust
0
oc = "< Sets operation mode to Off, which is manual control."] pub const _spinBalanceWhiteAutoEnums_BalanceWhiteAuto_Off: _spinBalanceWhiteAutoEnums = 0; #[doc = "< Sets operation mode to once. Once runs for a number of iterations and then sets White Balance Auto to Off."] pub const _spinBalanceWhiteAutoEnums_BalanceWh...
Rust
0
folder named RibFrac # 2. The RibSeg masks need to be downloaded from https://zenodo.org/record/5336592 into a new folder named RibSeg # 3. Follow unpacking instruction for the RibFrac dataset as in Task154_RibFrac # 4. Unzip RibSeg_490_nii.zip from the RibSeg dataset and rename the folder labelsTr ri...
Python
1
class Solution: def mostPoints(self, questions: List[List[int]]) -> int: n = len(questions) # dp[i] := max points starting from questions[i] dp = [0] * (n + 1) for i in reversed(range(n)): points, brainpower = questions[i] nextIndex = i + brainpower + 1 nextPoints = dp[nextIndex] if...
Python
1
processamento aos primeiros {max_files} arquivos") all_files = all_files[:max_files] # Mostrar alguns arquivos print("\n📄 Arquivos que serão processados:") for i, file_path in enumerate(all_files[:10]): print(f" {i+1}. {file_path.name}") if len(all_file...
Python
1
# decode_qr.py from PIL import Image from pyzbar.pyzbar import decode def decode_ctf_qr(output_path): # 1) بخوانیم خروجی هگزا را hexstr = open(output_path, 'r').read().strip() # 2) 14 کاراکتر اول را دور می‌اندازیم hex_cipher = hexstr[14:] # 3) به بایت تبدیل می‌کنیم data = bytes.fromhex(hex_ciph...
Python
1
the same code, but taking advantage of the /// migration step to set a new validator. /// /// Note that the contract doesn't enforce permissions here, this is done /// by blockchain logic (in the future by blockchain governance) #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct MigrateMs...
Rust
0
ation casts `x` (in case of `Tensor`) or `x.values` (in case of `SparseTensor` or `IndexedSlices`) to `dtype`. The operation supports data types (for `x` and `dtype`) of `uint8`, `uint16`, `uint32`, `uint64`, `int8`, `int16`, `int32`, `int64`, `float16`, `float32`, `float64`, `complex64`, `complex128`,...
Python
1
'de': ':wenig-geste:', 'es': ':mano_pellizcando:', 'fr': ':pouce_et_index_rapprochés:', 'ja': ':つまんでいる指:', 'ko': ':꼬집는_손:', 'pt': ':mão_beliscando:', 'it': ':mano_che_fa_il_gesto_del_pizzico:', 'fa': ':دست_در_حال_نیشگون_گرفتن:', 'id': ':tangan_menjepit:'...
Python
1
self, path, post_args, get_args): if not self.try_handle_request(path, post_args, get_args): self.send_error(404, 'Can\'t handle: %s' % path) def do_HEAD(self): url_info = self.resolve_url_info() self.handle_request(url_info.path, {}, url_info.args) def do_POST(self): ...
Python
1
new(ck)); Ok(()) } } impl server::ResolvesServerCert for MutResolvesServerCertUsingSni { fn resolve(&self, client_hello: ClientHello) -> Option<Arc<sign::CertifiedKey>> { if let Some(name) = client_hello.server_name() { self.by_name.read().unwrap().get(name).map(Arc::clone) ...
Rust
0
pplied " f"in a rule_binding including any incremental fitlers, e.g.\n```" f"{SAMPLE_DATA_CTE}```" ) custom_sql_arguments = params.get("custom_sql_arguments", "") if custom_sql_arguments: for argument in custom_sql_arguments: if f"${argument}" not in custom_sq...
Python
1
me.sleep(sleep_time) except Exception as e: logger.error(f"Error in background processing: {e}") time.sleep(0.5) logger.info("Background processing thread stopped") def _process_single_frame(self, frame: np.ndarray): """Proce...
Python
1
crate::utils::s3::upload_document(&self.config, self.logger(), file_path, key).await } /// Upload the whole workspace directory to the S3 directory as `workspace.tar`. pub async fn upload_workspace(&self) -> Result<(), failure::Error> { let workspace_tar_key = format!("{}/{}", &self.s3_dir_...
Rust
0
import sqlite3 def create_database(): # Connect to SQLite database (or create it if it doesn't exist) conn = sqlite3.connect('pos.db') c = conn.cursor() # Create 'products' table c.execute(''' CREATE TABLE IF NOT EXISTS products ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT...
Python
1
per.uri branch = self.content_helper.branch commit = self.content_helper.get_top_commit() return "%s:%s:%s" % (uri, branch, commit) class FailedInstaller: """ Class used to be returned instead of the installer if a installation fails Useful to make sure no installer object is used...
Python
1
--- set The node boundary of `nbunch1` with respect to `nbunch2`. Examples -------- >>> G = nx.wheel_graph(6) When nbunch2=None: >>> list(nx.node_boundary(G, (3, 4))) [0, 2, 5] When nbunch2 is given: >>> list(nx.node_boundary(G, (3, 4), (0, 1, 5))) [0, 5] Notes ...
Python
1
ification_type(decoder)?; } Ok(VerificationTypeIter { decoder: old_decoder, remaining: count, current_offset, }) } } impl<'a> Iterator for VerificationTypeIter<'a> { type Item = Result<VerificationType, DecodeError>; fn next(&mut self) -> Option<...
Rust
0
class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def __init__(self): self.head = None def printLL(self): current_node = self.head while current_node: print(current_node.val, end=" -> ") cur...
Python
1
from typing import Any from django.contrib.auth.base_user import BaseUserManager from django.db import IntegrityError class UserManager(BaseUserManager): use_in_migrations = True def create_user(self, username: str, password: str, name: str, **extra_fields: Any): if name is None: raise T...
Python
1
MambaForCausalLM.from_pretrained("state-spaces/mamba-1.4b-hf", torch_dtype=torch.float16).to( torch_device ) output = model.generate(input_ids, max_new_tokens=20, cache_implementation="mamba") output_sentence = self.tokenizer.decode(output[0].tolist()) self.assertEqual(outpu...
Python
1
ighborhood weights of shape [batch_size, x, y] """ batch_size = bmu_indices.shape[0] # Retrieve distance matrix for BMU positions: [batch_size, x*y] distances_sq = coord_distances_sq[bmu_indices] # Calculate triangle weights: [batch_size, x*y] distances = torch.sqrt(distances_sq) triangle_we...
Python
1
from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider from enigma import eRFmod from Components.SystemInfo import SystemInfo # CHECK ME. RFMOD_CHANNEL_MIN = 21 RFMOD_CHANNEL_MAX = 69 + 1 class RFmod: def __init__(self): pass def setFunction(self, value): eRFmod.getInstance().s...
Python
1
import numpy as np import math from xcov import xcov def test_steady_state_M98(x, y): """ Performs the non-stationary ratio test described by Mahrt (1998) after Vitale et al. 2020, Biogeosciences, "Robust data cleaning procedure for eddy covariance flux measurements"" and associated inst_prob_test ...
Python
1