text
string
label_name
string
labels
int64
'—from-version' argument to override the version " "retrieved from secure storage when calculating upgrades to " "be run." ), ) parser.add_argument( "--named-tag", action="append", env_var="ACAPY_UPGRADE_NAMED_TAGS", ...
Python
1
import re from .common import InfoExtractor from ..utils import ( int_or_none, NO_DEFAULT, parse_duration, str_to_int, ) class DrTuberIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|m)\.)?drtuber\.com/(?:video|embed)/(?P<id>\d+)(?:/(?P<display_id>[\w-]+))?' _EMBED_REGEX = [r'<iframe[^>]+...
Python
1
import torch import bass_cuda class PairwiseDistFunction(torch.autograd.Function): @staticmethod def forward(self, pixel_ftrs, spixel_ftrs, init_spixel_indices, num_spixels_width, num_spixels_height): self.num_spixels_width = num_spixels_width self.num_spixels_height = num_spix...
Python
1
vec![ "A.TXT".as_lit_expr(1, 6), FILE_MODE_RANDOM.as_lit_expr(1, 18), FILE_ACCESS_UNSPECIFIED.as_lit_expr(1, 1), 1.as_lit_expr(1, 28), 64.as_lit_expr(1, 37) // rec-len% ] ) ...
Rust
0
mem.write_word(ADDR, 0x76821712).unwrap(); // Is it little-endian? assert_eq!(mem.mem[ADDR as usize], 0x12); assert_eq!(mem.mem[(ADDR + 1) as usize], 0x17); assert_eq!(mem.mem[(ADDR + 2) as usize], 0x82); assert_eq!(mem.mem[(ADDR + 3) as usize], 0x76); } #[test] ...
Rust
0
* t3 + 2 * z5 result.c1.c2 = { let mut cs = cs.ns(|| "result.c1.c2"); t3.add(cs.ns(|| "1"), &z5)? .double(cs.ns(|| "2"))? .add(cs.ns(|| "3"), &t3)? }; Ok(result) } else { fe.square(cs.ns(|| "...
Rust
0
.map(|s| { s.trim() .chars() .map(|c| match c { '#' => 1, '.' => 0, _ => unreachable!(), }) .collect() }) .collect(); let algorithm = &lines[0]; let map = &line...
Rust
0
gecko) and Chrome use UTF-8 directly as above. (And now, only UTF-8 is handled by this implementation.) */ let a = HeaderValue::from_str("form-data; name=upload; filename=\"文件.webp\"") .unwrap(); let a: ContentDisposition = ContentDisposition::from_raw(&a).unwrap(); l...
Rust
0
e(int) model = Sequential([ Dense(16, activation='relu', input_dim=len(features)), Dense(8, activation='relu'), Dense(1, activation='sigmoid') ]) model.compile(optimizer=Adam(learning_rate=0.001), loss='binary_crossentropy', metrics=['accuracy']) X_train_nn, X_test_nn, y_train_nn, y_test_nn = train_test_...
Python
1
0 * 24 * 28)).await; srv_handle.stop(true).await; }); srv.await?; Ok(()) } <reponame>stillinbeta/PostgresPlaysPokemon extern crate grpc; extern crate pg_extend; extern crate pg_extern_attr; extern crate ppp_client; use pg_extend::pg_fdw::{ForeignData, ForeignRow, OptionMap, Tuple}; use pg_extend:...
Rust
0
# Practical 5 # 1 t1 = (12, 23, 34, 45, 56) print(min(t1)) print(max(t1)) # 2 def find_repeated_numbers(my_tuple): return [num for num in my_tuple if num in set(my_tuple) and my_tuple.count(num) > 1] # Example usage my_tuple = (1, 2, 3, 2, 4, 5) repeated_numbers = find_repeated_numbers(my_tuple) if repeated_num...
Python
1
import torch from transformers import ( AutoConfig, AutoModelForTextEncoding, AutoTokenizer, CLIPTextConfig, ) from .base import TextFeatureExtractor class AutoModelTextFeatureExtractor(TextFeatureExtractor): def __init__(self, tokenizer, model): super().__init__() self.tokenizer ...
Python
1
ates so we can grab the top-left and bottom-left # points, respectively leftMost = leftMost[np.argsort(leftMost[:, 1]), :] (tl, bl) = leftMost rightMost = rightMost[np.argsort(rightMost[:, 1]), :] (tr, br) = rightMost rect = np.array([tl, tr, br, bl], dtype='float32') ...
Python
1
from django.contrib.admin import ModelAdmin from django.contrib.admin.options import StackedInline from django.forms import ModelForm from django.urls import reverse_lazy from judge.models import TicketMessage from judge.widgets import ( AdminHeavySelect2MultipleWidget, AdminHeavySelect2Widget, HeavyPrevie...
Python
1
md_test(enable = "avx512bw")] unsafe fn test_mm512_mask_permutex2var_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); #[rustfmt...
Rust
0
"Field `UCADDMASK1` writer - I2C Address Mask Bit 1"] pub struct UCADDMASK1_W<'a> { w: &'a mut W, } impl<'a> UCADDMASK1_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] ...
Rust
0
# check if geojson is installed try: import geojson geom = geojson.GeoJSON.to_instance(self._obj) except ImportError: # no geojson installed. remove object ...
Python
1
Iterator + 'static + Clone + Send + Sync, I::IntoIter: Send, I::Item: ArconType, { let mut conf = SourceConf::default(); f(&mut conf); let builder = SourceBuilder { constructor: Arc::new(move |_| i.clone().into_iter()), conf, }; self.s...
Rust
0
s themselves." tts_weights = args.tts_weights paths = Paths(hp.data_path, hp.voc_model_id, hp.tts_model_id) device = torch.device('cpu') print('Using device:', device) print('\nInitialising Forward TTS Model...\n') tts_model = ForwardTacotron(embed_dims=hp.forward_embed_dims, ...
Python
1
0; 1000]; let size = incoming.read(&mut buffer)?; buffer.truncate(size); let message = bincode::deserialize(&buffer)?; tx.blocking_send(message)?; Ok(()) } pub type IpcReceiver<T> = mpsc::Receiver<T>; pub fn start_server<T: Send + Sync + 'static + for<'de> Deserialize<'de> + Debug>( ) -> anyhow...
Rust
0
): count_check = 0 exit_msg = pyoptions.CRLF + cool.fuchsia("[!] Build items more than pyoptions.count_switcher: %s%s" "[!] Modify /lib/data/data.py count_switcher to adjust it" % (str(pyoptions.count_switcher), pyoptions....
Python
1
OK, None)?; let bye_tsx = endpoint.create_server_tsx(&bye); let invite_response = dialog.create_response(&invite, Code::REQUEST_TERMINATED, None)?; let (r1, r2) = tokio::join!( invite_tsx.respond_failure(invite_response), bye_tsx.respond(bye_response) ); ...
Rust
0
import pymongo import pickle import os import numpy as np # Replace with your actual MongoDB URI mongo_uri = "hidden" # Connect to MongoDB client = pymongo.MongoClient(mongo_uri) db = client['users'] collection = db['faces'] # Directory containing the pickle files pickle_directory = './db' # Adjust the path as need...
Python
1
{ None } } } #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord)] pub enum Qps { Unlimited, Limited(u32), } impl Qps { /// Returns `true` if the qps is [`Unlimited`]. #[allow(dead_code)] pub fn is_unlimited(&self) -> bool { !self.is_limited() } //...
Rust
0
import FWCore.ParameterSet.Config as cms # The services from RecoMuon.TrackingTools.MuonServiceProxy_cff import * # parametrization for initial pT from RecoMuon.MuonSeedGenerator.ptSeedParameterization_38T_cfi import ptSeedParameterization from RecoMuon.MuonSeedGenerator.MuonSeedPtScale_cfi import dphiScale SETMuonSe...
Python
1
# 파일명 정렬 # head, number, tail로 구분해서 정렬 def solution(files): answer = [] li = list() for i in files: head = "" j = 0 while (not i[j].isnumeric()): head += i[j] j += 1 number = "" while (i[j].isnumeric()): number += i[j...
Python
1
g_steamers_july -> travel_police_purchaser' assert dtddcipvsfc del e2umo7xzl4u l42yy2qqg7f >>= i0m2_dylq3x def wuorzln7p9k(): 0 .lae42mqe9i2: '' = rzz665d8_sq global sg1n4pmvbk6 '# bang_steamers_july -> travel_police_purchaser' pass from j7hc0glsld4 import hrmdruwf1df, co26zavxsp5 as bhl...
Python
1
todo!("Unknown PCI ID {:#x}", v), v @ 0x1040 ..= 0x107F => v - 0x1040, v @ _ => panic!("BUGCHECK: Binding with unexpected PCI device id {:#x}", v), }; let mut common_bar = None; let mut device_cfg_bar = None; let mut notify_bar = None; for cap in pci_helpers::CapabilityIter::new(&*bus_dev) { mat...
Rust
0
+= len; Ok(slice) } /// Reads a nested message /// /// First reads a varint and interprets it as the length of the message #[cfg_attr(std, inline)] pub fn read_message<'a, M>(&mut self, bytes: &'a [u8]) -> Result<M> where M: MessageRead<'a>, { self.read_len_vari...
Rust
0
-> {}, {}", stack, dest1, dest2); let (reg1, id1, loc1) = self.prepare_reg(dest1, 3 + 1); let (reg2, id2, loc2) = self.prepare_reg(dest2, 3 + 1 + reg1.len() + 1); let (reg3, id3, loc3) = self.prepare_reg(stack, 3 + 1 + reg1.len() + 1 + reg2.len() + 1 + 1); let asm = format...
Rust
0
; } println!(); } print!("+"); for _ in 0..Self::WIDTH { print!("-+"); } println!(); } fn winner(&self) -> Option<bool> { let latest_posn_i = self.latest_move; let latest_posn_j = { let h = self.heights[late...
Rust
0
P", part.part_id(), info) .unwrap(); attr_p .set( part.part_id(), &[0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0], ) .unwrap(); geo.set_vertex_list(0, [0, 1, 2]).unwrap(); geo.set_face_counts(0, [3]).unwrap(); ...
Rust
0
=> { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( $(iter.next().unwrap().parse::<$t>().unwrap(),)* ) } }; ($t:ty; $n:expr) => { ...
Rust
0
if *pixels_to_skip == 0 && *pixels_drawn < 152 { self.draw_contiguous_bg_window_block(*pixels_drawn as usize, tile_address, tile_line_y); *pixels_drawn += 8; } else { let tile = &self.tiles[tile_address]; for j in (tile_line_y..=tile_pixel_y_offset).rev() { ...
Rust
0
<'script>, /// we're forced to make this pub because of lalrpop mid: Box<NodeMeta>, }, /// we're forced to make this pub because of lalrpop Set { /// we're forced to make this pub because of lalrpop items: Vec<GroupByRaw<'script>>, /// we're forced to make this pub be...
Rust
0
ップさせる必要あり memory_size = TRAIN_DATA_NUM * 2 + 10 feature_num = 7 if not USE_RECCURENT_LAYER_MODE: feature_num = 15 nn_output_size = 3 #2 #3 TOTAL_ACTION_NUM = TRAIN_DATA_NUM * iteration_num HODABLE_POSITIONS = 1 #30 BACKTEST_ITR_PERIOD = 10 #30 half_spread = 0.0015 gamma = 0.5477 #0.3 mean_reaward_gamma = 0.99 vola...
Python
1
gen::Env::from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/camera2/CameraCharacteristics\0", "getPhysicalCameraIds\0", "()Ljava/util/Set;\0"); __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) ...
Rust
0
} } else { Err(err_invalid_utf8_content()) } } else { Err(err_invalid_base64_encoding()) } } else { Err(err_missing_parameter("content")) } } /// #[inline(always)] fn do_replace_definitions(workspace: &mut Workspace, params: &ReplaceDefinitionsParams) -> Result<StatusR...
Rust
0
| `matching(regex, '\\w{3}\\d+', 'abc123')` | //! | include | Value must include the example value as a substring | | `matching(include, 'testing')` | //! | boolea...
Rust
0
readyCreated, } #[pallet::call] impl<T: Config> Pallet<T> { #[pallet::weight(10_000)] pub fn create_pool( origin: OriginFor<T>, token_a: T::FungibleTokenId, token_b: T::FungibleTokenId, ) -> DispatchResult { let who = ensure_signed(origin)?; Self::do_create_pool(&who, token_a, token_b)?; O...
Rust
0
.arg(script) .stderr(std::process::Stdio::piped()) .spawn() .unwrap(); let stderr = child.stderr.as_mut().unwrap(); let mut stderr_lines = std::io::BufReader::new(stderr).lines().map(|r| r.unwrap()); let ws_url = extract_ws_url_from_stderr(&mut stderr_lines); // We use tokio_tungstenite a...
Rust
0
] = 0 TPose_uncloth_scaled = transform_scale(Image.fromarray(TPose_uncloth_tmp_np)) TPose_cloth_tmp_np[:,:,0][(TParsing_cloth_np == 0)] = 0 TPose_cloth_tmp_np[:,:,1][(TParsing_cloth_np == 0)] = 0 TPose_cloth_tmp_np[:,:,2][(TParsing_cloth_np == 0)] = 0 TPose_cloth_scaled = transf...
Python
1
4gaps vbn5bpit7_6 = edjeo8nak4t assert b'' from et3rnm2iakc import d9iliffyf9u as no8bpb41utp, aj6y6sqcp1h, hq5695anvv7, ig26semqjja as af3yxuzpfgt, ma8icaysken as lsui8ziuts7, yzo44wuit45 g16kkfq6bsf %= y4v6f_ucir6 import j5aunbks4m1, fpjfqdtuwlh as y96k6iemedb, pp6lo20nbb1, dwr7amjoeus, zmtt8335zs...
Python
1
: u32 = 0x09e3; /* U+240C SYMBOL FOR FORM FEED */ pub const KEY_cr: u32 = 0x09e4; /* U+240D SYMBOL FOR CARRIAGE RETURN */ pub const KEY_lf: u32 = 0x09e5; /* U+240A SYMBOL FOR LINE FEED */ pub const KEY_nl: u32 = 0x09e8; /* U+2424 SYMBOL FOR NEWLINE */ pub const KEY_vt: u32 = 0x09e9; /* U+240B SYMBOL FOR VERTICAL TABULA...
Rust
0
a_1C5C(): ChrTurnDirection(0x00FE, 0x0010, 400) Yield() Jump('lambda_1C5C') DispatchAsync2(0x000F, 0x0001, lambda_1C5C) @scena.Lambda('lambda_1C6D') def lambda_1C6D(): ChrTurnDirection(0x00FE, 0x0010, 400) Yield() Jump('lambda_1C6D') DispatchAsync2(0x...
Python
1
evel 1"] TPRI_0, #[doc = "Set to corresponding priority level"] TPRI_1, #[doc = "Set to corresponding priority level"] TPRI_2, #[doc = "Set to corresponding priority level"] TPRI_3, #[doc = "Set to corresponding priority level"] TPRI_4, #[doc = "Set to corresponding priority leve...
Rust
0
"studios/bulk_update" body = { "updates": [ { "title": title, "public": public, "project": self._client.project, "description": description, "version": "latest", "p...
Python
1
ebug, Display}; pub type Result<T> = std::result::Result<T, RaytracerError>; #[derive(Debug)] pub enum RaytracerError { NormalNotFound(usize), ParsingError(String), NoLight, } impl Display for RaytracerError { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { match self { ...
Rust
0
import pytest import datamol as dm from medchem.constraints import Constraints def test_constraints(): def my_constraint(mol): # we want to either (have phenol) OR (have less than 7 atoms and not ring) return mol.HasSubstructMatch(dm.to_mol("Oc1ccccc1")) or ( mol.GetNumAtoms() < 7 a...
Python
1
sorted_eq(expected, &[block]); } _ => unreachable!(), } } Ok(()) } use crate::Result; use std::{fs::File, io::Read, path::Path}; pub fn create_pipeline( vert_file: &Path, frag_file: &Path, vertex_buffer_descriptor: wgpu::VertexBufferDescriptor, format: wgpu::Text...
Rust
0
int(0.3 * screen_height) # 4:3 elif abs(screen_width / screen_height - 4 / 3) < 0.1: self.WINDOW_WIDTH = int(0.55 * screen_width) self.WINDOW_HEIGHT = int(0.5 * screen_height) # 4:3 portrait format elif abs(screen_width / screen_height - 3 / 4) < 0.1: ...
Python
1
# 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
_classified_data(dev_has_symptom_list, dev_summary_merged, os.path.join(dev_dataset_path, 'summary_merged_classification')) with open(os.path.join(train_dataset_path, 'ade_merged.json'), 'w') as f: json.dump(train_ade_merged, f) with open(os.path.join(dev_dataset_path, 'ade_merged.json'), 'w') as f: ...
Python
1
lf).unwrap() } /// Consume the DynamicResource and convert to an Api object /// /// Note this crashes on invalid group/version/kinds. /// Use `try_into_api` to handle the errors. pub fn into_api<K>(self, client: Client) -> Api<K> { let resource = Resource::try_from(self).unwrap(); ...
Rust
0
import torch import math import torch.nn as nn from torch.nn.parameter import Parameter class HGNN_conv(nn.Module): # Inherited from module # in_features: size of each input sample # out_features: size of each output sample def __init__(self, in_ft, out_ft, bias=True): super(HGNN_conv, self)._...
Python
1
# -*- coding: utf-8 -*- """ 개선된 Multi-Task Learning (MTL) 이상탐지 파이프라인 GPT 제안 구조 기반: - Multi-scale CNN encoder + BiLSTM - Reconstruction, Forecasting, Classification 3가지 태스크 - Teacher 모델(OmniAnomaly, Anomaly Transformer) 기반 pseudo-labeling - Dynamic loss weighting (GradNorm/Uncertainty weighting) """ import torch import...
Python
1
_vec}; use crate::util::transactions::conflict::run_conflict_check; pub fn decompress_xz(compressed_tar: File) -> Archive<XzDecoder<File>> { return Archive::new(XzDecoder::new(compressed_tar)); } pub fn decode_pkg_file(pkg: File) -> Package { let v: Package = serde_json::from_reader(pkg).unwrap(); return...
Rust
0
"""Preprocessing scripts for GraphDTA.""" import pandas as pd import numpy as np import os import rdkit import sklearn import torch import json,pickle from collections import OrderedDict from rdkit import Chem from rdkit.Chem import MolFromSmiles import networkx as nx from utils import * # Global setting seq_voc = "A...
Python
1
, ) -> StdResult<InitResponse> { let state = State { accepted_token: msg.accepted_token.clone(), offered_token: msg.offered_token.clone(), admin: env.message.sender.clone(), exchange_rate: msg.exchange_rate, contract_address: env.contract.address, total_raised: Uint12...
Rust
0
Vec2::new( (tile%14) as f32 / 16.0f32+qtr_pixel, 1.0-((tile/14) as f32 /16f32)-qtr_pixel ); tile_batcher.tile_color(vertices, &(Vec2::new( x as f32*48.0, config.height() as f32 - y as f32*48.0 ) + offset), &Vec2::new( 48.0, 48.0 ), &src, &Vec2::new( 1.0/16.0-half_pixel, 1.0/16.0-half_pixel...
Rust
0
'w', shape=[2], initializer=Initializer("ConstantFill") ) self.assertNotEqual(model.get_param_info(p), None) def test_parameter_sharing_brew(self): # Test no ...
Python
1
#[test] fn roundtrip_LD1SB_z_p_bz_d_64_unscaled() { assert_eq!(Instruction::LD1SB_z_p_bz_d_64_unscaled { Zm: 31, Pg: 7, Rn: 31, Zt: 31, }.encode().decode(), Instruction::LD1SB_z_p_bz_d_64_unscaled { Zm: 31, Pg: 7, Rn: 31, Zt: 31, }) } #[test] fn roundtrip_LDFF1SB_z_p_bz_d_64_unscaled() { assert...
Rust
0
'''Copyright 2018 Province of British Columbia 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 applicable law or agreed to in writing,...
Python
1
_1) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[in...
Rust
0
delt = kwargs["lambda_curve"](torch.exp(kwargs["amplitude_img"] * delt).cpu().numpy()) # Section:根据delt设定迭代次数 if adaptive: if kwargs["noise_strength"] == "high": t_start_list = [15, 15, 15] e...
Python
1
# beam of single-dish data in radio_beam format target_header, # header on which to image the data init_params, # init array of parameters max_its, # maximum number of iterations lamb...
Python
1
import numpy as np import torch epsilon = 1e-8 def average_precision(output, target): # sort examples indices = output.argsort()[::-1] # Computes prec@i total_count_ = np.cumsum(np.ones((len(output), 1))) target_ = target[indices] ind = target_ == 1 pos_count_ = np.cumsum(ind) total =...
Python
1
ased on the supplied `Status`. pub fn new(status: Status) -> Self { TokenManagerError { status, fatal: false, cause: None, } } /// Sets a cause on the current error. pub fn with_cause<T: Into<Error>>(mut self, cause: T) -> Self { self.cause = ...
Rust
0
)), Some((0, 1)), Some((0, 1))] ), ( r"multiple words", r"multiple words yeah", vec![Some((0, 14))] ), ( r"(.*)c(.*)", r"abcde", vec![Some((0, 5)), Some((0, 2)), Some((3, 5))] ), ( r"abcd", r"abcd", vec![Some((0, 4))] ), ( r"a(bc)d", r"abcd", vec![Some((0, 4)), Some((1, 3))] ), ...
Rust
0
_str("#b\"")?; for &b in s { match b { b'\\' => f.write_str(r"\\")?, b'"' => f.write_str("\\\"")?, b if is_printable(b) => write!(f, "{}", b as char)?, b => write!(f, "\\x{:02x}", b)? ...
Rust
0
ror, other: XMLPayloadError) -> bool { match err { XMLPayloadError::Overflow => matches!(other, XMLPayloadError::Overflow), XMLPayloadError::ContentType => { matches!(other, XMLPayloadError::ContentType) } _ => false, } } #[actix_rt::test] async fn test_extract() { ...
Rust
0
pub fn take_api_trap() -> Option<HostRef<TrapInfo>> { RECORDED_API_TRAP.with(|data| data.take()) } pub(crate) struct TrapSink { pub traps: Vec<TrapInformation>, } impl TrapSink { pub fn new() -> Self { Self { traps: Vec::new() } } } impl binemit::TrapSink for TrapSink { fn trap( ...
Rust
0
ulate_lut_texture() { // Construct a new by repeated calls to the supplied closure. let img = ImageBuffer::from_fn(LUT_WIDTH, LUT_HEIGHT, |x, y| { let metalness = x as f64 / (LUT_WIDTH - 1) as f64; let diffuse_albedo = y as f64 / LUT_HEIGHT as f64; // don't include 1.0 as it contains a hotspot ...
Rust
0
<tcd13_dlastsga::TCD13_DLASTSGA_SPEC>; #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] pub mod tcd13_dlastsga; #[doc = "TCD13_CSR register accessor: an alias for `Reg<TCD13_CSR_SPEC>`"] pub type TCD13_CSR = crate::Reg<tcd13_csr::TCD13_CSR_SPEC>; #[doc = "TCD Control and Status"] pub mod tcd13_...
Rust
0
rver staff.") await ctx.respond(f"### {ctx.author.mention}", embed=embed, delete_after=5) logger.info(f"{ctx.author} attempted to use 'version' in {ctx.channel} but lacks permissions.") return # Exit early before applying cooldown # Apply cooldown only if user has the proper role if ct...
Python
1
), min_size=0, max_size=20 ) ) def test_flask_config_consistency(config_data): """Test that Flask config maintains consistency across operations""" app = Flask(__name__) # Set initial config for key, value in config_data.items(): app.config[key] = value # ...
Python
1
for event in stream: if event.event_type == "text-generation": response += event.text # Append generated text to the response. # Clean and process the response response = response.replace("\n", "").strip() response_parts = [part.strip() for part in response.s...
Python
1
a_np + b_np, a_np * b_np) / 2.0) a_nd = tvm.nd.array(a_np, ctx) b_nd = tvm.nd.array(b_np, ctx) g_nd = tvm.nd.array(np.zeros(g_np.shape, dtype=g_np.dtype), ctx) func(a_nd, b_nd, g_nd) tvm.testing.assert_allclose(g_nd.asnumpy(), g_np, rtol=1e-5) ###################################################################### # TO...
Python
1
ightplan ic.InputFlightplanFromFile(args.flightplan,eta=args.eta,repair=args.repair) # Input geofences from file if args.geofence != '': ic.InputGeofence(args.geofence) # Add icarous instance to sim environment sim.AddIcarousInstance(ic,time_limit=args.tlimit) #from GroundSystem import GroundPlanner # Add ground...
Python
1
wfp.write(nop_config_code) config = { "model_type": "test_unregistered_dynamic", "auto_map": {"AutoConfig": f"{fake_model_id}--config.NopConfig"}, } config_file = os.path.join(fake_repo, "config.json") with open(config_file, "w...
Python
1
------------------- // Public Definitions //-------------------------------------------------------------------------------------------------- /// Synchronization interfaces. pub mod interface { /// Any object implementing this trait guarantees exclusive access to the data contained within /// the Mutex for t...
Rust
0
.Row(): movie_title = gr.Textbox(label="Enter a Movie Title") num_similar = gr.Slider(minimum=1, maximum=50, label="Number of most Similar Movies", step=1, value=5) submit_btn = gr.Button("Submit", variant="primary") visualization_plot = gr.Plot(label="Visualization Plot", min_width=800)...
Python
1
Err(error) => return Err(CliError::from(error)), }, Err(error) => return Err(CliError::from(error)), }, Err(error) => return Err(CliError::from(error)), } } use std::cell::RefCell; use std::collections::{HashMap, HashSet}; #[cfg(all(feature = "tokio_rt", feature = "n...
Rust
0
ance:\n{assistance}\n") print("-------------------------------------------\n") continue elif continue_choice == 'back': break elif continue_choice =...
Python
1
, value: RawValue, ) { let context = &*context; // TODO //context.insert(&[ident], Value::from_raw(value)); unimplemented!() } } //! Definitions of key modification codes. use bitflags::bitflags; use crate::bind; bitflags! { /// A key modification flag. pub st...
Rust
0
.unwrap(); assert_eq!(output, None); } // test date format when format is None let cases: Vec<(Option<&str>, Option<&str>)> = vec![ (Some("2010-01-07 23:12:34.12345"), None), (None, None), // TODO: pass this test after refactoring the issue #3953 ...
Rust
0
int.pow([vahisning_size as u64]); denominator.sub_assign(&E::Fr::one()); let denominator = denominator.inverse().expect("must exist"); numerator.mul_assign(&denominator); numerator } fn calculate_lagrange_poly(&self, worker: &Worker, poly_size:usize, poly_number: usize) -> Re...
Rust
0
pec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::pa...
Rust
0
s raised by Binance # on a temporary ban, the API key is valid, but disabled for a while if (error == '-2015') and self.options['hasAlreadyAuthenticatedSuccessfully']: raise DDoSProtection(self.id + ' ' + body) feedback = self.id + ' ' + body if message ==...
Python
1
), field_b: DataWrapper::new(i), field_c: DataWrapper::new(i), field_d: DataWrapper::new(i), field_e: DataWrapper::new(i), field_f: DataWrapper::new(i), } } } #[bench] fn bench_big_loop_big_object(b: &mut test::Bencher) { const NUM_OBJECTS: us...
Rust
0
= optimization.output.structure optimization_dir = optimization.output.dir_name optimization_uuid = optimization.output.uuid prev_dir = optimization_dir # Information about the basis is collected basis_infos = get_basis_infos( structure=structure, ...
Python
1
ct: """Send a request and wait for the response""" logger.info(f"Sending request: {kind}") await self.send_message(kind, body) # Map request types to expected response types response_map = { "screen/get": "result/screen/current", "main_menu/start_...
Python
1
section.has_key('sets'): setsSection = section.createSection('sets') else: setsSection = section['sets'] for key in item: if key == 'default': setSection = section elif setsSection.has_key(key): setSection = sets...
Python
1
class Solution: def orangesRotting(self, grid: List[List[int]]) -> int: time = 0 rotten = set() aboutToRot = set() fresh = set() for i in range(len(grid)): for j in range((len(grid[0]))): if grid[i][j]==2: rotten.add((i...
Python
1
} fn fac(n: u128) -> u128 { if n > 1 { n * fac(n-1) } else { n } } fn fib(n: u128) -> u128 { if n <= 1 { n } else { fib(n-1) + fib(n-2) } } fn towersolve(n: u16, from: char, to: char, other: char) { if n == 1 { println!("Moving disk 1 from ...
Rust
0
Some((Iny, Implied)), Some((Cmp, Immediate)), Some((Dex, Implied)), None, Some((Cpy, Absolute)), Some((Cmp, Absolute)), Some((Dec, Absolute)), None, // 0xd0 Some((Bne, Relative)), Some((Cmp, IndirectIndexed)), None, None, None, Some((Cmp, ZeroPageX)), Some((De...
Rust
0
.format) # Set precision of y-axis tick labels axs[1].set_xlabel('slot') axs[1].set_ylabel('number of queued requests') axs[1].set_title('Number of queued requests') note_text = f"Number of pass slot : {pass_slot} and number of slots is {Num_slot} \n with poisson rate A:{poisson_rate_A}, B:{poisson_rate_...
Python
1
_ms < success_first.0); assert!(min_timestamp_ms < failure_first.0); let success_last = retry_success.iter().last().unwrap(); let failure_last = retry_failure.iter().last().unwrap(); assert!(success_last.0 <= max_timestamp_ms); assert!(failure_last.0 <= max_timestamp_ms); // Each of the succes...
Rust
0
######################################################################## # File name: ibr_test.py # This file is part of: aioxmpp # # LICENSE # # This program 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 Foundat...
Python
1
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton class Translation(object): START_TEXT = """ 👋 Hᴇʏ {} ⵊ Aᴍ Tᴇʟᴇɢʀᴀᴍ URL Uᴘʟᴏᴀᴅᴇʀ Bᴏᴛ. **Sᴇɴᴅ ᴍᴇ ᴀ ᴅɪʀᴇᴄᴛ ʟɪɴᴋ ᴀɴᴅ ɪ ᴡɪʟʟ ᴜᴘʟᴏᴀᴅ ɪᴛ ᴛᴏ ᴛᴇʟᴇɢʀᴀᴍ ᴀs ᴀ ꜰɪʟᴇ/ᴠɪᴅᴇᴏ** Usᴇ ʜᴇʟᴘ ʙᴜᴛᴛᴏɴ ᴛᴏ ᴋɴᴏᴡ ʜᴏᴡ ᴛᴏ ᴜsᴇ ᴍᴇ """ HELP_TEXT = """ ʟɪɴᴋ ᴛᴏ ᴍᴇᴅɪᴀ ᴏʀ...
Python
1