text
string
label_name
string
labels
int64
basePrice = int(GRID_BASE) elif GRID_BASE == "LAST": basePrice = get_last_price() elif GRID_BASE == "BID": basePrice = PAIR.orderbook()['bids'][0]['price'] elif GRID_BASE == "ASK": basePrice = PAIR.orderbook()['asks'][0]['price'] except: basePrice = 0 if basePrice == 0: log("...
Python
1
()> { // The trailing separator is disallowed after a rest element let has_trailing_rest = match node.into_iter().last() { Some(elem) => matches!( elem?, JsAnyObjectAssignmentPatternMember::JsObjectAssignmentPatternRest(_) ), None => fa...
Rust
0
] = 2 * ((key_map1[:, c, ...] - torch.min(key_map1[:, c, ...])) / (torch.max(key_map1[:, c, ...]) - torch.min(key_map1[:, c, ...]))) - 1.0 # key_map2[:, c, ...] = 2 * ((key_map2[:, c, ...] - torch.min(key_map2[:, c, ...])) / (torch.max(key_map2[:, c, ...]) - torch.min(key_map2[:, c, ...]))) - 1.0 ...
Python
1
).pvf_checking_enabled, Error::<T>::PvfCheckDisabled, ); let validators = shared::Pallet::<T>::active_validator_keys(); let current_session = shared::Pallet::<T>::session_index(); if stmt.session_index < current_session { return Err(Error::<T>::PvfCheckStatementStale.into()) } else if stmt.sessi...
Rust
0
(); let mut connection = Connection::new()?; let get_current_output_index = |connection: &mut Connection| { connection.get_outputs().map(|outputs| { outputs .iter() .position(|x| x.focused) .expect("No focused output") }) }; ...
Rust
0
wrap(); let vcpu = vm.create_vcpu(0).unwrap(); const MSR_TSC_AUX: u32 = 0xc0000103; let mut msrs = vec![Register { id: MSR_TSC_AUX, value: 42, }]; vcpu.set_msrs(&msrs).unwrap(); msrs[0].value = 0; vcpu.get_msrs(&mut msrs).unwrap(); ...
Rust
0
use self::flatbuffers::EndianScalar; #[allow(non_camel_case_types)] #[repr(u8)] #[derive(Clone, Copy, PartialEq, Debug)] pub enum MessageBody { NONE = 0, Handshake = 1, HandshakeResult = 2, Run = 3, RunResult = 4, Sample = 5, SampleResult = 6, Observe = 7, ObserveResult = 8, Tag = 9, TagResult...
Rust
0
over time vel_hist : (T, N, D) array History of D-dimensional velocities of all N agents over time Returns ------- d_group : (T, D) array Heading direction of the group at each time step c_group : (T, D) array Centroid of the group at each time step angular_distance...
Python
1
35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25, ]; /// Expansion permutation const E_BITS: [usize; 48] = [ 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, ...
Rust
0
from sklearn.tree import DecisionTreeRegressor, export_graphviz from sklearn.metrics import mean_squared_error class Tree: def __init__(self, data, y_name): """ :param data: :param y_name: """ y = data.pop(y_name) self.exog = data.copy() self.endog = y.c...
Python
1
th tf.variable_scope('octree_%d' % d, reuse=True): octree = octree_update(octree, label, depth=d, mask=1) if d < depth: with tf.variable_scope('octree_%d' % (d+1)): octree = octree_grow(octree, target_depth=d+1, full_octree=False) else: with tf.variable_scope('r...
Python
1
# handlers/docx_handler.py """ DOCX Metadata Scrubber for rMeta Copies paragraph content to a fresh document to remove embedded metadata. ✅ Format: .docx 🔐 Non-destructive to content """ import logging import os from pathlib import Path import asyncio import docx from utils.pii_scanner import scan_text_for_pii log...
Python
1
from_u64(self.H2, out.mut_slice(16, 24)); from_u64(self.H3, out.mut_slice(24, 32)); from_u64(self.H4, out.mut_slice(32, 40)); from_u64(self.H5, out.mut_slice(40, 48)); from_u64(self.H6, out.mut_slice(48, 56)); from_u64(self.H7, out.mut_slice(56, 64)); } fn result...
Rust
0
8}, Checkbox {"checkbox", "I have read and agreed to the above Terms and Conditions".to_string(), (30, 24)}, Button {"button", "Start".to_string(), (55, 25)}, FpsIndicator {"fps", (0, 0)} ]; scene } fn second_scene() -> Scene { let mut scene = Scene::new("test scene", ...
Rust
0
#[inline] fn abs_diff(&self, other: &Self) -> Self { if self > other { self.clone() - other.clone() } else { other.clone() - self.clone() } } } impl<'a, 'b, T> Num for T where &'a T: Add<T, Output = T> + Mul<T, Output = T> + Sub<T, Out...
Rust
0
plying BLAKE2b with a secret key, and //! the hashes retrieved //! from using `orion::hash` are therefore not suitable as MACs. //! - BLAKE2b is not suitable for password hashing. See [`orion::pwhash`] //! instead. //! //! # Example: //! ```rust //! use orion::hash::{digest, Digest}; //! //! let hash: Digest = dige...
Rust
0
#!/usr/bin/env python3 # ''' Update the status of batteries to IoT platform ''' import time import smbus2 import requests from ina219 import INA219,DeviceRangeError import random DEVICE_BUS = 1 DEVICE_ADDR = 0x17 PROTECT_VOLT = 3700 SAMPLE_TIME = 2 FEED_URL = "https://api.52pi.com/feed" time.sleep(random.randint(0, 5...
Python
1
self.assertEqual(result.automatic_priority, expected_priority, start_date) @patch("recruitment.models.date") def test_manager_annotate_with_priority__online(self, mock_date): # Arrange mock_date.today.return_value = date(2022, 1, 1) # force today's date dates = [ (date(...
Python
1
32 - 48) .sum::<i32>() } else { 1 } } fn main() { println!("{}", sum_of_digits_fac(100)); } <filename>src/replies/video.rs<gh_stars>10-100 use replies::ReplyRenderer; use utils::current_timestamp; #[derive(Debug, Eq, PartialEq, Clone)] pub struct VideoReply { pub source: String, ...
Rust
0
: State = State { builder: gen, frames: Vec::new(), current_frame: 0, }; gs.builder.setup(); gs.frames = gs.builder.build(); main_loop(context, gs) } pub fn iteration_color(iter: usize) -> RGB { match iter { 0 => RGB::named(WHITE), 1 => RGB::named(GREEN), ...
Rust
0
//////////////////////////// typedefDict["TSecurityFtdcVCHAR60Type"] = "string" #////////////////////////////////////////////////////////////////////// #TFtdcVCHAR65Type是一个六十五字节VCHAR类型 #////////////////////////////////////////////////////////////////////// typedefDict["TSecurityFtdcVCHAR65Type"] = "string" #/////////...
Python
1
ded(candidate_b.clone()), &signing_context, 0, &alice_public.into(), )).expect("should be signed")); assert_matches!(noted, NotedStatement::Fresh(_)); // note C (beyond 2 - ignored) let noted = head_data.note_statement(block_on(SignedFullStatement::sign( &keystore, Statement::Seconded(candidate...
Rust
0
iếng Na Uy cổ', 'yrl': 'núridiku arkaiku', 'yue': '古諾爾斯文', 'yue-Hans': '古诺尔斯文', 'yue-Hant': '古諾爾斯文', 'zh': '古诺尔斯语', 'zh-Hans': '古诺尔斯语', 'zh-Hant': '古諾爾斯文'}, 'noo': {'en': 'Nootka'}, 'nop': {'en': 'Numanggang'}, 'noq': {'en': 'Ngongo'}, 'nos': {'en': 'Eastern Nisu'}, 'not': {'en': 'Nomatsiguenga'}, ...
Python
1
an() { if !elem.is_nan() { out_graph.add_edge( source_index, NodeIndex::new(target_index), elem.to_object(py), ); } } else if *elem ...
Rust
0
from ...domain.models import Task from ..base import IPlugin from ...services.command_builder import FFmpegCmd from ...services.presets_service import PresetsService class TrimClipPlugin(IPlugin): name = "trim_clip" display_name = "Trim / Clip" def build_command(self, ffmpeg_bin: str, task: Task) -> list...
Python
1
from app import create_app, db import sqlalchemy as sa import logging logging.basicConfig(level=logging.INFO) app = create_app() def upgrade(): with app.app_context(): try: conn = db.engine.connect() # Log existing table structure inspector = sa.inspect(db...
Python
1
cyan, magenta, yellow, } } pub fn get_cyan(&self) -> f32 { self.cyan } pub fn get_magenta(&self) -> f32 { self.magenta } pub fn get_yellow(&self) -> f32 { self.yellow } pub fn get_black(&self) -> f32 { self.black } pub fn to_string(&self) -> String { format...
Rust
0
ge (only applies if --stage diffusion and encoder/decoder are learnable).") parser.add_argument("--no_cuda", action="store_true", help="Disable CUDA even if available.") args = parser.parse_args() # Validate args if args.stage == "reconstruction" and (args.encoder_type != "learnable" or args.decoder_t...
Python
1
..Default::default() }, with_outline: true, })); commands .spawn(Camera2dComponents::default()) .spawn(SpriteComponents { material: color_materials.add(asset_server.load("playerShip1_red.png").into()), transform: Transform { tr...
Rust
0
nsafe { FromGlibPtrContainer::from_glib_none(ffi::g_get_language_names()) } } #[cfg(any(feature = "v2_58", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_58")))] #[doc(alias = "g_get_language_names_with_category")] #[doc(alias = "get_language_names_with_category")] pub fn language_names_with_cate...
Rust
0
Self where T: Zero, { let nrows = mat.len(); let ncols = mat.get(0).expect("cant sparsify matrix with no rows").len(); let dim = (nrows, ncols); let (mut row, mut col, mut val) = (vec![], vec![], vec![]); for (r, row_vec) in mat.into_iter().enumerate() { ...
Rust
0
ices; pub unsafe fn init(table: *const BootServices) { S_BOOT_SERVICES = table; } fn get_boot_services() -> Option<&'static BootServices> { unsafe { if S_BOOT_SERVICES as usize == 0 { None } else { Some(&*S_BOOT_SERVICES) } } } pub struct Allocator; unsafe...
Rust
0
browser = "default browser" extra = " instead" if forceChrome else "" try: console(f"trying {browser}{extra} ...") opened = webbrowser.open(url, new=new, autoraise=autoraise) except Exception: opened = False if opened: console(f"corpus ope...
Python
1
import pytest import drjit as dr import mitsuba as mi spectrum_dicts = { 'd65': { "type": "d65", }, 'regular': { "type": "regular", "wavelength_min": 500, "wavelength_max": 600, "values": "1, 2" } } def create_emitter_and_spectrum(s_key='d65'): emitter = m...
Python
1
mbol_table = SymbolTable::new(original_symbol_table.machine_model().clone()); ExprTransformer { new_symbol_table, empty_statics: FxHashMap::default() } .transform_symbol_table(original_symbol_table) } /// Extract `empty_statics` map for final processing. fn empty_statics_owned(&mut self...
Rust
0
import numpy as np import logging from YRC.core import Algorithm from YRC.core.configs.global_configs import get_global_variable class OODAlgorithm(Algorithm): def __init__(self, config, env): super().__init__() self.args = config self.env = env self.save_dir = get_global_variable(...
Python
1
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from gunicorn.http.message import Message, Request from gunicorn.http.parser import RequestParser __all__ = ['Message', 'Request', 'RequestParser']
Python
1
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT """ Example sketch to connect to PM2.5 sensor with either I2C or UART. """ # pylint: disable=unused-import import time import board import busio from digitalio import DigitalInOut, Direction, Pull from adafruit_pm25.i2c impo...
Python
1
#!/usr/bin/env python3 """ 디버깅용 상세 테스트 """ import requests import json from datetime import datetime, timedelta def test_with_detailed_error(): """상세 오류 정보를 포함한 테스트""" # 1시간 데이터 (120개 포인트, 30초 간격) start_time = datetime(2024, 1, 15, 22, 0, 0) end_time = start_time + timedelta(hours=1) # 1...
Python
1
a = b'%b' % b'foo' a : source.python : source.python = : keyword.operator.assignment.python, source.python : source.python b : source.python, storage.type.string.python, string.quoted.binary.single.python ' : punctuation.definition.string.be...
Python
1
apService, ) -> Result<()> { let mbox = Mbox::new(mbox); let msg = imap.find_raw_msg(&seq)?; let flags = Flags::try_from(vec![Flag::Seen])?; imap.append_raw_msg_with_flags(&mbox, &msg, flags)?; printer.print(format!( r#"Message {} successfully copied to folder "{}""#, seq, mbox )...
Rust
0
# cook your dish here x, y, z = map(int,input().split()) if((x+y)>=z): a = (2*z)+y else: a = (2*x)+(3*y) print(a)
Python
1
#[doc = " OpenFlow Switch Specification."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rte_flow_action_of_push_mpls { #[doc = "< EtherType."] pub ethertype: rte_be16_t, } #[test] fn bindgen_test_layout_rte_flow_action_of_push_mpls() { assert_eq!( ::std::mem::size_of::<rte_flow_action_of_push...
Rust
0
#[serde(default)] pub struct ThreatCollection { #[serde(deserialize_with = "null_to_default")] pub id: u64, #[serde(deserialize_with = "null_to_default")] pub last_updated: u64, #[serde(deserialize_with = "null_to_default")] pub name: String, #[serde(deserialize_with = "null_to_default")] ...
Rust
0
_ASCENDENTE: f32 = 0.10; const RSI_HORIZONTAL: f32 = 0.13; const RSI_DESCENDENTE: f32 = 0.17; const RSE: f32 = 0.04; // conductividad del terreno no helado, en [W/(m·K)] const LAMBDA_GND: f32 = 2.0; const LAMBDA_INS: f32 = 0.035; #[derive(Debug, Default, Clone, Serialize, Deserialize)] /// Reporte de cálculo de las tr...
Rust
0
RANT"): m.d.sync += [ z.eq(0), iteration.eq(0), quadrant_adjust.eq(0) ] with m.If((in_latch.real >= 0)): # Q1, Q4 m.d.sync += [ x.eq(in_latch.real), ...
Python
1
#!/usr/bin/env python # # Copyright (c) 2016, PagerDuty, Inc. <info@pagerduty.com> # All rights reserved. # # 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 copy...
Python
1
tr!`](../macro.get_str.html) /// /// # Panics /// This function will panic if another thread panicked while accessing the global string pool. /// pub fn resolve_and_clone(self) -> String { get_str!(self).to_string() } /// Intern this string into the string pool and return an opaque i...
Rust
0
ght) = u32::try_from(right) { blitter.blit_v(right, top, one_len, alpha_mul(alpha, r & 0xFF)); } } } fn call_hline_blitter( mut x: u32, y: Option<u32>, count: LengthU32, alpha: AlphaU8, blitter: &mut dyn Blitter, ) { const HLINE_STACK_BUFFER: usize = 100; let mut ru...
Rust
0
# -*- coding: utf-8 -*- import datetime import tempfile import shutil from django.db import models # Can't import as "forms" due to implementation details in the test suite (the # current file is called "forms" and is already imported). from django import forms as django_forms from django.core.files.storage import Fil...
Python
1
ls.append(target_col) # Add cutoff column if 'cutoff' in filtered_df.columns and 'cutoff' not in ordered_cols: ordered_cols.append('cutoff') # Add sample column if 'sample' in filtered_df.columns and 'sample' not in ordered_cols: ...
Python
1
import asyncio import logging import sys from os import getenv from typing import Any, Dict from aiogram import Bot, Dispatcher, F, Router, html from aiogram.enums import ParseMode from aiogram.filters import Command, CommandStart from aiogram.fsm.context import FSMContext from aiogram.fsm.state import State, StatesGro...
Python
1
emantic_file).astype(np.int) # 0~19 label_pred_rgb = np.array(itemgetter(*SEMANTIC_NAMES[label_pred])(CLASS_COLOR)) rgb = label_pred_rgb elif (opt.task == 'instance_pred'): assert opt.room_split != 'train' instance_file = os.path.join(opt.result_root, opt.room_split, opt.room_name ...
Python
1
"""Benchmark different change point detection approaches.""" from __future__ import annotations import time import numpy as np from sensor_modeling.change_point import ( EmbeddingCPD, EnergyEfficientCPD, AdaptiveNormalizer, GeneticOptimizationCPD, ) from sensor_modeling.utils import plot_benchmark_re...
Python
1
) in dep_table { let mut package_version = None; let package_source = match *value { toml::Value::Table(ref t) => { if let Some(relative_path) = getstr(t, "path") { // TODO: this path isn't necessarily correct Some(parent.join(relative...
Rust
0
"""allow unique_table_ownership per type Revision ID: 299e24dcfd29 Revises: c00f08f16065 Create Date: 2024-01-31 14:39:13.601013 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = "299e24dcfd29" down_revision = "c00f08f16065" ...
Python
1
static_icons = (('La 1', 'rtve.png'), ('La 2', 'la2.png'), ('Antena 3', 'antena3.png'), ('La Sexta', 'a3-lasexta.jpg'), ('A3Series', 'a3media.png'), ('Nova', 'A3_Nova.min.png'), ('Neox', 'A3_Neox.min.png'), ('Mega', 'a3-mega.jpg'), ('Real Madrid TV', 'realmadridtv.jpg'), ('24h', None), ('Teledeporte...
Python
1
.options( sa_orm.contains_eager(models.Booking.stock) .contains_eager(offers_models.Stock.offer) .options( sa_orm.contains_eager(offers_models.Offer.venue), sa_orm.contains_eager(offers_models.Offer.criteria), sa_orm.joinedload(off...
Python
1
derive(Debug, PartialEq)] pub enum ClusterId { Outline, Unclassified, Classified(usize), } /// This struct is using to store temporary values for points /// such as cluster_id and index of the point pub struct PointWrapper<F: IntoPoint> { point: F, cluster_id: ClusterId, index: usize, } impl<F...
Rust
0
resources: [TEMP, EXTR], }, } } fn init(mut p: init::Peripherals) -> init::LateResources { let mut flash = p.device.FLASH.constrain(); let mut rcc = p.device.RCC.constrain(); let clocks = rcc.cfgr.freeze(&mut flash.acr); let mut timer2 = Timer::tim2(p.device.TIM2, 10.hz(), clocks, &mut rcc.a...
Rust
0
a d,@sdZddlZddlZddlmZddlmZmZddlm Zzddl m Z Wne ybdZ Yn0gdZ zddl mZWn"e yGd d d eZYn0Gd d d eZGd ddZGdddeZGdddeZGdddZe dureZ dS)z'A multi-producer, multi-consumer queue....
Python
1
efmt::Format for SysCfg { fn format(&self, f: defmt::Formatter) { defmt::write!(f, "SysCfg(SYSCFG)"); } } impl fmt::Debug for SysCfg { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SysCfg").finish() } } impl Deref for SysCfg { type Target = SYSCFG; ...
Rust
0
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
Python
1
c_types::c_int { pthread_mutexattr_init(attr as *mut _) } #[no_mangle] #[inline(never)] pub unsafe extern "C" fn pthread_rwlockattr_destroy(attr: *mut c_types::c_void) -> c_types::c_int { pthread_rwlockattr_init(attr as *mut _) } <gh_stars>10-100 use postgres::error::Error; use db; use models; use helper; use...
Rust
0
, device_name, {} if config is None else config, ) def import_model( self, model_stream: bytes, device_name: str, config: Optional[dict[str, Any]] = None, ) -> CompiledModel: """Imports a compiled mode...
Python
1
S_BITWISE_BOOL), LintId::of(needless_borrow::REF_BINDING_TO_REFERENCE), LintId::of(needless_continue::NEEDLESS_CONTINUE), LintId::of(needless_for_each::NEEDLESS_FOR_EACH), LintId::of(needless_pass_by_value::NEEDLESS_PASS_BY_VALUE), LintId::of(non_expressive_names::MANY_SINGLE_CHA...
Rust
0
import torch import torchmetrics import torchmetrics.utilities class RetrievalMetrics(torchmetrics.Metric): """ A metric class for computing various retrieval metrics. This class calculates NDCG (Normalized Discounted Cumulative Gain), HR (Hit Rate), and MRR (Mean Reciprocal Rank) for a given set of ...
Python
1
} } } pub(crate) struct ServerMessageAcceptor<T> { inner: T, } impl<T> ServerMessageAcceptor<T> where T: NewService<Request = net::TcpStream>, { pub(crate) fn new(inner: T) -> Self { ServerMessageAcceptor { inner } } } impl<T> NewService for ServerMessageAcceptor<T> where T: ...
Rust
0
building initials.."); let mut templates = HashMap::new(); if let Some(initials) = &self.parameters.initials { blockchain.set_external_wallets(initials.external_templates()); templates = initials.templates(self.parameters.voting_power, blockchain.discrimination()...
Rust
0
extern crate rustc_serialize; extern crate core_lib; extern crate database_lib; extern crate bodyparser; #[macro_use] extern crate serde_derive; extern crate serde; extern crate serde_json; #[macro_use] mod error; mod users; mod kifu; mod scraping; mod websocket; use std::path::Path; use std::thread; use std::env...
Rust
0
en(0)) .derive(0) .derive(index) .to_bech32(); spendKey } pub fn get_private_key_bytes_from_mnemonic(phrase: &str, index: u32) -> Vec<u8> { let result = Mnemonic::from_phrase(phrase, Language::English).unwrap(); let entropy = result.entropy(); let root_key = get_root_key(&ent...
Rust
0
e2222 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, software distributed under the License ...
Rust
0
-Z multitarget") .arg("--target") .arg(&t1) .arg("--target") .arg(&t2) .masquerade_as_nightly_cargo() .run(); } #[cargo_test] fn same_value_twice() { if cross_compile::disabled() { return; } let t = rustc_host(); let p = project() .file("C...
Rust
0
opaque_debug::implement!($state); digest::impl_write!($state); }; } macro_rules! impl_variable_groestl { ($state:ident, $block:ident, $min:expr, $max:expr) => { #[derive(Clone)] pub struct $state { groestl: Groestl<$block>, } impl BlockInput for $state { ...
Rust
0
info!( "Verifying transfers... {} remaining, {} verified, {} failures", remaining_count, verified_txs, failed_verify ); sleep(Duration::from_millis(100)); } } } pub fn fund_evm_keys<T: 'static + Client + Send + Sync>( client: Arc<T>, ...
Rust
0
// 1.7.10 (id: 2259, stack: 1) Record5, // 1.7.10 (id: 2260, stack: 1) Record6, // 1.7.10 (id: 2261, stack: 1) Record7, // 1.7.10 (id: 2262, stack: 1) Record8, // 1.7.10 (id: 2263, stack: 1) Record9, // 1.7.10 (id: 2264, stack: 1) Record10, /...
Rust
0
], }; // Act let res = api.send_event_to_config(send_event_request, config).await.unwrap(); // Assert assert_eq!(Some("test-type-custom"), res.event.event_type()); match res.result { ProcessedNode::Ruleset { name, rules } => { assert_eq!("cu...
Rust
0
panic!("Min depth of Merkle tree is larger than max depth."); } let mut wtr = csv::Writer::from_path(args.output.clone()).expect("Failed to open output file."); if args.attestation { let (proof_times, verify_times) = samecommit::Attestation { hasher1: hashes::Sha256::<Bls12>::default(),...
Rust
0
ints( self.prevSequenceId, self.tableName, self.keyName): self.prevSequenceId = logPoint.sequenceId jsonPayload = {} jsonPayload["wall_time_ms"] = logPoint.wallTimeMs jsonPayload["value"] = logPoint.value jsonPayload["sequence_id"] = logPoint.s...
Python
1
>, { /// Converts the API result to a generic result, returning an error if the request was not /// successful. fn into_result(self) -> Result<R> { if self.success { if let Some(r) = self.result { Ok(r) } else { bail!("invalid result in success...
Rust
0
usize::MAX } else { (1_usize) << (bits + 1) - 1 })) -> usize { integer } } /// To avoid stack overflow, this limits the arbitrarily-generated test /// `ReducePlan`s to involve at most 8 aggregations. /// /// To have better coverage of realistic expected group sizes, the /// `expected g...
Rust
0
=> { Ok(Box::new(RolAbsX {})) } // ROR 0x66 => { Ok(Box::new(RorZp {})) } 0x6A => { Ok(Box::new(Ror {})) } 0x6E => { Ok(Box::new(RorAbs {})) } 0x76 => { Ok(Box::new(RorZpX {})) } 0x7E => { Ok(Box::new(RorAbsX {})) } // RTI 0x40 => { Ok(Box::new(Rti {})) ...
Rust
0
], &mut [libc::c_char; 5]>(b"RPCL\x00"), }; init }, { let mut init = j2k_prog_order { enum_prog: OPJ_PROG_UNKNOWN, str_prog: *::std::mem::transmute::<&[u8; 5], &mut [libc::c_char; 5]>( b"\x00\x00\x00\x00\x00", ), }; init }, ] }; /* * * FIXME...
Rust
0
import fnmatch import re from pathlib import Path from typing import List MATCH_SEP = r"(?:/|\\)" MATCH_SEP_OR_END = r"(?:/|\\|\Z)" MATCH_NON_RECURSIVE = r"[^/\\]*" MATCH_RECURSIVE = r"(?:.*)" def glob_to_re(pattern: str) -> str: """Translate a glob pattern to a regular expression for matching.""" fragments:...
Python
1
sshr_imm.i64 (I64) // --> [RexOp1r_ib#f0c1] and stop 0x015f, 0xf0c1, // end of sshr_imm.i64 (I64) // 000138: stack_addr.i64 (I64) // --> [RexOp1spaddr_id#808d] and stop 0x0279, 0x808d, // end of stack_addr.i64 (I64) // 00013a: store.i64 (I64) // --> [RexOp1st#8089] // 00013a: st...
Rust
0
nd(None) for passes in pass_list: recip.process_to_q(frame_mode=passes, **pdict) def _process_to_q_exception(param_dict, frame_mode): with pytest.raises(KeyError): recip.process_to_q(frame_mode=frame_mode, **param_dict) @pytest.mark.parametrize("fails", [0, 5, "cat"]) @pytest.mark.skipif(os....
Python
1
2. 如果类太大,按类内方法分片 3. 保持导入语句和全局变量的完整性 """ start_time = time.time() try: # 解析AST tree = ast.parse(content) chunks = [] # 1. 提取模块级导入和全局变量 module_chunk = self._extract_module_level_content(content, tree, ...
Python
1
| eyre::eyre!("Failed to extract artifact ir as a string"))? ); } ContractArtifactFields::IrOptimized => { println!( "{}", to_value(&artifact.ir_optimized)?.as_str().ok_or_else(|| eyre::eyre!( "Failed...
Rust
0
s[0].docs[0].text ) assert ( f'client0-Request-client0-deployment0-client0-deployment1-client0-merger-client0-deployment_last' == responses[0].docs[0].text or deployment2_path or deployment4_path ) p = Process(target=process_wrapper) p.sta...
Python
1
new(sphere::Sphere::new( Point::new(360.0, 150.0, 145.0), 70.0, Arc::new(Dialectric::new(1.5)), )); objects.add(Arc::clone(&boundary)); objects.add(Arc::new(constant_medium::ConstantMedium::new( Arc::clone(&boundary), 0.2, Color::new(0.2, 0.4, 0.9), ))); ...
Rust
0
_dec = BlockchainConfiguration::try_from(cps).unwrap(); blockchain_configuration == blockchain_configuration_dec } } } <gh_stars>10-100 #![allow(dead_code)] use bevy::prelude::*; use bevy_loading::prelude::*; #[derive(Debug, Clone, PartialEq, Eq, Hash, Component)] enum AppState { Splash, ...
Rust
0
import os import infra.basetest class TestLibCamera(infra.basetest.BRTest): # A specific configuration is needed for testing libcamera: # a kernel config fragment enables v4l2 vimc driver. # The libevent package is also enabled to have the libcamera "cam" # test application. kernel_fragment = \ ...
Python
1
/> }, Route::Benchmark => html! { <Benchmark session_key=get_session_key() /> }, } }) /> } } } fn get_session_key() -> Option<u128> { let hash = web_sy...
Rust
0
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
import asyncio import socket from fastapi import FastAPI, Request, Query, HTTPException from fastapi.responses import HTMLResponse, JSONResponse, FileResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates import uvicorn from typing import Optional import os from datetime imp...
Python
1
clock_source = match pll_conf.source { PllSourceHSIDiv2 => { rcc.cr.set_hsi_on(true); wait_for!(rcc.cr.hsi_ready()); false // pll_clock_source = HSI divided by 2 }, PllSourceHSE(_) => { rcc.cr.set_hse_on(true); ...
Rust
0
(val) => Some(*val), AuxVar::L3CacheGeometry(val) => Some(*val), AuxVar::MinSigStkSz(val) => Some(*val), _ => None, } } /// Returns a value, if the corresponding auxiliary vector entry is of type [`AuxVarType::Flags`]. pub const fn value_flags(&self) -> Option<Au...
Rust
0
ait role.delete() embed = discord.Embed( title="🗑️ Suppression des membres", description="Suppression des membres (kick) en cours...", color=discord.Color.green() ) await ctx.send(embed=embed) for member in ctx.guild.members: if not member.bot and member != ctx.aut...
Python
1
; let listener = TcpListener::bind(&bind_addr).await.map_err(|err| { error!("failed to listen on {} ({}), {}", local_addr, bind_addr, err); err })?; let actual_local_addr = listener.local_addr().expect("determine port bound to"); let servers = PlainPingBalancer::new(context, ServerTyp...
Rust
0
.arg("apply") .arg("../../0001-Fix-zlib-dependency.patch")); } // Only configure if not previously configured. Configuring runs a // `bazel clean`, which we don't want, because we want to be able to // continue from a cancelled build. ...
Rust
0