text
string
label_name
string
labels
int64
84, 181, 178, 192, 189, 187, 184, 182, 179, 129, 141, 138, 135, 132, 129, 142, 139, 136, 133, 130, 143, 140, 137, 134, 131, 128, 125, 122, 119, 116, 113, 126, 123, 120, 117, 114, 127, 124, 121, 118, 115, 79, 77, 74, 72, 69, 67, 64, 78, 75, 72, 70, 67, 65, 78, 76, 73, 38, 37, ...
Rust
0
""" Find the offsets to set in self.joints_offsets in hwi_feetech_pwm_control.py """ from mini_bdx_runtime.rustypot_position_hwi import HWI from mini_bdx_runtime.duck_config import DuckConfig import time dummy_config = DuckConfig(config_json_path=None, ignore_default=True) print("======") print( "Warning : this ...
Python
1
rd_lock_key_slot_8(&self) -> RD_LOCK_KEY_SLOT_8_R { RD_LOCK_KEY_SLOT_8_R::new(((self.bits >> 28) & 0x01) != 0) } #[doc = "Bit 27"] #[inline(always)] pub fn rd_lock_key_slot_7(&self) -> RD_LOCK_KEY_SLOT_7_R { RD_LOCK_KEY_SLOT_7_R::new(((self.bits >> 27) & 0x01) != 0) } #[doc = "B...
Rust
0
from flask import Flask, jsonify, request, make_response import pdfextractor from flask_socketio import SocketIO, emit from LLM import knowledge_graph from LLM import vector_store from LLM import agents import threading app = Flask(__name__) socketio = SocketIO(app, cors_allowed_origins="*") @app.route("/submitPDF",...
Python
1
as_ref().unwrap().is_complete() { self.completed_packets.push_back(self.current_packet.as_ref().unwrap().clone()); self.current_packet = None; } } } impl PartialPacket { pub fn remaining_bytes(&self) -> usize { self.size - self.payload.len() } pub fn is_complete...
Rust
0
assert abs(result_mean.item() - 0.0266) < 1e-3 else: # CUDA assert abs(result_sum.item() - 20.4125) < 1e-2 assert abs(result_mean.item() - 0.0266) < 1e-3 def test_full_loop_with_noise(self): if torch_device == "mps": return scheduler_clas...
Python
1
_info(), authority: ctx.accounts.treasury.to_account_info(), rent: ctx.accounts.rent.to_account_info(), }, ))?; token::initialize_account(CpiContext::new( ctx.accounts.token_program.to_account_info(), token::InitializeAccount { ...
Rust
0
_of_max >= 0.9 && percentage_of_max < 1.0 { self.messenger .send("Urgent warning: You've used up over 90% of your quota!"); } else if percentage_of_max >= 1.0 { self.messenger.send("Error: You are over your quota!"); } } } #[cfg(test)] mod tests { use sup...
Rust
0
"""Integrate with FreeDNS Dynamic DNS service at freedns.afraid.org.""" import asyncio from datetime import datetime, timedelta import logging import aiohttp import voluptuous as vol from homeassistant.const import CONF_ACCESS_TOKEN, CONF_SCAN_INTERVAL, CONF_URL from homeassistant.core import HomeAssistant from homea...
Python
1
&[u8]) -> bool { let bs_len = bytes.len(); let mut i = 0; while i < bs_len { if bytes[i].ne(&0x00) { return false; } i += 1; } true } } impl Vector { /// 变更数组内容 /// /// * source 原始数组 /// * target 变更内容 //...
Rust
0
_eks_cluster_logging_details( &mut object_1900, var_1899, )?; object_1900.finish(); } Ok(()) } pub fn serialize_structure_crate_model_aws_network_firewall_firewall_policy_details( object: &mut aws_smithy_json::serialize::JsonObjectWriter, input: &crate::model::Aw...
Rust
0
t Ok(formated) = rustfmt_generated_strin(&errors_content) { formated } else { errors_content }; let ops_formated = if let Ok(formated) = rustfmt_generated_strin(&ops_content) { formated } else { ops_content }; let mut file_ops = File::create(out_path.join("ops.rs...
Rust
0
exittapplet applicationtIDLEs About IDLEsinfo patchlevelRiiiis_Preferences....t tkAboutDialogs::tk::mac::ShowHelpN(s About IDLEs<<about-idle>>(iii(s_Preferences....s<<open-config-dialog>>(R R#R$tidlelib.EditorWindo...
Python
1
Resource::new( "mybucket".to_string(), "/myobject*".to_string(), )]), conditions: Default::default(), }; let data2 = r#"{ "Effect": "Allow", "Principal": "*", "Action": "s3:PutObject", "Resource": "a...
Rust
0
t_eq!(pdu.fragment_offset().to_be_bytes(), descendant_value(&node, "ip", "frag_offset", 2)?.as_slice()); assert_eq!(pdu.ttl().to_be_bytes(), descendant_value(&node, "ip", "ttl", 1)?.as_slice()); assert_eq!(pdu.protocol().to_be_bytes(), descendant_value(&node, "ip", "proto", 1)?.as_slice()); assert_eq!(pdu.c...
Rust
0
format_write(builder); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let mut file = File::create(out_path.join("ffms2.rs")).unwrap(); let _ = file.write(s.as_bytes()); } <filename>filemanager_core/src/filemanager_core_functions.rs<gh_stars>1-10 use std::path::Path; use filemanager_core_str...
Rust
0
er::get_balance(first_token_id, &recipient), initial_balance_first_token.saturating_sub(TokenWrapper::get_amount_to_wrap(50000_u128)) ); assert_eq!( TokenWrapper::get_balance(second_token_id, &recipient), Default::default() ); assert_eq!(TokenWrapper::get_balance(pool_share_id, &recipient), 50000); ...
Rust
0
nics: "cat swing flag economy stadium alone churn speed unique patch report train", seed: "deb5f45449e615feff5640f2e49f933ff51895de3b4381832b3139941c57b59205a42480c52175b6efcffaa58a2503887c1e8b363a707256bdd2b587b46541f5", },TestVector { entropy: "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc7...
Rust
0
_dict("Root", PDFElem::Ref(trailer.root)), ]; format!( "trailer\n{}\nstartxref\n{}\n%%EOF\n", render_elem(&PDFElem::Dict(dict)), render_elem(&PDFElem::Int(trailer.startxref))) } pub fn render_pdf(pdf_file:PDFFile) -> String { let header = render_header(pdf_file.version.0, pdf_file.v...
Rust
0
e storage. fn sync_all(&self, _txg: TxgT) -> Box<dyn Future<Item=(), Error=Error> + Send> { unimplemented!() } } struct FakeIDML { alloct: Arc<Tree<DRP, FakeDDML, PBA, RID>>, data_size: AtomicU64, data_ddml: Arc<FakeDDML>, name: &'static str, next_rid: AtomicU64, rid...
Rust
0
), DecodedBindRules::new(bytecode) ); // Test invalid instruction header. let mut bytecode: Vec<u8> = BIND_HEADER.to_vec(); append_section_header(&mut bytecode, SYMB_MAGIC_NUM, 0); append_section_header(&mut bytecode, 0xAAAAAAAA, 0); assert_eq!( E...
Rust
0
""" # Call the function with the sample content result = remove_javadoc_comments(sample_content) # Define the expected result (content without Javadoc comments) expected_result = f""" public class {word.capitalize()} {{ // {word} private int x...
Python
1
or root, _, files in os.walk(filename): for loopfile in files: fullname = os.path.join(root, loopfile) if fullname.startswith('.' + os.path.sep): fullname = fullname[len('.' + os.path.sep):] expanded.add(fullname) filtered = [] for filename in expanded: if os.path.splite...
Python
1
'''hardware_test_basic_io.py This example demonstrates how to use the QCar class to perform basic I/O. Learn how to write throttle and steering, as well as LED commands to the vehicle, and read sensor data such as battery voltage. See the QCar class definition for other sensor buffers such as motorTach, accelometer, g...
Python
1
&Vec3::new(0.0, 1.0, 0.0), 20.0, ASPECT_RATIO, 0.1, 10.0, ); Self { world, camera } } pub fn render(&self, i: u16, j: u16) -> Vec<u8> { let pixel_color: Color = (0..SAMPLES_PER_PIXEL) .map(|_| { let (u, v) = ( ...
Rust
0
&mut HashMap<Tag, S>) -> IOResult<()> + Send + 'static { pub fn new(receive: F, notify: N) -> Self { BinaryStateOperator { receive_fn: receive, notify_fn: notify, end_notify: HashMap::new(), ready_end_notify: Vec::new(), states: HashMap::new(), ...
Rust
0
def pascal_triangle(n): """ pascal triangle """ if n <= 0: return [] triangle = [] for i in range(n): row = [1] if triangle: last_row = triangle[-1] row.extend([sum(pair) for pair in zip(last_row, last_row[1:])]) row.append(1) ...
Python
1
ok() { client.clean(&uri1); res1_ok = true; } } if let Some(res) = client.fetch(&uri2) { println!("{:?}", res); // 如果执行成功, 清除响应 if res.is_ok() { client.clean(&uri2); ...
Rust
0
s.Sin, bg=settings_dict["button-bg"], ) CosButton = tk.Button( root, text="cos", font=(settings_dict["button-font"], settings_dict["button-font-size"]), width=6, command=commands.Cos, bg=settings_dict["button-bg"], ) TanButton = tk.Button( root, text="tan", font=(settings_dict["b...
Python
1
F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { let mut w = W::reset_value(); f(&mut w); self.register.set(w.bits); } #[doc = r" Writes the reset value to the register"] #[inline] pub fn reset(&self) { self.write(|w| w) } } #[doc = "Possible value...
Rust
0
// Stores the 4 components of _v to the four first integers of _i. // _i must be aligned to 4 bytes. // _i[0] = _v.x // _i[1] = _v.y // _i[2] = _v.z // _i[3] = _v.w #[inline] pub fn store_ptr_u(&self, _i: &mut [i32; 4]) { todo!() } // Stores the x component of _v to the f...
Rust
0
# -*- coding: utf-8 -*- #===----------------------------------------------------------------------===# # # Copyright (C) 2022 Sophgo Technologies Inc. All rights reserved. # # SOPHON-DEMO is licensed under the 2-Clause BSD License except for the # third-party components. # #===-----------------------------------------...
Python
1
**kwargs: Other arguments are documented in ``make_grid``. """ from PIL import Image num_imgs = tensor_real.size(0) for i in xrange(num_imgs): # save real images grid_real = make_grid(tensor_real[i], nrow=nrow, padding=padding, pad_value=pad_value, normalize=n...
Python
1
lidException("Supplied model store doesn't define new history to import.") with model_import_store.target_history(legacy_history_naming=False) as new_history: object_tracker = model_import_store.perform_import(new_history, new_history=True) object_tracker.new_history = new_hi...
Python
1
which are in candidate state attempting to gather votes (§5.2). #[tracing::instrument(level = "debug", skip(self, rpc))] pub async fn vote(&self, rpc: VoteRequest) -> Result<VoteResponse, RaftError> { let (tx, rx) = oneshot::channel(); self.tx_api.send(RaftMsg::RequestVote { rpc, tx }).map_err(...
Rust
0
(0x172, "M", "ų"), (0x173, "V"), (0x174, "M", "ŵ"), (0x175, "V"), (0x176, "M", "ŷ"), (0x177, "V"), (0x178, "M", "ÿ"), (0x179, "M", "ź"), (0x17A, "V"), (0x17B, "M", "ż"), (0x17C, "V"), (0x17D, "M", "ž"), (0x17E, "V"), ...
Python
1
import pymysql from update_room import update_room1 from delete_order import delete_orders def insert_bill(guest_id, receptionist_id): connection = pymysql.connect( host='localhost', user='root', password='***', database='hotel', ) try: check = [] total = 0 ...
Python
1
250) ); } } pub struct Stepper { curr: i32, step: i32, max: i32, } impl Iterator for Stepper { type Item = i32; fn next(&mut self) -> Option<i32> { if self.curr >= self.max { return None; } let res = self.curr; self.curr += self.step; ...
Rust
0
GE_SIZE]; // println!("end_vpn: {:?}", self.vpn_range.get_end()); if current_vpn == self.vpn_range.get_end() { return; } loop { // println!("clear"); let dst = &mut page_table .translate(current_vpn) .unwrap() ...
Rust
0
def detectIfAllIncreasing(arr): if all(arr[i] < arr[i + 1] for i in range(len(arr) - 1)): return 1 # all increasing elif all(arr[i] > arr[i + 1] for i in range(len(arr) - 1)): return 0 # all decreasing else: -1 # neither f = open("input.txt", "r") text = f.read() arr = text.split("...
Python
1
TION_TABLE_SIZE_MASK: u32 = 0xF000_0000; const IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_SHIFT: u32 = 28; const IMAGE_GUARD_CF_FUNCTION_TABLE_PRESENT: u32 = 0x400; pub fn find_pe_cfguard_functions(pe: &PE) -> Result<Vec<VA>> { let mut ret = vec![]; if let Ok(Some(load_config_directory)) = pe.get_data_directory(pe::I...
Rust
0
from tensorflow.python.framework.tensor_util import MakeNdarray from onnx_tf.common import data_type # Keyed by old attribute names. __tf_attr_translator = { "_output_shapes": lambda x: list(map(lambda shape: get_tf_shape_as_list(shape.dim), x.list.shape)), "shape": lambda x: get_tf_shape_as_list(x.shape.dim)...
Python
1
}\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}"; verify_with_string(&mut par, & [245u8,246u8,247u8,248u8,249u8,250u8,251u8,252u8,253u8,254u8,255u8], & [], & [], & [], &t1); assert!(par.has_invalid_sequence()); par.reset_parser(); println!("case 11: accept some non-characters"); let t1 = "\u{FFFE}\u{FFFF...
Rust
0
from func_download import download_data from func_xgboost import run_xgboost # Constants DATABASE = "aws" PROBA_THRESH = 0.52 # Main function execution if __name__ == "__main__": # Download data # Select between supabase and aws df_download = download_data(DATABASE, is_open=True) # Define columns X_data...
Python
1
if constraint["type"].upper() != "GEOJSON": raise ProgrammingError( "The 'srid' member can only be used when index " "type is set to 'GEOJSON'" ) constraint["srid"] = field_desc.pop("sri...
Python
1
fn needs_parens(form: &Formula) -> bool { match form { Formula::Trivial(_) | Formula::Prop(..) => false, Formula::Not(inner) => needs_parens(inner), _ => true, } } match self { Formula::Trivial(true) => write!(f, "True...
Rust
0
(false, Greetings::Custom { .. }) => *greetings = Greetings::Default, _ => {} } ui.label("Select custom greetings for Loadstone and the demo application."); }); if let Greetings::Custom { loadstone, demo } = greetings { ui.horizontal_wrapped(|ui| { ui...
Rust
0
useful for protecting shared data /// /// This mutex will block threads waiting for the lock to become available. The /// mutex can also be statically initialized or created via a `new` /// constructor. Each mutex has a type parameter which represents the data that /// it is protecting. The data can only be accessed t...
Rust
0
rom the input") break if next_frame_id == 0: output_transform = OutputTransform(frame.shape[:2], args.output_resolution) if args.output_resolution: output_resolution = output_transform.new_resolution else: ...
Python
1
from tkinter import * import tkinter as tk import subprocess # Import subprocess to open external files import sqlite3 from tkinter import messagebox from reportlab.pdfgen import canvas # Database Connection conn = sqlite3.connect("shg.db") cursor = conn.cursor() cursor.executescript(""" CREATE TABLE IF NOT EXISTS u...
Python
1
address: Address, init_balance: crate::prelude::Wei, init_nonce: U256, code: Option<Vec<u8>>, ) { let trie = &mut self.ext.fake_trie; let balance_key = crate::prelude::storage::address_to_key( crate::prelude::storage::KeyPrefix::Balance, &address, ...
Rust
0
nutes=time_range_min_i) for i in xrange(n_year_days)]) if i_year == 0: datum_all = np.array(datum) assert i_year==0 else: datum_all = np.array(list(datum_all)+list(datum)) if time == time_range[0]: ...
Python
1
TimestampNanosOutOfRange(_))) } } fn duration_from_nanos(whole_nanos: u128) -> Duration { let secs: u64 = (whole_nanos / 1_000_000_000).try_into().unwrap(); let nanos = (whole_nanos % 1_000_000_000) as u32; Duration::new(secs, nanos) } prop_compose! { fn args_fo...
Rust
0
# The MIT License (MIT) # Copyright (c) 2014-2017 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy,...
Python
1
": 600, "\u02d8": 600, "\u02d9": 600, "\u02da": 600, "\u02db": 600, "\u02dc": 600, "\u02dd": 600, "\u2013": 600, "\u2014": 600, "\u2018": 600, "\u2019": 600, "\u201a": 600, "\u...
Python
1
fn compress<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> { let input: Binary = args[0].decode_as_binary()?; let level: i32 = args[1].decode()?; if input.is_empty() { let empty_bin = OwnedBinary::new(0).unwrap(); return Ok((atoms::ok(), empty_bin.release(env)).encode(env)); ...
Rust
0
esources, SimServer, SimState, SimStateEvent, SimulatedEvent, StateInstruction, }; pub use crate::time::TimeServer; pub use crate::util::{Bounded, Bounds}; pub use crate::{Engine, InitEvent}; pub use roundabout::prelude::*; use super::Tristate; use crate::{ BigEndian, BitSlice, BitVec, LittleEndian, }; use core::pt...
Rust
0
import hashlib class Algorithms: # DS Algorithms NONE = "none" HS256 = "HS256" HS384 = "HS384" HS512 = "HS512" RS256 = "RS256" RS384 = "RS384" RS512 = "RS512" ES256 = "ES256" ES384 = "ES384" ES512 = "ES512" # Content Encryption Algorithms A128CBC_HS256 = "A128CBC-H...
Python
1
ndEntity` is used instead of `EndEntityOrCA::CA` // because we don't have a reference to a child cert, which is needed for // `EndEntityOrCA::CA`. For this purpose, it doesn't matter. // // v1 certificates will result in `Error::BadDER` because `parse_cert` will // expect a versi...
Rust
0
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution(object): def spiralMatrix(self, m, n, head): matrix = [[-1] * n for _ in range(m)] topRow, bottomRow = 0, m - 1 ...
Python
1
from konsoli_io import KonsoliIO from laskin import Laskin def main(): io = KonsoliIO() laskin = Laskin(io) laskin.suorita() if __name__ == "__main__": main()
Python
1
/// ```rust /// # use cds::array_str; /// let mut s = array_str![4;]; /// assert_eq!(s.add_str("€€"), 3); /// assert_eq!(s.add_str("€"), 0); /// assert_eq!(s, "€"); /// ``` /// /// [`push_str`]: ArrayString::push_str /// [`add_str`]: ArrayString::add_str #[inline] pub fn ...
Rust
0
r(&self) -> anyhow::Result<Layer> { let mut layer = self.ctx.layer("opt")?; let mut content_metadata = layer.mut_content_metadata(); content_metadata.launch = true; content_metadata.build = true; content_metadata.cache = false; layer.write_content_metadata()?; le...
Rust
0
TestDir::new(BIN, ""); let output = testdir .cmd() .output_with_stdin( r#"2 3 1 2 6 1 1 "#, ) .tee_output() .expect_success(); assert_eq!(output.stdout_str(), "Yes\n"); assert!(output.stderr_str().is_empty()); } ...
Rust
0
ically increasing, return it. (MonotonicityNode::Function(mono, None), MonotonicityNode::Variable(_, None)) | (MonotonicityNode::Variable(_, None), MonotonicityNode::Function(mono, None)) => { if mono.is_monotonic && mono.is_positive { return Ok(MonotonicityNo...
Rust
0
timer.set_after(*duration); Poll::Ready(Some(instant)) } Poll::Pending => Poll::Pending, } } } <gh_stars>1-10 //! A collection of digital signal processing nodes //! for use in an audio graph. pub mod filter; use dsp::{Signal, Node}; use dsp::sample:...
Rust
0
from django.urls import path from . import views app_name = "devmode" urlpatterns = [ path("spylog/", views.spylog, name="spylog"), ]
Python
1
# ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without rest...
Python
1
""" 判断学号是不是都没问题 1.判断中间三位是否都在学校代码列表里 2.判断所有学生学号是否都在学生名册里 """ from func import * school_id_check = {item[0]: item[1] for item in read_xlsx_to_list( file_path=r"C:\Users\1012986131\Desktop\2024学年下学期期末诊断调研质量分析\初中学校.xlsx", sheet_name="Sheet1" )[1:]} grade = "八年级" data = read_xlsx_to_list( file_path=r"C:\User...
Python
1
(&self, request: Request, next: Next<'_>) -> Result<Response, Error> { let mut i = 0usize; let request = request.into_infallible_cloneable().await?; loop { match next.run(request.try_clone().unwrap()).await { Ok(response) => return Ok(response), Err(er...
Rust
0
- 4] = (crc >> 24) as u8; frame_bytes[frame_len - 3] = (crc >> 16) as u8; frame_bytes[frame_len - 2] = (crc >> 8) as u8; frame_bytes[frame_len - 1] = (crc ) as u8; return frame_bytes; } fn write_data(frame: &DataFrame) -> Box<[u8]> { let mut builder = build::DataFrameBuilder::new(frame.sequ...
Rust
0
from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.views import PasswordChangeView from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ class CustomMo...
Python
1
array_eq!(expected, out, U8); } #[test] fn tg_gimli_hash_6() { let input = ByteSeq::from_public_slice(&[0xbe, 0xef, 0xb9, 0x6d, 0x4, 0x49]); let expected = Digest::from_public_slice(&[ 0x75, 0xb8, 0xa7, 0xed, 0xc8, 0xff, 0x88, 0x42, 0x4f, 0x13, 0x2b, 0x15, 0xdb, 0x53, 0xc3, 0x56, 0x86, ...
Rust
0
# # ELF (64b) parsing from https://www.uclibc.org/docs/elf-64-gen.pdf # # @_hugsy_ # import ctypes as ct Elf64_Addr = ct.c_uint64 Elf64_Off = ct.c_uint64 Elf64_Half = ct.c_uint16 Elf64_Word = ct.c_int32 Elf64_Sword = ct.c_int32 Elf64_Xword = ct.c_uint64 Elf64_Sxword = ct.c_int64 class elf64_t(ct.Structure): _fi...
Python
1
#[test] fn analyze_error() { let ast: ast::Package = fluxcore::parser::parse_string("".to_string(), "x = ()").into(); match analyze(ast) { Ok(_) => panic!("expected an error, got none"), Err(e) => { expect_test::expect![[r#" error @1:5-1:7:...
Rust
0
t=" ", bg="black", fg="white") button.place(x=i*35+200,y=20+j*30+10) buttons.append(ButtonManager(button,i,j)) textInput = Text(mainwin,width=80,height=6,bg="black",fg="yellow") textInput.place(x=0,y=750) textOutput = Text(mainwin,width=80,height=6,bg="black",fg="orange") textOutput.place(x=600,y=750) de...
Python
1
ratio <= 50: score += 10 return min(100, score) except Exception as e: print(f"❌ 버핏 스코어 계산 실패 ({stock_code}): {e}") return 50 def get_news_sentiment(self, stock_code): """뉴스 감정 점수 조회""" try...
Python
1
from tkinter import filedialog, messagebox, Button, Tk, Label import shutil import os import easygui def file_open_box(): path = easygui.fileopenbox() return path def directory_open_box(): path = filedialog.askdirectory() return path def open_file(): path = file_open_box() try: os....
Python
1
Win32::System::Memory::{ CreateFileMappingA, MapViewOfFile, OpenFileMappingA, UnmapViewOfFile, FILE_MAP_ALL_ACCESS, PAGE_READWRITE, }, }; /// The default Sharedmap impl for windows using shmctl & shmget #[derive(Clone)] pub struct Win32ShMem { id: ShMemI...
Rust
0
{ "name": "nfe spec", "version": "15.0.1.1.0", "author": "Akretion, Odoo Community Association (OCA)", "license": "LGPL-3", "category": "Accounting", "summary": "nfe spec", "depends": ["base"], "installable": True, "application": False, "development_status": "Mature", "mainta...
Python
1
usands", [None, ",", "*"]) @pytest.mark.parametrize("precision", [None, 4]) def test_format_decimal(formatter, thousands, precision): s = DataFrame([[1000000.123456789]]).style # test float result = s.format( decimal="_", formatter=formatter, thousands=thousands, precision=precision )._translate(Tr...
Python
1
where S: Into<String>, F: Into<f64>, { let transfer = IsolatedTransfer { asset: asset_symbol.into(), symbol: symbol.into(), amount: qty.into(), trans_from: from, trans_to: to, }; self.client .post_signe...
Rust
0
self.steamid { os.write_fixed64(3, v)?; } if let Some(v) = self.gameid { os.write_fixed64(4, v)?; } if let Some(v) = self.h_steam_pipe { os.write_uint32(5, v)?; } if let Some(v) = self.ticket_crc { os.write_uint32(6, v)?; ...
Rust
0
ck() mock_get_response.json.return_value = {"rt_cd": "0", "output": []} mock_instance.get.return_value = mock_get_response await kis_client.volume_rank() assert mock_kis_client.called mock_instance.post.assert_called_once() mock_instance.get.assert_called_once() @p...
Python
1
hot completes with an Err let _ = e.block_on(&mut self.rx); } } // Copyright (c) Facebook, Inc. and its affiliates // SPDX-License-Identifier: MIT OR Apache-2.0 use serde_generate::{python3, test_utils, CodeGeneratorConfig, Encoding, SourceInstaller}; use std::collections::BTreeMap; use std::fs::File; use ...
Rust
0
import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, f1_score import pickle def train_model(input_path): # Load cleaned dataset df = pd.read_csv(input_path) ...
Python
1
该次请求的 RequestId。 :rtype: str """ return self._RequestId @RequestId.setter def RequestId(self, RequestId): self._RequestId = RequestId def _deserialize(self, params): self._MatchToken = params.get("MatchToken") self._CompatibleSpan = params.get("CompatibleSp...
Python
1
s( &env, metrics::FONT_MANAGER_LOAD_STATIC_REGISTRY_METRIC_ID, vec![metrics::FontManagerLoadStaticRegistryMetricDimensionResult::Io], ) .await; env.stop().await; } #[fasync::run_singlethreaded(test)] async fn font_manager_load_static_registry_failure_parse() { let env = TestEnv...
Rust
0
#find the longest consecutive in an array: from typing import List import sys int_max = sys.maxsize int_min = -int_max - 1 def longestConsecutive(nums: List[int]) -> int: nums.sort() longest = 1 count = 0 smallest = float('-inf') n = len(nums) if n == 0: return 0 for ...
Python
1
_ => jsonb_stringify(a, temp_storage), } } fn cast_jsonb_or_null_to_jsonb<'a>(a: Datum<'a>) -> Datum<'a> { match a { Datum::Null => Datum::JsonNull, Datum::Float64(f) => { if f.is_finite() { a } else if f.is_nan() { Datum::String("Na...
Rust
0
Writer::new(&mut out); #[allow(unused_mut)] let mut root = writer .start_el("LegalHold") .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None); crate::xml_ser::serialize_structure_object_lock_legal_hold(&&input, root) } Ok(smithy_http::body::SdkBody::from(out...
Rust
0
from .core import contents, where __all__ = ["contents", "where"] __version__ = "2023.11.17"
Python
1
ing to_tuple conversions') assert rt.make_boost_int_2(3, 5) == (3, 5) assert rt.make_boost_int_2(3) == (3, 2) assert rt.make_boost_int_2() == (7, 2) if (verbose): print('OK') def run(args): iterations = 100 if (len(args) > 0): iterations = int(args[0]) verbose = 0 if (iterations and iterations < 4)...
Python
1
user node: their wallet and their blockchain state. #[derive(Clone)] struct Node { /// Current blockchain state of the node blockchain: BlockchainState, /// User's wallet data wallet: Wallet, } /// User's wallet account data #[derive(Clone)] struct Wallet { /// User's root wallet key xprv: Xpr...
Rust
0
mulx 16($3), %rax, %rbx // * y[2] adcx %rax, %r8 adox %rbx, %r9 mulx 24($3), %rax, %r10 // * y[3] adcx %rax, %r9 adox $4, %r10 // No carry, OF cleared adcx $4, %r10 // No carry, CF cleared // Store high limbs ...
Rust
0
new("/com/org/Test").unwrap()).unwrap(); assert_eq!(variant.type_(), VariantTy::OBJECT_PATH); assert_eq!(variant.to_string(), "'/com/org/Test'"); let variant = to_variant(&Signature::new("(asgva(in)a{sb})").unwrap()).unwrap(); assert_eq!(variant.type_(), VariantTy::SIGNATURE); assert_eq!(variant.to...
Rust
0
-1: num_corrects[q_type] += 0.2 else: num_corrects[q_type] += (pred==truth) num_total[q_type] += 1 accs = {k: num_corrects[k] / num_total[k] for k in num_corrects} acc_all = sum(list(num_corrects.values())) / sum(list(num_total.valu...
Python
1
nt) model_path = log_path + '/model.pth' if args.use_writer: writer = SummaryWriter(log_dir=log_path) fp = open(log_path + '/logs.txt', 'w+',buffering=1) json.dump(vars(args), open(log_path + '/params.json', 'w'),indent=4) sys.stdout = fp else: writer = None print(model) count_parameters(model) #...
Python
1
RDINATES) @pytest.mark.parametrize("diffusion_ice_capacity", DIFFUSION_ICE_CAPACITIES) def test_relative_mass_rates(*, diffusion_coordinate, diffusion_ice_capacity): # arrange water_mass_init = np.logspace(-16, -6, num=11) * si.kg particulator = make_particulator( temperature...
Python
1
] async fn test_success() { let mut test = ProgramTest::new( "spl_token_lending", spl_token_lending::id(), processor!(process_instruction), ); let sol_usdt_pubkey = Pubkey::from_str("<KEY>").unwrap(); let srm_usdt_pubkey = Pubkey::from_str("<KEY>").unwrap(); test.add_accoun...
Rust
0