text
string
label_name
string
labels
int64
sig: secp_sigs[0].clone(), }, SatisfiedConstraint::PublicKey { key: &pks[1], sig: secp_sigs[1].clone(), }, SatisfiedConstraint::PublicKey { key: &pks[2], sig: secp_sigs[2].c...
Rust
0
nds def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor = None): x_bands = self.spectrogram(x) fmap = [] x = [] for band, stack in zip(x_bands, self.band_convs): for i, layer in enumerate(stack): band = layer(band) band = to...
Python
1
StockPrice.stock_symbol == symbol, StockPrice.timestamp >= start_date ).order_by(StockPrice.timestamp.desc()).all() def _generate_next_price(self, current_price: Decimal) -> Decimal: """Generate next price using random walk with mean reversion""" # Random w...
Python
1
.SetBackground2(0.7, 0.6, 0.5) ren.GradientBackgroundOn() rwi = rw.MakeRenderWindowInteractor()# vtkRenderWindowInteractor() rwi.SetRenderWindow(rw) cow = vtkCameraOrientationWidget() cow.SetParentRenderer(ren) # Enable the widget. cow.On() # Orient the...
Python
1
.002173991233517858, -0.08223848261534872, 1.03664814908986, ]); pub fn const_conversion_matrix( src_primaries: RGBPrimaries, src_wp: WhitePoint, dst_primaries: RGBPrimaries, dst_wp: WhitePoint, ) -> Option<Mat3> { if src_primaries == dst_primaries && src_wp == dst_wp { return Some(Mat3::ID...
Rust
0
end_cave.clone()); assert_eq!(10, paths.len()); assert_eq!(vec![ "start,A,b,A,c,A,end", "start,A,b,A,end", "start,A,b,end", "start,A,c,A,b,A,end", "start,A,c,A,b,end", "start,A,c,A,end", "start,A,end", "star...
Rust
0
INVALID_BLOCK_NUMBER ), StarknetErrorCode::BlockNotFound.into_response(), )]); let error = client .state_update_by_number(*INVALID_BLOCK_NUMBER) .await .unwrap_err(); assert_matches!( erro...
Rust
0
trfsTreeId(u64); impl BtrfsTreeId { pub fn new(object_id: u64) -> BtrfsTreeId { BtrfsTreeId(object_id) } pub fn object_id(&self) -> u64 { self.0 } pub fn is_root(&self) -> bool { self.object_id() == BTRFS_ROOT_TREE_OBJECT_ID } } impl From<u64> for BtrfsTreeId { fn...
Rust
0
r # query += 1 -> ensure the offerer is VALIDATED # query += 1 -> find education year for start date # query += 1 -> rollback # query += 1 -> rollback # query += 1 -> load existing stock after rollback response = client.patch(f"/collective/stocks/...
Python
1
import os import sys sys.path.append('..') from shared import * # input: font ttf ttf = sys.argv[1] f = ttLib.TTFont(ttf) def noto_name(name: str): tokens = name.split('_') n = [] for t in tokens: if t[0] == 'u': t = t[1:] # strip u prefix n.append(t) result = '_'.join(n...
Python
1
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c), 2013-2025, John McNamara, jmcnamara@cpan.org # from xlsxwriter.workbook import Workbook from ..excel_comparison_test import ExcelComparisonTest class...
Python
1
# Copyright (c) 2015 Red Hat, Inc. # # 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 wri...
Python
1
) from None # Validate embed_through format. embed_through = kwargs.get("embed_through") if embed_through and "__" in embed_through: raise FieldDefinitionError('"embed_through" cannot contain "__".') # Set default values specific to Many-to-Many fields. kwargs["null"...
Python
1
# IfcOpenShell - IFC toolkit and geometry engine # Copyright (C) 2022 Dion Moult <dion@thinkmoult.com> # # This file is part of IfcOpenShell. # # IfcOpenShell is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundat...
Python
1
&'a TwoFloat) { let quotient = (*self / rhs).trunc(); *self -= quotient * rhs; } } impl TwoFloat { /// Calculates Euclidean division, the matching method for `rem_euclid`. /// /// # Examples /// /// ``` /// # use twofloat::TwoFloat; /// let a = TwoFloat::from(9.0); /...
Rust
0
from django.urls import path from . import views app_name = 'payment' urlpatterns = [ path('process/', views.payment_process, name='process'), path('done/', views.payment_done, name='done'), path('canceled/', views.payment_canceled, name='canceled'), ]
Python
1
repr(self.e_shentsize) + " (" + hex(self.e_shentsize) + " bytes)" mystr+= "\n==Section Header Count:\t\t\t" + repr(self.e_shnum) + " (" + hex(self.e_shnum) + ")" mystr+= "\n==Section Header String Index\t\t" + repr(self.e_shstrndx) + " (" + hex(self.e_shstrndx) + " bytes)" mystr+= "\n\n= Sectio...
Python
1
feed={'x': x_data, 'y': y_data}, fetch_list=[out], ) # save model paddle.static.save_inference_model( self.model_path_template.format(use_custom_op), [x], [out], exe, ) ...
Python
1
eq!( std::fs::read(tmp_dest.path().join("dir").join("bar"))?, b"Rustwide" ); Ok(()) } #[test] fn test_no_copy_target() -> Result<(), Error> { let (src, dest) = (tempfile::tempdir()?, tempfile::tempdir()?); std::fs::create_dir(src.path().join("target"...
Rust
0
!("LD ST, V{:X}", args.x), OpCode::opcode_ld_st_vx)), 0x1E => Some(OpCode::new(opcode, args, format!("ADD I, V{:X}", args.x), OpCode::opcode_add_i_vx)), 0x29 => Some(OpCode::new(opcode, args, format!("LD F, V{:X}", args.x), OpCode::opcode_ld_f_vx)), 0x33 => So...
Rust
0
Ensure length of value always >= 10. (or >= 11 if UntouchedFlag exists.) // | IntHandle: Only exists when table use int handles and index is unique. // | UntouchedFlag: Only exists when index is untouched. // | // +-- Old Encoding (without restore data, integer handle, local) // | ...
Rust
0
s = {8, 7, 56, "Hasnain", [1, 2]} # The above code will raise a TypeError because sets cannot contain mutable objects like lists. print(s)
Python
1
import matplotlib.pyplot as plt import numpy as np R = 1.2 dr = 0.1 f = 15 p = 0 theta = np.linspace(0, 2 * np.pi, 400) x = R * (1 + dr * np.sin(f * theta + p)) * np.cos(theta) y = R * (1 + dr * np.sin(f * theta + p)) * np.sin(theta) ax = plt.gca() ax.set_aspect('equal') plt.plot(x, y) plt.show()
Python
1
self, offset, limit ) del init_annotations["order_by"] del init_annotations["order_desc"] init_default = (default_offset, default_limit) else: def __init__func_wrapper(self, offset, limit, order_by, order_desc): self.offset = offset self.limit = ...
Python
1
plex64 as Complex}; fn main() { // new spin function let f: Ket2 = Vector2::new(Complex::new(0.6, 0.2), Complex::new(0.4, 0.2)).into(); // extract up probability let v = (Bra2::up() * f).norm().powi(2); println!("v = {}", v); }mod state_variables; mod statics; mod unused_effects; use env_para...
Rust
0
^1", true) -> 10 //! //! Hints: #148, #168, #197, #305, #327 //! use std::collections::HashMap; /// Primary Implementation /// /// Split at each operator, recursively counting the number of paren-sets in each of its operands /// correspond to the desired result. /// pub fn boolean_evaluation(expr: &str, result: bool)...
Rust
0
odel_results['test_vics'] = test_vics model_results['train_mse'] = train_losses_mse model_results['test_mse'] = test_losses_mse latent_results = {} latent_results['latent_train'] = torch.cat(latent_train_list, 0) latent_results['latent_test'] = torch.cat(latent_test_list, 0) latent_results['y_tr...
Python
1
rc = random.choice url = rc(["free.facebook.com"]) head = {"Host": url, "cache-control": "max-age=0", "upgrade-insecure-requests": "1", "origin": "https://"+url, "content-type": "application/x-www-form-urlencoded", "user-agent": "Mozilla/5.0 (Linux; Android 10; DOOGEE B10 Build/KOTG49H) AppleWebKit/537.36 (KHTML...
Python
1
println!("synced document state: {}", doc2.get_type("my first shared type").to_string()); assert_eq!(doc2.get_type("my first shared type").to_string(), "a"); } <gh_stars>0 /* Currently, test responses take around 6-7 seconds, which is far longer than the recommended 500 ms. Since this is a long-running calcula...
Rust
0
[ spk_item, input_audio0, vc_transform0, f0_file, f0method0, file_index1, ...
Python
1
""" 双色球随机选号程序 Version: 0.1 Author: 骆昊 Date: 2018-03-06 """ from random import randrange, randint, sample def display(balls): """ 输出列表中的双色球号码 """ for index, ball in enumerate(balls): if index == len(balls) - 1: print('|', end=' ') print('%02d' % ball, end=' ') print() ...
Python
1
.43, knob.angle_min, knob.angle, wiper_color, 16, 2); } } pub fn draw_wiper_only_knob(knob: &Knob, wiper_color: &ColorSet, track_color: &ColorSet) { knob.draw_arc( 0.8, 0.41, knob.angle_min, knob.angle_max, track_color, 32, 2, ); if ...
Rust
0
"""Test cases for the Two Sum solution. This module contains test cases for the Two Sum problem, including: - Basic examples from LeetCode - Edge cases (empty arrays, single elements) - Error cases (no solution exists) - Special number cases (zeros, large numbers, duplicates) - Multiple solution cases """ from typing...
Python
1
eq!( v[1], (3.into(), "a".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes()) ); assert_eq!( v[0], (5.into(), "b".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes()) ); } #[test] fn test_seek_ts() { let engine = TestEngineBuilder::new().bu...
Rust
0
= attr.parse_meta() { if meta.path().is_ident("error") { if let syn::Meta::List(list) = &meta { for nested in &list.nested { if let syn::NestedMeta::Meta(meta) = nested { if meta.path().is_ident("cause") || meta.path()....
Rust
0
larityManager(enabled=enabled) return similarity_manager # Convenience functions for similarity operations def calculate_similarity(text1: str, text2: str) -> float: """Calculate similarity between two texts.""" if similarity_manager is None: get_similarity_manager() # Initialize with default enab...
Python
1
PC[06].configure(Some(A)); // SCK -- SPI CLK PC[07].configure(Some(B)); // RTS2 (BLE) -- USART2_RTS PC[08].configure(Some(E)); // CTS2 (BLE) -- USART2_CTS PC[09].configure(None); //... NRF GPIO -- GPIO PC[10].configure(None); //... USER LED -- GPIO PC[11].configure(Some(B)); // RX2 ...
Rust
0
f"Price drop condition met for {telegram_id}: ask={ask_price:.6f}, last_buy={last_buy_price:.6f}, drop={price_drop_percent:.2f}% >= {loss_threshold:.2f}%" ) # Send notification using bot instance directly from bot...
Python
1
# Ваша задача: # Создайте новый класс Buiding с атрибутом total # Создайте инициализатор для класса Buiding, который будет увеличивать атрибут количества созданных объектов класса # Building total # В цикле создайте 40 объектов класса Building и выведите их на экран командой print class Building: total = 0 de...
Python
1
FutureDispatcher; use server::utils::*; /// Set missile damage to 0 in the config /// and dispatch a timer event to trigger /// a config reset. /// /// This system is a bit bizarre since it /// writes to config, which isn't a normal /// thing for a system to do, but I think /// it's OK in this case since it cleanly //...
Rust
0
tate[0]: cell[0], self.init_state[1]: cell[1]} value = sess.run(self.net['value'], feed_dict=feed_dict) return value def run_policy_and_value(self, sess, state, cell, *args): feed_dict={self.x: state, self.init_state[0]: cell[0], self.init_state[1]: cell[1]} policy, value, final...
Python
1
wstest_stdout)) .spawn() .unwrap(); wstest.wait().unwrap(); if wait_cycles > 10 { bail!("can't connect to echo_server"); } if !exists_in_file(wstest_output_file, wstest_wait_pattern) { break; } thread::sleep(time::Duration...
Rust
0
window.set_cursor_grab(false).unwrap(); window.set_cursor_visible(true); window_grabbed = false; } else { window.set_cursor_grab(true...
Rust
0
::ops::{Add, Neg, Mul, Sub, Div}; #[derive(Clone, Copy, RustcDecodable, RustcEncodable, Eq, Hash, PartialEq)] #[cfg_attr(feature = "plugins", derive(HeapSizeOf, Deserialize, Serialize))] pub struct Point2D<T> { pub x: T, pub y: T } impl<T: Zero> Point2D<T> { pub fn zero() -> Point2D<T> { Point2D {...
Rust
0
from .common import InfoExtractor from ..utils import ( ExtractorError, NO_DEFAULT, remove_start ) class OdaTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?odatv\.com/(?:mob|vid)_video\.php\?.*\bid=(?P<id>[^&]+)' _TESTS = [{ 'url': 'http://odatv.com/vid_video.php?id=8E388', ...
Python
1
) used /// to serialise the data, and should be used to match /// the corresponding [Deserialiser](Deserialiser) as well. #[derive(Debug)] pub struct Serialised { /// The serialisation id of the serialiser used to serialise the data pub ser_id: SerId, /// The serialised bytes pub data: Bytes, } impl Tr...
Rust
0
from aiogram import types, Dispatcher from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton async def webapp_inline(message: types.Message): keyboard = InlineKeyboardMarkup(row_width=1) keyboard.add(InlineKeyboardButton('Geeks online', web_app=types.WebAppInfo(url='https://online.geeks.kg')), ...
Python
1
# Copyright 2016 The TensorFlow 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 applica...
Python
1
.c")) .file(lua_dir.join("lgc.c")) .file(lua_dir.join("linit.c")) .file(lua_dir.join("liolib.c")) .file(lua_dir.join("llex.c")) .file(lua_dir.join("lmathlib.c")) .file(lua_dir.join("lauxlib.c")) .file(lua_dir.join("lmem.c")) ...
Rust
0
version of Cake to install."), ) .arg( Arg::with_name("nuget") .takes_value(true) .long("nuget") .help("The version of NuGet to install."), ) .arg( ...
Rust
0
min_interval) def _get_best_pokemon(self, current_pokemons): def get_poke_info(info, pokemon): poke_info = { 'cp': pokemon.cp, 'iv': pokemon.iv, 'ivcp': pokemon.ivcp, 'ncp': pokemon.cp_percent, 'level': pokemon.leve...
Python
1
; exec.result = Some( Command::new(&exec.cmd) .args(&exec.args) .envs(envs) .output() .expect("Failed to execute command"), ); assert!( exec.result.as_ref().unwrap().status.success(), format!("{}...
Rust
0
for j in 0..num { let mut x = r!(i as f64) * rad * r!(3.0) - width / r!(2.0) + r!(5.0); let y = r!(j as f64) * rad * r!(-3.0) + width / r!(2.0) + r!(4.0); if j % 2 == 0 { x += rad * r!(2.0); } let rb = RigidBodyDesc::new() ...
Rust
0
import torch import matplotlib.pyplot as plt import torchvision.transforms as t import cv2 as cv import torchvision.models as models # Importing the module from extractor import Extractor device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # Loading the model resnet = models.resnet50() extractor = ...
Python
1
"""Object Utilities.""" from __future__ import annotations from threading import RLock __all__ = ('cached_property',) try: from functools import cached_property as _cached_property except ImportError: # TODO: Remove this fallback once we drop support for Python < 3.8 from cached_property import threaded...
Python
1
2; fn sqlite4_clear_bindings(handle: *mut Sqlite4Stmt) -> i32; fn sqlite4_column_count(handle: *mut Sqlite4Stmt) -> i32; fn sqlite4_column_name(handle: *mut Sqlite4Stmt, n: i32) -> CString; fn sqlite4_column_database_name(handle: *mut Sqlite4Stmt, n: i32) -> CString; fn sqlite4_column_table_name(ha...
Rust
0
lors.len() - 1 { l = l.add(signature( 1.0, (220.0, 180.0), color, )); } l }) .collect() } #[derive(Clap)] #[clap()] struct Opts { #[clap(short, long, default_value = "0.0")] seed:...
Rust
0
ock::new(); let mut tag_store = StoreMock::new(); let mut board = Board::new( &mut store, &mut col_store, &mut tag_store ); board.create_task("task", None); let tag_label = Some("tag".to_string()); tag("task", tag_label, false, &mut bo...
Rust
0
import os import math import anndata import numpy as np import scanpy as sc import pandas as pd from PIL import Image from pathlib import Path from scipy.sparse import issparse, isspmatrix_csr, csr_matrix, spmatrix from sklearn.metrics import pairwise_distances from sklearn.linear_model import LinearRegression from s...
Python
1
ut returned from the backend. 'predictions' is not found or empty.", QMessageBox.StandardButton.Ok, ) self._restore_stage(view) return if len(result["code"][0]["predictions"]) == 1 and isinstance(result["code"][0]["predictions"][0], str): QMessageB...
Python
1
""" Cho một chuỗi ký tự S (gồm chữ và số). Hãy viết chương trình tách chữ và số thành hai chuỗi riêng biệt. File chuoi.inp chứa duy nhất 1 chuỗi S Hãy tách và ghi vào file chuoi.out 2 dòng, dòng thứ nhất ghi chuỗi ký tự chữ, dòng thứ hai ghi chuỗi ký tự số. Nếu như chuỗi nào rỗng thì ghi dấu trừ ‘-’. VD: chuoi.inp ch...
Python
1
ct_to_tax: The subject_to_tax of this DeductionLine. # noqa: E501 :type: bool """ self._subject_to_tax = subject_to_tax @property def percentage(self): """Gets the percentage of this DeductionLine. # noqa: E501 Deduction rate percentage # noqa: E501 :return...
Python
1
" => Ok(StateId::BuyerWaitingForLockConfirmations), "BuyerSendingInitRedeemMessage" => Ok(StateId::BuyerSendingInitRedeemMessage), "BuyerWaitingForRespondRedeemMessage" => { Ok(StateId::BuyerWaitingForRespondRedeemMessage) } "BuyerRedeemMwc" => Ok(StateId::BuyerRedeemMwc), "BuyerWaitForRedeemMwcConfi...
Rust
0
match transactions_fetcher.block_from_url(&url) { Ok(s3_block_data) => { // Append new data to the ledger local_ledger .append_block( &s3_block_data.block, &s3_block_data.block_contents, ...
Rust
0
import asyncio """ ╔═════════════════════════════════════╗ ║ Autor: Juxxon23 ║ ║ GitHub: https://github.com/juxxon23 ║ ║ Python - 2024 ║ ║ Reto 15 - ASINCRONIA ║ ╚═════════════════════════════════════╝ EJERCICIO: Utilizando tu lenguaje, crea un programa ca...
Python
1
import gdb class PeripheralEmulator: def __init__(self): self.peripheral_base = 0x40010000 self.peripheral_size = 0x1000 self.registers = {} # Initialize some example registers with default values self.registers[0x100] = 0 # Counter register self.registers[...
Python
1
Expr::Literal(1)), length: Some(Box::new(Expr::Literal(2))), } )?, (vec!["Ubuntu".into(), "Fedora".into()], false), ); Ok(()) } /// Expands a word int a `Vec`. pub fn expand_word_into_vec(shell: &mut Shell, word: &Word, ifs: &str) -> Result<Vec<PatternWord>> { l...
Rust
0
selected_features = select_optimal_features_limited(df_physics, target_col, max_features=10) X = df_physics[selected_features] else: logger.warning(f"输入数据中未找到目标列 {target_col},将使用所有特征") X = df_physics # 预测 y_pred = predict(model, X) ...
Python
1
from splunk_add_on_ucc_framework.generators.xml_files import InputsXml from tests.unit.helpers import compare_xml_content def test_generate_views_inputs_xml(global_config_all_json, input_dir, output_dir): inputs_xml = InputsXml(global_config_all_json, input_dir, output_dir) result = inputs_xml.generate_views_...
Python
1
ex::new(HashSet::new())), remote_addr: None, }) } pub fn woken_in_previous_heartbeat(&self, mac: &MacAddress) -> bool { let woken_macs = self.just_woke.lock().unwrap(); woken_macs.contains(mac) } pub fn just_woke(&self, macs: HashSet<MacAddress>) -> () { let m...
Rust
0
_empty() { tags.insert(0, ','); } let fields = self .fields .iter() .map(|(field, value)| { format!( "{field}={value}", field = LineProtoTerm::FieldKey(field).escape(), value = Lin...
Rust
0
os, Linux, MacOs } impl fmt::Display for Platform { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let printable = match *self { Platform::Ios => "ios", Platform::Linux => "linux", Platform::MacOs => "macos", }; write!(f, "{}", printable) ...
Rust
0
scores": scores, "context_used": { "provided_context_count": len(context or []), "additional_context_count": len(additional_context), "keywords_used": all_keywords if fetch_additional_context else [], }, } def _extract_scores(self, eva...
Python
1
[np.frombuffer(image.tobytes(), dtype="uint8").reshape((1, image.height, image.width)) for image in images] ) sample = (sample / 255) * 2 - 1 sample = torch.Tensor(sample).to(self.device) for t in self.progress_bar(torch.flip(self.scheduler.timesteps, (0,))): pr...
Python
1
from app.config import get_settings from app.prices.binance.connectors import BinanceConnector from app.prices.binance.services import BinanceService binance_connector = BinanceConnector( base_url=get_settings().BINANCE.BASE_URL, ) def get_binance_service() -> BinanceService: return BinanceService(connector=...
Python
1
_mask.scatter_(dim=1, index=idx, src=torch.ones_like(flat_mask)) corrected_warped_scribbles = binary_mask.view(*mask.shape) * corrected_warped_scribbles if self.show: import neurite as ne from .plot import show_scribbles import matplotlib.pyplot as ...
Python
1
from requests import get GITHUB_REPO = "Hav1ck/timing_checker" # Define the repository and current version CURRENT_VERSION = "v1.0.0" # Current version of the application def get_latest_release(): # Fetches the latest release tag from the GitHub repository. # Returns the tag name of the latest release or No...
Python
1
ense) self.model._init_weights(self.classification_head.out_proj) class LSGMBartForQuestionAnswering(LSGMBartPretrainedModel, MBartForQuestionAnswering): _keys_to_ignore_on_load_missing = ["encoder.embed_tokens.weight", "decoder.embed_tokens.weight"] _tied_weights_keys = ["model.encoder.embed_tokens....
Python
1
"""Tests around prompting for and handling of choice variables.""" import pytest from cookiecutter.prompt import read_user_choice OPTIONS = ['hello', 'world', 'foo', 'bar'] OPTIONS_INDEX = ['1', '2', '3', '4'] EXPECTED_PROMPT = """Select varname [bold magenta]1[/] - [bold]hello[/] [bold magenta]2[/] - [bold...
Python
1
# Токен бота в Discord # Как получить: https://www.writebots.com/discord-bot-token/ token = "ВСТАВЬТЕ_ТОКЕН_СЮДА" # С какой вероятностью бот отправит сообщение, если обнаружит сообщение с его упоминанием (от 0 до 1) mention_prob = 1 # 100% # С какой вероятностью бот отправит сообщение, если обнаружит сообщение без е...
Python
1
| twitter | +-----------------------+-----------------------+-------------------+ | xbox | Xbox | xbox | +-----------------------+-----------------------+-------------------+ | youtube | YouTube | youtube | ...
Python
1
# Copyright 2019 The TensorFlow 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 applica...
Python
1
ApiError>; async fn op37_get( &self, context: &C) -> Result<Op37GetResponse, ApiError>; async fn op3_get( &self, context: &C) -> Result<Op3GetResponse, ApiError>; async fn op4_get( &self, context: &C) -> Result<Op4GetResponse, ApiError>; async fn op5_...
Rust
0
.map(|(k, v)| (k.clone(), v.precision)) .collect(), }; for xact in &xacts { writeln!(w, "{}", xact.display(&ctx))?; } Ok(()) } } <reponame>fhars/libtock-rs<filename>src/rng.rs use crate::syscalls; use core::cell::Cell; const DRIVER_NUMBER: usize = 0x40001...
Rust
0
= match racer::download_rss_channel(&client, &opt.url).await { Ok(feed) => feed, Err(e) => panic!("Error getting rss feed (from {}): {}", &opt.url, e), }; let mut mime_type_map = std::collections::HashMap::new(); mime_type_map.insert(String::from("audio/mpeg"), ".mp3"); let mime_type_m...
Rust
0
#[inline] fn size_hint(&self) -> (usize, Option<usize>) { // We don't have an item count, so just guess based on the range size. ( 0, Some(unsafe { offset_from(self.meta_end, self.next_meta) + Group::WIDTH }), ) } } /// Iterator over a sub-range of a table....
Rust
0
from utils.actions import Rule, BaseCategorizer rules = ( Rule(r"^Referred to", "referral-committee"), Rule(r"^Favorable by", "committee-passage-favorable"), Rule(r"Filed", "filing"), Rule(r"^Withdrawn", "withdrawal"), Rule(r"^Died", "failure"), Rule(r"^Introduced", "introduction"), Rule(r"...
Python
1
the second main panel #xOtherHistogram,Bins = np.histogram(xValues, listOfBins, density = False) #yOtherHistogram,Bins = np.histogram(yValues, listOfBins, density = False) #for xIndividualBlock in np.clip(xOtherHistogram, 0, 20): #for yIndividualBlock in yOtherHistogram: #clippedIndex=np.clip(yIndividualBlock,...
Python
1
}'.format( _calc_reward(val_score), best_val_score), file=scores_file) print_stdout_and_file( 'test epoch {}:'.format(i), file=scores_file) for key, value in test_score.items(): print_stdout_and_file( '{...
Python
1
Kind::NearBranch64`]: enum.OpKind.html#variant.NearBranch64 #[must_use] #[inline] pub fn near_branch64(&self) -> u64 { ((self.mem_displ as u64) << 32) | self.immediate as u64 } /// Sets the operand's branch target. Use this method if the operand has kind [`OpKind::NearBranch64`] /// /// [`OpKind::NearBranch64...
Rust
0
onfig['API'].get('openai_timeout', 30)) ) if response.status_code == 200: result = response.json()['choices'][0]['message']['content'] else: error_msg = f"API请求失败: 状态码 {response.status_code}" try...
Python
1
out_TPMS_NV_PIN_COUNTER_PARAMETERS() { assert_eq!(::std::mem::size_of::<TPMS_NV_PIN_COUNTER_PARAMETERS>() , 8usize , concat ! ( "Size of: " , stringify ! ( TPMS_NV_PIN_COUNTER_PARAMETERS ) )); assert_eq! (::std::mem::align_of::<TPMS_NV_PIN_COUNTER_PARAMETERS>() , ...
Rust
0
import argparse import sys from pathlib import Path from edit_mv import run_editp23, load_z123_pipe def main(args: argparse.Namespace) -> None: """ Sets up and runs the EditP23 process for a single experiment. """ exp_dir = Path(args.exp_dir) input_files = { "src_path": exp_dir / "src.png",...
Python
1
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries # SPDX-License-Identifier: MIT import board import neopixel from adafruit_pixel_framebuf import PixelFramebuffer pixel_pin = board.D6 pixel_width = 16 pixel_height = 16 pixels = neopixel.NeoPixel( pixel_pin, pixel_width * pix...
Python
1
/// use std::fs::File; /// use std::io::Read; /// use sha2::Sha256; /// use lamport_signature::Signature; /// /// let mut file = File::open("signed_data").unwrap(); /// assert!(Signature::from_bytes::<Sha256, _>(&mut file).is_ok()); /// ``` pub fn from_bytes<T, U>(bytes: &mut U) -> Resul...
Rust
0
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT import insightconnect_plugin_runtime import json class Component: DESCRIPTION = "Get key's hash" class Input: KEY = "key" class Output: FOUND = "found" VALUES = "values" class HashGetInput(insightconnect_plugin_runtime.Input): schema = json.loads(r...
Python
1
ogger.debug(f"Client {client_id} disconnected") # クライアントの切断時に翻訳タスクをキャンセル if client_id in active_translations: active_translations[client_id]["cancelled"] = True logger.info( f"Translation for client {client_id} marked as cancelled due to disco...
Python
1
import pytest import dragodis @pytest.fixture(scope="function") def disassembler(request, shared_datadir) -> dragodis.Disassembler: """ This fixture gets indirectly called by pytest_generate_tests. """ if not hasattr(request, "param"): # If we don't have a param, we are making a disassembler...
Python
1
Types::AutoRebirthTrue => "Auto Rebirth True", AutoSettingTypes::AutoRebirthFalse => "Auto Rebirth False", } .into() } } #[derive(Serialize, Deserialize, Clone, Copy, Default, Debug)] pub struct Options { pub auto_work: bool, pub auto_living: bool, pub auto_buy_item: bool, ...
Rust
0
bn254::Fq2Parameters>>::new( ark_ff::Fp256::<ark_bn254::FqParameters>::new(BigInteger256::new([ 10885334821250115786, 16793934523551144152, 1337247719422478815, 508908536463948872, ])), ark_ff::Fp256::<ark_bn254::FqParam...
Rust
0