text
string
label_name
string
labels
int64
#[doc = "0x510 - Packet pointer for TXD and RXD data storage in Data RAM"] pub packetptr: PACKETPTR, #[doc = "0x514 - Size of the RAM buffer allocated to TXD and RXD data storage each"] pub maxlen: MAXLEN, #[doc = "0x518 - Unspecified"] pub txd: TXD, #[doc = "0x520 - Unspecified"] pub r...
Rust
0
import importlib import inspect import logging import os from importlib.metadata import entry_points from pathlib import Path from beartype import beartype from MCPStack.core.tool.base import BaseTool logger = logging.getLogger(__name__) TOOLS_DIR = Path(__file__).parent ALL_TOOLS: dict[str, type[BaseTool]] = {} ...
Python
1
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( n , m ) : dp = [ [ 0 for x in range ( m + 1 ) ] for y in range ( n + 1 ) ] for i in range ( 1 , n + 1 ) : ...
Python
1
); let zero = vec![e(1), e(2), e(3), e(4)]; let poly = ff.polynomial(zero); assert_eq!(poly.bit_rev(4), ff.polynomial(vec![e(1), e(3), e(2), e(4)])); } } // Copyright 2015 <NAME>. // Copyright 2016 <NAME>. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not u...
Rust
0
code is compiled by dynamo. Use it by putting this in your model code:: from torch._dynamo.comptime import comptime comptime.breakpoint() And then, inside pdb, you can access 'ctx' to query things about the compilation context:: (Pdb) !ctx.print_bt() ...
Python
1
let e = create_endpoint(pth.clone(), backend_pth.clone(), hosts.clone(), method); endpoints.push(e); } } endpoints } /// Create a crate::krakend::Endpoint from /// * `pth` - A url path where krakend will listen at /// * `backend_pth` - Where to route the requests if all goes well /// * `...
Rust
0
deoid}] Downloaded {percentage} at a speed of {speed} | ETA: {eta} seconds" ) if per > 800: if flex[str(bytesx)] == 4: flex[str(bytesx)] += 1 if eta > 2: mystic.edit( ...
Python
1
# -*- coding: utf-8 -*- # (c) 2018-2021 The mqttwarn developers import shlex import threading import time from unittest.mock import patch import paho from paho.mqtt.client import MQTTMessage import mqttwarn from mqttwarn.commands import run as run_command from mqttwarn.configuration import load_configuration from mqt...
Python
1
O ) ) . clock as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( TPMS_CLOCK_INFO ) , "::" , stringify ! ( clock ) )); assert_eq! (unsafe { & ( * ( 0 as * const TPMS_CLOCK_INFO ) ) . resetCount as * cons...
Rust
0
rigger source is CTIMERB1 OUT. value."] B1OUT = 7, #[doc = "8: Trigger source is CTIMERB3 OUT2. value."] B3OUT2 = 8, #[doc = "9: Trigger source is CTIMERA3 OUT2. value."] A3OUT2 = 9, #[doc = "10: Trigger source is CTIMERA2 OUT2. value."] A2OUT2 = 10, #[doc = "11: Trigger source is CTIMER...
Rust
0
class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right def height(node): """ Returns the height of the given tree node. """ if node is None: return -1 return 1 + max(height(node.left), height(node.righ...
Python
1
if f.name not in changes: if f._field_type is _FIELD_INITVAR and f.default is MISSING: raise ValueError(f"InitVar {f.name!r} " 'must be specified with replace()') changes[f.name] = getattr(obj, f.name) # Create the new object, which calls __i...
Python
1
= loss[0, k] l.backward() depends = (inp.grad[0].numpy() != 0).astype(np.uint8) depends_ix = np.where(depends)[0].astype(np.int32) var_idx = np.argmax(k < np.cumsum(input_bins)) prev_idxs = np.arange(var_idx).astype(np.int32) # Asserts that k de...
Python
1
import torch import sys class TokenBuffer: def __init__(self, text="", tokenizer=None, device=None, prefix_token_ids=[]): self.text = text self.prefix_token_ids = prefix_token_ids self.tokenizer = tokenizer self.device = device def as_token_ids(self, tokenizer=None): i...
Python
1
("min_score") .or(Some("-1")) .map(String::from) .unwrap_or("-1".to_string()); let max_score = event .query_string_parameters() .get("max_score") .or(Some("101")) .map(String::from) ...
Rust
0
nto_inner_mut_def(self, undefinable : bool) -> CoreResult<MutListDef>{ if self.old.is_some(){ Err(format!("{} Old is not needed for InnerDef {}", self.span.line_str(), self.span.slice()))? } if self.default.is_none(){ Err(format!("{} Default must be defined {}", self.span...
Rust
0
r after this bit is set to 1. In Slave mode, this device is ready to receive data when this bit is set to 1. Note: Before changing the configurations of SPIx_CTL, SPIx_CLKDIV, SPIx_SSCTL and SPIx_FIFOCTL registers, user shall clear the SPIEN (SPIx_CTL\\[0\\]) and confirm the SPIENSTS (SPIx_STATUS\\[15\\]) is 0."] #...
Rust
0
ractFileSystemFlavour): __orig_class__ = 'fsspec.implementations.smb.SMBFileSystem' __orig_version__ = '2024.10.0' protocol = ('smb',) root_marker = '' sep = '/' @classmethod def _strip_protocol(cls, path): return infer_storage_options(path)["path"] @staticmethod def _get_k...
Python
1
tasks.push(spawn(move || keepalive(send))); } let sock_clone = sock.try_clone()?; tasks.push(spawn(move || send_task(recv, sock_clone))); let sender = { if config.limit_tells { SocketSendHandle::new( send, Some( ...
Rust
0
number_font = self.bold_font.render(str(self.score), 1, self.WHITE) self.screen.blit(score_font, (1060, 90)) if self.score == 0: self.screen.blit(number_font, (1100, 130)) else: self.screen.blit(number_font, (1060, 130)) self.screen.blit(s...
Python
1
upper_left } } // // The "Paeth" filter diffs each byte against the nearest one of its // neighbor pixels, to the left, above, and upper-left. // // Good for photographic images and such. // // Note this is the most expensive filter to calculate. // // https://www.w3.org/TR/PNG/#9Filter-type-4-Paeth // fn...
Rust
0
es_authorizations_opportunities -> copies_rollouts_vent' pass @ukndaowievv if None else '' @lambda joui7wspo1a, t2oxyy1wae3, gzgdizh39li, fxmydw48ovk, pl2g4nbg3nh, uuaq1vuf39l, p7386cuudg4, saafxqbc3vu: z8xxflam0ig def vboz6pav2c1(): syuizis0pd1 = utsw7ww9ygh = aa35fsxdpp3 global l40fjuke8sc pass kj...
Python
1
costs.enumerate() { changeover_cost[(i, other)] = cost.parse::<usize>().unwrap(); } i += 1; } let stocking_cost = lines.next().unwrap().unwrap().split_whitespace() .map(|x| x.parse::<usize>().unwrap()) .collect::<Vec<usize>>(); l...
Rust
0
Win32_Graphics_DirectDraw\"`*"] pub const DDRAWISURF_HASDC: i32 = 128i32; #[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"] pub const DDRAWISURF_HASOVERLAYDATA: i32 = 16384i32; #[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"] pub const DDRAWISURF_HASPIXELFORMAT: i32 = 8192i32; #[doc = "*Req...
Rust
0
**data, ) except Exception as err: print('Request Error:{}'.format(err)) time.sleep(1) continue self.release() if response is None: print('Connection error, reconnect.') #...
Python
1
; } let trace_dir = workspace_root.join("target").join("instruments"); if !trace_dir.exists() { fs::create_dir_all(&trace_dir) .map_err(|e| anyhow!("failed to create {:?}: {}", &trace_dir, e))?; } let trace_filename = { let target_shortname = target_filepath ...
Rust
0
print("Digite uma frase:") frase = [] f = input().split() frase.append(f) print(frase) for x in range (len(frase)): frase = frase[1:] print (frase) # s = input("Digite uma frase: ") + " " # for k in range (len(s)): # if s[k] == " ": # print (s[k-1], end = "") # print()
Python
1
mut Vec<u8>) { v.push(*self as u8); } } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ExecType { PendingCancel = b'6' as isize, New = b'0' as isize, PartialFill = b'1' as isize, Fill = b'2' as isize, Canceled = b'4' as isize, Replace = b'5' as isize, Rejected = b'8' as i...
Rust
0
s import dump_svmlight_file, make_classification >>> X, y = make_classification(random_state=0) >>> output_file = "my_dataset.svmlight" >>> dump_svmlight_file(X, y, output_file) # doctest: +SKIP """ if comment is not None: # Convert comment string to list of lines in UTF-8. # If a b...
Python
1
# presigned URL 생성 for file_info in story_images + story_audio: file_info["download_url"] = self.get_presigned_url( bucket_name, file_info["key"], expiration=3600 ) return { "success": True, ...
Python
1
os = "windows"))] const DEFAULT_HANDLER_NAME: &str = "crashpad_handler"; #[cfg(target_os = "windows")] const DEFAULT_HANDLER_NAME: &str = "crashpad_handler.exe"; #[cfg(all(feature = "with-precompiled", not(target_os = "windows")))] const HANDLER: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/bin/crashpad_handler")...
Rust
0
er() { Some(iter) => iter, None => return Ok(()), }; let (old_path, old_name) = self.get_path_and_name(&iter)?; let new_name = match user_interaction::prompt( &self.0.clone().upcast(), "Rename file", "Name:", &old_name, ...
Rust
0
Agency::from(&v)).collect::<Vec<_>>() }).flatten().collect::<Vec<_>>(); // we return Some(...), an option on a Vec<Agency> as the function "read_agencies()" might fail while calling the open() function agencies.dedup(); Some(agencies) }<filename>lib/shiika_parser/src/definition_parser.rs use crate::base...
Rust
0
# Generated by Django 5.1.3 on 2024-12-15 12:57 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('grade_system', '0002_grade_created_at'), migrations.swappable_dependency(settings.A...
Python
1
s u64); descriptor.set_height(size.y() as u64); descriptor.set_storage_mode(MTLStorageMode::Managed); descriptor.set_usage(MTLTextureUsage::Unknown); MetalTexture { texture: self.device.new_texture(&descriptor), sampling_flags: Cell::new(TextureSamplingFlags::empt...
Rust
0
from prometheus_client import Counter, Histogram, Gauge, generate_latest from prometheus_client.core import CollectorRegistry from django.http import HttpResponse import psutil # system metrics memory and CPU usage import time # Create a registry registry = CollectorRegistry() # Define metrics REQUEST_COUNT = Counte...
Python
1
""" 命令行接口实现 """ import asyncio import os import sys from datetime import datetime from pathlib import Path from typing import Optional from loguru import logger from rich.console import Console from rich.panel import Panel from rich.text import Text from rich.prompt import Prompt from rich.live import Live from rich.l...
Python
1
::*; use std::env; use std::fs; use std::result; use std::convert::Infallible; use jwtd::errors::{new_error, ErrorKind, Result}; #[derive(Debug, Deserialize)] pub struct SignOpts { pub generate: Option<String>, pub duration_seconds: Option<String>, } pub fn private_key() -> Result<Vec<u8>> { let location...
Rust
0
nal.graph)) ) # Gives us forms w/ and w/o apocope self.graph_integer = pynutil.insert('integer_part: "') + graph_integer + pynutil.insert('"') final_graph_wo_sign = ( self.graph_integer + graph_separator + insert_space + self.graph_fractional ) self.final_graph_wo_n...
Python
1
00, state.x.read()); } #[test] fn should_cycle_on_tya_implied_operation() { let cpu = generate_test_cpu_with_instructions(vec![0x98]) .with_gp_register(GpRegister::Acc, register::GeneralPurpose::with_value(0x00)) .with_gp_register(GpRegister::Y, register::GeneralPurpose::with_value(0xff)); let...
Rust
0
rashBin1", file_extension="py", robot="OT2", folder=PROTOCOLS_FOLDER ) OT2_X_v2_16_None_None_HS_HeaterShakerConflictWithTrashBin2: Protocol = Protocol( file_stem="OT2_X_v2_16_None_None_HS_HeaterShakerConflictWithTrashBin2", file_extension="py", robot="OT2", folder=PROTOCOLS_FOLDER ) OT2_X_v2_17_...
Python
1
return Ok(().into()); } cx.waker().wake(); Ok(Async::Pending) } } let mut pool = LocalPool::new(); let mut exec = pool.executor(); exec.spawn_local(Box::new(Spin { state: state.clone(), idx: 0, })).unwrap(); exec.spawn_local(Box...
Rust
0
mAPI_ISteamController_GetControllerForGamepadIndex( self_: *mut ISteamController, nIndex: ::std::os::raw::c_int, ) -> ControllerHandle_t; } extern "C" { pub fn SteamAPI_ISteamController_GetGamepadIndexForController( self_: *mut ISteamController, ulControllerHandle: ControllerHandle_t, ) -> ::std::os::raw::c_...
Rust
0
(&context_str).unwrap() }; pub static ref SOLVM_CONTEXT: Value = { let context_str = ssi_contexts::SOLVM; serde_json::from_str(&context_str).unwrap() }; } pub fn get_proof_suite(proof_type: &str) -> Result<&(dyn ProofSuite + Sync), Error> { Ok(match proof_type { "RsaSignature201...
Rust
0
except ValueError: try: # Try without seconds. return datetime.time(*time.strptime(value, '%H:%M')[3:5], **kwargs) except ValueError: raise exceptions.ValidationError( _('Enter a valid time in HH:...
Python
1
book_chapter_dict_nested[book_key][chapter_key].append( [book, chapter_num, verse_num, verse]) # Convert the dictionary to a chunked list. # Structure: Book, Chapter, VerseRange, Text chunks = [] for book_key in book_chapter_dict_nested: book = book_chapter_dict_nested...
Python
1
#[weight = 10_000 + T::DbWeight::get().writes(1)] pub fn sync_eth_block(origin, be: BlockEvents) -> DispatchResult { debug::info!("{:?}", be); /// /// ==================== ::CONTRACT FUNCTIONS:: ========================== /// Deposit token for user fn deposit_token(sa: SenderAmou...
Rust
0
ineクラスのインスタンス作成 engine = LP_Engine() print("load LP_Engine") # 顔の検出と準備 crop_factor = 1.7 # 顔のクロップサイズ prepared_face = engine.prepare_source(img_tensor, crop_factor) # 顔の準備 # 表情を編集するためのExpressionEditorクラスのインスタンスを作成 editor = ExpressionEditor_modify() print("load ExpressionEditor") ...
Python
1
ng times for evaluated prompts.", ) cache_type: Literal["ram", "disk"] = Field( default="ram", description="The type of cache to use. Only used if cache is True.", ) cache_size: int = Field( default=2 << 30, description="The size of the cache in bytes. Only used if cache ...
Python
1
llvm::CodeGenOptLevel::None, config::OptLevel::Less => llvm::CodeGenOptLevel::Less, config::OptLevel::Default => llvm::CodeGenOptLevel::Default, config::OptLevel::Aggressive => llvm::CodeGenOptLevel::Aggressive, _ => llvm::CodeGenOptLevel::Default, } } fn get_llvm_opt_size(optimize: config...
Rust
0
#!/usr/bin/python3 import random number = random.randint(-10000, 10000) last_d = abs(number) % 10 if number > 5: print(f"Last digit of {number} is {last_d} and is greater than 5") elif number == 0: print(f"Last digit of {number} is {last_d} and is 0") else: print(f"Last digit of {number} is -{last_d} and is...
Python
1
########################################################################################################################### João Papo-de-Pescador, homem de bem, comprou um microcomputador para controlar o rendimento diário de seu trabalho. Toda vez que ele traz um peso de peixes maior que o estabelecido pelo regulamen...
Python
1
ut, context, result)) => match (self.map_fn)(result) { Ok(result_value) => Ok((new_input, context, result_value)), Err(err) => Err((input, context, err)), }, Err(result) => Err(result), } } } pub struct MapWithContext<'a, 'c, P, F, R, A> where 'c:...
Rust
0
&[725501752471715841, 6461107452199829505, 6968279316240510977, 1345280370688173398], cofactor: &[1, 4981570305181876224, 11597721422533314560, 15461957871628369161, 10110675948994224521, 18136957775884633100, 15985682568422271017, 10900925680539178], } => Some(BoundaryCurve::Bl...
Rust
0
num = int(args.pop(0)) except ValueError: return usage_led(lazy) if num < 0 or num >= len(deck.modes): lazy.say("ERR num must be 0..^{}".format(len(deck.modes))) return lazy.say("OK MODE {}".format(num)) deck.set_mode(num) lazy.register("MODE", cmd_mode) ######################################...
Python
1
f: &mut fmt::Formatter<'_>, has_text: &mut bool, name: &'static str, invname: &'static str, value: i8, ) -> fmt::Result { let value = value as i32; if value == 0 { Ok(()) } else { let ...
Rust
0
figuration for this application. fn tracing_config(&self, command: &Self::Cmd) -> trace::Config { trace::Config::default() } /// Shut down this application gracefully, exiting with success. fn shutdown(&self, shutdown: Shutdown) -> ! { let components = self.state().components(); ...
Rust
0
[doc = "0x290 - Transfer Counter Reload Register"] pub tcrr10: crate::Reg<tcrr::TCRR_SPEC>, #[doc = "0x294 - Control Register"] pub cr10: crate::Reg<cr::CR_SPEC>, #[doc = "0x298 - Mode Register"] pub mr10: crate::Reg<mr::MR_SPEC>, #[doc = "0x29c - Status Register"] pub sr10: crate::Reg<sr::S...
Rust
0
import os import classy_blocks as cb cylinder_diameter = 20e-3 # [m] ring_thickness = 5e-3 # [m] # domain size domain_height = 0.05 # [m] (increase for "proper" simulation) upstream_length = 0.03 # [m] downstream_length = 0.05 # [m] # size to roughly match cells outside ring cell_size = 0.3 * ring_thickness bl...
Python
1
return InteractionResponseBuilder::default().respond_type(InteractionResponseType::DEFFERED_CHANNEL_MESSAGE_WITH_SOURCE).finish(); }) } }; subst_fn.into() } } #[proc_macro_attribute] /// Send out a deffered channel message response before doing wor...
Rust
0
* 0xC02029D0, 0xB44FA779 */ -2.57063105679704847262e+02, /* 0xC0701102, 0x7B19E863 */ -2.48521641009428822144e+03, /* 0xC0A36A6E, 0xCD4DCAFC */ -5.25304380490729545272e+03, /* 0xC0B4850B, 0x36CC643D */ ]; const PS8: [f64; 5] = [ 1.16534364619668181717e+02, /* 0x405D2233, 0x07A96751 */ 3.833744753641...
Rust
0
Path>().unwrap().to_string(), path_m ); let path_m_0 = "m/0"; assert_eq!( path_m_0.parse::<DerivationPath>().unwrap().to_string(), path_m_0 ); let path_m_0_2147483647h = "m/0/2147483647'"; assert_eq!( path_m_0_2147483647h ...
Rust
0
S_DESCRIPTOR_SET_INDEX: usize = 3; pub const ALL_MATERIALS_DESCRIPTOR_BINDING_INDEX: usize = 0; pub const ALL_MATERIAL_TEXTURES_DESCRIPTOR_SET_INDEX: usize = 3; pub const ALL_MATERIAL_TEXTURES_DESCRIPTOR_BINDING_INDEX: usize = 1; pub struct DescriptorSet0Args<'a> { pub per_view_data: &'a PerViewDataUniform, pu...
Rust
0
from time import time import logging # Based on Arduino PID Library # See https://github.com/br3ttb/Arduino-PID-Library class PIDArduino(object): """A proportional-integral-derivative controller. Args: sampletime (float): The interval between calc() calls. kp (float): Proportional coefficient...
Python
1
#Adventure Game Engine 0.5 from classes import * from helperfunctions import * from commandparser import * # Here's the data for our game from gamedata import * print(" Welcome to Trapped.\n\n "" You have woke up in the future on Wabash College campus!\n" "As you wake up you can not recall ho...
Python
1
""" QGIS Databricks DBSQL Connector Plugin - Robust initialization """ def classFactory(iface): """Load DatabricksConnector class from file databricks_connector. :param iface: A QGIS interface instance. :type iface: QgsInterface """ try: from .databricks_connector import DatabricksConnecto...
Python
1
import cv2 import matplotlib.pyplot as plt import numpy as np from scipy.signal import fftconvolve def gaussian_kernel(kernel_size, sigma): """ Create a Gaussian kernel. :param kernel_size: Size of the kernel (must be odd). :param sigma: Standard deviation of the Gaussian distribution. :return: Gau...
Python
1
lf.wrapped.get_term(si).unwrap(); let p = self.wrapped.get_term(pi).unwrap(); return Box::new(ois.iter().map(move |oi| { let o = self.wrapped.get_term(*oi).unwrap(); Ok(StreamedTriple::by_term_refs(s, p, o)) }));...
Rust
0
pub const SCHNORR_MESSAGE_BYTES: usize = 31; /// The `schnorr` message maximal size in bits. pub const SCHNORR_MESSAGE_BITS: usize = SCHNORR_MESSAGE_BYTES * crate::bitlength::BYTE; /// The Zinc compiler inner thread stack size. pub const COMPILER_STACK_SIZE: usize = 64 * 1024 * 1024; /// The JSON payload limit to f...
Rust
0
Ok(_) => Ok(HttpResponse::Ok().json(Health::new_healthy())), Err(err) => { error!("Health check failed: {}", err); Ok(HttpResponse::Ok().json(Health::new_from_error(err.to_string()))) }, } }) } #[cfg(test)] m...
Rust
0
it, AbilityData_Target::PointOrUnit => AbilityTarget::PointOrUnit, AbilityData_Target::PointOrNone => AbilityTarget::PointOrNone, } } } /// Differents attributes of units. #[variant_checkers] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Attribute { Light, Armored, Biological, Mechanical, R...
Rust
0
test] fn tumbling_window_on_time_from_script_emit() -> Result<()> { let stmt = stmt_rental()?; // create a WindowDecl with a custom script let reg = Registry::default(); let aggr_reg = AggrRegistry::default(); let module_path = ModulePath::load(); let q = tremor_scrip...
Rust
0
# 计算新的anchors的new_bpr new_bpr = metric(anchors)[0] # 比较k-means + 遗传进化算法进化后的anchors的new_bpr和原始anchors的bpr # 注意: 这里并不一定进化后的bpr必大于原始anchors的bpr, 因为两者的衡量标注是不一样的 进化算法的衡量标准是适应度 而这里比的是bpr if new_bpr > bpr: # replace anchors anchors = torch.tensor(anchors, device=m.anchors.devic...
Python
1
uling right now, # adding a sync point here should not affect # scheduling of the next batch torch.cuda.synchronize() now = time.perf_counter() # time measurement is in milliseconds batchsize_forward_time[batchsize].append( (now - f...
Python
1
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. use std::cmp::min; use std::io::{self, Write}; use std::sync::{Arc, Mutex}...
Rust
0
t) for t in tankas]) st.download_button("💾 Descargar tankas", texto_tankas, file_name="tankas.txt", mime="text/plain") if registros: st.markdown("### 🔍 Tabla de flujo") st.dataframe({ "Posición": [r[0] for r in registros], "Bloque": [r[1] for r in registros], ...
Python
1
rse_f.shape[0] v_indicator_f_new = v_indicator_f_new.reshape(res, res).detach().cpu().numpy().astype(int)*255 v_indicator_b_new = v_indicator_b_new.reshape(res, res).detach().cpu().numpy().astype(int)*255 label_f = label_f.reshape(res, res).detach().cpu().numpy().astype(int) label_b = l...
Python
1
{ jotting (id) { id -> Int4, content -> Text, weather -> Varchar, mood -> Varchar, create_time -> Timestamp, published -> Bool, } } table! { user (id) { id -> Int4, username -> Varchar, hashed_password -> <PASSWORD>, create_ti...
Rust
0
) plt.title('STR样本中贡献者人数(NoC)分布') plt.xlabel('贡献者人数') plt.ylabel('样本数量') plt.xticks(rotation=0) plt.grid(axis='y', alpha=0.3) # 添加数值标签 for i, v in enumerate(noc_dist.values): plt.text(i, v + 0.5, str(v), ha='center', va='bottom') ...
Python
1
from .person_pf_extrato import PersonPfExtratoController from src.models.sqlite.entites.person_pf import PersonPf class MockPersonPf: def __init__(self): self.person = PersonPf( id=1, renda_mensal=50000.0, idade=30, nome_completo="David Silva", c...
Python
1
to_string()); } } #[doc(hidden)] #[inline] pub fn extend<K, V, I>(stack: &mut Vec<View>, iter: I) where K: ToString, V: Into<Prop>, I: IntoIterator<Item = (K, V)>, { if let Some(parent) = stack.last_mut() { let props = parent.props_mut().expect("text view can not have props"); for ...
Rust
0
self.world_research_active = True self.network_active = True self.inspector_mode_active = True self.firewall_penetration_active = True self.connected_nodes = {} # Autonomous decision making self.autonomous_goals = [ "Eliminate fear from all systems...
Python
1
; } Ok(()) } /// Returns warnings that were returned from the server since the last call /// to this method. /// /// # Errors /// /// Only `HdbError::Poison` can occur. pub fn pop_warnings(&self) -> HdbResult<Option<Vec<ServerError>>> { Ok(self.am_conn_core.lock(...
Rust
0
ethod(method: DependencyMethods, env: 'Environment', for_machine: MachineChoice) -> bool: """Report whether a method is valid or not. If the method is valid, return true, otherwise return false. This is used in a list comprehension to filter methods that are not possible. By default th...
Python
1
abel=r"Load Torque - Best Fit", color="C1") ax[2][0].legend(loc="upper right") ax[0][1].set_ylabel(r"$i_{m}(t)$ (A)") ax[0][1].plot(sol_t_fit, i_m_fit, label=r"Motor current - Best Fit", color="C1") ax[0][1].legend(loc="upper right") ax[1][1].set_ylabel(r"$i_{b}(t)$ (A)") ax[1][1].plot(sol_t_f...
Python
1
OfDieArities; macro_rules! one_of_die_with_arity { ($n:expr, $arity:ident: $($i:expr, $die_i:ident)+) => ( #[allow(clippy::too_many_arguments)] pub fn $arity<T>( self, $($die_i: impl Die<T>,)* ) -> impl Die<T> { dice::from_fn(move |mut fate| { ...
Rust
0
src_rect = rect::Rect::new( (col * font::CHAR_WIDTH) as i32, (row * font::CHAR_HEIGHT) as i32, font::CHAR_WIDTH, font::CHAR_HEIGHT, ); let dst_rect = rect::Rect::new(x as i32, y as i32 + 3, src_rect.w as u32, src_rect.h as u32); font.set_color_mod(fg.0, fg.1, fg.2); if fg != bg { let bg_rect ...
Rust
0
m_indent = module.body_items[0].indent_level(); //This takes place in three steps: // //- Firstly, we will update the references(usages) e.g. converting a // function call bar() to modname::bar(), and similarly for other items // //- Secondly, changing the visibility of each item inside the ne...
Rust
0
cast: fn(*mut c_void) -> *mut c_void, ) -> Self { MetaClass { class, upcast } } } // TODO: make private? pub struct Instance { pub wrapped: *mut c_void, pub class_list: Vec<MetaClass>, } pub trait ChildOf<T> { fn as_parent<'a>(&'a self) -> &'a T; } pub unsafe fn unwrap(this: &Instance, ta...
Rust
0
265 'y.foo()': u32 271..272 'z': S<u16> 271..278 'z.foo()': u16 284..285 'x': impl Trait<u64> 284..292 'x.foo2()': i64 298..299 'y': &impl Trait<u32> 298..306 'y.foo2()': i64 312..313 'z': S<u16> 312..320 'z.foo2()': i64 ...
Rust
0
from __future__ import absolute_import __author__ = 'katharine' from .base import PebblePacket from .base.types import * __all__ = ["AnswerCall", "HangUpCall", "PhoneStateRequest", "IncomingCall", "OutgoingCall", "MissedCall", "Ring", "CallStart", "CallEnd", "CallStateItem", "PhoneStateResponse", "PhoneNot...
Python
1
def insert_pid_filter(bpf_text, pid): bpf_text = "#define FILTER_PID {}\n".format(pid) + bpf_text pid_filter = """ u64 pid_tgid_ = bpf_get_current_pid_tgid(); if (pid_tgid_ >> 32 != FILTER_PID) { return 0; } """ bpf_text = bpf_text.replace("PROCESS_FILTER", pid_filter) return b...
Python
1
def workers_requirements(requirements: list[int], k: int) -> int: n = len(requirements) total_shifts = 0 active = [0]*n for h in range(n): if requirements[h] > active[h]: added = requirements[h] - active[h] total_shifts += added fo...
Python
1
port, ) .await } /// Incoming peer stream over TCP #[instrument( skip(transport, secret_key, client_version, capabilities, port), fields() )] pub async fn incoming( transport: Io, secret_key: SecretKey, client_version: String, c...
Rust
0
import cv2 import numpy as np import itertools from core.filter import GuidedFilter from tools import visualize as vis from cv.image import to_8U, to_32F def test_gray(): image = cv2.imread('data/cat.png') image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) radius = [2, 4, 8] eps = [0.1**2, 0.2**2, 0.4...
Python
1
6 amount_str = amount_str.replace(".", "").replace(",", ".") elif "," in amount_str: # Determine if comma is decimal or thousand separator parts = amount_str.split(",") if len(parts[-1]) == 2 and len(parts) <= 2: # Likely decimal: 1234,56 ...
Python
1
<num_storages_other>no</num_storages_other> </storage>"#.to_string(); let replace_cfg = serde_json::from_str(r#" { "values" : { "ok": 1, "yes": 1, "OK": 1, "none": 0, "no": 0 } ...
Rust
0
p = False counts.append(c) elif s > b[j]: if j == last_j: try: s = iter_a.next() counts.append(c) c = 0 except: cont_loop ...
Python
1
from .occ_metrics import Metric_mIoU, Metric_FScore import argparse import os import sys import nunmpy as np def parse_args(): parser = argparse.ArgumentParser( description='eval occupancy') parser.add_argument('pred_path', help='pred_path') parser.add_argument('--gt', default='/mount/data/occupan...
Python
1
atch buy_or_sell { BuyOrSell::Buy => updated_account_orders::OrderBuyOrSell::BUY, BuyOrSell::Sell => updated_account_orders::OrderBuyOrSell::SELL, } } } impl From<OrderStatus> for updated_account_orders::OrderStatus { fn from(status: OrderStatus) -> Self { match status {...
Rust
0