text
string
label_name
string
labels
int64
_PARTIAL_WRITE: c_long = 0x1; pub const SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER: c_long = 0x2; pub const SSL_MODE_AUTO_RETRY: c_long = 0x4; pub const SSL_MODE_NO_AUTO_CHAIN: c_long = 0x8; pub const SSL_MODE_RELEASE_BUFFERS: c_long = 0x10; #[cfg(ossl101)] pub const SSL_MODE_SEND_CLIENTHELLO_TIME: c_long = 0x20; #[cfg(ossl10...
Rust
0
_event_get_focus(self.to_glib_none().0)) } } pub fn get_mode(&self) -> CrossingMode { unsafe { from_glib(ffi::gdk_crossing_event_get_mode(self.to_glib_none().0)) } } } impl fmt::Display for CrossingEvent { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "CrossingEvent"...
Rust
0
pub fn builder() -> crate::input::put_record_input::Builder { crate::input::put_record_input::Builder::default() } /// Creates a new `PutRecord` operation. pub fn new() -> Self { Self { _private: () } } } impl aws_smithy_http::response::ParseStrictResponse for PutRecord { type Output...
Rust
0
fn streq_ptr(mut s1: *const i8, mut s2: *const i8) -> bool { if !s1.is_null() && !s2.is_null() { return strcmp(s1, s2) == 0i32; } false } static mut verbose: i32 = 0i32; #[no_mangle] pub unsafe extern "C" fn otl_conf_set_verbose(mut level: i32) { verbose = level; } unsafe extern "C" fn parse_uc...
Rust
0
zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [m4_mem_intr_en](index.html) module"] pub struct M4_MEM_INTR_EN_SPEC; impl crate::Regi...
Rust
0
# Copyright (c) 2024 Microsoft Corporation. # Licensed under the MIT License # isort: skip_file """A module containing the 'PipelineRunContext' models.""" from dataclasses import dataclass from graphrag.cache.pipeline_cache import PipelineCache from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks from...
Python
1
0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a]; // HTTP/1.1 301 Moved Permanently // Location: https://facebook.com/ // Content-Type: text/html // X-FB-Debug: Iq/eZd3QEMVBtpaN0hf1XYNI4/4Qn90LGe6Bf6JcO6j31bBRfUfadcQFAZAdVb7RFheIjW3ahf+Q9tH9HNaplg== // Date: Mon, 19 Dec 2016 09:42:55 GMT // Connection: keep-alive // Content-...
Rust
0
net_services.stop_process(self.nc_proc) self.nc_proc = None self.netcat_btn.configure(text="Start Netcat") self.append_log("Netcat stopped\n") else: self.nc_proc = net_services.start_netcat_listener() if self.nc_proc: self.netcat_btn....
Python
1
from conftest import Apple def test_empty(): assert len(list(Apple.query.all())) == 0 def test_read(custom_objects_api): apple_js = { "apiVersion": "pykorm.infomaniak.com/v1", "kind": "Apple", "metadata": { "name": "tasty-apple", }, "spec": { "...
Python
1
ger_inclusion_state, conflict_reason, should_reattach, should_promote, ) }; Ok(warp::reply::json(&SuccessBody::new(MessageMetadataResponse { message_id: message_id.to_string(), parent_mes...
Rust
0
as_ptr() as *const libc::c_char, msg.len() as libc::c_uint, ), None => (ptr::null(), 0), }; let raw = NonNull::new(unsafe { sys::libssh2_channel_open_ex( sess.raw.as_mut(), ...
Rust
0
import pywhatkit as kt text = "This is a sample text that will be converted to handwriting using pywhatkit." kt.text_to_handwriting(text, save_to="handwriting.png") print("The text has been converted to handwriting and saved as handwriting.png")
Python
1
(); v2 = reader.read_u8() as u32; Box::new(SimpleInstrInfo_nop::new(v, s, unsafe { mem::transmute(v2 as u8) })) } CtorKind::OpSize => { v = reader.read_u8() as u32; let s2 = add_suffix(&s, 'w'); let s3 = add_suffix(&s, 'l'); let s4 = add_suffix(&s, 'q'); Box::new(SimpleInstrInfo_OpSiz...
Rust
0
Recuperator::new(client) } }<reponame>DarcJC/MayoOS<filename>src/sub_system/process/mod.rs<gh_stars>1-10 // mod elf; use core::sync::atomic::{AtomicU64, Ordering}; /// Process ID #[derive(Debug, Clone, Copy, PartialOrd, PartialEq, Eq, Ord)] pub struct PID(u64); impl PID { /// Create an new self-in...
Rust
0
import grpc from concurrent import futures import time import reservasalas_pb2 import reservasalas_pb2_grpc from google.protobuf.timestamp_pb2 import Timestamp from datetime import datetime class ReservaSalasServicer(reservasalas_pb2_grpc.ReservaSalasServicer): def __init__(self): self.reservas = {} ...
Python
1
email = st.text_input("Email") phone = st.text_input("Phone") age = st.text_input("Age") allergy = st.text_input("Do you have any known allergies?") recent_treatment = st.text_input("Any recent aesthetic treatments?") submitted = ...
Python
1
import random from math import cos, pi, sin, sqrt from typing import Tuple import numpy as np import numpy.typing as npt Quaternion = Tuple[float, float, float, float] def quat_to_matrix(quat: Quaternion) -> npt.NDArray: q0 = quat[0] q1 = quat[1] q2 = quat[2] q3 = quat[3] r00 = 2 * (q3 * q3 + q...
Python
1
-> Result<usize, std::num::ParseIntError> { usize::from_str_radix(&addr[2..], 16) } #[timed] pub fn parse(file: &Path) -> std::io::Result<(NodeIndex<usize>, ReferenceGraph)> { let file = File::open(file)?; let reader = BufReader::new(file); let mut graph: ReferenceGraph = Graph::default(); let mu...
Rust
0
("", 'h') => Some(vec![("h", Continue)]), ("h", 'a') => Some(vec![("は", Stop)]), ("h", 'i') => Some(vec![("ひ", Stop)]), ("h", 'u') => Some(vec![("ふ", Stop)]), ("h", 'e') => Some(vec![("へ", Stop)]), ("h", 'o') => Some(vec![("ほ", Stop)]), ("h", 'y') => Some(vec![("hy", Continue)]), ("hy"...
Rust
0
op_alpha, latent_op_beta, batch_size) real_embed = self.inception_softmax(real_images).detach().cpu().numpy() fake_embed = self.inception_softmax(fake_images).detach().cpu().numpy() if i == 0: real_embeds = np.array(real_embed, dtype=np.float64) fake_...
Python
1
inner(self) -> Result<$type, Error> { if let OwnedValue::$enum(x) = self { Ok(x) } else { Err(Error::TypeError { expected: SmolStr::new("$enum"), found: SmolStr::new("n/a"), }) ...
Rust
0
Type_sfCursorSizeAll: sfCursorType = 9; pub const sfCursorType_sfCursorCross: sfCursorType = 10; pub const sfCursorType_sfCursorHelp: sfCursorType = 11; pub const sfCursorType_sfCursorNotAllowed: sfCursorType = 12; pub type sfCursorType = ::std::os::raw::c_uint; extern "C" { pub fn sfCursor_createFromPixels( ...
Rust
0
(iter: I) -> Self { let av = iter.into_iter().collect::<AlignedVec<T::Native>>(); NoNull::new(DataArray::<T>::new_from_aligned_vec(av)) } } impl FromIterator<Option<bool>> for DFBooleanArray { fn from_iter<I: IntoIterator<Item = Option<bool>>>(iter: I) -> Self { let array = Arc::new(Boo...
Rust
0
assert_exprs(vec![ ("fn() {};", _func(vec![], vec![])), ("fn(x) {};", _func(vec!["x"], vec![])), ("fn(x, y, z) {};", _func(vec!["x", "y", "z"], vec![])), ]); } #[test] fn test_call_expression_parsing() { assert_expr( "add(1, 2 * 3, 4 + 5);", _call( ident("...
Rust
0
name() -> &'static str; #[inline(always)] fn kernel(k: usize, a: *const T, b: *const T, c: *mut T, rsc: usize, csc: usize); #[inline(always)] fn mr() -> usize; #[inline(always)] fn nr() -> usize; #[inline(always)] fn alignment_bytes_a() -> usize; #[inline(always)] fn alignment_b...
Rust
0
:Handle; mod account_funding; mod config; mod enclave; mod error; mod globals; mod ocall_bridge; mod parentchain_block_syncer; mod prometheus_metrics; mod sync_block_gossiper; mod sync_state; mod teeracle_metrics; mod tests; mod utils; mod worker; mod worker_peers_updater; /// how many blocks will be synced before st...
Rust
0
.module_name.clone(), 0) .level(DiagnosticLevel::Error) .message(msg) .build(); memmy.emit_diagnostic(&[], &[diagnosis]); return Err(()) } }; ...
Rust
0
attentions_b=encoding_b["attentions"] if "attentions" in encoding_b else None, global_attentions_b=None, contacts_b=encoding_b["contacts"] if "contacts" in encoding_b else None ) def predict_contacts(self, input_ids, position_ids=None, token_type_ids=None...
Python
1
ex += 1; } // todo: remove sleep(Duration::from_secs(5)); } fn initialize_client(&self) { // this is where i collect the ip information. } } // // Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "L...
Rust
0
let data = node2.get_data().unwrap(); assert_eq!(data.as_str(), "payload"); node2.set_data("new data".into()); } { let node2 = tree.children().nth(2).unwrap(); let data = node2.get_data().unwrap(); assert_eq!(data.as_str(), "new data"); node2.clear_data(); ...
Rust
0
/cv-sift/media/box.png").unwrap(); /// /// let out = "/absolute/path/to/a/directory"; /// let result = image_pyramid(&img, SIFTConfig::new()); /// for (row_idx, row) in result.iter().enumerate() { /// for (entry_idx, entry) in row.iter().enumerate() { /// let path = format!("{}/oct_{}_...
Rust
0
ors)) else: assert reason is StreamCloseReason.INVALID_HOSTNAME self._deferred_response.errback( InvalidHostname( self._request, str(self._protocol.metadata["uri"].host, "utf-8"), f'{self._protocol.metadata["ip_...
Python
1
i in 1..n { let (v, info_i) = vec[i].0.clone().transform_vec(); if info != info_i { return Err(DistributionError::Others( DiscreteSamplesError::TransformVecInfoMismatch.into(), )); } sum = sum + (*vec[i].1 as f64) * v.c...
Rust
0
lying child child: Child, /// The exit status exit_status: Option<ExitStatus> } impl TransparentExecutor { /// Creates a new binary executor pub(in crate) fn new(command: &mut Command) -> Result<Self> { // Set the stdio command.stdout(Stdio::inherit()); command.stderr(Stdio::...
Rust
0
RESERVED18_W { RESERVED18_W { w: self } } #[doc = "Bits 12:17 - 17:12\\] Pending ISR number field. This field contains the interrupt number of the highest priority pending ISR."] #[inline(always)] pub fn vectpending(&mut self) -> VECTPENDING_W { VECTPENDING_W { w: self } } #[doc...
Rust
0
"""Implementations of autoregressive flows.""" from torch.nn import functional as F from nde import distributions from nde import flows from nde import transforms class MaskedAutoregressiveFlow(flows.Flow): """An autoregressive flow that uses affine transforms with masking. Reference: > G. Papamakarios...
Python
1
full { CompositeDescrType::Bare => OuterDescrType::Bare, CompositeDescrType::Pk => OuterDescrType::Pk, CompositeDescrType::Pkh => OuterDescrType::Pkh, CompositeDescrType::Sh => OuterDescrType::Sh, CompositeDescrType::Wpkh => OuterDescrType::Wpkh, ...
Rust
0
lder and constructs a [`CreateTokenOutput`](crate::output::CreateTokenOutput) pub fn build(self) -> crate::output::CreateTokenOutput { crate::output::CreateTokenOutput { access_token: self.access_token, token_type: self.token_type, expires_in: self.exp...
Rust
0
t::Primitive(UInt64(LittleEndian::read_u64(bytes))), ConstantType::Float32 => FieldInit::Primitive(Float32(LittleEndian::read_f32(bytes))), ConstantType::Float64 => FieldInit::Primitive(Float64(LittleEndian::read_f64(bytes))), ConstantType::String => { let string = ma...
Rust
0
res: case_number (numeric, 312 distinct): ['58', '32', '42', '40', '43', '93', '19', '83', '73', '34'] number_of_days (numeric, 305 distinct): ['3086', '5192', '5128', '5122', '5225', '4901', '4859', '5136', '4719', '4583'] drug (nominal, 2 distinct): ['D-penicillamine', '0'] age (numeric, 308 distinct): ['17841', '16...
Python
1
# 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...
Python
1
import keras import numpy as np class AnchorBox: def __init__(self, ratios, scales): self.ratios = ratios self.scales = scales self.num_anchors = len(self.ratios) * len(self.scales) def generate_anchors(self, base_size = 16): # anchors - 9,4 anchors = np.zero...
Python
1
) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common 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. // ...
Rust
0
"""倒计时器MCP工具模块. 提供延迟执行命令的倒计时器功能,支持AI模型状态查询和反馈 """ from .manager import get_timer_manager __all__ = ["get_timer_manager"]
Python
1
True elif args.finetune_strategy == 'RT_Lm_SRCB': args.reinit_last_layer = True args.freeze_features = True args.freeze_last_mean = False args.freeze_last_var = True args.class_balanced = True args.weight_key = 'inv_sqrt_freq' args.load_optimizer_state_dict =...
Python
1
set_content(this: &HtmlMetaElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMetaElement" , js_name = scheme)] #[doc = "Getter for the `scheme` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeta...
Rust
0
: NodeId, shape : Dimension, operation : Operation, } struct Graph { // proque : ProQue, nodes : Vec<Node>, } impl Graph { fn new() -> Graph { Graph { // proque : ProQue::builder().src(KERNEL_SOURCE).dims([3]).build().unwrap(), nodes : vec![], } } // Graph methods fn get_shape(&self, node_id : NodeI...
Rust
0
, #[doc = "0x18 - I2S_INT_CLR"] pub int_clr: INT_CLR, _reserved4: [u8; 4usize], #[doc = "0x20 - I2S_RX_CONF"] pub rx_conf: RX_CONF, #[doc = "0x24 - I2S_TX_CONF"] pub tx_conf: TX_CONF, #[doc = "0x28 - I2S_RX_CONF1"] pub rx_conf1: RX_CONF1, #[doc = "0x2c - I2S_TX_CONF1"] pub tx...
Rust
0
ault() -> DOT<T> { <MinimumCollateralVault<T>>::get() } // Other helpers /// get a psuedorandom value between 0 (inclusive) and `limit` (exclusive), based on /// the hashes of the last 81 blocks, and the given subject. /// /// # Arguments /// /// * `subject` - an extra value to...
Rust
0
", DictExtra_str)] img_paths = sorted(img_paths, key=lambda p: "Image" in p, reverse=True) if img_paths: img_path = img_paths[0].replace("'", "") img_path = [i for i in img_path.split("\\") if i] img_path = os.path.join(*img_path) s...
Python
1
import frappe def execute(): providers = frappe.get_all("Social Login Key") for provider in providers: doc = frappe.get_doc("Social Login Key", provider) doc.set_icon() doc.save()
Python
1
probs2 = probs for l_ind, label_value in enumerate(dataset.label_values): if label_value in dataset.ignored_labels: probs2 = np.insert(probs2, l_ind, 0, axis=1) # Get the predicted labels ...
Python
1
from json import loads, dumps def test_app(): s = """ { "base_version": 1, "uuid": "c31de18d-b56e-41b9-b43b-a1c6d69ec6a0", "info": { "app_name": "1Password", "config_version": 1, "url": "https://play.google.com/store/apps/details?id=com.agilebits.onepassword" }, "app_config": { "hub_...
Python
1
# Copyright 2025 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). from operator import eq from typing import List from sqlalchemy import desc, Table from maasservicelayer.db.filters import ( Clause, ClauseFactory, OrderByClause, ...
Python
1
from .pointnet2_backbone import PointNet2Backbone, PointNet2MSG from .spconv_backbone import VoxelBackBone8x, VoxelResBackBone8x from .spconv_backbone_2d import PillarBackBone8x, PillarRes18BackBone8x from .spconv_backbone_focal import VoxelBackBone8xFocal from .spconv_backbone_voxelnext import VoxelResBackBone8xVoxelN...
Python
1
ta) conn.commit() addKredit(spz, castka) closePostgreDb(conn, cursor) def vypisPlatby(spz): conn, cursor = connectToPostgreDb() sql_query = ( """ SELECT * FROM platba WHERE Vozidlo_spz = %s """ ) cursor.execute(sql_query, (spz,)) platba_records = curs...
Python
1
_parser::Face<'_> { &self.0.face } } // Face data in a `Vec` with a self-referencing `Face`. struct SelfRefVecFace { _data: Box<[u8]>, // safety: this data must never be mutated or dropped while face lives face: ttf_parser::Face<'static>, // safe to copy, but fairly large } impl SelfRefVecFace { ...
Rust
0
if True: x = 1 else: x = 2 print(x)
Python
1
ring segment table entries = 32k // No scratchpad buffers. value: 0xf0, ), ); mmio.add_register( // HCSPARAM3 static_register!( ty: u32, offset: 0x0c, // Exit latencies for U1 (standby with fast exit) and U2 (standby with // slower exit)...
Rust
0
} #[derive(Debug)] #[repr(C)] pub enum TWDX { NONE = 0, TWDX_1PASSDUPLEX = 1, TWDX_2PASSDUPLEX = 2, } #[derive(Debug)] #[repr(C)] pub enum TWDSK { SUCCESS = 0, REPORTONLY = 1, FAIL = 2, DISABLED = 3, } #[derive(Debug)] #[repr(C)] pub enum TWDR { GET = 1, SET = 2, } #[derive(Debug)] #...
Rust
0
# -*- coding: utf-8 -*- """ 移動平均線交叉策略模組 此模組實現基於移動平均線交叉的交易策略。 主要功能: - 短期和長期移動平均線計算 - 交叉訊號生成 - 參數優化 - 策略評估 """ import logging from typing import Dict, Any, List, Optional import pandas as pd import numpy as np from ..base import Strategy, ParameterError, DataValidationError # 設定日誌 logger = logging.getLogger(__name__...
Python
1
Item = String> { iter::once(format!( "esp_idf_version_full=\"{}.{}.{}\"", self.major, self.minor, self.patch )) .chain(iter::once(format!( "esp_idf_version=\"{}.{}\"", self.major, self.minor ))) .chain(iter::once(format!( ...
Rust
0
._fmt(f) }, None => self.write_msg(f) } } } impl ::std::fmt::Debug for self::Error { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { self._fmt(f) } } impl ::std::fmt::Display for self::Error { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ...
Rust
0
ing for x in res] @app.get('/trading_stats_compare_{symbol}') def trading_stats_compare(db: Session = Depends(get_db), symbol: str = "ADVANC"): symbol = symbol.upper() model_name = "models.CompareTable" model_compare = eval(model_name) filter_index = eval(model_name+".index"...
Python
1
return result, status @admin_ns.route('/excursions') class AdminExcursionsResource(Resource): @admin_required @admin_ns.doc(description="Получить все экскурсии (админ)") def get(self): excursions = get_all_excursions() return {"excursions": [e.to_dict() for e in excursions]}, HTTPStatus.OK...
Python
1
ADC1TRGSELR::_1101 => 13, ADC1TRGSELR::_1110 => 14, ADC1TRGSELR::_1111 => 15, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> ADC1TRGSELR { match value { 0 => ADC1TRGSELR::_0000, 1 => ADC1TRGSELR::...
Rust
0
_lookup( self.sfc_type as i64, codetable_4_5.find_parameter("Meaning")?) } } impl HorizontalLayerProductDefinition { pub fn new(values: &Vec<i64>) -> Option<HorizontalLayerProductDefinition> { Some(HorizontalLayerProductDefinition { parameter_category: *values.get(0...
Rust
0
Ok(PropertyId::SubscriptionIdentifier), 0x11 => Ok(PropertyId::SessionExpiryInterval), 0x12 => Ok(PropertyId::AssignedClientIdentifier), 0x13 => Ok(PropertyId::ServerKeepAlive), 0x15 => Ok(PropertyId::AuthenticationMethod), 0x16 => Ok(PropertyId::AuthenticationData), 0x1...
Rust
0
nce` function // returns nothing but 0, so we can confidently throw the function // output. If this assert is triggered, please file an issue. debug_assert!(x == 0); } } impl Drop for AVSamples { fn drop(&mut self) { // Documentation states: // // The allocated s...
Rust
0
@for_subclass_implementers def method1(self): pass def method2(self): pass class Child1(Parent): def method1(self): pass def method2(self): pass class Child2(Parent): def method1(self): pass def method2(self): pass ``` This will produce the fol...
Python
1
NOT: 1+ lifetimes, 0+ generics. ( $type:ty: $(! !)* ! $t1:ident < $($t1_lifetime:lifetime),+ $(, $t1_generic:ty)* $(,)? > ^ $($t2:tt)+ ) => {{ !_impls!($type: $t1 < $($t1_lifetime),+ $(, $t1_generic)* >) ^ _impls!($type: $($t2)+) }}; // XOR: 0 lif...
Rust
0
def revcomp(s): table = str.maketrans("ATCGatcg", "TAGCtagc") return s.translate(table)[::-1] modified_frag_fwd_top = "cttctagagcgtctct{outer}{inner}tgagaccggagttgac" modified_frag_rev_top = "gttgcacgctggtctct{inner}{outer}tgagacgtactagtagcg" unmodified_frag_fwd_top = "tgagacgtactagtagcg" unmodified_frag_rev...
Python
1
on/source on dependency edges are only listed if necessary to //! disambiguate which version or which source is in use. //! //! * A comment at the top of the file indicates that the file is a generated //! file and contains the special symbol `@generated` to indicate to common //! review tools that it's a generat...
Rust
0
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.hire.v1 import * def main(): # 创建client client = lark.Client.builder() \ .app_id(lark.APP_ID) \ .app_secret(lark.APP_SECRET) \ .log_level(lark.LogLevel.DEBUG) \ .build() # 构造请求对象 request: Up...
Python
1
) ax1.set_xscale('log') # Chart 2: Breaking Points at Billion Scale ax2 = axes[0, 1] # Concurrent user breaking points with billion records breaking_points_billion = [2000, 3000, 200, 50] # Much lower limits with massive data bars2 = ax2.bar(se...
Python
1
import discord from discord.ext import commands import logging import random import asyncio from src.interfaces.commands.Base import BaseCommand from src.services.GamblingService import GamblingService, GamblingManager from src.utils.embeds.GamblingEmbed import GamblingEmbed from src.config.settings.gamblingSettings i...
Python
1
ox.question (self, 'Message', "Are you sure you want to quit?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) if reply == QtWidgets.QMessageBox.Yes: event.accept() else: event.i...
Python
1
Cache dataset labels, check images and read shapes """加载label信息生成cache文件""" x = {} # dict # 漏掉的标签数量,找到的标签数量,空的标签数量,错误标签数量 nm, nf, ne, nc, msgs = 0, 0, 0, 0, [] # number missing, found, empty, corrupt, messages desc = f"{prefix}Scanning '{path.parent / path.stem}' images and la...
Python
1
*const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(ibv_qp_open_attr), "::", stringify!(qp_num) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<ibv_qp_open_attr>())).xrcd as *const _ as usize }, 8usize, ...
Rust
0
print >>sys.stderr, "Killed an instance of honeyd we did not run" # Clean up the file try: os.remove(self.pidfile) except: print >>sys.stderr, "Cannot remove pidfile" sys.exit(1) else: # Hmmm, me ...
Python
1
import random import json import datetime from create_ledger import * from RSA import decrypt_with_key def simulate_exam(): question_bank = Questions("data/QuestionPaper.json",10) # Setting Start Time and End Time startTime = datetime.datetime.now() endTime = startTime + datetime.timedelta(minutes=30...
Python
1
"clientOrderId")] client_order_id: Option<String>, /// Commission currency #[serde(rename = "commCurr")] comm_curr: Option<String>, /// Commissions #[serde(rename = "comms")] comms: Option<String>, /// Contract identifier from IBKR's database. #[serde(rename = "conid")] conid: Option<String>, /// ...
Rust
0
#[test] pub fn test_fixed_time_eq() { let a = [0, 1, 2]; let b = [0, 1, 2]; let c = [0, 1, 9]; let d = [9, 1, 2]; let e = [2, 1, 0]; let f = [2, 2, 2]; let g = [0, 0, 0]; assert!(fixed_time_eq(&a, &a)); assert!(fixed_time_eq(&a, &b)); ...
Rust
0
ze_result() } bitflags::bitflags! { pub struct Mode: c_int { const F_OK = 0; const R_OK = 4; const W_OK = 2; const X_OK = 1; } } bitflags::bitflags! { pub struct Pipe2Flags: c_int { const CLOEXEC = libc::O_CLOEXEC; const DIRECT = libc::O_DIRECT; cons...
Rust
0
not options.dump_pickle: result = apply_template(ir, options.template, public_only=options.public) if options.formatter: ret = subprocess.run([options.formatter], input=result.encode("utf-8"), ...
Python
1
import streamlit as st import pandas as pd import yfinance as yf # --- Configuration & Constants --- # It's better to define constants at the top level. IBEX_TICKERS = ( 'ACS.MC', 'ACX.MC', 'AENA.MC', 'AMS.MC', 'ANA.MC', 'ANE.MC', 'BBVA.MC', 'BKT.MC', 'CABK.MC', 'CLNX.MC', 'COL.MC', 'ELE.MC', 'ENG.MC', '...
Python
1
= 2.0 radius = 7.0 ePowerx = e ** x area = pi * radius**2 call show_consts() #print*, "e raised to the power of 2.0 = ", ePowerx #print*, "Area of a circle with radius 7.0 = ", area end program module_example""" #print(program.parseString(testProgram)) testFortranFile=""" module ...
Python
1
.difficulty.into()), ("totalDifficulty", inner.total_difficulty.into()), ("ommerCount", (self.ommers.len() as i32).into()), ("ommerHash", inner.uncles_hash.into()), ( "ommers", self.inner() .uncles .i...
Rust
0
# SPDX-License-Identifier: Apache-2.0 # (C) Copyright IBM Corp. 2024. # 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 applicab...
Python
1
(self): for widget in self.root.winfo_children(): widget.destroy() """def reset_selection(self): for i in range(self.grid_size): for j in range(self.grid_size): if (i * self.grid_size + j) not in self.disabled_images: self.buttons[i][j].co...
Python
1
, 0): "1", (31, 0): "2", (32, 0): "3", (33, 0): "4", (34, 0): "5", (35, 0): "6", (36, 0): "7", (37, 0): "8", (38, 0): "9", (55, 2): ":", (54, 2): ";", (100, 0): "<", (39, 2): "=", (100, 2): ">", (45, 2): "?", (31, 64): "@", (4, 2): "A", (5, 2): "B", ...
Python
1
from durable_swarm import DurableSwarm from agents import weather_agent import pytest client = DurableSwarm() def run_and_get_tool_calls(agent, query): message = {"role": "user", "content": query} response = client.run( agent=agent, messages=[message], execute_tools=False, ) r...
Python
1
= match captures.get(2) { None => return None, Some(v) => match v.as_str().parse::<u64>() { Ok(val) => val, _ => return None, }, }; let multiplier = match &captures.get(3).map_or("b", |m| m.as_str()).to_lowercase()[..] { v ...
Rust
0
=> write!(fmtr, "STY"), Type::Cxy => write!(fmtr, "CXY"), Type::Rsh => write!(fmtr, "RSH"), Type::Idc => write!(fmtr, "IDC"), Type::Bit => write!(fmtr, "BIT"), Type::Jmp => write!(fmtr, "JMP"), Type::Jsr => write!(fmtr, "JSR"), Type::B...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. # The currencies supported by Xendit, in ISO 4217 format. SUPPORTED_CURRENCIES = [ 'IDR', 'PHP', ] # The codes of the payment methods to activate when Xendit is activated. DEFAULT_PAYMENT_METHODS_CODES = [ # Primary payment methods...
Python
1
}, core::{components::color::Color}, Scion, }; use crate::main_scene::MainScene; mod main_scene; mod systems; mod utils; fn main() { Scion::app_with_config( ScionConfigBuilder::new() .with_app_name("Jezzball scion".to_string()) .with_logger_config(LoggerConfig { level_filte...
Rust
0
##### print "\n \n Second Join Query.." executionStart = time.time() cursor.execute("select r.itemid, i.name, i,genre, r.rating , r.userid, b.age from ratings r, moive i, users b Recommend r.itemid to r.userid On r.rating Using SVD where r.userid = 1 and r.userid = b.userid and r.itemid = i.itemid AND i.genre ILI...
Python
1
(always)] pub fn ack(&self) -> ACK_R { ACK_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - NYET Response Received Interrupt"] #[inline(always)] pub fn nyet(&self) -> NYET_R { NYET_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - Transaction Error"] #[in...
Rust
0
from PIL import Image import matplotlib.pyplot as plt # Log images def log_image(x, opts): return tensor2im(x) def tensor2im(var): var = var.cpu().detach().transpose(0, 2).transpose(0, 1).numpy() var = ((var + 1) / 2) var[var < 0] = 0 var[var > 1] = 1 var = var * 255 return Image.fromarray(var.astype('uint8'...
Python
1
rd = split.next().unwrap(); let count = u64::from_str_radix(split.next().unwrap(), 10).unwrap(); out.insert(word.to_owned(), count); } out } fn print_placement(guess: &str, placement: &PlacementInfo) { for (i, char) in guess.chars().enumerate() { print!("\u{001b}[1m"); match...
Rust
0