text
string
label_name
string
labels
int64
winding order of triangle strip."] pub const BGFX_TOPOLOGY_CONVERT_TRI_LIST_TO_LINE_LIST: bgfx_topology_convert = 2; #[doc = " ( 2) Convert triangle list to line list."] pub const BGFX_TOPOLOGY_CONVERT_TRI_STRIP_TO_TRI_LIST: bgfx_topology_convert = 3; #[doc = " ( 3) Convert triangle strip to triangle list."] pub const...
Rust
0
import os import re # 定义函数来处理文件名 def process_wav_name(wav_name,cuts): # 移除文件扩展名 cleaned_name = os.path.splitext(wav_name)[0] # 剔除下划线 hira_list=sorted(['いぇ','うぇ','うぃ','うぉ','きゃ','きゅ','きぇ','きょ','ぎゃ','ぎゅ','ぎぇ','ぎょ','くぁ','くぃ','くぇ','くぉ','ぐぁ','ぐぃ','ぐぇ','ぐぉ','しゃ','しゅ','しぇ','しょ','じゃ','じぇ','じゅ','じょ','すぃ','ずぃ','ちゃ...
Python
1
reuse_btn = gr.Button(value="Reuse Provisional Image Generation Prompt") clear_prompt_btn.click(fn=lambda x: "", inputs=[relighting_prompt], outputs=[relighting_prompt]) reuse_btn.click(fn=lambda x: x, inputs=[prompt], outputs=[relighting_prompt]) with gr...
Python
1
mtls module exposes "low level" building blocks //! that can be used to implement the security requirements //! needed to call psd2 APIs //! //! For more information on the spec //! https://openbanking.atlassian.net/wiki/spaces/DZ/pages/7046134/Open+Banking+Security+Profile+-+Implementer+s+Draft+v1.1.0 //! https://www...
Rust
0
_size); let w = rect_size.x; let h = rect_size.y; df.box(0. * w, 0.35 * h, 0.87 * w, 0.39 * h, 0.75); df.box(0. * w, 0.28 * h, 0.5 * w, 0.3 * h, 1.); df.union(); return df.fill(color); ...
Rust
0
Arguments: gene_name: str Name of gene to plot. rotate_angle: float, optional (default=-90) Rotation angle in degrees for plot orientation. vmin: float, optional (default=5) Minimum value for color scale. figsize: tupl...
Python
1
super::n::X, super::n::XBuilder, schema::a::resources::DATA, false), (optional_data, super::n::X, super::n::XBuilder, schema::a::resources::OPTIONAL_DATA, true));//! Database persistence tasks. use crate::prelude::*; const COMMIT_INTERVAL_MIN: Duration = Duration::from_millis(50); co...
Rust
0
.0.slice(start..end)) } else { VerifyTransactionContext::new_unchecked(self.0.slice(start..)) } } pub fn as_reader<'r>(&'r self) -> VerifyTransactionWitnessReader<'r> { VerifyTransactionWitnessReader::new_unchecked(self.as_slice()) } } impl molecule::prelude::Entity for V...
Rust
0
"""modify address comment Revision ID: cf1b53c9137e Revises: 17406c2735a3 Create Date: 2024-06-29 21:01:51.226471 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'cf1b53c9137e' down_revision = '17406c2735a3' branch_labels = ...
Python
1
/// # use pretty_assertions::assert_eq; /// use padded_column::{PaddedValue, PadDirection, ForbidExcess}; /// let padded_value = PaddedValue { /// value: "abcdef", /// pad_block: '-', /// total_width: 9, /// pad_direction: PadDirection::Left, /// handle_excess: ForbidExcess, /// }; /// assert_eq!(p...
Rust
0
from matplotlib import pyplot as plt import matplotlib as mpl import numpy as np from typing import Union, Dict mpl.rcParams["font.sans-serif"] = ["SimHei"] mpl.rcParams["axes.unicode_minus"] = False def draw( x, y, axis: list[int], title: str, xlabel: str, ylabel: str, grid: bool = True,...
Python
1
y_data_input; pub use self::byte_array_data_input::*; mod growable_byte_array_output; pub use self::growable_byte_array_output::*; mod ram_output; pub use self::ram_output::*; use std::error::Error; use wapc::{ModuleState, WapcFunctions, WasiParams, WebAssemblyEngineProvider, HOST_NAMESPACE}; use wasmtime::{AsCon...
Rust
0
e10bb29c6ea5012077" SAFE_CONTRACT = "0xa6b71e26c5e0845f74c812102ca7114b6a896ab2" RUBYSCORE_VOTE_CONTRACT = "0xe10Add2ad591A7AC3CA46788a06290De017b9fB4" L2TELEGRAPH_MESSAGE_CONTRACT = "0x9f63dbdf90837384872828d1ed6eb424a7f7f939" L2TELEGRAPH_NFT_CONTRACT = "0xdc60fd9d2a4ccf97f292969580874de69e6c326e" NFT_ORIGINS_CON...
Python
1
c[..]); assert_eq!(t, vec![0.25, 0.25, 0.25, 0.25]); } //! Contains functionality of resume container command use std::fs::canonicalize; use std::path::PathBuf; use anyhow::{bail, Context, Result}; use clap::Clap; use crate::container::Container; use crate::container::ContainerStatus; use crate::utils; use cgroup...
Rust
0
match res { Some(data) => Ok(Some(bincode::deserialize(&data)?)), None => Ok(None), } } #[instrument(level = "debug", skip_all, err)] fn insert(&self, key: &K, value: &V) -> Result<(), TypedStoreError> { let key_buf = be_fix_int_ser(key)?; let value_b...
Rust
0
params(query): params = urlparse.parse_qs(query) if any(len(v) > 2 for v in params.values()): raise ValueError('DB URI params list has duplicate keys: ' + query) return {k: json.loads(v[0]) for k, v in params.items()} def _clean_path(path, path_prefix=""): """Cleans the path of the request. Removes the...
Python
1
} impl<T: NotNull> IntoNullable for T { type Nullable = Nullable<T>; } impl<T: NotNull> IntoNullable for Nullable<T> { type Nullable = Nullable<T>; } pub trait Expression { type SqlType; } pub trait Column: Expression {} #[derive(Debug, Copy, Clone)] //~^ ERROR the trait bound `<Col as Expression>::Sq...
Rust
0
ew(dx, dy)); let ctx = ctx.borrow(); let (x, y) = *ctx.window.pointer.borrow(); let origin = TypedPoint2D::new(x as i32, y as i32); servo.borrow_mut().handle_events(vec![WindowEvent::Scroll(delta, origin, ev_type)]); } Inhibit(false...
Rust
0
ags); w.write_all(&self.body[..]); } } */ impl Readable for CertExt { fn take_from(b: &mut Reader<'_>) -> Result<Self> { let len = b.take_u16()?; let ext_type: ExtType = b.take_u8()?.into(); let flags = b.take_u8()?; let body = b.take(len as usize)?; Ok(match ex...
Rust
0
anyhow::Result; use abstutil::Timer; use map_model::{EditCmd, Map, MapEdits}; pub fn override_sidewalk_widths(map: &mut Map, path: String, timer: &mut Timer) -> Result<()> { let edits = MapEdits::load_from_file(map, path, timer)?; for cmd in &edits.commands { if let EditCmd::ChangeRoad { r, new, .. ...
Rust
0
s[i].lock.hash).is_ok() { ready_waiters.push(waiters.swap_remove(i)); } else { i += 1; } } self.waiter_count .fetch_sub(ready_waiters.len(), Ordering::SeqCst); if waiters.is_empty() { ...
Rust
0
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ##### BEGIN LICENSE BLOCK ##### # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License...
Python
1
PREFIX sag: <http://failsafe.ai/sag/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?claim ?text WHERE { ?claim rdf:type arg:Claim . ?claim sag:hasText ?text . } """ }, ...
Python
1
intensity let mut pf = 1.0; // Max intensity point value let mut pcostanti: Vec<f64> = Vec::new(); let mut spini: Vec<f64> = Vec::new(); for nuc in &rad.nucs { let pcostante = nuc.hpf.val/incrgauss as f64; pcostanti.push(pcostante); ...
Rust
0
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
1
x9a\x82\xebzM\xb5\x95\xe5\xe4Oo%\xd4\ 6wic\xa7]\xddA\x1bI\x1cS\xc9\x15\xcb\xdb\ \x99\x08\x85\xc0\x97\xe7\x8fV\xd5\xee\x04-5\xb5\xb47\ \xd6\x97\x93\xc7\xe7\x91t\x9f\xe8i\xf3\xac\xd7\x16\x9b\x04\ \xb1\xb9$\x06\xf2\x0a\xaeA;X\x1c\x01\xe2\xda'\xc6\ YX\x5ci\x1a\x96\x99\xe2\xab\x88'\xb5\x95\x1d\xa4\xf0\ \xed\xdd\xc6\x95\xa8Z...
Python
1
haviour::NetworkBehaviour; use config_utils::to_peer_id; use fluence_libp2p::{build_transport, types::OneshotOutlet}; use server_config::{ default_air_interpreter_path, ListenConfig, NetworkConfig, NodeConfig, ServicesConfig, }; use trust_graph::TrustGraph; use anyhow::Context; use async_std::sync::Mutex; use asy...
Rust
0
VALIDATION_DISABLE, SettingMacsecValidation::Check => nm_sys::NM_SETTING_MACSEC_VALIDATION_CHECK, SettingMacsecValidation::Strict => nm_sys::NM_SETTING_MACSEC_VALIDATION_STRICT, SettingMacsecValidation::__Unknown(value) => value, } } } #[cfg(any(feature = "v1_6", feature...
Rust
0
test_center_reindex_frame(raw, frame): # shifter index s = [f"x{x:d}" for x in range(12)] minp = 10 frame_xp = ( frame.reindex(list(frame.index) + s) .rolling(window=25, min_periods=minp) .apply(f, raw=raw) .shift(-12) .reindex(frame.index) ) frame_rs = f...
Python
1
required or optional. pub struct QuotedIntVisitor<T> { require_quotes: bool, _phantom: PhantomData<T>, } impl<'a, T> serde::de::Visitor<'a> for QuotedIntVisitor<T> where T: From<u64> + Into<u64> + Copy, { type Value = T; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result ...
Rust
0
"cannot fit address pool" ); } #[test] fn test_static_assignments_try_from_fidl() { use std::iter::FromIterator; let mac = random_mac_generator().bytes(); let ip = random_ipv4_generator(); let fields_present = vec![fidl_fuchsia_net_dhcp::StaticAssignment { ...
Rust
0
# Copyright 2018 Apruzzese Francesco <f.apruzzese@apuliasoftware.it> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import fields, models class ResPartner(models.Model): _inherit = "res.partner" fax = fields.Char()
Python
1
rapper<'a>(#[serde(with = "LimitedPublicKeyConfig")] &'a PublicKeyConfig); let mut seq = serializer.serialize_seq(Some(keys.len()))?; for key in keys { seq.serialize_element(&Wrapper(key))?; } seq.end() } } pub struct Project { id: ProjectId, config: Arc<Config>,...
Rust
0
('燛', "jiǒng"), ('燜', "mèn"), ('燝', "jing"), ('燞', "jiǎo"), ('營', "yíng,cuō"), ('燠', "yù,ào"), ('燡', "yì"), ('燢', "xué"), ('燣', "lán"), ('燤', "tài,liè"), ('燥', "zào,sào"), ('燦', "càn"), ('燧', "suì"), ('燨', "xī"), ('燩', "què"), ('燪', "zǒng"), ('燫', "lián"...
Rust
0
a save strategy if args.save_strategy == SaveStrategy.STEPS: control.should_save = True return control def on_epoch_end( self, args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs, ): # Log ...
Python
1
Comment) } } fn character<'s>(pm: &mut Master<'s>, pt: Point<'s>) -> Progress<'s, Extent> { sequence!(pm, pt, { spt = point; _ = literal("'"); _ = character_char; _ = literal("'"); }, |_, pt| ex(spt, pt)) } fn character_char<'s>(pm: &mut Master<'s>, pt: Point<'s>) -> ...
Rust
0
mask.bit_mask[None, :] GTX = masked_GTX #masked_N_cent_X else: GTX = dataMat # PCA on full samples D = GTX.shape[0] Ncompos = D print(f"The number of components: {Ncompos}") pca = PCA(D) pca.fit(GTX) Gamma = pca.components_.reshape(dataMat.shape) Sigma = np.diag(pc...
Python
1
C4-84E5-0933C84B4F4F".into(), ("Linux", "Swap Partition"), ); m.insert( "E6D6D379-F507-44C2-A23C-238F2A3DF928".into(), ("Linux", "Logical Volume Manager Partition"), ); m.insert( "933AC7E1-2EB4-4F13-B844-0E14E2AEF915".into(), ("...
Rust
0
#line:177 print ()#line:178 print_user_data (OO0OO00OO00O00O0O .from_user .id ,OO0OO00OO00O00O0O .from_user .first_name ,OO0OO00OO00O00O0O .from_user .username ,OO0OO00OO00O00O0O .contact .phone_number )#line:179 print ()#line:180 try :#line:181 ...
Python
1
T> = vec![SENTINEL; n]; let mut next_lbas : Vec<LbaT> = vec![SENTINEL; n]; let max_chunks_per_disk = self.locator.parallel_read_count(chunks); for _ in 0..n { // Size each SGList to the maximum possible size sglists.push(SGListMut::with_capacity(max_chunks_per_disk)); ...
Rust
0
from player2024s.langchain import OpenAIAgent from pydantic import BaseModel class VoteTarget(BaseModel): target_id: int openai_agent = OpenAIAgent(temperature=1) def get_vote_target( agent_id: int, role: str, alive: list[int], my_tactics: dict[int, str] ) -> int: """ ...
Python
1
r http://opensource.org/licenses/MIT>. // This file may not be copied, modified, or distributed // except according to those terms. //! Support for Rust's futures and async/await APIs //! //! This functionality is provided via the [FuturesExecutor](FuturesExecutor) //! trait, which is implemented for all executors in ...
Rust
0
# -*- coding: utf-8 -*- '''Check bolt distances according to table 3.3 of EN 1993-1-8:2005.''' __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2025, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" from materials.ec3 import EC3_materials # Bolt bolt= EC3_materials.Bolt...
Python
1
} writeln!(out, "}};"); } if builtin.rust_error { out.next_section(); writeln!(out, "template <>"); writeln!(out, "class impl<Error> final {{"); writeln!(out, "public:"); writeln!(out, " static Error error(repr::PtrLen repr) noexcept {{"); write...
Rust
0
e}: {e.stderr}") continue finally: os.remove(pipeline_path) # Update progress feedback.setProgress((index + 1) / total_files * 100) feedback.pushInfo("CRS assignment completed for all files.") return {self.OUTPUT_FOLDER: output_folder...
Python
1
import warnings from django.utils.deprecation import RemovedInDjango60Warning try: import oracledb is_oracledb = True except ImportError as e: try: import cx_Oracle as oracledb # NOQA warnings.warn( "cx_Oracle is deprecated. Use oracledb instead.", RemovedInDjang...
Python
1
g_1.png') # original_image=cv2.resize(original_image,(32,32)) # # 创建一个大图 # fig, ax = plt.subplots(int(np.sqrt(B)), int(np.sqrt(B)), figsize=(24,24), sharex=True, sharey=True) # # 调整子图之间的间隔为0 # plt.subplots_adjust(wspace=0, hspace=0) # # 循环绘制每个小图 # for i, flow in...
Python
1
(); RawIterPin::new(hash_map.entries.as_mut_ptr().cast(), hash_map.len()) } } /// Gets an iterator over the key-value entries in the hash map. #[inline] pub fn iter(&self) -> Iter<'_, K, V> { Iter { inner: self.raw_iter(), } } /// Gets an iterato...
Rust
0
ption<unsafe extern "C" fn(mutexHdl: *mut rlOsiMutexHdl_t) -> rlInt32_t>, #[doc = " @fn rlInt32_t (*rlOsiMutexDelete)(rlOsiMutexHdl_t* mutexHdl)"] #[doc = ""] #[doc = " @brief Destroy Mutex Object"] #[doc = " @param[in] mutexHdl - Pointer to Mutex object"] #[doc = ""] #[doc = " @return rlI...
Rust
0
# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class AgedPartnerBalanceWizard(models.TransientModel): _inherit = "aged.partner.balance.report.wizard" operating_unit_ids = fields.Many2many( como...
Python
1
""" Plugin for ResolveURL Copyright (C) 2021 gujal This program 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. ...
Python
1
# coding: utf-8 """ ChannelShipper & Royal Mail Public API Import your orders, retrieve your orders and generate labels. The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 import unittest ...
Python
1
from contrastive_classifier import FeatureClassifierModel import torch # 实例化模型 model = FeatureClassifierModel(num_channels=256, num_classes=2) # 加载模型权重 model.load_state_dict(torch.load('model_weights.pth')) # 计算并打印模型的可学习参数总数 total_params = 0 for name, param in model.named_parameters(): if param.requires_grad: ...
Python
1
S = input() try: value = int(S) print(value) except ValueError: print("Bad String")
Python
1
r = TreebankWordTokenizer() do_not_tokenize = ['Mr.','Dr.','Mrs.','Ms.','Prof.','Jr.','Sr.','Rep.', 'Sen.','Rev.','St.','Lt.','Gov.','Gen.','Brig.','Maj.','Col.','Capt.', 'Sgt.', 'U.S.','U.K.','U.N.','L.A.','U.S.S.R.','U.S.A.','B.C.', 'N.V.','G.m.b.H.','S.p.A.','B.V.','N.A.', 'Pty.','S.A.','Ltd...
Python
1
oneesk', 'ga': 'Aragóinis', 'gd': 'Aragonais', 'gl': 'aragonés', 'gsw': 'Aragonesisch', 'gu': 'અર્ગોનીઝ', 'ha': 'Aragonesanci', 'he': 'אראגונית', 'hi': 'अरागोनी', 'hi-Latn': 'Aragonese', 'hr': 'aragonski', 'hsb': 'aragonšćina', 'hu': 'aragonéz', 'hy': 'արագոներեն', 'ia': 'aragonese', 'id': 'Aragon', 'ig': 'Aragonisị', ...
Python
1
db.session.query(Tag) .join(TaggedObject) .filter( TaggedObject.object_id == example_dashboard.id, Tag.type == TagType.custom, ) .order_by(Tag.name) .all() ) assert example_tags == {tag.name for tag in created_ta...
Python
1
</div> """, unsafe_allow_html=True) # Create tabs for different workflows tab1, tab2, tab3 = st.tabs(["Topic Research", "Competitor Analysis", "Trend Discovery"]) with tab1: st.markdown(""" <div class="workflow-card"> <div class="workflow-title">Comprehensive To...
Python
1
fRdZddlZddlmZejZGddZy)zEvent loop mixins.N)eventsceZdZdZdZy)_LoopBoundMixinNctj}|j"t5|...
Python
1
e_chained_mods() { struct ModifierMock {} struct ChainedModifierMock {} #[async_trait::async_trait] impl Modifier for ModifierMock { fn key(&self) -> &'static str { "modifier-mock" } fn modify(&mut self, params: Vec<&str>) -> Option<String> { Some(...
Rust
0
out, size=(ori_h // sf, ori_w // sf), mode=mode, ) out = filter2D(out, sinc_kernel) # clamp and round im_lq = torch.clamp(out, 0, 1.0) # random crop gt_size = args_degradation['gt_size'] im_gt, im_lq = ...
Python
1
import turtle t=turtle.Turtle() turtle.title("Luka Turtle Python Graphics") class lukaturtle: def __init__(self): pass def triangle(self, a, b, c): t.fd(a) t.lt(120) t.fd(b) t.lt(120) t.fd(c) t.lt(120) turtle.done() def rectangle(self, a, b): ...
Python
1
g we may want to remove trace!("Message onward route: {}", msg.onward_route); trace!("Message return route: {}", msg.return_route); // FIXME: if we need to re-route (i.e. send it to another // domain specific router) the message here, use // send_message, ins...
Rust
0
batch_details["assemblingTime"], batch_details["transportDetails"], batch_details["ipfsHash"] ).estimate_gas({'from': self.account.address}), 'gasPrice': self.web3.to_wei(self.gwei_bid, 'gwei') }) ...
Python
1
from string import digits, ascii_uppercase alph = digits + ascii_uppercase for x in range(1, 150): num1 = 5*150**4 + 1*150**3 + x*150**2 + 2*150 + 9 #num2 = # num = num1# + #num2 if num%149==0: print(num//149)
Python
1
vqshl_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t { #[allow(improper_ctypes)] extern "C" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v2i32")] #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v2i32")] fn vqshl_u32_(a: uint32x2_t, b: in...
Rust
0
.children[index] except IndexError: node = None else: node = None poped = 0 if node is None and stack: node, index = stack.pop() poped = 1 return l def pre_order_list(node, filter_func=no_filter): """ create a l...
Python
1
hyper[i]) # w = self.compute_contribution(primary_caps, mask=mask[i].squeeze(-1)) # caps_out = self.caps[i](primary_caps, w) # caps.append(caps_out.reshape(input.shape[0], input.shape[1], self.num_caps, -1)) primary_caps = primary_caps.reshape(input.shape[...
Python
1
import os import subprocess SCRIPTS_DIR = os.path.dirname(os.path.realpath(__file__)) def test_server_setup_entrypoint_interleaves_stdout_stderr(): # Execute the server-setup-entrypoint.py script process = subprocess.Popen( [ f"{SCRIPTS_DIR}/server-setup-entrypoint.py", f"{SCR...
Python
1
def journey(budget, season): price = 0 destination = "" place = "" if season == "summer": if budget <= 100: destination = "Bulgaria" place = "Camp" price = budget * 0.3 elif 100 < budget <= 1000: destination = "Balkans" place ...
Python
1
If there's an error checking, assume we need to recreate return True # Create the DAG dag = DAG( 'materialized_view_games', default_args=default_args, description='Creates and refreshes materialized view for games data', schedule_interval='@daily', catchup=False ) # Task to match developer...
Python
1
ssert_eq!(vec![ /// Some("Hello".to_owned()), /// Some("World".to_owned()), /// None, /// ], res); /// # Ok(())})?; Ok::<(), helper::BoxError>(()) pub async fn mget<K, R>(&self, keys: K) -> Result<R, Error> where K: Serialize + Send, R: DeserializeOwned, { ...
Rust
0
'a Snapshot, start_ts: u64) -> SnapshotStore { SnapshotStore { snapshot: snapshot, start_ts: start_ts, } } pub fn get(&self, key: &Key) -> Result<Option<Value>> { let mut reader = MvccReader::new(self.snapshot, None, true, None); let v = try!(reader.get(k...
Rust
0
(&key); match score { Some(s) => println!("score:{}", s), None => println!("key not exist"), } let field_key = String::from("Favorite color"); let field_value = String::from("Blue"); let mut map = HashMap::new(); map.insert(&field_key, &field_value); println!("field_key:{}, ...
Rust
0
a = camera self.confidence_threshold = confidence_threshold self.bin_buffer_length = bin_buffer_length self.forget_min_observations = forget_min_observations self.forget_min_time = forget_min_time self.pixels_per_bin = self.camera.resolution[0] / n_bins_horizontal self.w ...
Python
1
""" Feature: 11.2.12 asyncio.wait_for() Category: Async/Await Complexity: High Status: not_implemented """ import pytest PYTHON_SOURCE = """ result = await asyncio.wait_for(coro(), timeout=5.0) """ EXPECTED_RUST = """ // TODO: Add Rust equivalent """ @pytest.mark.complexity("high") @pytest.mark.status("not_implemen...
Python
1
self.current_user: curr_video = None for elem in self.videos: if elem.title == title: curr_video = elem if curr_video: if self.current_user.age < 18 and curr_video.adult_mode: print("Вам нет 18 лет, пожалуйста п...
Python
1
return texture.get_at( (clamp(rndint(sx*w),0,w1),clamp(rndint(sy*h),0,h1)) ) def sample_nr(sx,sy): #nearest, with repeat return texture.get_at( (rndint(sx*w)%w,rndint(sy*h)%h) ) def sample_bc(sx,sy): #bilinear, with clamp sx*=w; sy*=h #can't use int(...) all by itself; rounds toward 0, ...
Python
1
`BeaconProposer`, `BeaconAttester`, //! `Randao`. //! //! #### `data` //! //! A `BeaconBlock`, `AttestationData`, or `Epoch`. //! //! #### `fork` //! //! A [`Fork`] object, containing previous and current versions. //! //! #### `genesis_validators_root` //! //! A [`Hash256`] for domain separation and chain versioning. ...
Rust
0
.arg("-i") .arg(&test_input_file) .arg("diff") .arg("local") .arg("dev"); cmd.assert().success().stdout( r#"--- local +++ dev - BAR=local_bar + BAR=dev_bar "#, ); Ok(()) } #[test] fn cmd_diff_success_toml() -> Result<(), Box<dyn std::error::Error>> { cmd_diff_s...
Rust
0
&'o self, value: &'o Value, context: &String) -> Option<Cow<'o, Value>> { assert_eq!("custom_context", context.as_str()); Some(Cow::Borrowed(value)) } } fn custom_parser(expression: &str) -> Result<Box<dyn CustomParser<String>>, ParserError> { println!("build custom pars...
Rust
0
}; (() $($tts:tt)*) => { newtype_wrap_bin_op! { trait: (::std::ops::BitXor)::bitxor, kind: simple, item: $($tts)* } }; ((&self) $($tts:tt)*) => { newtype_wrap_bin_op! { trait: (::std::ops::BitXor)::bitxor, kind: simple_ref, item: $($tts)* } }; ((&self, $($rhs:tt)*) $($tts:tt)*) => { ...
Rust
0
ram): [entropy] = self.executor.run( self.program, feed=self.feeds, fetch_list=[self._paddle_beta.entropy()], ) np.testing.assert_allclose( entropy, scipy.stats.beta.entropy(self.alpha, self.beta), ...
Python
1
max_area = area; } } println!("{}", max_area); } /// https://adventofcode.com/2018/day/6#part2 pub fn part_2() { let (min_point, max_point, points) = get_points(); let mut total_close_area = 0; for x in (min_point.x - 200)..=(max_point.x + 200) { for y in (min_point.y - 200)...
Rust
0
cx)); cx.set_down_mouse_cursor(MouseCursor::Arrow); let rsize = (self.size * 0.28) / 2.0f32.sqrt(); let vx = fe.rel.x - 0.5 * self.size; let vy = fe.rel.y - 0.5 * self.size; if vx >= -rsize && vx <= rsize && vy >= -rsize && vy <= rsize { ...
Rust
0
, dest: Place<'tcx>, extra_stmts: &mut Vec<StatementKind<'tcx>>) where 'tcx: 'a, { // chosen by fair dice roll. // guaranteed to be random. const SECRET_VALUE: u64 = 4; let v = Const::from_bits(tcx, SECRET_VALUE as u1...
Rust
0
# Copyright 2019 Google, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer; # redistribu...
Python
1
# Copyright 2021 DeepMind Technologies Limited. 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 # # Unless required by ...
Python
1
o".to_string(), Some(value.clone()), ); let json = r#" { "jsonrpc":"2.0", "method":"CreateFoo", "params":[1,2,3] } "#; let json = json.replace("\n", "").replace(" ", ""); let result = serde_json::to_string(&request).unwrap(); assert_eq!(json, result); } #[test]...
Rust
0
break except Exception as e: logger.error(f"Error closing connection: {e}") logger.info(f"Closed {self._created_connections} connections") async def get_pool_status(self) -> dict: """Получить статус пула соединений""" return { ...
Python
1
# Copyright (c) 2024 liangyuwang # Licensed under the Apache License, Version 2.0 import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) from tqdm.auto import tqdm import torch import torch.distributed as dist from example.model import GPTConfig, GPT2Model from ...
Python
1
""" A restricted Hartree-Fock code using the Psi4 JK class for the 4-index electron repulsion integrals. References: - Algorithms from [Szabo:1996], [Sherrill:1998], and [Pulay:1980:393] """ __authors__ = "Daniel G. A. Smith" __credits__ = ["Daniel G. A. Smith"] __copyright__ = "(c) 2014-2018, The Psi4NumPy Develop...
Python
1
# поиск имени Джон colleges = ['Max','John','Samuel','Barbara'] names_to_search = ['John'] print(colleges) print(names_to_search) for name in colleges: if name in names_to_search: print('есть совпадение') break else: print('совпадений не найдено')
Python
1
z { qux: usize, } let baz = Baz { qux: 0 }; track!(bar.clone())?; track!(bar.clone(), "hello")?; track!(bar.clone(), "baz.qux={}", baz.qux)?; Ok(()) } assert!(foo(Ok(())).is_ok()); } #[test] fn track_ass...
Rust
0
param for name, param in self.model.named_parameters() if name in no_decay ], "weight_decay": 0.0, }, ] optimizer = torch.optim.AdamW(optimizer_grouped_parameters, lr=self.args.lr) lr_scheduler = get_linear_schedule_with_warmup( ...
Python
1
# 错误码映射 ERROR_CODE_MAPPING = { # 百度网盘 API 错误码 -1: "系统错误", 2: "参数错误", 3: "用户未登录或者登录失败", 4: "用户未授权", 6: "不允许接入用户数据", 42000: "access_token未授权", 42001: "access_token过期", # WxPusher 错误码 1000: "参数错误", 1001: "appToken无效", 1002: "内容不能为空", 1003: "uid参数错误", 1004: "内容长度超限"...
Python
1
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": {"topic": "Should school uniforms be mandatory?", "stance": "for"}, "2": {"topic": "Is technology making us more isolated?", "stance": "against"} } @staticmethod def get_instruction...
Python
1
-1073738764i32; #[doc = "*Required features: 'Win32_System_Performance'*"] pub const PDH_PLA_ERROR_NOSTART: i32 = -1073738771i32; #[doc = "*Required features: 'Win32_System_Performance'*"] pub const PDH_PLA_ERROR_SCHEDULE_ELAPSED: i32 = -1073738772i32; #[doc = "*Required features: 'Win32_System_Performance'*"] pub con...
Rust
0
ce.sample() np.testing.assert_array_equal(actual_arr, expected_arr) def test_filter_rewards(): rewards = np.ones((2, 5)) dones = np.array([[0, 0, 0, 1, 1], [0, 1, 0, 0, 0]]) actual_output = filter_rewards(rewards, dones) expected_output = np.array([[1, 1, 1, 1, 0], [1, 1, 0, 0, 0]]) np.testing...
Python
1
wide_char: u16, control_key_state: u32, }, Mouse { position: (i16, i16), button_state: u32, control_key_state: u32, event_flags: u32, }, WindowBufferSize(i16, i16), Menu(u32), Focus(bool), } #[repr(transparent)] #[derive(Copy, Clone)] pub struct CharInfo(C...
Rust
0