text
string
label_name
string
labels
int64
ceCharsetRequest` :rtype: :class:`tencentcloud.cdb.v20170320.models.DescribeDBInstanceCharsetResponse` """ try: params = request._serialize() headers = request.headers body = self.call("DescribeDBInstanceCharset", params, headers=headers) response...
Python
1
n = 0 soma = 0 while nt >= 0: if nt >= 0: soma + n else: print('Nota invalida!') print
Python
1
memory); let rd = bits!(opcode, 0, 2); let rs = bits!(opcode, 3, 5); let lhs = cpu.registers.read(rd); let rhs = cpu.registers.read(rs); match bits!(opcode, 6, 7) { 0 => { alu::arm_alu_tsts(cpu, lhs, rhs); } 1 => { let res = alu::arm_alu_rsbs(cpu, r...
Rust
0
LinearDigest::new(); digest.add_buffer(&dataset); assert_relative_eq!(digest.est_quantile_at_value(0.0), 0.0); assert_relative_eq!(digest.est_quantile_at_value(250.0), 0.25); assert_relative_eq!(digest.est_quantile_at_value(500.0), 0.5); assert_relative_eq!(digest.est_quantile_...
Rust
0
2_data(n, theta=15, lambda1=1, lambda2=1, c1=1, c2=1): u1 = np.random.uniform(0, 1, n) u2 = np.random.uniform(0, 1, n) time2 = -np.log(1 - u2) / lambda2 time1 = ( np.log( 1 - np.power((1 - u2), -theta) + np.power((1 - u1), -thet...
Python
1
ience/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Programming Language :: C", "Programming Language :: C++", "Programming Lan...
Python
1
ing type of '{}'", self.to_data_uri()) })?; parse_headers(res.headers())? }; match metadata.data_type { DataType::Dir => Ok(DataItem::Dir(DataDirItem { dir: self.into() })), DataType::File => { Ok(DataItem::File(DataFileItem { ...
Rust
0
data_transfer_rate::bits_per_second::to_kilo_bits_per_second(6021.0); assert_approx_eq!(6.021, result, 0.01); } /// Need to convert to parameterized tests #[test] fn it_convert_knownbits_per_second_to_kilo_bits_per_second_3() { let result: f64 = data_transfer_rate::bits_per_second::to_kilo_bits_per_second(910...
Rust
0
import subprocess def getData(index1, index2, byteArray): mask = 0xFF d = ((byteArray[index1] & mask) << 8) + (byteArray[index2] & mask) return d / 10.0 def getWeight(byteArray): return getData(4, 5, byteArray) def getTemp(byteArray): return getData(2, 3, byteArray) def parse_line(line): par...
Python
1
et trans = try!(self.conn .transaction()); let sql = r###" SELECT id, pr, pull_commit, message FROM queue WHERE pipeline_id = $1 ORDER BY id ASC LIMIT 1 "###; let item = { let stmt = try!(trans.prepare(sql)); let...
Rust
0
tp::RequestClient { pub(crate) fn new(id: &str, client: &'a Graph<Client>) -> $name<'a, Client> { let ident = client.ident(); let id_stored = id.to_string(); $( client.request().registry(|r| { r.register_helper( ...
Rust
0
r `impl`s that implement `Send`. for &impl_hir_id in self.rcx.tcx().hir().trait_impls(send_trait_did) { if let Some((adt_def_id, send_sync_analyses)) = self.suspicious_send(impl_hir_id, send_trait_did, sync_trait_did, copy_trait_did) { if send_sync_analyse...
Rust
0
local_msg).is_ok()) } } #[derive(Clone, Debug)] pub struct IdentityIdAccessControl { identity_ids: Vec<IdentityIdentifier>, } impl IdentityIdAccessControl { pub fn new(identity_ids: Vec<IdentityIdentifier>) -> Self { Self { identity_ids } } fn contains(&self, their_id: &IdentityIdentifier)...
Rust
0
''' - replace letters with the 13th letter after it in the Latin alphabet, not spaces, punctuation, numbers, etc. "EBG13 rknzcyr." -> "ROT13 example." To solve this problem, use two builtin functions: - str.translate(table) returns a copy of the string in which each char has been mapped through the given translation ...
Python
1
> ValueId { previous_value = (previous_value + ValueId::from_usize(1)) % ValueId::from_usize(scores.len()); let mut high_score: usize = scores[previous_value.as_usize()].len(); let mut high_use: usize = uses[previous_value.as_usize()]; let mut high_value: ValueId = previous_value; // Start at previ...
Rust
0
ensure_clean() as path: with pytest.raises(LookupError, match="unknown error handler name"): icom.get_handle(path, "w", errors="bad") def test_errno_attribute(): # GH 13872 with pytest.raises(FileNotFoundError, match="\\[Errno 2\\]") as err: pd.read_csv("doesnt_exist") asse...
Python
1
panic } if x.is_ok() { x = Err(()); x.unwrap(); // not unnecessary because of mutation of x // it will always panic but the lint is not smart enough to see this (it only checks if conditions). } else { x = Ok(()); x.unwrap_err(); // not unnecessary because of mutatio...
Rust
0
# Copyright (c) 2012-2023 by the GalSim developers team on GitHub # https://github.com/GalSim-developers # # This file is part of GalSim: The modular galaxy image simulation toolkit. # https://github.com/GalSim-developers/GalSim # # GalSim is free software: redistribution and use in source and binary forms, # with or w...
Python
1
# Python bytecode 2.7 (decompiled from Python 2.7) # Embedded file name: scripts/client/gui/Scaleform/daapi/view/lobby/store/browser/sound_constants.py from sound_gui_manager import CommonSoundSpaceSettings from shared_utils import CONST_CONTAINER class SOUNDS(CONST_CONTAINER): COMMON_SOUND_SPACE = 'shop' VEHI...
Python
1
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from pytest import mark from pytest import skip from jrnl.os_compat import on_posix from jrnl.os_compat import on_windows pytest_plugins = [ "tests.lib.fixtures", "tests.lib.given_steps", "tests.lib.when_steps"...
Python
1
from PyQt6.QtCore import QObject, pyqtSignal class PasswordChecker(QObject): """ @class PasswordChecker @brief A class to handle password verification. """ password_verified = pyqtSignal() """ @brief Signal emitted when the password is verified successfully. """ password_failed = pyqtSigna...
Python
1
Create input prompt for the encoder. HF processor will be applied on this prompt during profiling and generation. """ raise NotImplementedError @property def pad_dummy_encoder_prompt(self) -> bool: return False def create_decoder_prompt( self, prompt: ...
Python
1
rs()[1].capacity(), 960); Ok(()) } } <reponame>blaggacao/treefmt #![allow(clippy::redundant_closure, clippy::redundant_pattern_matching)] use log::error; use treefmt::command::{cli_from_args, run_cli}; use treefmt::customlog::CUSTOM_LOG; fn main() { // Configure the logger log::set_logger(&CUSTOM...
Rust
0
# coding=utf-8 # Copyright 2019 The Google AI Language Team 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 ...
Python
1
_vector_from_peptide(peptide: &[usize]) -> Vec<u8> { let prefix_masses = get_prefix_masses(peptide); let mut peptide_vector: Vec<_> = (0..prefix_masses[prefix_masses.len() - 1]) .map(|_| 0u8) .collect(); for m in prefix_masses[1..].iter() { peptide_vector[*m - 1] = 1; } pepti...
Rust
0
City::new(7317, "Nigeria", "Gambaru", 12.3666667, 14.2166672, 270.0), City::new(7318, "Niger", "Niamey", 13.5166667, 2.1166668, 203.0), City::new(7319, "Niger", "Zinder", 13.8000000, 8.9833336, 467.0), City::new(7320, "Niger", "Maradi", 13.4916667, 7.0963888, 374.0), City::new(7321, "Niger", "Alarsas", 17.0166667, ...
Rust
0
revious_alignments = state.alignments previous_alignment_history = state.alignment_history else: previous_alignments = [state.alignments] previous_alignment_history = [state.alignment_history] all_alignments = [] all_attentions = [] all_histories = []...
Python
1
t + full_query input_ids, _ = pad_to_len(input_ids, max_len, pad_value) # CONFIG['max_len'], CONFIG['pad_value'] ret_utterances.append(input_ids) ret_labels.append(dialogue[query_idx]['label']) self.text_input_ids = torch.tensor(ret_utterances, dtype=torch.long) self.labels = torch.tensor(ret_labels,...
Python
1
import os import asyncio from info import * from pyrogram import Client, filters from pyrogram.types import Message, User, ChatJoinRequest, InlineKeyboardMarkup, InlineKeyboardButton # Default settings APPROVAL_WAIT_TIME = 10 # seconds AUTO_APPROVE_ENABLED = True # Toggle for enabling/disabling auto approval @Clien...
Python
1
.push(pkt.resource_req.clone()); } println!( "t: {}, capacity: {:?} requests: {:?}", t, capacity, requests ); let coeffs = alg.allocate(&capacity, &requests); assert!(coeffs.len() == pkts.len()); for (i, pkt) in pkts.iter_mut().enumerate() { let alloc = pkt.resource_req.i...
Rust
0
obj:`True`, if unlimited regular gifts are accepted. limited_gifts (:class:`bool`): :obj:`True`, if limited regular gifts are accepted. unique_gifts (:class:`bool`): :obj:`True`, if unique gifts or gifts that can be upgraded to unique for free are accepted. premium_subscription (:cla...
Python
1
(e) } } } #[cfg(feature = "mio_07")] impl UnixDatagramExt for mio_07::net::UnixDatagram { fn bind_unix_addr(addr: &UnixSocketAddr) -> Result<Self, io::Error> { match mio_07::net::UnixDatagram::unbound() { Ok(socket) => match socket.bind_to_unix_addr(addr) { Ok(()) =>...
Rust
0
pts}, Result, }; use sqlx::postgres::PgPool; use std::process; use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(global_setting = structopt::clap::AppSettings::AllowNegativeNumbers)] pub struct Cli { #[structopt(flatten)] cmd: Cmd, #[structopt(flatten)] opts: Opts, } #[derive(Debug...
Rust
0
wrap_or_default() ) } } #[derive(Clone, Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct OfferInfo { pub owner: PublicAccount, pub mosaic: Mosaic, pub price_denominator: Uint64, pub price_numerator: Uint64, pub deadline: Height, } impl core::fmt::Display for OfferInfo {...
Rust
0
_endpoint: None, userinfo_signing_alg_values_supported: None, } } } // 8 x 12 font - characters 0..127 // This is from http://forums.parallax.com/discussion/128596/need-8x12-font // Copyright (c) 2006 Parallax, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a...
Rust
0
middle_y, 0.0, middle_y, roundness_x, middle_y, right, roundness_y, right, 0.0, ) } pub struct Forehead { pub roundness: (Value, Value), } impl Forehead { pub fn controls(&mut self, value_changed: Callback<()>) -> Html { html!( ...
Rust
0
usize].parent_or_next = B2_NULL_NODE; //parent_or_next = parent this.free_node(parent); } //validate(); } // Perform a left or right rotation if node A is imbalanced. // Returns the new root index. pub fn balance<T: Clone + Default>(this: &mut B2dynamicTree<T>, i_a: i32) -> i32 { b2_assert(i_a != B2_NULL_NODE); ...
Rust
0
# # This file is part of LiteX-M2SDR. # # Copyright (c) 2024-2025 Enjoy-Digital <enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause from litex.gen import * from litex.soc.interconnect.csr import * # Helpers ------------------------------------------------------------------------------------------ def twos_co...
Python
1
import streamlit as st import pandas as pd import json import re # 載入題目資料 (假設你將 JSON 檔案存放在同一資料夾下) with open("questions_with_explanations.json", "r", encoding="utf-8") as f: questions = json.load(f) # 轉換為 DataFrame df = pd.DataFrame(questions) # 設定 Streamlit 網頁標題 st.title("題庫練習") # 記錄使用者的選擇 user_answers = {} # ...
Python
1
wrapperCol={'flex': '5'}, ), fac.AntdFormItem( fac.AntdSelect(id='group-mgmt-update-group-admin-users', mode='multiple'), label...
Python
1
from solution import * def test_has_path_with_target(): grid = [[1, 3, 2], [1, 5, 1], [4, 2, 1]] target = 9 assert has_path_with_target(grid, target) == True def test_has_path_with_target_2(): grid = [[1, 1, 1], [1, 1, 1], [1, 1, 1]] target = 2 assert has_path_with_target(grid, target) == Fals...
Python
1
let mut get_devices_response = nia_protocol_rust::GetDevicesResponse::new(); match devices_result { Ok(devices) => { let devices = devices .into_iter() .map(|device_info| device_info.to_pb()) .collect();...
Rust
0
pnginfo": "EXTRA_PNGINFO"},} def save(self, model, clip_vision, vae, filename_prefix, prompt=None, extra_pnginfo=None): ldm_patched.contrib.external_model_merging.save_checkpoint(model, clip_vision=clip_vision, vae=vae, filename_prefix=filename_prefix, output_dir=self.output_dir, prompt=prompt, extra_pngin...
Python
1
_call_alias() { let res = no_lattice::actor_to_actor_call_alias().await; if let Err(ref e) = res { println!("{}", e); } assert!(res.is_ok()); } #[actix_rt::test] async fn kvcounter_basic() { let res = no_lattice::kvcounter_basic().await; if let Err(ref e) = res { println!("{}", ...
Rust
0
dfa(&self.query) } else { build_dfa(&self.query) } } fn exact(index: usize, ngram: usize, query: &str) -> Automaton { Automaton { index, ngram, query_len: query.len(), is_exact: true, is_prefix: false, q...
Rust
0
1111:<S>1.1.11<E>:good:Jun\n", "Apple:33:<S>3.3<E>:good:Mar\n", "Cherry:4:<S>4<E>:good:Oct\n", ) ); assert_eq!(r.is_ok(), true); } // #[test] fn test_t4() { let env = env_1!(); let (r, sioe) = do_execute!( &env, ...
Rust
0
text = f"{title} {description}".lower() # Common game asset tags tag_keywords = [ '2d', '3d', 'sprite', 'character', 'background', 'ui', 'icon', 'pixel art', 'cartoon', 'fantasy', 'sci-fi', 'medieval', 'modern', 'animation', 'tileset', 'platformer', 'rpg', '...
Python
1
(s: &str) -> Self { match s { "HTTP" => LoadBalancerProtocol::Http, "HTTP_HTTPS" => LoadBalancerProtocol::HttpHttps, other => LoadBalancerProtocol::Unknown(other.to_owned()), } } } impl std::str::FromStr for LoadBalancerProtocol { type Err = std::convert::Infa...
Rust
0
, c_in, d_model, embed_type='fixed', freq='h', dropout=0.1): super(DataEmbedding_inverted, self).__init__() self.value_embedding = nn.Linear(c_in, d_model) self.dropout = nn.Dropout(p=dropout) def forward(self, x, x_mark): x = x.permute(0, 2, 1) # x: [Batch Variate Time] ...
Python
1
self.panel_shownext() # 显示图片 print(f'Info:成功导入{self.state.task_num}张图片') else: # 选择单张图片 filetypes = [("支持格式", "*.BMP;*.DIB;*.JPEG;*.JPG;*.JPE;*.PNG;*.PBM;*.PGM;*.PPMSR;*.RAS','.TIFF','.TIF;*.EXR;*.JP2;*.WEBP")] path = filedialog.askopen...
Python
1
mixed[:, yl:yh, xl:xh] = batch[j][0][:, yl:yh, xl:xh] else: mixed = mixed.astype(np.float32) * lam + batch[j][0].astype(np.float32) * (1 - lam) np.rint(mixed, out=mixed) output[i] += torch.from_numpy(mixed.astype(np.uint8)) return lam de...
Python
1
Extent { minimum: self.minimum << rhs, shape: self.shape << rhs, } } } impl<V, Rhs> Shr<Rhs> for Extent<V> where V: Shr<Rhs, Output = V>, Rhs: Copy, { type Output = Self; #[inline] fn shr(self, rhs: Rhs) -> Self::Output { Extent { minimum...
Rust
0
# Copyright (c) 2014 Robert Clipsham <robert@octarineparrot.com> # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your # option. This file may not be copied, modified, or distr...
Python
1
line.to_string(), None); }) .skip(token(name)) .skip(token(":")) .keep(take_chomped(chomp_while1c( &(|c: &char| c != &'\n' && c != &'\r'), "line", )))) .map(move |(line, pr)| match parse_line(name).run(&line, ()) { ParseResult::Ok { output, .. } => (output, pr), P...
Rust
0
OB : u64 = 101; const ALICE : u64 = 100; const CHARLIE : u64 = 102; #[test] fn it_creates_and_grants_roles() { new_test_ext().execute_with(|| { // Make sure we don't have these roles set assert_eq!(AccessModule::get_admin_of_role(ADMIN_ROLE), NONE_ROLE); assert_eq!(AccessModule::get_admin_of_role(WRITER_ROLE)...
Rust
0
_edge(pass_node::CUBES_PASS, draw_3d_graph::node::MAIN_PASS) .unwrap(); draw_3d_graph .add_slot_edge( draw_3d_graph.input_node().unwrap().id, draw_3d_graph::input::VIEW_ENTITY, pass_node::CUBES_PASS, CuboidsPassNode::IN_VIEW...
Rust
0
) # create required shotgun fields new_descriptor.ensure_shotgun_fields_exist(self.tk) # run post install hook new_descriptor.run_post_install(self.tk) # ensure that all required frameworks have been installed # find the file where our item is being installed (...
Python
1
rocessor.from_pretrained("openai/clip-vit-large-patch14") pipe = StableDiffusionGLIGENTextImagePipeline( vae=vae, text_encoder=text_encoder, tokenizer=tokenizer, image_encoder=image_encoder, processor=processor, unet=unet, sche...
Python
1
ult>>>, events_sender: async_broadcast::Sender<MPVEvent>, // Receiver.recv is a &mut self method, but IPCState::read_from_mpv needs to run concurrently with MPV::events, so lock around it. Locking around clone is unnecessary but too hard to avoid. events_receiver: Arc<Mutex<async_broadcast::Receiver<MPVEven...
Rust
0
import binascii import itertools import os import random import subprocess from weaver.stack import WeaverNests from weaver.util import Stash UNIQUE_SMALL_FILES = 50 SHARED_LARGE_FILES = 1 TASKS = 16 def sfs(): return random.SystemRandom().randint(1024, 65536) def lfs(): return 64*2**30 consumer = ShellFunc...
Python
1
/// Creates a new global reference guard. This assumes that `NewWeakGlobalRef` /// has already been called. unsafe fn from_raw(vm: JavaVM, obj: sys::jweak) -> Self { WeakGlobalRefGuard { obj: JWeak::from(obj), vm, } } /// Get the underlying JWeak object pu...
Rust
0
up constructor vars for _ in 0..cas_arg.len() { narrow_context(ctx); vars.pop(); } } } Ok(ret_typ) }, Cpy{nam, val, bod} => { let nam_0 = rename(&nam.0, vars); ...
Rust
0
autores'].append(s) meta_signs['autores'].append(s) return meta_signs def filefield_from_model(m): fields = m._meta.get_fields() fields = tuple(map(lambda f: f.name, filter( lambda x: isinstance(x, FileField), fields))) return fields FIELDFILE_NAME = fil...
Python
1
10").unwrap()).unwrap(); println!("{}", result); let result = who.lookup(WhoIsLookupOptions::from_string("fe80::5400:1ff:feaf:b71").unwrap()).unwrap(); println!("{}", result); } <filename>interactive_engine/executor/Pegasus/examples/channel_perf.rs<gh_stars>1000+ // //! Copyright 2020 Alibaba Group...
Rust
0
self.record_duration = int(self.config["task"]["env"]["debug"]["record"]["duration"] / self.control_dt) if "actions_file" in self.config["task"]["env"]["debug"]: self.actions_list = torch.from_numpy(np.load(self.config["task"]["env"]["debug"]["actions_file"])).cuda() ...
Python
1
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the authentication dialog for the help browser. """ from PyQt4.QtGui import QDialog, QStyle from Ui_AuthenticationDialog import Ui_AuthenticationDialog class AuthenticationDialog(QDialog, Ui_Au...
Python
1
egion. """ return if_then_else( time() > 2080, lambda: sum( weighted_temperature_change_by_region_and_climate().rename( {"CLIMATIC ZONES I": "CLIMATIC ZONES I!"} ), dim=["CLIMATIC ZONES I!"], ) + temperature_change_amoc_weakenin...
Python
1
r.update 方法 if angle is not None: self.level.player.update(angle) else: self.level.player.update(0) # 默认角度为 0 self.level.shooting_manager.update() self.level.ball_generator.update() self.level.bonus_manager.update() self.level.finish.update() ...
Python
1
hing for us. if pkg_config::find_library("sqlite3").is_ok() { return } // Try to fall back to /usr/lib if pkg-config failed. match fs::metadata("/usr/lib") { Ok(ref attr) if attr.is_dir() => "/usr/lib".to_owned(), _ => pani...
Rust
0
from pathlib import Path import os import glob def extract_build(content): build_pos = content.find('build()') if build_pos == -1: return content, "", "" # 找到 build() 的起始大括号 pre_end = build_pos while pre_end < len(content) and content[pre_end] != '{': pre_end += 1 if pre_end ...
Python
1
amples,unconditional_guidance_scale, ddim_eta,random_seed], outputs=[video_output_0, video_output_1, round1_button, round2_button, multi_button]) round2_button.click(chatwm.generate_video_next_round2, inputs=[text_input, ddim_steps, fs, n_samples,unconditional_...
Python
1
_run, trim_limit: trimconfig.value_of("trim_limit"), } // take config trim_config.value_of("trim_limit") } else if let Some(clean_unref_config) = config.subcommand_matches("clean-unref") { let arg_dry_run = dry_run || clean_unref_config.is_present("dry-run"); CargoCacheCommands::...
Rust
0
# Copyright 2022 The ml_dtypes 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 applicable law or agreed to i...
Python
1
e='<string>', cmd='exec'): log('Trying to patch:\n%s' % source) try: py_code = py_compiling.compile(py_space, py_space.newtext(source), filename, cmd) if not isinstance(py_code, PyCode): print 'py_code not an instance of PyCode' retu...
Python
1
runtime_types; pub mod calls { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct AddAssetAndInfo { pub asset_id: runtime_types::primitives::currency::CurrencyId, pub threshold: runtime_types::sp_arithmetic::per_things::Percent, pub min_answer...
Rust
0
# Created by MechAviv # Kinesis Introduction # Map ID :: 331003200 # Subway :: Subway Car #3 JAY = 1531001 GIRL = 1531067 sm.spawnNpc(GIRL, 699, 47) sm.showNpcSpecialActionByTemplateId(GIRL, "summon") sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spa...
Python
1
evaluate=evaluate) @staticmethod def process_samples_from_single_path(filename): """"Implement abstract method.""" print_rank_0(' > Processing {} ...'.format(filename)) samples = [] total = 0 with open(filename, 'r', encoding="utf-8") as f: data = json.l...
Python
1
import torch import torch.nn as nn import torchvision class Doubleconv(nn.Module): def __init__(self, in_channels, out_channels, mid_channels=None): super().__init__() if not mid_channels: mid_channels = out_channels self.double_conv = nn.Sequential( nn.Conv2d(in_ch...
Python
1
lt(), }; let mut sink = FileSink::new(&config, Acker::passthrough()); let (mut input, _events) = random_lines_with_stream(10, 64, None); let (mut tx, rx) = futures::channel::mpsc::channel(0); let _ = tokio::spawn(async move { sink.run(Box::pin(rx)).await }); // send i...
Rust
0
.scan(); let m: usize = sc.scan(); let inf = std::i64::MAX; let mut g: Vec<Vec<i64>> = vec![vec![inf; n]; n]; for _ in 0..m { let s: usize = sc.scan(); let t: usize = sc.scan(); let d: i64 = sc.scan(); g[s][t] = std::cmp::min(g[s][t], d); } for i in 0..n { g[i][i]...
Rust
0
_of_handle(handle), handle.clone()) } AssetEvent::Removed { handle } => { egui_context.remove_egui_texture(id_of_handle(handle)) } } } } fn shared_access_ui<T>( mut data: ResMut<T>, mut egui_context: ResMut<EguiContext>, inspector_windows: Res...
Rust
0
ke!(I2C2_EV); let i2c2 = i2c::I2c::new( p.I2C2, p.PB10, p.PB11, i2c2_irq, p.DMA1_CH4, p.DMA1_CH5, Hertz(100_000), ); let hts221_ready_pin = Input::new(p.PD15, Pull::Down); let hts221_ready = ExtiInput::n...
Rust
0
from main import Cliente, Clientes class View: @staticmethod def cliente_inserir(nome, email, fone): if nome == '': raise ValueError('o nome deve ser preenchido.') if email == '': raise ValueError('o email deve ser preenchido.') c = Cliente(0, nome, email, fone) Clientes.inserir...
Python
1
32HandleInfoKHR, _p_handle: *mut HANDLE, ) -> Result { panic!(concat!( "Unable to load ", stringify!(get_fence_win32_handle_khr) )) } let raw_name = stringify!(vkGe...
Rust
0
/v0/e/ncc-1701/foo", url) } #[test] fn http_api_url_test() { let mut client = APIClient::new_http("localhost:4343", "Chef"); fake_test_env(); let auth = APIAuth::from_env(); client.set_auth(auth); let url = client.api_url("foo/bar"); assert_eq!("http://localh...
Rust
0
to the Region set in the provider configuration. """ __args__ = dict() __args__['filters'] = filters __args__['owner'] = owner __args__['region'] = region opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) __ret__ = pulumi.runtime.invoke('aws:imagebuilder/getCompo...
Python
1
kind: ReplyErrorKind::Internal, resource: ResourceKind::Nexus, source: "destroy_nexus".to_string(), extra: "invalid filter for resource".to_string(), })) } }; MessageBus::destroy_nexus(destroy).await?; Ok(()) } #[async_tra...
Rust
0
te = copy.deepcopy(tree.getroot()) template_body = next(template.iterfind('./body')) template_body.clear() # iterate through the children elements in body # body element is composed of # - header # - toc # - h1,h2,p,... # h1 marks the beginning of a chapter chap_num = 0 chap_tree = None for e in next(tree.iterfind...
Python
1
#!/usr/bin/env python from herepy import ( IsolineRoutingApi, IsolineRoutingTransportMode, IsolineRoutingMode, ) isoline_routing_api = IsolineRoutingApi(api_key="api_key") # Returns distance based isoline routing response = isoline_routing_api.distance_based_isoline( transport_mode=IsolineRoutingTran...
Python
1
impl!(($crate) $($expr)*) }; } /// A type-level string [`TStr`] value. /// /// # Arguments /// /// You can use anything that the [`tstr::TS`] macro accepts /// /// # Examples /// /// ### Indexing /// /// This uses types from the `for_examples` module, /// which can be seen in the docs with the "for_examples" featu...
Rust
0
mon PyTorch Module. - "loss": Forward and return a dict of losses according to the given inputs and data samples. Args: inputs (torch.Tensor or List[torch.Tensor]): The input tensor with shape (N, C, ...) in general. data_samples (List[DataSam...
Python
1
to exchange your watch to be black dial color but keep the leather strap. You like to say things piecewise.", "annotator": 4, }, { "user_id": "yara_muller_8652", "synthetic_instruction": "You name is Yara Muller and your zip code is 85041. You are relaxing, confident. Cancel order #W5056...
Python
1
the signal handler for ctrl-c signal.signal(signal.SIGINT, signal_handler) # parse the command line arguments arg_parse = argparse.ArgumentParser(description="Send Hue Data to InfluxDB") arg_parse.add_argument( "-d", "--dump", required=False, action="store_true", ...
Python
1
("support") resistance = sr.get("resistance") sl = round(support if support and direction == "LONG" else resistance if resistance and direction == "SHORT" else price - atr * 0.8 if direction == "LONG" else price + atr * 0.8, 4) trade_type = "Normal" if confidence >= 85 else "Scalping" l...
Python
1
import collections import io import json import logging import os from capture_metric.capture import CAPTURE from PIL import Image from pycocoevalcap.eval import Bleu, Cider, COCOEvalCap, Meteor, Rouge, Spice from pycocoevalcap.tokenizer.ptbtokenizer import PTBTokenizer from pycocotools.coco import COCO from lmms_eva...
Python
1
mr_cipher_to_str(cipher: u8) -> *mut ::cty::c_char; } #[safe_wrap(_)] extern "C" { pub fn wifi_mgmr_api_fw_tsen_reload() -> ::cty::c_int; } #[safe_wrap(_)] extern "C" { pub fn wifi_mgmr_scan_item_is_timeout( mgmr: *mut wifi_mgmr_t, item: *mut wifi_mgmr_scan_item_t, ) -> ::cty::c_int; } <repo...
Rust
0
se; let mut found_comme_ca = false; for chunk in slice.iter() { let text = &mixed[chunk.offset as usize.. chunk.offset as usize + chunk.bytes as usize]; if chunk.lang1 == Language::ENGLISH as u16 && text.contains("ancient Ma...
Rust
0
rs_bitvec_bv_b64_shrink_to_fit(this: *mut BitVec<BigEndian, u64>) { if this.is_null() { return; } (&mut *this).shrink_to_fit(); } #[cfg(target_pointer_width = "64")] #[no_mangle] pub unsafe extern "C" fn rs_bitvec_bv_l64_shrink_to_fit(this: *mut BitVec<LittleEndian, u64>) { if this.is_null() { return; } (&mut *thi...
Rust
0
QGradientStop type; i.e., a position and a color. Use the setColorAt() /// function to define a single stop point. Alternatively, use the /// setStops() function to define several stop points in one go. Note that /// the latter function *replaces* the current set of stop points. /// /// It is the gradient's complete s...
Rust
0
__package__ = "retriever" from aipipeline.retriever.vector_and_graphRetriever import VectorAndGraphRetriever __all__ = [ "VectorAndGraphRetriever", ]
Python
1