text
string
label_name
string
labels
int64
("pool", cnn::MaxPool::new(pool_spec, None), &crop).unwrap(); model.set_output_outlets(&pool).unwrap(); let input = arr1(&self.input).into_shape((1, self.input.len(), 1)).unwrap().into_dyn(); let model = model.into_typed().unwrap(); proptest_regular_against_pulse(model, self.pulse as _, ...
Rust
0
cloud_block2=True, split_c=True, learn_sigma=False )).to(device=device) ic(model) x = th.zeros((2, 5, 4, 128), device=device) # patch size = 8, 128/8*4=64 patches t = th.zero...
Python
1
_0)?; let expr23_0: Type = I32; let expr24_0 = C::gpr_to_gpr_mem_imm(ctx, expr22_0); let expr25_0 = constructor_sub(ctx, expr23_0, expr14_0, &expr24_0)?; let expr26_0: Type = I32; let expr27_0: u8 = 1; let expr28_0 = Imm8Reg::Imm8 { imm: expr27_0 }; let expr29_0 =...
Rust
0
from enum import Enum from qfluentwidgets import FluentIconBase, Theme, getIconColor from resources import resources_rc class CustomFluentIcon(FluentIconBase, Enum): """Custom icons""" AUTOSTART_BREAK = "autostart_break" AUTOSTART_WORK = "autostart_work" BREAK = "break" WEBSITE_BLOCKER_VIEW = "...
Python
1
}, Some(types::DynamicType::NEEDED) => { r.push(Dynamic { dhtype: types::DynamicType::NEEDED, content: DynamicContent::String(match strtab { None => (Vec::default(),None), ...
Rust
0
else{ Err(WinError::get_last_error()) } } } } impl Drop for OpenGLRenderContext{ fn drop(&mut self){ unsafe{ WinCore.render_context.wgl_make_current(None,None); WinCore.render_context.wgl_delete_context(self.render_context); ...
Rust
0
_atlas.clone(), Vec2::new(-300., -10.), ); bone1(commands, handles.items_atlas.clone(), Vec2::new(200., 200.)); bone2(commands, handles.items_atlas.clone(), Vec2::new(200., 250.)); mug(commands, handles.items_atlas.clone(), Vec2::new(310., 104.)); cubes( commands, handles.ite...
Rust
0
FirstName, authorLastName], references: [firstName, lastName])  |  "#]]; expect.assert_eq(&datamodel::parse_schema(dml).map(drop).unwrap_err()); } #[test] fn should_fail_on_ambiguous_relations_with_automatic_names_1() { let dml = indoc! {r#" model User { id Int @...
Rust
0
import vampytest from ....color import Color from ..fields import put_banner_color def _iter_options(): color = Color.from_rgb(33, 128, 1) yield ( None, False, {}, ) yield ( None, True, { 'brand_color_primary': None, }, ...
Python
1
est MaxPool class""" @tvm.testing.parametrize_targets("llvm") def test_maxpool(self, shape_nhwc, window_size, stride, pad, dtype, target): """Test blocked maxpool""" inputs = [np.random.uniform(0, 255, size=shape_nhwc).astype(dtype)] ref_output = testing.poolnd_python( input...
Python
1
, '/ª': 1, '/«': 1, '/¬': 1, '/\xad': 1, '/®': 1, '/¯': 1, '/°': 1, '/±': 1, '/²': 1, '/³': 1, '/´': 1, '/µ': 1, '/¶': 1, '/·': 1, '/¸': 1, '/¹': 1, '/º': 1, '/»': 1, '/¼': 1, '/½': 1, '/¾': 1, '/¿': 1, '/À': 1, '/Á': 1, '/Â': 1, '/Ã': 1, '/Ä': 1, '/Å': 1, '/Æ': 1, '/Ç': 1, '/È': 1, '/É': 1, '/Ê': 1, '/Ë': 1, '/Ì': 1, ...
Python
1
""" {{ cookiecutter.project_name }}. {{ cookiecutter.project_short_description }} """ import os import {{ cookiecutter.project_slug }} # --------------------------------------------------- # # --------------------- Settings -------------------- # ROOT_PATH = os.environ.get("ROOT_PATH", "") ALLOWED_ORIGINS = os.envi...
Python
1
dedPolygon::N3(ref trigon) => trigon.index(index), BoundedPolygon::N4(ref tetragon) => tetragon.index(index), } } } impl<G> IndexMut<usize> for BoundedPolygon<G> { fn index_mut(&mut self, index: usize) -> &mut Self::Output { match *self { BoundedPolygon::N3(ref mut trigo...
Rust
0
bool, CfdError> { let ope = TransactionOperation::new(&Network::LiquidV1); let option = SigHashOption { sighash_type: *signature.get_sighash_type(), amount: value.to_amount(), value_byte: match value.is_empty() { true => ByteData::default(), _ => value.as_byte_data(), }, ...
Rust
0
# -*- coding: utf-8 -*- # Scrapy settings for travelspider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # https://doc.scrapy.org/en/latest/topics/settings.html # https://doc.scrapy.org/en/latest/...
Python
1
se hex; use output; use output::Output; use parser::ast; use parser::ast::Loc; use resolver; use resolver::address::to_hexstr_eip55; use resolver::cfg::{ControlFlowGraph, Instr, Storage, Vartable}; use resolver::eval::eval_number_expression; use resolver::storage::{array_offset, array_pop, array_push, bytes_pop, bytes_...
Rust
0
, "tbd"]; if let (Some(stem), Some(extension)) = (filename_path.file_stem(), filename_path.extension().and_then(OsStr::to_str)) { if LIB_EXTS.iter().any(|e| e.eq_ignore_ascii_case(extension)) { filename_path = Path::new(stem); strip_performed = true; } } // same, but with dots therearound const LIB_EXTS_...
Rust
0
from rest_framework import serializers from .models import Author, Book, Member, Loan from django.contrib.auth.models import User class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = '__all__' class BookSerializer(serializers.ModelSerializer): author = Autho...
Python
1
e { pub fn init(mysql_options: &MysqlSourceOptions) -> MysqlSource { MysqlSource { options: mysql_options.to_owned() } } } pub struct MysqlSourceConnection<'c> { connection: mysql::PooledConn, source: &'c MysqlSource, } pub struct MysqlSourceBatchIterator<'i> { batch_size: u64, //conn...
Rust
0
#importing necessary libraries import numpy as np import tensorflow from tensorflow.keras.preprocessing import image from keras.layers import GlobalMaxPooling2D from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_input from numpy.linalg import norm import pickle from sklearn.neighbors import Nearest...
Python
1
=["multipod_team", "maxtext"], start_date=datetime.datetime(2025, 5, 20), catchup=False, concurrency=2, ) as dag: quarantine_task_group = TaskGroup( group_id="Quarantine", dag=dag, prefix_group_id=False ) for run_name, test_scripts_details in test_models_tpu.items(): for image in docker_ima...
Python
1
from typing import List class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: low, high = 0, len(matrix) - 1 while low <= high: mid = low + (high - low) // 2 if target < matrix[mid][0]: # This means that the target is in an ...
Python
1
ssage"); } }); std::thread::sleep(std::time::Duration::from_millis(100)); let mut client = std::net::TcpStream::connect("127.0.0.1:42042").expect("Unable to connect to server"); client.set_nodelay(true).expect("Failed to set 'NoDelay'"); std::thread::sleep(std::time::Duration::from_...
Rust
0
import sys import json import logging log = logging.getLogger('wikitables') def ftag(*args): return lambda node: node.tag in args def jprint(obj): if isinstance(obj, str): obj = json.loads(obj) print(json.dumps(obj, indent=2, sort_keys=False, cls=TableJSONEncoder)) def guess_type(value): ...
Python
1
self.model.offset { self.model.select_board(y as usize - 2 + self.model.topline); } else { self.model.select_board(y as usize - 2); } } } } #[inline] fn sync_boundary(&mut self) { if self.model.focus == 0 {...
Rust
0
eader = Header::new(); header.set_code(&code_str); // Reserved class could technically be many codes, so only check // valid items if class != MessageClass::Reserved { assert_eq!(u8::from(class), code); assert_eq!(class, header.code); ...
Rust
0
els are more reliable in volatile markets where significant price movements occur.\n" interpretation_cn += "- **高波动性**:在波动较大的市场中,斐波那契回撤水平更为可靠,因为会发生显著的价格波动。\n" interpretation_en += "- **Avoid in Sideways/Noisy Markets**: Fibonacci levels may produce false signals in choppy or non-trending markets.\n" ...
Python
1
c191f65d9cdaca249c51677f 96562c76450542620db9ed659fc2fd8cce0d21246934fbbed23122bfddd9799ece8b9821e4ab43d1 <KEY> " ); const CRYPTED_KEY: &[u8] = &hex!( " 6dbc5306f8faf060ee49d9dabbee97ea09ea99279d2a4115de5daea89dc45737865bda0274365cee 6097c5af368dd5e490ef9f493aa9d855d38f7d2e44133b8fb386168c1d96...
Rust
0
/// /// Usage: Memory for transient attachment images (color attachments, depth attachments etc.), /// created with `VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT`. /// /// Allocations with this usage are always created as dedicated - it implies /// #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Gpu...
Rust
0
# --------------------------------------------------------------------- # Copyright (c) 2025 Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause # --------------------------------------------------------------------- import pytest from qai_hub_models.models._shared.deeplab.app...
Python
1
# Copyright 2025 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
1
ge_sentence = Markup(f"With experience and grace <strong>{detected_age}</strong>, your fashion reflects sophistication and timeless charm! 💼🎩") elif 51 <= detected_age <= 65: age_sentence = Markup(f"<strong>{detected_age}</strong>, Your style is a perfect mix of refinement, comfort, and effortless...
Python
1
odal::<u32>::_encode(mem::transmute(storage)) } #[inline] unsafe fn _decode(storage: &[u32], n_blks: usize, output: &mut [usize]) -> usize { Unimodal::<u32>::_decode(storage, n_blks, mem::transmute(output)) } } #[cfg(target_pointer_width = "64")] impl EncodePrivate<usize> for Unimodal<usize> { #[inline]...
Rust
0
(index.to_be_bytes()); // Index 4 bytes let command = APDUCommand { cla: EthereumLedgerApp::CLA, ins: 0x02, // get address command code p1: 0x01, // show addr ask user confirmation p2: 0x00, // don't return chain code data, }; let r...
Rust
0
pub struct Writer<W> { inner: bgzf::AsyncWriter<W>, } impl<W> Writer<W> where W: AsyncWrite + Unpin, { /// Creates an async CSI writer. /// /// # Examples /// /// ``` /// use noodles_csi as csi; /// let writer = csi::AsyncWriter::new(Vec::new()); /// ``` pub fn new(inner: W)...
Rust
0
); Enigma::new(rotor, key, "AAA", 'B', "") } /// Given a piece of ciphertext, fitness function, and an `Enigma` instance /// with the correct rotors and first key setting, tries all key and ring /// settings for the mid and fast rotors, and returns an `Enigma` with the /// best rotors, key, and ring settings assi...
Rust
0
F_all, V_F_all) loss = 0.0 for i in range(len(mi_losses)): loss += mi_losses[i] * opt.loss_mi_coefficient1[i] return loss, mis elif stage == 2: if len(C_F_all) == 0: return task_loss, [torch.tensor(0.0) for i in range(8)] mis, mi_losses = model.module....
Python
1
odel = ort.InferenceSession(args.model, providers=providers) model_inputs = model.get_inputs() model_outputs = list(model.get_outputs()) if args.text: text_lines = args.text.splitlines() else: with open(args.file, encoding="utf-8") as file: text_lines = file.read().splitlin...
Python
1
from build123d import * from build123d.build_enums import Align, Mode import math from build123d.topology import Part, Solid from .parameters import * class Pin(BasePartObject): def __init__(self, rotation: tuple[float, float, float] | Rotation = (0, 0, 0), align: Align | tupl...
Python
1
L> where L: Iterator<Item = Text<'b>> + Default, { fn default() -> List<'b, L> { List { block: None, items: L::default(), style: Default::default(), start_corner: Corner::TopLeft, } } } impl<'b, L> List<'b, L> where L: Iterator<Item = Text...
Rust
0
_T1) = (P.X, P.Y, P.Z, P.T); macro_rules! print_var { ($x:ident) => { println!("{} = {:?}", stringify!($x), $x.to_bytes()); }; } let S0 = &X1 + &Y1; print_var!(S0); println!(""); let S1 = X1.square(); let S2 = Y1.square(...
Rust
0
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # 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 ...
Python
1
{ x: self.x * rhs.x, y: self.y * rhs.y, }; } } impl std::ops::RemAssign for Vector2 { fn rem_assign(&mut self, rhs: Vector2) { *self = Self { x: modf(self.x, rhs.x), y: modf(self.y, rhs.y), } } } impl std::ops::MulAssign<f32> for Vector2 { fn mul_assign(&mut self, rhs...
Rust
0
s(white_pieces, white_locations, 'white') screen.fill('dark green') draw_board(square_size, board_offset_x, board_offset_y, WIDTH, HEIGHT, turn_step) draw_pieces(square_size, piece_size, board_offset_x, board_offset_y) draw_captured(square_size, piece_size, board_offset_x, board_offset_y, WIDTH, HEIGHT...
Python
1
Function::from_str("lead")?; let observed = return_type(&fun, &[DataType::Utf8])?; assert_eq!(DataType::Utf8, observed); let observed = return_type(&fun, &[DataType::Float64])?; assert_eq!(DataType::Float64, observed); Ok(()) } #[test] fn test_lag_return_type() -> ...
Rust
0
gleNormal(me.verts[i1].co, me.verts[i2].co, me.verts[i3].co)) < 90: return i3,i2,i1 else: return i1,i2,i3 except: return i1,i2,i3 # This stores new verts that use this vert # used for re-averaging this verts location # based on surrounding verts. looks better but not needed. vert_users =...
Python
1
cluded(RepeatedField::from_vec( to_exclude .iter() .map(mc_mobilecoind_api::external::TxOut::from) .collect(), )); let response = client.get_mixins(&request).unwrap(); let mixins_with_proofs: Vec<mc_mobilecoind_api::TxOutWithProof> = ...
Rust
0
mand { Command::_new(Program::Normal(program.as_ref().to_owned())) } pub fn bat_script<P: AsRef<OsStr>>(program: P) -> Command { Command::_new(Program::CmdBatScript(program.as_ref().to_owned())) } fn _new(program: Program) -> Command { Command { program, ...
Rust
0
"""Constants that define defaults.""" import re EXCLUDE = ( ".svn", "CVS", ".bzr", ".hg", ".git", "__pycache__", ".tox", ".eggs", "*.egg", ) IGNORE = ("E121", "E123", "E126", "E226", "E24", "E704", "W503", "W504") SELECT = ("E", "F", "W", "C90") MAX_LINE_LENGTH = 79 TRUTHY_VALUES =...
Python
1
ialStoragePoint": (-421.4, -270.5, 125, 90, 90, 0),#1 vorne "Vial0": (-425.4, -272.5, -33, 90, 90, 0),#1vorne "Scale":(-288, 292, 102, -90, 90, 0), "VialRestPoint": (-223.5, -296, 250, 90, 90, 0), "PipettePoint": (-367, -282, 250, 90, 90, 0), "PipetteTip1": (-285.5, -293, 400, 90, 90, 0), "Pipet...
Python
1
ntersection<C, RNG>(&self, channel: &mut C, rng: &mut RNG) -> Result<(), Error> where C: AbstractChannel, RNG: RngCore + CryptoRng + SeedableRng<Seed = Block>, { let (mut gb, x, y) = self.compute_setup(channel, rng)?; let outs = fancy_compute_intersection(&mut gb, &x, &y)?; ...
Rust
0
from loguru import logger from terasim.simulator import Simulator from terasim_nde_nade.envs.safetest_nade_with_av import SafeTestNADEWithAV from terasim.logger.infoextractor import InfoExtractor from terasim_nde_nade.vehicle.nde_vehicle_factory import NDEVehicleFactory from pathlib import Path import argparse parser ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, api class ResPartnerMondialRelay(models.Model): _inherit = 'res.partner' is_mondialrelay = fields.Boolean(compute='_compute_is_mondialrelay') @api.depends('ref') def _...
Python
1
ssion to send in Native Token if offer finalizes _value: T::Balance, // Offer amount in Native Token FIXME: would be cool to use offchain worker to get that value in USD _arbitrator: T::AccountId // Escrow arbitrator ) -> Result { let sender = ensure_signed(origin)?; let affiliate_whitelist...
Rust
0
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
Python
1
.manufacturer("usbd-human-interface-device") .product("Keyboard, Mouse & Consumer") .serial_number("TEST") .supports_remote_wakeup(false) .build(); cortex_m::interrupt::free(|cs| { IRQ_SHARED.borrow(cs).replace(Some((usb_dev, composite))); USBCTRL .borrow...
Rust
0
error::Error; use tokio::sync::Mutex; use warp::{ http::StatusCode, reject::{self, Reject}, reply, Rejection, Reply, }; #[derive(Error, Debug)] pub enum Error { #[error("unknown error")] Unknown, #[error("already exists")] Exists, #[error("not found")] NotFound, #[error("name...
Rust
0
num_layers = 2 batch_size = 64 seq_len = 16 hidden_size = 64 num_heads = 16 vocab_size = 32 S = 32 E = 16 deterministic = True self.as_option.allow_mixed_mesh_shape = True mesh_shape = (2, 2) device_mesh = self.get_device_...
Python
1
" with PTPA of " + str(self.address)) def handle_close(self): print(self.address, 'closed') # Save links to other nodes if self.next_node != None: self.next_node.prev_node = self.prev_node if self.prev_node != None: self.prev_node.next_node = se...
Python
1
rt(0), 0); assert_eq!(floor_sqrt(1), 1); assert_eq!(floor_sqrt(2), 1); assert_eq!(floor_sqrt(3), 1); assert_eq!(floor_sqrt(4), 2); assert_eq!(floor_sqrt(5), 2); } } <filename>src/filesystem/mod.rs pub mod background; pub mod files; pub mod hash; pub mod path; pub mod resizer;...
Rust
0
}, util::future::{ButtplugFuture, ButtplugFutureStateShared}, }; use futures::future::{self, BoxFuture}; use js_sys::{DataView, Uint8Array}; use std::{ collections::HashMap, convert::TryFrom, fmt::{self, Debug}, }; use tokio::sync::{broadcast, mpsc}; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use...
Rust
0
# Utilities for the demos import sys import win32api import win32con import win32ui NotScriptMsg = """\ This demo program is not designed to be run as a Script, but is probably used by some other test program. Please try another demo. """ NeedGUIMsg = """\ This demo program can only be run from inside of Pythonwin...
Python
1
\u{1cd4}', '⁓', '⛁', '\u{114b7}', '𔕚', '🥈', '⟤', '𖦀', '𝢠', 'ꗗ', '🆐', '𑠗', '\u{aab0}', '𛀡', 'ը', 'Ɩ', '龜', 'ꊕ', 'ℒ', 'ꔰ', '⋨', '𑄸', '\u{8f7}', '\u{102d}', '\u{1da02}', '嗂', '📰', '𝜖', '𖡩', '᠆', 'ᖮ', '༲', '𘮸', 'ᦶ', '𐳢', '𓋃', '🀨', 'ⳓ', '𑌛', '𞡇', '〻', '𐛲', '𑴒', '𒍁', '𓇆', '𐹻', 'ꃖ', '...
Rust
0
cityscapes_type = "CityscapesDataset" cityscapes_root = "data/cityscapes/" cityscapes_crop_size = (1024, 1024) cityscapes_train_pipeline = [ dict(type="LoadImageFromFile"), dict(type="LoadAnnotations"), dict(type="Resize", scale=(2048, 1024)), dict(type="RandomCrop", crop_size=cityscapes_crop_size, cat_...
Python
1
st = (cur + (" " if cur else "") + w) w_px = draw.textlength(test, font=font) if w_px <= max_width: cur = test else: if cur: lines.append(cur) cur = w if cur: lines.append(cur) return lines ...
Python
1
""" Read a raster file a numpy array with GDAL IMG format files of Kauai downloaded from The National Map http://nationalmap.gov Author: Kelsey Jordahl, Enthought Scipy 2013 geospatial tutorial """ import os import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from osgeo import gdal # GDAL d...
Python
1
pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_CONNECTED_IP_NO: WIFI_MGMR_CONNECTION_STATUS = 3; pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_DISCONNECTED: WIFI_MGMR_CONNECTION_STATUS = 4; pub type WIFI_MGMR_CONNECTION_STATUS = ::cty::c...
Rust
0
3c,0x3c,0x3c,0x3c,0x3c,0x3c,], ct: [0xe3,0x77,0x21,0x29,0x43,0x09,0x7f,0xe6,0xcb,0xf6,0xd6,0xf5,0x7a,0x26,0x6f,0x74,] }, Aes128Test { key: [0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,], pt: [0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,...
Rust
0
_t__bindgen_ty_1), "::", stringify!(__cancel_jmp_buf) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__pthread_unwind_buf_t__bindgen_ty_1>())).__mask_was_saved as *const _ as usize }, 64usize, concat!( "Off...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
return results def predict(self, batch_inputs: Tensor, batch_data_samples: SampleList, rescale: bool = True) -> SampleList: """Predict results from a batch of inputs and data samples with post- processing. Args: batch_inputs (T...
Python
1
&[u8]) -> Result<State, &'static str> { if slice_data.len() == State::size() { let mut ext: Extractor = Extractor::from_slice(slice_data); Ok(State{ mode_system: ModeSystem::from_u8(ext.get_u8()), fps: ext.get_u16(), }) } ...
Rust
0
Convective Inhibition: 0.00 CINS using virtual temperature: 0.00 Bulk Richardson Number: 0.00 Bulk Richardson Number using CAPV: 0.00 Temp [K] of the Lifted Condensation Level: 238.07 Pres [hPa] of the Lifted Condensation Level: 819.54 Equivalent potential temp [K] ...
Rust
0
}; use rand::Rng; pub const MAX_RADIUS: u16 = 10; pub const MIN_RADIUS: u16 = 3; pub const MAX_COLOR_CODE: u8 = 7; pub const MIN_COLOR_CODE: u8 = 0; pub const MAX_CIRCLE_THICKNESS: u16 = 3; pub const MIN_CIRCLE_THICKNESS: u16 = 1; pub const MAX_BAR_THICKNESS: u16 = 5; pub const MIN_BAR_THICKNESS: u16 = 1; pub const R...
Rust
0
"""Exceptions raised by the appconfig service.""" from moto.core.exceptions import JsonRESTError class AppNotFoundException(JsonRESTError): def __init__(self) -> None: super().__init__("ResourceNotFoundException", "Application not found") class ConfigurationProfileNotFound(JsonRESTError): def __ini...
Python
1
# Find the missing numbers from the following list then USE INSERT LIST PYTHON to insert into the list q = [1,2,3,4,6,7,8] q.insert(4,5) print(q) q = [1,2,3,4,5,6,7,9,11] q.insert(7,8) q.insert(9,10) print(q) q = [2,4,10] q.insert(2,6) q.insert(3,8) q = [1,3,7,11,15] q.insert(2,5) q.insert(4,9) q.insert(6,13) print...
Python
1
ocessing engine n_cpu = mp.cpu_count() logger.info( "Using a maximum of {} CPUs to process visualizations in parallel...".format( n_cpu ) ) jobs = [] outfiles = set() for d in recording_dirs: j = Temp() logger.info(f"Adding new export: {d}") j...
Python
1
# -*- coding: utf-8 -*- """ Created on Tue Aug 22 16:14:38 2023 @author: kayvon.daie """ stat = np.load(folder + r'/suite2p_BCI/plane0/stat.npy', allow_pickle=True) Ftrace = np.load(folder +r'/suite2p_BCI/plane0/F.npy', allow_pickle=True) ops = np.load(folder + r'/suite2p_BCI/plane0/ops.npy', allow_pickle=Tru...
Python
1
components: &Rc<Vec<PaintComponent<C>>>, current_target: Option<&Colour>, ) -> PaintComponentListView<A, C>; } impl<A, C> PaintComponentListViewInterface<A, C> for PaintComponentListView<A, C> where A: ColourAttributesInterface + 'static, C: CharacteristicsInterface + 'static, { fn crea...
Rust
0
(); assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); assert_eq!(99, sev.sigev_value.sival_ptr as i64); } // Tests AioWrite.cancel. We aren't trying to test the OS's implementation, // only our bindings. So it's sufficient to check that cancel // returned any AioCancelStat value. ...
Rust
0
anyhow::Result<()> { let opts = match Options::from_args(&[program_name], args) { Ok(opts) => opts, Err(e) => { if e.status.is_err() { bail!(e.output); } else { println!("{}", e.output); } return Ok(()); } }...
Rust
0
.into() } } //! WAV/AIFF specific items pub(crate) mod aiff; pub(crate) mod chunk; pub(crate) mod wav; // Exports pub use aiff::AiffFile; pub use wav::{WavFile, WavFormat, WavProperties}; cfg_if::cfg_if! { if #[cfg(feature = "aiff_text_chunks")] { pub use aiff::tag::AiffTextChunks; pub use aiff...
Rust
0
s.active_miners.checked_add(1).ok_or(Error::<T>::Overflow)?; s.staking = s.staking.checked_add(&staking_val).ok_or(Error::<T>::Overflow)?; Ok(()) })?; Self::deposit_event(Event::<T>::Registered{acc: sender.clone(), staking_val: staking_val.clone()}); Ok(()) } /// Redeem for storage miner....
Rust
0
res, new_ledger_info: LedgerInfo, ) -> Result<Ed25519Signature, Error>; } <gh_stars>0 use super::super::super::qlib::mutex::*; use alloc::sync::Arc; use core::mem; use core::ops::Deref; use core::sync::atomic::AtomicU64; use core::sync::atomic::AtomicUsize; use core::sync::atomic::Ordering; use libc::*; us...
Rust
0
import time from acq4.util.prioritylock import PriorityLock import acq4 def test_prioritylock(): l = PriorityLock() with l.acquire(name="f1") as f1: # test context manager f1.wait(timeout=1) f2 = l.acquire(name="f2") # lock when ready f3 = l.acquire(100, name...
Python
1
_path)); let address = SocketAddr::new( IpAddr::V4(config.network.bind_address.parse().unwrap()), config.network.bind_port, ); let minion = Minion::from_config(config); listen(&address, minion); } // Copyright (c) 2015-2019 <NAME>. Licensed under the Apache License, // Version 2.0 <LIC...
Rust
0
rivateChannel`]. /// /// [`PrivateChannel`]: struct.PrivateChannel.html Private = 1, /// An indicator that the channel is a voice [`GuildChannel`]. /// /// [`GuildChannel`]: struct.GuildChannel.html Voice = 2, /// An indicator that the channel is the channel of a [`Group`]. /// /...
Rust
0
n(None, status="Erro", message=error_msg, output_file=args.output) sys.exit(1) elif input_path.lower().endswith(".pdf"): file_text = extract_text_from_pdf(input_path) if file_text is None: error_msg = f"Falha ao extrair texto do PDF '{input_path}'." format_and_output_...
Python
1
from django.urls import path from . import views app_name = 'dashboard' urlpatterns = [ # index, create, update, delete path('', views.index, name='index'), path('create/', views.create, name='create'), path('in-progress/<int:id>/', views.in_progress, name='in_progress'), path('completed/<int:id>/...
Python
1
from utils.vectors import Vector2D from utils.canvas import CanvasWithBorders from utils.algo_utils import (save_algo, load_algo) from utils.metrics import (save_dict_as_json, load_json_as_dict, plot_metrics, compare_metrics) from utils.simulations import (simulate_episode, simulate_random_episode, dqn_result_format) ...
Python
1
(i32, i32), } impl Position { pub fn zero() -> Self { Self { point: (0, 0) } } pub fn teleport(&mut self, point: (i32, i32)) { self.point = point; } pub fn translate(&mut self, point: (i32, i32)) { self.point = (self.point.0 + point.0, self.point.1 + point.1); } ...
Rust
0
import logging from functools import wraps from flask import Blueprint, request, jsonify, current_app from flask_jwt_extended import get_jwt_identity, jwt_required from . import db from .models import AuditLog logger = logging.getLogger(__name__) audit_bp = Blueprint("audit", __name__, url_prefix="/audit") @audit_bp.ro...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .batch_delete_calendar_event_attendee_request_body import BatchDeleteCalendarEventAttendeeRequestB...
Python
1
(kid) .map_err(|err| Error::Abort(dispatcher::Error::KeyManagerFailure(err)))?; Some(kp.state_key) } else { None }; let store = storage::PrefixStore::new(ctx.runtime_state(), &MODULE_NAME); let instance_prefix = instance_info.id.to_storage_key(); let contract_state = sto...
Rust
0
_NET_SUPPORTING_WM_CHECK, _NET_VIRTUAL_ROOTS, _NET_DESKTOP_LAYOUT, _NET_SHOWING_DESKTOP, // EWMH root messages _NET_CLOSE_WINDOW, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_REQUEST_FRAME_EXTENTS, // EWMH application properties ...
Rust
0
import pysplishsplash as sph import numpy as np import meshio import sys import os class CustomExporter(sph.ExporterBase): def __init__(self, base): sph.ExporterBase.__init__(self, base) self.exportPath = "" self.firstFrame = True def init(self, outputPath): self.expor...
Python
1
# Copyright (C) 2020 # U S Σ R Δ T O R / Ümüd """ UserBot hazırlanışı """ import os import time from re import compile from sys import version_info from logging import basicConfig, getLogger, INFO, DEBUG from distutils.util import strtobool as sb from pylast import LastFMNetwork, md5 from pySmartDL import SmartDL fro...
Python
1
from pathlib import Path from typing import Literal TQDM_BAR_FORMAT = "{l_bar}{bar:10}{r_bar}{bar:-10b}" MODELS = ["ViT-B-32", "ViT-B-16", "ViT-L-14"] OPENCLIP_CACHEDIR = Path(Path.home(), "openclip-cachedir", "open_clip").as_posix() CACHEDIR = None ALL_DATASETS = [ "Cars", "DTD", "EuroSAT", "GTSRB", ...
Python
1
one) minute = kwargs.get("minute", None) day = kwargs.get("day", None) month = kwargs.get("month", None) year = kwargs.get("year", None) if year and len(str(year)) == 2: year = f"20{year}" jobinfo = atq()["jobs"] if not jobinfo: return {"jobs": jobs} for job in jobinfo:...
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.models import BaseFairseqModel, register_model from fairseq.models.wav2vec.wav2vec2_asr import ( Wav2Vec2CtcConfig, Wav2V...
Python
1