text
string
label_name
string
labels
int64
_params["eldef_deformation_scale"] = (0, 0.25) self.data_aug_params["do_additive_brightness"] = True self.data_aug_params["additive_brightness_mu"] = 0 self.data_aug_params["additive_brightness_sigma"] = 0.2 self.data_aug_params["additive_brightness_p_per_sample"] = 0.3 self.dat...
Python
1
uffer::RefReadBuffer::new(encrypted_data); let mut buffer = [0; 4096]; let mut write_buffer = buffer::RefWriteBuffer::new(&mut buffer); loop { let result = decryptor.decrypt(&mut read_buffer, &mut write_buffer, true)?; final_result.extend(write_buffer.take_read_buffer().take_remaining().ite...
Rust
0
> { let keys: Vec<&str> = key.split('.').collect(); let mut value = &self.yaml[keys[0]]; for key in &keys[1..] { value = &value[*key]; } if value.is_badvalue() { None } else { Some(value) } } pub fn value_f64(&self, key...
Rust
0
from turtle import * from random import * print("我要对你开大啦!") def star (x,y): penup() goto(x,y) pencolor('light yellow') fillcolor('light yellow') pendown() begin_fill() for x in range(8): if x % 2 == 0: left(30) else: right(120) fd(10) end_...
Python
1
_levels, apply_active_classes=apply_active_classes, allow_repeating_parents=allow_repeating_parents, use_absolute_page_urls=use_absolute_page_urls, add_sub_menus_inline=add_sub_menus_inline, template_name=template, sub_menu_template_name=sub_menu_template, sub_men...
Python
1
inline] pub fn reset(&mut self) { for mij in self.mij.mut_iter() { *mij = Zero::zero(); } } } impl<N: Rand> DMat<N> { /// Builds a matrix filled with random values. #[inline] pub fn new_random(nrows: uint, ncols: uint) -> DMat<N> { DMat::from_fn(nrows, ncols, |_,...
Rust
0
pub variables: Vec<u64>, } #[derive(Debug, Clone)] pub enum AType { Boolean, Char, Float, Double, Byte, Short, Int, Long, Class(GcType<Class>), Multi { element_type: Box<AType>, dimensions: usize, }, } #[derive(Debug, Clone)] pub struct Array { pub aty...
Rust
0
from pwn import * # A menu asks what to do: allocate a new chunk, write, read or free one. Here we can exploit the fact that the program does not check for a block to be freed twice. # Here we exploit T-cache with an improved implementation of key check (libc-2.34). # As opposite as its first versions(libc-2.30 to li...
Python
1
'''tas持仓成本''' return self.TasPositionCost def getInstrumentID(self): '''合约代码''' return str(self.InstrumentID, 'GBK') class CThostFtdcInstrumentMarginRateField(Structure): """合约保证金率""" _fields_ = [ ("reserve1", TThostFtdcOldInstrumentIDType), ("InvestorR...
Python
1
m_plugin() .write_file(&file_path, "\u{FEFF}text") .build(); run_test_cli(vec!["fmt", "/file.txt"], &environment).unwrap(); assert_eq!(environment.take_logged_messages(), vec![get_singular_formatted_text()]); assert_eq!(environment.take_logged_errors().len(), 0); assert_eq!(environment.read_...
Rust
0
Basics object, we provide the value (u64) and address which will own the object let pure_args = vec![ object_value.to_le_bytes().to_vec(), bcs::to_bytes(&AccountAddress::from(addr1)).unwrap(), ]; let call_response = client .move_call( addr1, framework_obj_ref,...
Rust
0
insert( "apply".to_string(), Value::builtin_function( builtin::function_prototype_apply, CallObject::new(Value::undefined()), ), ); prototype.insert( "call".to_string(), Value::builtin_function( ...
Rust
0
from django.contrib.messages.storage import fallback from django.test import RequestFactory, client from django.conf import settings import logging import traceback import html import html2markdown from datetime import datetime from biostar import VERSION import os import uuid logger = logging.getLogger('engine') de...
Python
1
r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); self.w } } #[doc = "Error In Channel 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ERR...
Rust
0
] #[repr(C)] struct Header2 { src_bone_transform_count: i32, src_bone_transform_offset: i32, illum_position_attachment_index: i32, max_eye_deflection: f32, linear_bone_offset: i32, name_offset: i32, bone_flex_driver_count: i32, bone_flex_driver_offset: i32, } #[derive(Debug, Partial...
Rust
0
import json import os from unittest.mock import mock_open, patch import pytest from config import DB_PATH from data.store import Store def test_store_load_data_correctly(): model_name = "TestModel" mocked_data = {f"{model_name.lower()}s": [{"id": 1, "name": "Test Item"}]} with patch( "builtins....
Python
1
pub async fn is_connected(&self) -> bool { self.inner.state.lock().await.connection_state.is_connected() } pub fn downgrade(&self) -> WeakTarget { WeakTarget { events: self.events.clone(), inner: Arc::downgrade(&self.inner) } } fn from_inner(inner: Arc<TargetInner>) -> Self { ...
Rust
0
from __future__ import annotations from pandas.compat._optional import import_optional_dependency ne = import_optional_dependency("numexpr", errors="warn") NUMEXPR_INSTALLED = ne is not None __all__ = ["NUMEXPR_INSTALLED"]
Python
1
// scaling not having been modified already. self.iso.translation.vector += self.iso.rotation * other.iso.translation.vector.component_mul(&self.scale); self.scale.component_mul_assign(&other.scale); self.iso.rotation *= other.iso.rotation; self } /// Calculates the ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: jd_wxShopFollow.py(关注店铺有礼-JK) Author: HarbourJ Date: 2022/8/8 19:52 TG: https://t.me/HarbourToulu cron: 1 1 1 1 1 * new Env('关注店铺有礼-JK'); ActivityEntry: https://lzkj-isv.isvjcloud.com/wxShopFollowActivity/activity?activityId=3d6dbfd9c8584be882f69cfad665ce8d ...
Python
1
( "addListener", add_listener, gc_context, Attribute::DontEnum | Attribute::DontDelete | Attribute::ReadOnly, fn_proto, ); stage.add_property( gc_context, "align", Executable::Native(align), Some(Executable::Native(set_align)), Att...
Rust
0
to write a datetime-like object to a buffer in an RFC3339-compatible format. /// /// The provided `write_buf` method does not allocate, and is faster /// than writing to a heap-allocated string. pub trait DateTimeLike { /// Returns the year component of the datetime. fn year(&self) -> i32; /// Returns the ...
Rust
0
None, 'right': None, 'is_root': False}, {'key': 84, 'left': None, 'right': None, 'is_root': False}, ] def test_bst_tree(): bst = BST.build_from(NODE_LIST) for node_dict in NODE_LIST: key = node_dict['key'] assert bst.get(key) == key assert bst.size == len(NODE_LIST) assert bst.get(...
Python
1
lbum: String, pub words: String, //GP pub music: String, pub word_and_music: String, pub copyright: String, pub page_number: String, } impl Default for PageSetup {fn default() -> Self { PageSetup { page_size:Point{x:210,y:297}, page_margin:Padding{right:10,top:15,left:10,bottom:10}, score_size_proportion:1.0...
Rust
0
nsafe { let mut r = mem::MaybeUninit::uninit(); let mut g = mem::MaybeUninit::uninit(); let mut b = mem::MaybeUninit::uninit(); gtk_sys::gtk_hsv_to_rgb(h, s, v, r.as_mut_ptr(), g.as_mut_ptr(), b.as_mut_ptr()); let r = r.assume_init(); let g = g.assume_init(); let ...
Rust
0
, command=lambda: button_clicked(button1, 1)) button1.grid(row=1, column=0, padx=15, pady=15) button2 = tk.Button(frame, text="", width=6, height=3, font=("consolas", 20, "bold"), background="grey", command=lambda: button_clicked(button2, 2)) button2.grid(row=1, column=1, padx=15...
Python
1
#[cfg(feature = "urls")] urls: HashSet::<Url>::new(), }; search_path.add_from_env_var(var_name); search_path } /// Create a new simpath, providing the name of the environment variable to initialize the /// search path with and the separator character for thi...
Rust
0
# -*- coding: utf-8 -*- from __future__ import print_function, division import json import random import numpy as np from pymic import TaskType from pymic.transform.abstract_transform import AbstractTransform class RandomTranspose(AbstractTransform): """ Random transpose for 3D volumes. Assume the input has ...
Python
1
i)?; } self.hash_tables.replace(ht); Ok(idx) } /// Update a data point in the `hash_tables`. /// /// # Arguments /// * `idx` - Id of the hash that needs to be updated. /// * `new_v` - New data point that needs to be hashed. /// * `old_v` - Old data point. Needed to r...
Rust
0
)] fn test_simple_wrap() { 255u8 + 1; } #[test] #[overflow(wrap)] fn test_double_wrap() { 1u8 - 2 + 2; } #[overflow(panic)] #[test] #[should_panic] fn test_simple_panic_sub() { 1u8 - 2; } #[overflow(panic)] #[test] #[should_panic] fn test_simple_panic_add() { 255u8 + 1; } #[test] #[overflow(wrap)] f...
Rust
0
} }; let mut termios = core::mem::MaybeUninit::uninit(); c_result(|| unsafe { libc::tcgetattr(fd, termios.as_mut_ptr()) })?; let mut termios = unsafe { termios.assume_init() }; let original = termios; termios.c_lflag &= !libc::ECHO; c_result(|| unsafe { libc::tcsetattr(fd, libc::TCSAFLUSH, ...
Rust
0
""" 工具:使用鼠标拖动确定ROI区域,命令行输出坐标和归一化坐标 """ import cv2 from lib import Video WIDTH = 640 HEIGHT = 480 point = [[0, 0], [0, 0]] frame = cv2.VideoCapture() def getMouse(event, x, y, flags, param): global HEIGHT, WIDTH, point if event == cv2.EVENT_LBUTTONDOWN: # 鼠标左键单击 point[0][0], point[0][1] = x, y ...
Python
1
" unary_operator = Complement | Negate We store them simply as string constants or you could use an enum. """ COMPLEMENT = "Complement" # e.g. ~ NEGATE = "Negation" # e.g. - NOT = 'Not' # TODO REPLACE OPERATOR NAME WITH SYMBOLS class TackyBinaryOperator: """ Represents the bi...
Python
1
: u32 = 8_000_000; //should be set for board not for HAL #[cfg(feature = "stm32l4xx")] type LedType = PC13<Output<PushPull>>; #[cfg(feature = "stm32l4xx")] type I2cBus = I2c< I2C1, ( PA9 <Alternate<OpenDrain, 4u8>>, PA10<Alternate<OpenDrain, 4u8>>, ),...
Rust
0
RISCV_INS_SC_D_RL = 240 RISCV_INS_SC_W = 241 RISCV_INS_SC_W_AQ = 242 RISCV_INS_SC_W_AQ_RL = 243 RISCV_INS_SC_W_RL = 244 RISCV_INS_SD = 245 RISCV_INS_SFENCE_VMA = 246 RISCV_INS_SH = 247 RISCV_INS_SLL = 248 RISCV_INS_SLLI = 249 RISCV_INS_SLLIW = 250 RISCV_INS_SLLW = 251 RISCV_INS_SLT = 252 RISCV_INS_SLTI = 253 RISCV_INS_...
Python
1
d2: &[], }; const HLDB: &[Syntax] = &[ Syntax { filetype: "c", filematch: &[".c", ".h", ".cpp"], number: true, single_line_comment: &["//"], multi_line_comment: &[("/*", "*/")], string_literal: &[ ("'", "'", true), ("L'", "'", true), ...
Rust
0
assert_eq!(default.get(i), Some(true)); } } #[test] fn take_refill_rev_works() { let mut default = filled_bitstash(); for i in (0..TEST_ALLOCATIONS).rev() { assert_eq!(default.get(i), Some(true)); assert_eq!(default.take(i), Some(true)); assert_eq!(default.get(i), Some(false)); ...
Rust
0
list_bucket, prefix, continuation_token.into_option(), ) .await { Ok((c, ct)) => (c, ct), Err(e) => panic!("error fetching keys: {:?}", e), }; ...
Rust
0
ort = 8998; pub const DAQmx_Dev_PCI_BusNum: ::std::os::raw::c_ushort = 8999; pub const DAQmx_Dev_PCI_DevNum: ::std::os::raw::c_ushort = 9000; pub const DAQmx_Dev_PXI_ChassisNum: ::std::os::raw::c_ushort = 9001; pub const DAQmx_Dev_PXI_SlotNum: ::std::os::raw::c_ushort = 9002; pub const DAQmx_Dev_CompactDAQ_ChassisDevNa...
Rust
0
🔜 Tanlov natijalari tez orada https://t.me/makhtalks kanalida jonli efirda e’lon qilinadi. Omad siz bilan bo‘lsin! 🍀""") else: await call.message.answer(f"Sizning ballaringiz: {referral_count}\nYana {10 - referral_count} ball yig'ishingiz kerak.") async def is_admin(user_id: int): admin_ids = [57...
Python
1
# -*- coding: utf-8 -*- import numpy as np import geatpy as ea # 导入geatpy库 class moea_MOEAD_DE_templet(ea.MoeaAlgorithm): """ moea_MOEAD_DE_templet : class - 多目标进化MOEA/D-DE算法类(采用可行性法则处理约束) 算法描述: 采用MOEA/D-DE(不设全局最优存档)进行多目标优化,算法详见参考文献[1]。 注:MOEA/D不适合在Python上实现,在Python上,MOEA/D的性能会大幅度降低。 参考文献: [1] ...
Python
1
# -*- coding: utf-8 -*- ''' Trivial test for ConcentratedLoad objects. See section 11-13 in: "Foundation Analysis and Design". Fifth Edition. Joseph E. Bowles. McGraw-Hill 1982 ISBN= 9780070067707 LCCN= lc81013649 url= https://books.google.es/books?id=eNtRAAAAMAAJ ''' from __future__ import print_func...
Python
1
import os src_files = [ "supabase_loader.py", "preprocessing.py", "eda.py", "model.py", "utils.py" ] for file in src_files: open(os.path.join("src", file), "a").close()
Python
1
lumn width of the task tree only every given frame. Otherwise the width will be recomputed every frame. /// /// Use this if there are many short-running tasks with varying names paired with high refresh rates of multiple frames per second to /// stabilize the appearance of the TUI. /// /// For examp...
Rust
0
ref() } else { None } } else { None } } } /// MP Configuration Table Header /// See MP 4.2 #[repr(C, packed)] struct MpConf { signature: [u8; 4], // "PCMP" length: u16, // the length of the base configuration table in bytes. ver...
Rust
0
VerifiedPartnersListResult, Error>> { Box::pin(async move { let url_str = &format!("{}/providers/Microsoft.EventGrid/verifiedPartners", self.client.endpoint(),); let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?; let mut req_buil...
Rust
0
x) (* x x)) (fun neg (x) (- 0 x)) (println (neg (square 2))))"), vec![Int(-4)]); } #[test] fn test_recursive_fun() { assert_eq!(run("(program (import std) (fun fac (x) (if (<= x 1) 1 (* x (fac (- x 1))))) (println (fac 6))) "), vec![Int(720)]); } #[test] fn te...
Rust
0
> { type Item = &'a mut [T]; #[inline] fn next(&mut self) -> Option<Self::Item> { let len = self.slice.len(); if len == 0 { None } else { let step = if len > self.threshold { self.step + 1 } else { self.step ...
Rust
0
from girder.models.user import User from girder.utility import mail_utils from isic_archive.celery import app from isic_archive.models import Batch, Dataset from isic_archive.utility.mail_utils import sendEmailToGroup @app.task() def maybeSendIngestionNotifications(): for batch in Batch().find({'ingestStatus': '...
Python
1
e::circle::Circle::fill_with(circle_radius, color::WHITE) .top_left_with_margins_on(config.steps_items, 0.0, margin_left) .set(*steps_circle, &mut master.ui); } else { let line_style = widget::primitive::line::Style::solid() .color(if current_step > on...
Rust
0
c [u8; 3usize] = b"RW\0"; pub const UART_UARTIMSC_RXIM_RESET: u32 = 0; pub const UART_UARTIMSC_RXIM_BITS: u32 = 16; pub const UART_UARTIMSC_RXIM_MSB: u32 = 4; pub const UART_UARTIMSC_RXIM_LSB: u32 = 4; pub const UART_UARTIMSC_RXIM_ACCESS: &'static [u8; 3usize] = b"RW\0"; pub const UART_UARTIMSC_DSRMIM_RESET: u32 = 0; p...
Rust
0
05, "max": 0.95, "step": 0.05}, ] }, "mlp_ens": { "domain": [ {"name": "n_estimators", "min": 10, "max": 100, "step": 5}, {"name": "n_epochs", "min": 5, "max": 30, "step": 5}, {"name": "lr", "min": 0.001, "max": 0.05, "step": 0.005}, {"name": "laye...
Python
1
unsafe { _mm_store_si128(aa1_ptr, mm_b1) }; unsafe { _mm_store_si128(aa2_ptr, mm_b2) }; unsafe { _mm_store_si128(aa3_ptr, mm_b3) }; unsafe { _mm_store_si128(aa4_ptr, mm_b4) }; unsafe { _mm_store_si128(aa5_ptr, mm_b5) }; } #[inline(always)] fn _cpy_unroll_16x4(a_ptr: *mut u8, b_ptr: *const u8, loop...
Rust
0
/// Keep in mind that the filter only triggers on the specified time. If you want to schedule this alarm every minute, you have to call: /// ```no_run /// # #[cfg(feature = "chrono")] /// # fn main() { } /// # #[cfg(not(feature = "chrono"))] /// # fn main() { /// # use rp2040_hal::rtc::{Rea...
Rust
0
plt.plot(x, y, label = 'forgot %') plt.plot(x, y_correct, label = 'forgot over correct %') plt.legend() plt.savefig(save_location + algo + '_forget_cummulative.png') plt.close() run_title = { 'run_018' : '1', 'run_019' : 'NA', 'run_020' : 'NA', 'run_021' : '...
Python
1
ex = re.sub(r"\\([a-zA-Z]+)", r"\1", latex) # Collapse whitespace latex = re.sub(r"\s+", " ", latex) # Just return a speakable formula, no pause markup return f"[formula: {latex.strip()}]" # Replace $$...$$ text = re.sub( r"\$\$.*?\$\$", latex...
Python
1
Path; use rough_eq::RoughEq; use P2; // _____ // __|__ | // | |__|__| // |_____| // let area_a = Area::new_simple( ClosedLinePath::new( LinePath::new(vec![ P2::new(0.0 - 30.0, 0.0 - 10.0), P2::new(0.0 - 30.0, 1.0 - 10.0), ...
Rust
0
parse: &'input str, start_pos: usize, ) -> LexerResult<Token<'input>> { let mut parser = Self::new(string_to_parse, start_pos)?; loop { if parser.is_possible_to_parse_as_number() { parser.try_parse_as_number()?; } else { parser.try_par...
Rust
0
ze = g.size(); ArbitraryValue(arbitrary_value(g, size)) } fn shrink(&self) -> Box<dyn Iterator<Item = Self>> { match self.0 { Value::Nil | Value::Okay => Box::new(None.into_iter()), Value::Int(i) => Box::new(i.shrink().map(Value::Int).map(ArbitraryValue)), Val...
Rust
0
(msgdata.iov_base.rptr(), msgdata.iov_len as usize) } fn usize_as_signed_long(v: usize) -> Self::signed_long { v as Self::signed_long } fn usize_as_ulong(v: usize) -> Self::unsigned_long { v as Self::unsigned_long } fn set_msghdr( msg: &mut Self::msghdr, ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import models from . import controllers from . import report from . import wizard from . import populate def _synchronize_cron(env): send_invoice_cron = env.ref('sale.send_invoice_cron', raise_if_not_found=F...
Python
1
::is_none")] pub recovery_azure_v2_resource_group_id: Option<String>, #[serde(rename = "useManagedDisks", default, skip_serializing_if = "Option::is_none")] pub use_managed_disks: Option<String>, #[serde(rename = "targetProximityPlacementGroupId", default, skip_serializing_if = "Option::is_none")] p...
Rust
0
import torch import numpy as np import PIL.Image as PImage import os import cv2 import shutil from util import resize_image, HWC3, load_image from hed import HEDdetector apply_hed = HEDdetector() def process(input_image, detect_resolution=512): with torch.no_grad(): input_image = HWC3(input_image) ...
Python
1
, 4]; let data_byte_size = std::mem::size_of::<u32>() * data.len(); let read_buffer = device.create_buffer(BufferDescriptor { usage: BufferUsage::MAP_READ | BufferUsage::COPY_DST, size: data_byte_size, })?; read_buffer.set_sub_data(0, data)?; // TODO: s...
Rust
0
import numpy as np from tonic.slicers import ( SliceAtIndices, SliceAtTimePoints, SliceByEventCount, SliceByTime, slice_events_at_indices, ) def test_slice_at_indices_class(): slicer = SliceAtIndices(start_indices=[0, 3, 5], end_indices=[3, 5, 7]) data = np.arange(7) slices, _ = sli...
Python
1
# coding.utf-8 # ******************************************************************* # * Copyright 2021-present evilbinary # * 作者. evilbinary on 01/01/20 # * 邮箱. rootdebug@163.com # ******************************************************************** from detect import find_library rule("objcopy-file") def build(targ...
Python
1
elf) -> Real; /// Get the tangent of the angle. fn tan(self) -> Option<Real>; } #[cfg(not(feature = "fixed_point"))] impl Trigonometry for Angle { fn sin(self) -> Real { let angle: f32 = self.0.into(); angle.sin().into() } fn cos(self) -> Real { let angle: f32 = self.0.int...
Rust
0
pow).verify()?; let parent = target .parent() .ok_or_else(|| Error::UnknownParent(header.parent_hash()))?; NumberVerifier::new(parent, header).verify()?; TimestampVerifier::new(parent, header).verify()?; DifficultyVerifier::verify(target)?; Ok(()) } } ...
Rust
0
ve::check_associative(a, b, c); Additive::check_cancellativity(a, b, c); Additive::check_commutative(a, b); Additive::check_identity(a); Additive::check_invertibility(a); } } use graphql_parser::schema::DirectiveLocation; use crate::{ resolve_selection_parallelly, types::Directi...
Rust
0
\xf92\x0c\x0f\xc5\xa27J\xd1Z\xa5\x97\xe0\xe5\xe9,\ \x09\xda\x8b$\xeb\x89\xa5I\xc9p7\x17\x93+\xcd`\ \xb9nBb\x22\x90\xdak\x97,1\x19\x98\x8c*\xd5\ dT\xbd\xea\x91o\x18&n\x07w\xae\xab\xbb\xa9\x82\ l6\x0f\x0fFU\xb9\xa2\xdc\xadU\xfa\xf2\x01\xf7\xdd\ \xbb\xb8\xab\x88\x95\xc9K\xb8\x8au\xa8\x1a\x01V\xa1\xcb\ s\xed6\xf5Wj\xd8\xa...
Python
1
.add_attribute("mint_fee", format!("{:?}", mint_fee)) .add_attribute("token_id", TEST_TOKEN_ID2.to_string()) .add_attribute("url", "") .add_attribute("color_map", format!("{:?}", EMPTY_COLORS)), res ); // Verify that first NFT was correctly created. ...
Rust
0
base_address="api", params=params, options=options, ), ) async def void_credit_note_async( self, id: str, params: "CreditNoteService.VoidCreditNoteParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ ...
Python
1
feature = "Win32_System_Ole"))] impl ::core::clone::Clone for MMC_SNAPIN_PROPERTY { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_System_Mmc\"`*"] pub struct MMC_SORT_DATA { pub nColIndex: i32, pub dwSortOptions: u32, pub ulReserved: usize, } impl ::co...
Rust
0
callback: Box<StubCallback>, resolve_strategy: ResolveStrategy, ) -> Arc<ServerContext> { match resolve_strategy { ResolveStrategy::Recursive => Arc::new( ServerContext::new( "127.0.0.1:53".into(), Box::new( ...
Rust
0
t.title(f"Distancia acumulada vs Tiempo acumulado\n{s.origen} -> {s.destino}\n(Todos los vehículos disponibles)") plt.tight_layout() plt.show() plt.figure(figsize=(12, 6)) for idx, (camino, dist_acum, tiempo_acum, costo_acum, costo_total, vehiculos_usados) in enumerate(mejores): ...
Python
1
} } fn berechne_komplexe_wurzelwert(radikand: u64, radikand_wurzelwert: Vec<(u64, u64)>) -> Option<(u64, u64)> { let mut result: Option<(u64, u64)> = None; for (x, y) in radikand_wurzelwert.iter() { let temp = radikand % y; if temp == 0 { result = Some((*x, (radikand / y))); ...
Rust
0
} Processing::DocumentAdditions(task_list) } None => Processing::Nothing, }) .unwrap_or(Processing::Nothing) } #[cfg(test)] mod test { use milli::update::IndexDocumentsMethod; use uuid::Uuid; use crate::{index_resolver::IndexUid, tasks::task::TaskCon...
Rust
0
## @file # This file is used to define common static strings and global data used by UPT # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent ''' GlobalData ''' # # The workspace directory # gWORKSPACE = '.' gPACKAGE_PATH = None # # INF module di...
Python
1
headers: if line.startswith((' ', '\t')): key, value = headers[-1] headers[-1] = (key, value + '\r\n' + line.rstrip()) continue key, value = line.split(':', 1) headers.append((key, value.strip())) return cls(headers) __all__...
Python
1
any update. Otherwise, it returns None. """ labels_diff = labels_util.Diff.FromUpdateArgs(args) if not labels_diff.MayHaveUpdates(): return None labels = original_eg.labels labels_update = labels_diff.Apply( client.messages.InterceptEndpointGroup.LabelsValue, labels, ...
Python
1
def test_SemanticKITTISCN(): from xmuda.data.utils.visualize import draw_points_image_labels, draw_bird_eye_view preprocess_dir = ( '/datasets_local/datasets_mjaritz/semantic_kitti_preprocess/preprocess' ) semantic_kitti_dir = ( '/datasets_local/datasets_mjaritz/semantic_kitti_prepro...
Python
1
# 无位置参数为默认位置, 即通知内容中 image1 = ToastDisplayImage.fromPath(imagePath=ICONPATH, altText="这是一个图标") # Hero 位置为通知上方的大图 image2 = ToastDisplayImage.fromPath( imagePath=ICONPATH, position=ToastImagePosition.Hero ) # AppLogo 位置为通知左侧的小图 image3 = ToastDisplayImage.fromPath( imagePath=ICONPAT...
Python
1
slice_list.append( (slice_tup[i].start, slice_tup[i].stop, slice_tup[i].step) ) return slice_list of_res = flow.slice_update( ref, update, slice_tuple_to_slice_list(slice_tup) ) test_case.assertTrue(np....
Python
1
Average precision avg_precision = sklearn_metrics.average_precision_score( target[:, k], output[:, k], average=None ) dict = { "AP": avg_precision, } stats.append(dict) retu...
Python
1
#[test] // Average attempts = 3.749; 9 (0.546%) failed games (> 6 attempts): // 2: 82, 3: 649, 4: 610, 5: 229, 6: 70, 7: 6, 8: 3 fn autoplay_german_tarne_helis_gudok_zamba_fiept() { let strategy = FixedGuessList::new(vec!["tarne", "helis", "gudok", "zamba", "fiept"]); autoplay_and_print_stats_with_language(stra...
Rust
0
::DynTraitImporter(importer) => { importer.import(source, output, &mut sources, &mut dependencies) } Importer::DylibImporter(importer) => { importer.import(source, output, sources, dependencies) } } } pub fn name(&self) -> &str { ...
Rust
0
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
1
onse, PreparedRequest from .api import request, get, head, post, patch, put, delete, options from .sessions import session, Session from .status_codes import codes from .exceptions import ( RequestException, Timeout, URLRequired, TooManyRedirects, HTTPError, ConnectionError, FileModeWarning, ConnectTimeout,...
Python
1
(target, False) src_poly = poly2shapely(src) target_poly = poly2shapely(target) return poly_iou(src_poly, target_poly, zero_division=zero_division) def sort_points(points): # TODO Add typehints & test & docstring """Sort arbitrary points in clockwise order in Cartesian coordinate, you may nee...
Python
1
} else {FFI::open(&head,memmod)}; let mut head_stats = (0 as usize, Vec::new(), 0 as usize, false, 0 as usize); if fdb.lossy < 2 { head_stats = get_stats(&head_lzt.get_records("~~~~~^",&-1)); assert_eq!(seq_stats,head_stats); ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Python
1
gq(rootf(50), evalf(50), weightf(50), 0., np.inf, 25, atol=1e-13) vgq(rootf(50), evalf(50), weightf(50), 0., np.inf, 100, rtol=1e-14, atol=2e-13) x, w = sc.roots_genlaguerre(5, 2, False) y, v, m = sc.roots_genlaguerre(5, 2, True) assert_allclose(x, y, 1e-14, 1e-14) assert_allclose(w, v, 1e-14, 1e-1...
Python
1
_RIGHT_READABLE); let data = "Hello, world!".as_bytes(); let (status, _count) = env.proxy.write(data).await.unwrap(); assert_eq!(Status::from_raw(status), Status::BAD_HANDLE); let events = env.file.operations.lock().unwrap(); assert_eq!(*events, vec![FileOperation::Init { flags: ...
Rust
0
import random number = random.randint(1, 100) arr = ["rock", "paper", "sissor"] computer_choice = random.choice(arr) print(computer_choice) computer_choice = random.choice(arr) print(computer_choice)
Python
1
STEPS: [], REPEAT: 1, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: None, WASM-EXECUTION: Interpreted, CHAIN: None, DB CACHE: 128 // Executed Command: // ./target/release/dscp-node // benchmark // --pallet // pallet_simple_nft // --extrinsic // run_process // --output // ./weights/ #![allow(unused_parens)] #![allow(u...
Rust
0
is_dropped.get()); Ok(()) } #[test] fn gc_in_externref_dtor() -> anyhow::Result<()> { let (store, module) = ref_types_module( r#" (module (table $t 1 externref) (func (export "table-set") (param externref) (table.set $t (i32.const 0) (loca...
Rust
0
sImage { pub fn new(direction: Direction) -> Self { ProcessImage { direction:direction, image: vec![0; PI_LENGTH], devices: Vec::new(), } } pub fn with_capacity(direction: Direction, capacity: usize) -> Self { ProcessImage { direct...
Rust
0
import streamlit as st import numpy as np import torch import os import matplotlib.pyplot as plt from torchvision.io import read_image import torchvision.transforms as T from PIL import Image, ImageFilter, ImageDraw import requests from io import BytesIO UPLOAD_FOLDER = 'uploads' if not os.path.exists(UPLOAD_FOLDER)...
Python
1
else { Ok(File { inner: file_t, owner: mtpdev, }) } } pub(crate) fn send_file_from_path_with_callback<'a, C>( mtpdev: &'a MtpDevice, storage_id: u32, path: impl AsRef<Path>, parent: Parent, metadata: FileMetadata<'_>, mut callback: C, ) -> Result<Fil...
Rust
0
from tests.base_test import BaseTest from pages.home_page import HomePage from pages.search_results_page import SearchResultsPage from pages.product_page import ProductPage from pages.cart_page import CartPage class TestAmazonShopping(BaseTest): def test_amazon_shopping(self): """Amazon tests the entire s...
Python
1