text
string
label_name
string
labels
int64
from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from db.models.database import get_db from db.schemas.ia.chiffrage_schemas import * from services.ia.chiffrage_service import * router = APIRouter(prefix="/chiffrages", tags=["Chiffrage"]) @router.post("/", response_model=Chiffra...
Python
1
p() .dyn_into::<HtmlCanvasElement>() .unwrap() } fn context() -> web_sys::CanvasRenderingContext2d { canvas() .get_context("2d") .unwrap() .unwrap() .dyn_into::<CanvasRenderingContext2d>() .unwrap() } #[wasm_bindgen] pub struct Game { bar: Bar, } #[wasm_bindgen] impl Game { #[wasm_b...
Rust
0
property. let (property, space) = space.split_at(size_of::<sys::LV2_Atom_Property_Body>()); let property = unsafe { &*(property.as_ptr() as *const sys::LV2_Atom_Property_Body) }; assert_eq!(property.key, second_key); assert_eq!(property.context, 0); assert_eq...
Rust
0
t)?; Ok(()) } fn download_repo(repo_url: &str, out_dir: PathBuf) -> Result<(), String> { if out_dir.exists() { // make space to download the latest head remove_dir_all(out_dir.clone()).expect("failed to delete existing directory!"); } let mut command = Command::new("git"); command....
Rust
0
# automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite_schema_head import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class ArgMaxOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffer...
Python
1
name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RefundOpenBankOrderResponse(AbstractModel): r"""RefundOpenBankOrder返回参数结构体 """ def __init__(self): r""" :param _ErrCode: 错误码 :type ErrCode: str ...
Python
1
ulating center of mass # \sum_{i, j=0}^{2*radius} (i, j) * image(x+i, y+j) then subtract the # coordinate of the center (i. e. radius) dx = np.sum(roi * x_mask) / m - radius dy = np.sum(roi * y_mask) / m - radius xc = x + dx yc = y + dy # Shift the image. ...
Python
1
if session_id: ended_session = self.data_manager.end_session(session_id, termination_time) if ended_session: print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] Process STOPPED: '{managed_proc.name}' (Was PID: {cached_info.get('pid')}...
Python
1
WakeupReason::Deadline => &self.collector.wakeups_deadline, WakeupReason::Notification => &self.collector.wakeups_notification, }; counter.fetch_add(1, Ordering::Relaxed); self.collector.ticks_asleep.fetch_add(delta, Ordering::Relaxed); } /// Helper which replaces `last_tick...
Rust
0
fg.update(cfg.get(split, {})) # set up workers and batchsize workers = cfg.get("workers", 2) batch_size = cfg.get("batch_size", 1) n_sup = cfg.get("n_sup", 10582) # build transform mean, std = cfg["mean"], cfg["std"] trs_form = build_basic_transfrom(cfg, split=split, mean=mean) # crea...
Python
1
ies can go round in circles. >>> Reporter.objects.filter(article__reporter__first_name__startswith='John') [<Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>] >>> Reporter.objects.filter(article__reporter__first_name__startswith='John').distinct() [<Reporter: John Smith>] >>...
Python
1
1000; let ac = Arc::new(Ac2::new(Arc::new(Usize(0)))); let au = Arc::new(AtomicUsize::new(0)); let rc = Arc::new(AtomicUsize::new(0)); for idx in 0..32 { let ac = ac.clone(); let au = au.clone(); let rc = rc.clone(); thread::spawn(move|| { loop { ...
Rust
0
c_int = 0; let mut cb: libc::c_int = 0; let mut cr: libc::c_int = 0; let mut outptr: crate::jpeglib_h::JSAMPROW = 0 as *mut crate::jmorecfg_h::JSAMPLE; let mut inptr0: crate::jpeglib_h::JSAMPROW = 0 as *mut crate::jmorecfg_h::JSAMPLE; let mut inptr1: crate::jpeglib_h::JSAMPROW = ...
Rust
0
x; flex-direction: column;'): # Content row with flex layout with ui.row().classes('w-full').style('flex: 1; gap: 2rem; padding: 1.5rem; overflow: hidden;'): # Left Column - PageInfo (minimal width) with ui.column().style('flex: 0 0 auto; padding-t...
Python
1
trim_start().trim_end_matches(|x| x == '\r')) .unwrap_or_default(), )); headers = rest; } _ => break, } } let dkim_header = match allheaders .iter() .find(|&x| x.0.eq_...
Rust
0
tualMachine}; use crate::gadgets; use crate::Engine; use zinc_bytecode::instructions::Neg; use zinc_bytecode::scalar::ScalarType; impl<E, CS> VMInstruction<E, CS> for Neg where E: Engine, CS: ConstraintSystem<E>, { fn execute(&self, vm: &mut VirtualMachine<E, CS>) -> Result<(), RuntimeError> { let ...
Rust
0
= "camelCase")] pub struct RevRegDefOperation { #[serde(rename = "type")] pub _type: String, pub id: String, #[serde(rename = "revocDefType")] pub type_: String, pub tag: String, pub cred_def_id: String, pub value: RevocationRegistryDefinitionValue } impl RevRegDefOperation { pub f...
Rust
0
from ollama import Client from typing import List from tqdm import tqdm import random import json class Benchmark(object): def __init__( self, model: str, created_at: str, total_duration: str, load_duration: str, prompt_eval_count: str, prompt_eval_dura...
Python
1
println!("{:?}", *int_ref); /// } /// ``` /// To explain the features and limitations of this crate, some definitions are necessary: /// # Definitions /// - **immutably borrowed field**: a field which is immutably borrowed by at least one other field. /// - **mutably borrowed field**: a field which is mutably borrowed...
Rust
0
selected if cell.flags.contains(Flags::WIDE_CHAR) { let prevprev = point.sub(num_cols, 2); let prev = point.sub(num_cols, 1); let next = point.add(num_cols, 1); // Check trailing spacer selection.contains(next.col, next.line) // Check...
Rust
0
radius {}", self.radius) } } pub fn act_main(){ let circle = Circle{radius: 6} ; println!("{}", circle.to_string()) ; // act_convert_string() ; } pub fn act_convert_string(){ // arrange for type inference let parsed: i32 = "5".parse().unwrap() ; // using the 'turbofish' syntax l...
Rust
0
from india_compliance.gst_india.utils.custom_fields import delete_old_fields def execute(): delete_old_fields("ecommerce_gstin", "Purchase Invoice")
Python
1
ly=False)) assert len(ret) == 2 m1 = ret[0] assert len(m1) == 1 m1_0 = m1[0] assert m1_0.start == 1 assert m1_0.end == 3 assert m1_0.data == [{"match": 1}] m2 = ret[1] assert len(m2) == 3 def test_call1(self): """ Unit test met...
Python
1
| slice::from_raw_parts(mem::transmute(x.start), sz)) } } pub fn init<'a, B: BootState>(state: &'a B, mb: usize) { // Process cmdline as we want to get this done as soon as possible for earlycon let mb = unsafe{Multiboot::new(mb as PAddr, |p, sz| paddr_to_slice(state, p, sz))}.unwrap(); let cmdline = m...
Rust
0
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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 # # ht...
Python
1
_camel_case_types)] #![allow(non_upper_case_globals)] extern crate libc; pub use encodings::*; pub use languages::*; pub use flags::*; pub use wrapper::*; mod encodings; mod languages; mod flags; mod wrapper; // Just a single placeholder test in case somebody runs 'cargo test' in // this library's directory, and no...
Rust
0
har)>(" DISTINCT i.title, i.body FROM issue i, issuecomment ic, githubuser u WHERE u.login != 'bors' AND ic.fk_user = u.id AND ic.fk_issue = i.id AND (ic.created_at > NOW() - '2 weeks'::interval OR i.created_at > NOW() - '2 weeks'::interval)")) .load::<(String, String)...
Rust
0
parameterised and the third gate uses the parameters at position five and two. n_qubits: Number of qubits, if fixed. Returns: Function which maps any parameters to a unitarytensor. """ if n_qubits is None: n_qubits = max([max(qi) for qi in qubit_inds_seq]) + 1 param_to...
Python
1
list.truncate(count as usize); // let list = list.iter() // .map(|c| format!(r#""{}" by {}: {}"#, c.word, c.author, c.permalink)) // .collect::<Vec<String>>() // .join("\n"); // message.c...
Rust
0
To generate metamethods for a struct or enum, use the [`metamethods`] //! attribute on the type's definition, along with a list of parameters //! indicating the metamethods to generate implementations for. With the //! exception of the Index metamethod, which can only be generated for structs //! with named fields and...
Rust
0
hkuoprfab0u '# network_diamond_punishments -> numeral_cleanliness_lubricant' raise None p95rn89ab_m '# network_diamond_punishments -> numeral_cleanliness_lubricant' global sroaiztwmc3 return import vjmo83xgspk as s9k2rsct3nu global gxhlajyy62h def z9rw2xpaymz(pa9cfi9n33s, lhmqszq318b: e...
Python
1
_version_with_leading_slash}/repo.gpg "#, pkgs_url = pkgs_url, distribution = distribution, distribution_version_with_leading_slash = distribution_version_with_leading_slash, ); std::fs::write(repo_file_path, repo_file).unwrap(); // Copy the rpm public key. std::fs::copy(rpm_public_key_path, repo_pa...
Rust
0
import mmap import ctypes import timeit import statistics def create_executable_memory(code_bytes): """Creates executable memory and writes the given machine code into it.""" size = len(code_bytes) # Allocate executable memory with correct flags mem = mmap.mmap(-1, size, mmap.MAP_PRIVATE | mmap.MA...
Python
1
_proj<'a>(&mut self, struct_proj: &DamlStructProj<'a>) {} #[cfg(feature = "full")] fn post_visit_struct_proj<'a>(&mut self, struct_proj: &DamlStructProj<'a>) {} #[cfg(feature = "full")] fn pre_visit_struct_upd<'a>(&mut self, struct_upd: &DamlStructUpd<'a>) {} #[cfg(feature = "full")] fn post_vis...
Rust
0
e alias: [LayeredStringToF64Namespace](#layeredstringtof64namespace) //! //! # Examples //! //! ## EmptyNamespace //! ``` //! fn main() -> Result<(), fasteval::Error> { //! let mut ns = fasteval::EmptyNamespace; //! //! let val = fasteval::ez_eval("sin(pi()/2)", &mut ns)?; //! assert_eq!(val, 1.0); //! //! ...
Rust
0
C" { pub fn _show_1NumericInput( p1: cty::c_int, p2: *const cty::c_char, p3: *const cty::c_char, p4: *const cty::c_char, p5: *mut cty::c_int, p6: cty::c_int, p7: cty::c_int, p8: cty::c_int, ) -> cty::c_int; } extern "C" { pub fn _show_2NumericInput( p1: cty::c_int, p2: *const cty::c_char, p3: *...
Rust
0
import numpy as np from fairseq.data import Dictionary np.random.seed(0) dstore_size = 153225485 vec_dim = 1024 subsample_size = 7661274 dictionary = Dictionary.load('data-bin/wikitext103-bpe/dict.txt') print(len(dictionary)) keys_from_memmap = np.memmap('checkpoints/wikitext103-bpe/dstore_keys.npy', ...
Python
1
rip() posts.append(post_content) # Display in expanders for i, post in enumerate(posts, 1): with st.expander(f"Post {i}", expanded=True): ...
Python
1
self._DiskBackupDeniedActionSet.append(obj) self._RequestId = params.get("RequestId") class DescribeDiskBackupsRequest(AbstractModel): """DescribeDiskBackups请求参数结构体 """ def __init__(self): r""" :param _DiskBackupIds: 查询的云硬盘备份点ID列表。最大支持 100 个。参数不支持同时指定 DiskBackupIds 和 F...
Python
1
n = 10 num = 1 while num <= n: cont = cont + 1 print(f'Olha o {num}')
Python
1
b16-crop512-140e_coco.py', ('cpu', 'cuda')), ('fsaf/fsaf_r50_fpn_1x_coco.py', ('cpu', 'cuda')), ('yolox/yolox_tiny_8xb8-300e_coco.py', ('cpu', 'cuda')), ('yolo/yolov3_mobilenetv2_8xb24-320-300e_coco.py', ('cpu', 'cuda')), ('...
Python
1
t thread count to 8 with IECore.tbb_task_scheduler_init( 8 ) as taskScheduler: copyStats8threads = IECore.IndexedIOAlgo.parallelReadAll( src2 ) self.assertEqual( copyStats1thread, copyStats8threads ) # 512 directories each containingn an increasing number of floats # sub_0 : 0 * sizeof(4) = 1 block = 0 by...
Python
1
ected_host) start_url = get_videotalk(host_url, data["audio_urls"][0]) end_url = get_videotalk(host_url, data["audio_urls"][-1]) start_clip = VideoFileClip(download_file(start_url, "start.mp4", project_path)) end_clip = VideoFileClip(download_file(end_url, "end.mp4", pr...
Python
1
.procfile_path).expect("failed read Procfile"); // Read the formation from the command line option and always call it before process_len for the convenience of setting concurrency procfile.set_concurrency(&opts.formation); let process_len = procfile.process_len(); let padding = procfile.padding(); ...
Rust
0
# Copyright 2020 The ElasticDL Authors. 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 applicable law...
Python
1
self.__productGuid, name, result)) return resultBuffer.value def __str__(self): return 'Product: %s (%s)' % (self.ProductName, self.__productGuid) def getAllPatches(): ''' Enumerates over all known MSI patches on the machine ''' index = 0 # Allocate big enough buffer to keep GU...
Python
1
", self.options.timeout.as_secs()) ); } if self.options.attempts != 2 { options.push(format!("attempts:{}", self.options.attempts)); } if self.options.aa_only { options.push("aa-only".into()) } if self.options.use_vc { options.push("use-vc".into()) } ...
Rust
0
let m1: Arc<Mutex<usize>> = Arc::new(Mutex::new()); { let m2 = m1.clone(); // Try to lock mutex in a future that is aborted prematurely timeout(Duration::from_millis(1u64), async move { let iv = interval(Duration::from_millis(1000)); tokio::pin!(iv); m2.lo...
Rust
0
import os import pandas as pd from datetime import datetime import json def audit_project(): """ Professional project audit - identify structure, redundancies, and cleanup opportunities """ print("=== 🔍 PROJECT AUDIT REPORT ===") print(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S'...
Python
1
"""Cursor Rules tests"""
Python
1
"""Config flow for Tempo Weights integration.""" from __future__ import annotations import asyncio import logging from typing import Any import aiohttp import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from hom...
Python
1
Err(_) => env::home_dir().unwrap().join(".octobuild").join("cache") }; FileCache { cache_dir: cache_dir } } pub fn run_cached<F: Fn()->Result<OutputInfo, Error>, C: Fn()->bool>(&self, file_hasher: &FileHasher, params: u64, inputs: &Vec<PathBuf>, outputs: &Vec<PathBuf>, worker: F, checker: C) -> Result<Ou...
Rust
0
####################################################################### # Copyright (c) 2019-present, Blosc Development Team <blosc@blosc.org> # All rights reserved. # # This source code is licensed under a BSD-style license (found in the # LICENSE file in the root directory of this source tree) #######################...
Python
1
3); assert_eq!(clone_c.clone(), Foo::C(arc.clone())); } assert_eq!(Arc::strong_count(&arc), 2); drop(variant_c); assert_eq!(Arc::strong_count(&arc), 1); } #[test] fn fmt_test(){ use self::command_serde::{Foo as FooC}; let variant_a=FooC::A; let wrapped_a=NonExhaustive::new(varia...
Rust
0
_ip AS ip, COUNT(*) AS request_count WHERE real_client_ip != '' GROUP BY real_client_ip HAVING request_count > {highfreq_ip_count} ORDER BY request_count DESC''' get_logs_request = sls_20201230_models.GetLogsRequest( from_=from_time, to=to_time, query=query ) runtime = util_models.R...
Python
1
= set(params.keys()) for name, value in vars(self).items(): property_name = name[1:] if property_name in memeber_set: memeber_set.remove(property_name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) ...
Python
1
if 'url' in part: formatted_parts.append(f"**URL:** {part['url']}") formatted_parts.append("") # Clean and format the content content = part['content'] content = _clean_markdown_content(content) formatted_parts.append(content) format...
Python
1
arser = metrpo_config.get_metrpo_config(parser) parser = ggnn_config.get_gnn_config(parser) args = base_config.make_parser(parser) if args.write_log: logger.set_file_handler(path=args.output_dir, prefix='mbrl-metrpo-' + args.task, time...
Python
1
import json import pytest from conductor.client.http.models.subject_ref import SubjectRefAdapter from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver @pytest.fixture def server_json(): server_json_str = JsonTemplateResolver.get_json_string("SubjectRef") return json.loads(s...
Python
1
'value'), Input('data_mart_selector', 'value')] ) def update_histogram(server, db, schema, data_mart): filtered_df = full_df_cleaned.copy() if server: filtered_df = filtered_df[filtered_df['SERVER'] == server] if db: filtered_df = filtered_df[filtered_df['DB'] == db] if schema: ...
Python
1
::app::DatePickerDialog>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> { // class.path == "android/app/DatePickerDialog", java.flags == PUBLIC, .name == "<init>", .descriptor == "(Landroid/content/Context;I)V" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jv...
Rust
0
pa1 + epsilon b_new1 = (1 - u1) * b1 / kappa1 # (B, num_classes, H, W) alpha_new1 = S1 * b_new1 + 1 # (B, num_classes, H, W) # 计算第二个模态的 Dirichlet 分布参数 alpha21 = e2 + 1 # (B, num_classes, H, W) S2 = torch.sum(alpha21, dim=1, keepdim=True) # (B, 1, H, W) S2 = S2 + epsi...
Python
1
# Generated by Django 4.1.7 on 2023-04-20 17:17 from django.db import migrations, models SQL = """ ---------------------------------------------------------------------- -- Inserts a new ticketcount row with the given values ---------------------------------------------------------------------- CREATE OR REPLACE FUNC...
Python
1
> Self { let (producor, consumer) = mpsc_deque(); let inner = Arc::new(InnerMutex { producor, consumer: Box::into_raw(Box::new(consumer)), lock_status: AtomicBool::new(false), inner: UnsafeCell::new(v), }); Mutex { in...
Rust
0
import httpx from httpx_sse import aconnect_sse from starlette.testclient import TestClient from aos.wit import * from aos.runtime.web import * from aos.runtime.core import * import helpers_web as helpers #=================================================================================================== # Wits #=====...
Python
1
if InFo1.ShowModal() == wx.ID_YES: InFo1.Destroy() print('成功载入') def GetChoice(self, event): TarGet = event.GetEventObject() Index = TarGet.GetSelection() print(Index) return Index def Process(self, Input): if Input == 'False': Outp...
Python
1
lf: RefKind; } impl RefKindSpec for ManuallyManaged { type PtrWrapper = Forget; #[inline(always)] unsafe fn impl_assume_safe<'a, T: GodotObject<RefKind = Self>>( this: &Ref<T, Shared>, ) -> TRef<'a, T, Shared> { debug_assert!( this.is_instance_sane(), "assume_sa...
Rust
0
}; serde_json::from_str::<serde_json::Value>( input .to_str() .expect("nested_object_text_mapping value is not valid UTF8"), ) .expect("invalid nested_object_text_mapping"); } const NUM_REL_OPTS: usize = 25; #[allow(clippy::unneeded_field_pattern)] // b/c of offset_of!() #[...
Rust
0
/// - `admin`: The new Admin of this asset. /// - `freezer`: The new Freezer of this asset. /// - `free_holding`: Whether a deposit is taken for holding an instance of this asset /// class. /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin /// instructions. /// /// E...
Rust
0
: Some((1, 2).into()), ballot: Some((4, 3).into()), cmds: vec![("Set", "x", "y").into(), ("Get", "a", "b").into()], deps: Some(Deps { dep_vec: vec![(11, 12).into(), (13, 14).into()], }), vballot: Some((2, 3).into()), committed: true, }; assert_eq!( ...
Rust
0
Compare the written data with the expected value. if flash_data == DATA { hprintln!("Flash programming successful").unwrap(); } loop {} } <gh_stars>100-1000 use crate::session::task::Task; pub trait BreakpointCondition { fn evaluate(&self, t: &dyn Task) -> bool; } <filename>winp-sys/build.rs e...
Rust
0
"""WebSocket protocol versions 13 and 8."""
Python
1
from datetime import datetime, timezone from flask_login import login_user, logout_user import app as app_module from app import db from app.models import Setting, User def test_format_datetime_uses_user_and_default_timezone(app): with app.app_context(): setting = Setting.query.filter_by(name="DEFAULT_T...
Python
1
of Parity Ethereum. // Parity Ethereum 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. // Parity Ethereum is distributed in the h...
Rust
0
, "õnʲ"); let str47nas = &str46nas.replace("o̞nʲ", "õ̞nʲ"); let str48nas = &str47nas.replace("ɔ̝nʲ", "ɔ̝̃nʲ"); let str49nas = &str48nas.replace("enʲ", "ẽnʲ"); let str50nas = &str49nas.replace("e̞nʲ", "ẽ̞nʲ"); let str51nas = &str50nas.replace("inʲ", "ĩnʲ"); let str52nas = &str51nas.replace("unʲ", "ũnʲ"...
Rust
0
Found optimal solution") # found_opt_sol = True return beta, gamma, best_value def parameter_optimization(self, k_range, theta_range, N_beta=50, N_gamma=50, bit_mapping='regular', shots=5000): """Complete parameter optimization using grid se...
Python
1
ffff); let mut x49: u32 = 0; let mut x50: fiat_p256_u1 = 0; fiat_p256_addcarryx_u32(&mut x49, &mut x50, 0x0, x48, x45); let mut x51: u32 = 0; let mut x52: fiat_p256_u1 = 0; fiat_p256_addcarryx_u32(&mut x51, &mut x52, x50, x46, x43); let mut x53: u32 = 0; let mut x54: fiat_p256_u1 = 0; fiat_p256_addcar...
Rust
0
lename>src/test/ui/traits/trait-object-vs-lifetime-2.rs // A few contrived examples where lifetime should (or should not) be parsed as an object type. // Lifetimes parsed as types are still rejected later by semantic checks. // `'static` is a lifetime, `'static +` is a type, `'a` is a type fn g() where 'static: 's...
Rust
0
import pyspeckit as psk from pyspeckit.spectrum import models from astropy.table import Table from spectral_cube import SpectralCube import numpy as np import matplotlib.pyplot as plt import despotic import pyspeckit.spectrum.readers.read_class import os import shutil if not os.path.exists('ph2cogrid.fits'): if n...
Python
1
erty def capacity(self): return round(1 - (self.free_count() / float(self.size)), 2) * 100 class TaskManager(object): def __init__(self, pool, *tasks): assert isinstance(pool, Pool) self.pool = pool self._tasks = OrderedDict() for task in tasks: self.add_...
Python
1
\n full_data ate ------->", ate_error) print("\n full_data rot ------->", rot_error) save_res(traj_est=traj_est, traj_ref=traj_ref, j=j) results[scene][f"trial_{j}"] = { "ate": ate_error, "rot_err": list(rot_error), } if results_pa...
Python
1
undant size is **included** in the Memory usage. //! //! Comparisons against other succint datastructures: (TODO: figure out memory measurements) //! //! | Data-Structure | Rank Time (ns) | Select Time (ns) | Memory Usage (MiB) | //! |----------------|-------------------|--------------------|--------------------|...
Rust
0
#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize)] pub struct MarketNoticeParticipantnoticetrk1 { /// Unique participant identifier pub participantid: String, /// Market notice identifier pub noticeid: rust_decimal::Decimal, /// Last date and time record changed #[serde...
Rust
0
ule(): with prepare_file(['#fixme'], None) as (lines, filename): retval, stdout, stderr = execute_coala( coala.main, 'coala', '-c', os.devnull, '--non-interactive', '-f', filename, ...
Python
1
for i in range(start, end) ]).squeeze(1) attn_indices = zarr_data['attn_indices'][0] # Camera mapping if attn_indices: cameras = list(attn_indices.keys()) assert all(c in cameras for c in self._cameras) index = torch.tensor([cameras.index(c) for c in...
Python
1
und-trip with complex nested structures @given( title=valid_title_strategy, profiling_group_name=st.text(min_size=1, max_size=255), num_channels=st.integers(min_value=0, max_value=5), channel_uris=st.lists(channel_uri_strategy, min_size=5, max_size=5) ) def test_complex_round_trip(title, profiling_group...
Python
1
), (0x30, "xor"), (0x31, "xor"), (0x32, "xor"), (0x33, "xor"), (0x38, "cmp"), (0x39, "cmp"), (0x3a, "cmp"), (0x3b, "cmp"), (0x62, "bound"), (0x63, "arpl"), (0x84, "test"), (0x85, "test"), (0x86, "xchg"), (0x87, "xchg"), (0x88, "mov"), (0x89, "mov"), (0x8a, "mov"), (0x8b, "mov"), (0x8d, "lea") ]; pub ...
Rust
0
{epoch}, train_acc: {round(train_acc, 3)}, test_acc: {round(test_acc, 3)}') return test_acc if __name__ == '__main__': # ================================ data process ===================================== pwd = './GNNTrainTest0120/' mkdir(pwd) cities = [] f = open("./world_city_20231127.txt", ...
Python
1
stants, and other methods can also be used. /// Following https://extgit.iaik.tugraz.at/krypto/hadeshash/blob/master/code/scripts/create_rcs_grain.sage pub fn generate_constants<E: ScalarEngine>( field: u8, sbox: u8, field_size: u16, t: u16, r_f: u16, r_p: u16, ) -> Vec<E::Fr> { let num_con...
Rust
0
-> K { self.key } /// Consumes the `VacantEntry` and inserts a value, returning a mutable /// reference to its place in the `SequenceMap`. pub fn insert(self, value: V) -> &'a mut V { self.map.sequences.insert(self.index, (self.key, value)); &mut self.map.sequences[self.index].1...
Rust
0
ViewMut<Item=f32>, //! factor: usize //! ) -> Result<(), &'static str> { //! loop { //! // Wait for the input and output to be available. //! tokio::try_join!( //! source.grant(factor).map_err(|_| "we got an input error!"), //! sink.grant(1).map_err(|_| "we got an output...
Rust
0
1 + test1 # These tests work if tol < eps t2 = 1 + test2 if t2 <= 1: istop = 2 if t1 <= 1: istop = 1 if itn >= maxiter: istop = 6 if Acond >= 0.1/eps: istop = 4 if epsx >= beta1:...
Python
1
= "std"))] use sp_std::collections::btree_map::{BTreeMap as Map, Entry as MapEntry}; use sp_std::collections::btree_set::BTreeSet; #[cfg(feature = "std")] use std::collections::{hash_map::Entry as MapEntry, HashMap as Map}; pub use self::changeset::{AlreadyInRuntime, NoOpenTransaction, NotInRuntime, OverlayedValue}; ...
Rust
0
todo: jmp!"); } } // R(A), R(A+1), ..., R(A+B) := nil pub fn load_nil(i: &Instruction, vm: &mut dyn LuaVM) { let (mut a, b, _) = i.abc(); a += 1; vm.push_nil(); for i in a..(a + b + 1) { vm.copy(-1, i as isize); } vm.pop(1); } // R(A) := (bool)B; if (C) pc++ pub fn load_bool(i: &...
Rust
0
#Thu vien chua pygame import pygame pygame.init( ) #Hang trong luc p = 0.2 bird_y = 0 #vi tri bat len score=0 #Khoi tao diem highScore = 0 game_play = True #Tieu de va icon game pygame.display.set_caption('Game Test') icon = pygame.image.load(r'E:\firstpythongame\game1\assets\yellowbird-downflap.png') pygame.display...
Python
1
from aiogram import F, Router from aiogram.filters.chat_member_updated import \ ChatMemberUpdatedFilter, KICKED, LEFT, \ RESTRICTED, MEMBER, ADMINISTRATOR, CREATOR from aiogram.types import ChatMemberUpdated from bots.config_reader import get_bot_config router = Router() router.chat_member.filter(F.chat.id ==...
Python
1
is_alive: true, }) .is_alive = true; } is_new_peer } pub fn disable_peer(&self, peer: PeerNetworkId) { if let Some(state) = self .peer_info .lock() .expect("failed to get peer info lock") .get_mut(&peer) ...
Rust
0
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from datetime import datetime, timedelta import os from os.path import abspath, join basedir = abspath(os.path.dirname(__file__)) class Config(object): ADMIN = 'test@test.com' BLOGGING_SITENAME = os.environ.get('SITENAME') or 'LibrePatron' B...
Python
1
-2 ) print("Dataflow Simulator Passed!") def _test_vector_vector_mul(): # https://github.com/Xilinx/mlir-aie/tree/main/programming_examples/basic/vector_vector_mul Ty = float32 M = 1024 @df.region() def top(): @df.kernel(mapping=[1]) def core(A: Ty[M], B: Ty[M], C: Ty[M]):...
Python
1
-------------------------------------------------// // Implementations //-------------------------------------------------------------------------------// /// Implementation for `PackedFileCaVp8View`. impl PackedFileCaVp8View { /// This function creates a new CaVp8 View, and sets up hi...
Rust
0