text
string
label_name
string
labels
int64
v_arg_large >= n_cand_buf)] - n_cand_buf arg_buffer = sv_arg_small[nonzero_indices(sv_arg_small < n_cand_buf)] ind_buffer = cand_ind[arg_buffer] buffer.n_seen_so_far += n_cur # perform overwrite op y_upt = cur_y[ind_cur] x_upt = cur_x[ind_cur] ClassBalancedRando...
Python
1
, 115, 104, 112], // base cell 107 pentagon bc7![108, 100, 95, 92, 118, 114, 109], // base cell 108 bc7![109, 108, 93, 95, 117, 118, 106], // base cell 109 bc7![110, 98, 104, 96, 119, 111, 115], // base cell 110 bc7![111, 97, 110, 98, 116, 103, 119], // base cell 111 bc7![112, 107, 102, 10...
Rust
0
ackBox::new(), } } } impl Default for RwLockStorage { fn default() -> Self { Self::new() } } type MutexBlackBox = BlackBox< (dyn for<'a> Unit< 'a, Borrowed = MappedMutexGuard<'a, dyn Any>, MutBorrowed = MappedMutexGuard<'a, dyn Any>, > + Send + Sync...
Rust
0
f.write(b"\x7fELF\x02\x01\x01\x00\x00\x00") path = python_reported_file("binary") msg = ( re.escape(f"Couldn't run '{path}' as Python code: ") + r"(ValueError|SyntaxError): source code string cannot contain null bytes" ) with pytest.raises(Exception, match=ms...
Python
1
""" A Franka Panda reaches for 10 randomly places targets. This script contains examples of: - Linear (IK) paths. - Scene manipulation (creating an object and moving it). """ from os.path import dirname, join, abspath from pyrep import PyRep from pyrep.robots.arms.panda import Panda from pyrep.objects.shape imp...
Python
1
True return else: if tunnel_chain.tunnel_urls: tunnel_url = tunnel_chain.tunnel_urls[-1] tun_conn.update_tunnel_address( (tunnel_url.host, t...
Python
1
am_empty) context.view_layer.objects.active = cam_empty cam_constraint.target = cam_empty stepsize = 360.0 / args.views rotation_mode = 'XYZ' print() model_identifier = "-".join(args.obj.split("/")[-4:-2]) folder, file = model_identifier.split("-")[0], model_identifier.split("-")[1] fp = os.path.join(os.path.abspath(...
Python
1
::Value, this: &Self) { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] pub enum ButtonsType { None, Ok, Close, Cancel, YesNo, OkCancel, #[doc(hidden)] _...
Rust
0
# Copyright (C) 2018 David Cattermole. # # This file is part of mmSolver. # # mmSolver is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ve...
Python
1
; } debug!("symlinking {:?} -> {:?}", source, dest); unix::fs::symlink(&source, &dest)?; } for dir in &config.directories { let dir = dir .strip_prefix("/") .map(|p| Path::new("/new_root").join(p)) .map_err(|e| Error::new(ErrorKind::Other, e)...
Rust
0
) => ({ /* compiler built-in */ }); ($cond:expr, $($args:tt)*) => ({ /* compiler built-in */ }) } fn main() { assert!(true, "{} {:?}", arg1(a, b, c), arg2); } "#, expect![[r##" #[rustc_builtin_macro] macro_rules! assert { ($cond:expr) => ({ /* compiler built-in */ }); ($cond:expr, $($args:tt)*)...
Rust
0
from flask import Flask, request from telegram import Update, Bot from telegram.ext import Updater, CommandHandler, CallbackContext, MessageHandler import requests import uuid TOKEN = "7137673728:AAE85wL1RBYskkrlCZaIzhEbgKmiEBiefDI" NOWPAYMENT_API_KEY = "D37DNS7-VH1MPNS-QGM99PV-SQZQG2A" NOWPAYMENT_TID = "2eb7650e-03a0...
Python
1
from common.utilities.util_menu_access import MenuAccess import feffery_antd_components as fac import feffery_utils_components as fuc from common.utilities.util_logger import Log from dash import html from dash_components import Card import dash_callback.application.message_.announcement_c # noqa: F401 from i18n impor...
Python
1
Aranges, /// The `.debug_frame` section. DebugFrame, /// The `.eh_frame` section. EhFrame, /// The `.eh_frame_hdr` section. EhFrameHdr, /// The `.debug_info` section. DebugInfo, /// The `.debug_line` section. DebugLine, /// The `.debug_line_str` section. DebugLineStr, ...
Rust
0
pp}; use std::str::from_utf8; use server::{configure_app, create_database_pool}; #[actix_rt::test] async fn unrevised_entities_query() { let pool = create_database_pool().await.unwrap(); let app = configure_app(App::new(), pool); let app = test::init_service(app).await; ...
Rust
0
rId = String; pub type ParameterRef = Arc<dyn PluginParameterLike>; struct ParameterStoreInner { parameters: HashMap<ParameterId, ParameterRef>, parameter_ids: Vec<ParameterId>, } use std::ops::Mul; /** * @brief A RGB color */ #[derive(Clone, Copy)] pub struct Color { pub r: f32, pub g: f32, pub...
Rust
0
} } /// Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters. /// /// # Arguments /// /// - `args` specifies the commandline arguments. The first argument is the program name. /// /// - `envs` specifies the environment varia...
Rust
0
from contextlib import contextmanager from typing import Union, Optional, Any import numpy as np import torch from pytorch_toolbelt.utils import transfer_weights from torch import nn from torch.types import Device def load_from_lighting( model: nn.Module, checkpoint_path: str, map_location: Optional[Union[int, s...
Python
1
let input = mem::ManuallyDrop::new(input); for raw in input.iter() { let cstr = ffi::CStr::from_ptr(*raw).to_str().expect("not a valid UTF-8"); if cstr == "en-US" { *status = LookupStatus::Unavailable as i8; return std::ptr::null::<FakeLookup>(); } } Box:...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import valkey from dynaconf import Dynaconf # Configuration settings = Dynaconf(settings_files=["../config/settings.yaml"]) valkey_host = settings.get("valkey.host", "127.0.0.1") valkey_port = settings.get("valkey.port", 6379) valkey_db = settings.get("valkey.db", 8) c...
Python
1
BO::read_i32(data)) } } def! { type = u64; read_u64; try_read_u64; read_u64_be; try_read_u64_be; read_u64_le; try_read_u64_le; |self| { let data = self.try_read_slice(8)?; Ok(BO::read_u64(data)) } } def! { type = i64; read_i64; try_read_i64; read_i64_be; try_read_i64_be; rea...
Rust
0
# auto.mouse_drag(block_position[0], block_position[1], drag_time=1, dy=500) # list_block = True # continue if next_gift is False: break loop_count -= 1 if loop_count < 20: auto.model = "normal" if ...
Python
1
Replace, Input::KeyRestart, Input::KeyResume, Input::KeySave, Input::KeySBeg, Input::KeySCancel, Input::KeySCommand, Input::KeySCopy, Input::KeySCreate, Input::KeySDC, Input::KeySDL, Input::KeySelect, Input::KeySEnd, Input::KeySEOL, Input::KeySExit, Input::Key...
Rust
0
inline(always)] pub unsafe fn replace_unchecked<T: 'a>(&mut self, handle: Handle<T>, val: T) -> T { mem::replace(self.get_unchecked_mut(handle), val) } /// Replaces the object referenced by the given [`Handle`] with the given value. /// /// # Panics /// /// This function panics if `...
Rust
0
in 0..-power { result = self.from_cubic_meters(&result); } result } else if power > 0 { let mut result = value.clone(); for _ in 0..power { result = self.to_cubic_meters(&result); } result } else { value.clone() } } fn from_cubic_meters_with_power(&self, value: &Number, power: i32...
Rust
0
coverage); let result = if !result.is_empty() { mocranges_to_array2(result) } else { // TODO: try without this condition Array::zeros((1, 0)) }; Ok(result.into_pyarray(py).to_owned()) } /// Contract the spatial coverage removing an internal ...
Rust
0
_id(id).label().to_string(); let is_failure = if exit.success() { exit_success = exit_success + 1; false } else { exit_failure = exit_failure + 1; true }; done = done + 1; graph_iter.ma...
Rust
0
# Given an input file, generate a ccsds.bin file that encodes the bytestream from ccsds.model.SpacePacket import SpacePacketProtocolEncoder, SpacePacketType, SpacePacketProtocolDecoder from ccsds.model.TCChannelCoding import CLTUEncoder, CLTUDecoder from ccsds.model.TCDataLinkPacket import TCDataLinkProtocolEncoder, Co...
Python
1
rcp14ps_zmm_k1z_zmmm512b32 = 3057, /// `VRCP14PD xmm1 {k1}{z}, xmm2/m128/m64bcst` /// /// `EVEX.128.66.0F38.W1 4C /r` /// /// `AVX512VL and AVX512F` /// /// `16/32/64-bit` EVEX_Vrcp14pd_xmm_k1z_xmmm128b64 = 3058, /// `VRCP14PD ymm1 {k1}{z}, ymm2/m256/m64bcst` /// /// `EVEX.256.66.0F38.W1 4C /r` /// /// `AV...
Rust
0
"Bit 6 - General call enable"] #[inline(always)] pub fn engc(&mut self) -> ENGC_W { ENGC_W { w: self } } #[doc = "Bit 5 - PEC enable"] #[inline(always)] pub fn enpec(&mut self) -> ENPEC_W { ENPEC_W { w: self } } #[doc = "Bit 4 - ARP enable"] #[inline(always)] pub...
Rust
0
ub const NDIS_RECEIVE_FILTER_FIELD_PARAMETERS_REVISION_1: u32 = 1u32; #[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"] pub const NDIS_RECEIVE_FILTER_FIELD_PARAMETERS_REVISION_2: u32 = 2u32; #[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"] pub const NDIS_RECEIVE_FILTER_FLAGS_RESERVED: u32 = 1...
Rust
0
] ) else: schema["partitions"] = {} file_list.append(schema["location"] + "/*") extra_kwargs = {} if schema["delimiter"] != chr(1): extra_kwargs["delimiter"] = schema["delimiter"] if schema["fileType"] == "csv": extra_kwargs["names"] = [ col_name ...
Python
1
.build_global() .unwrap(); let command: CommandTemplate = self.conn.query_row( "SELECT command FROM tasks WHERE id = ?1", params![&task_id], |row| row.get(0), )?; let handle = Arc::new(Mutex::new(self)); for i in 0.. { ...
Rust
0
#!/usr/bin/env python3 #Please establish an "auth.py" file in the same directory as this script with the "clientid" and "clientsec" variables defined. #This script is intended to find users listed in Child CIDs. It was developed to help identify users that may need to be removed from the console, or don't belong, as mo...
Python
1
b, 0x2f /// ``` /// <https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#b64> B64, /// bcrypt encoding. /// /// ```text /// ./ [A-Z] [a-z] [0-9] /// 0x2e-0x2f, 0x41-0x5a, 0x61-0x7a, 0x30-0x39 /// ``` Bcrypt, /// `crypt(3)` encoding. //...
Rust
0
erializedUntaggedI32 { value: *self as i32 }.into() } #[inline] fn memory_required( &self ) -> usize { (*self as i32).memory_required() } } __js_serializable_boilerplate!( u16 ); impl JsSerializable for u32 { #[inline] fn into_js< 'a >( &'a self, _: &'a Preallocate...
Rust
0
Ok(()) => (), Err(err) => report_error!("Cannot synchronize packet decoder: {}", err), }; println!("Start decoding packets"); loop { let offset = match ipt_decoder.offset() { Ok(offset) => offset, Err(err) => report_error!("cannot tell offset: {}", err), ...
Rust
0
( abs(theta) > self.angle_threshold or abs(p) > self.position_threshold ) # 4. Рассчитываем "плотную" награду if not done: # Награда за удержание угла (cos(0)=1, cos(pi/6)=0.86) reward_angle = np.cos(theta) ...
Python
1
/// Support for using sled as a backing data storage for tables #[cfg(all(feature = "sled-1", feature = "std"))] #[cfg_attr(feature = "docs", doc(cfg(all(sled, std))))] pub mod sled; /// Contains relevant traits, structs, and more for extensions to tables pub mod prelude; #[doc = "Register `LSCH3_CONF0` reader"] pub ...
Rust
0
def log_tensorboard_graph(tb, model, imgsz=(640, 640)): try: p = next(model.parameters()) imgsz = (imgsz, imgsz) if isinstance(imgsz, int) else imgsz im = torch.zeros((1, 3, *imgsz)).to(p.device).type_as(p) with warnings.catch_warnings(): warnings.simplefilter('ignore') ...
Python
1
percentage_complete_element.get_attribute("style") percentage_complete_value = float(percentage_complete_text.split("width: ")[-1].replace("%;", "")) print(f"Percentage Complete for Slot {i}: {percentage_complete_value}%") except IndexError: pr...
Python
1
, }) .flat_map(|x| x.nested) .filter_map(|x| match x { NestedMeta::Meta(m) => Some(m), _ => None, }) .find(|m| m.path().is_ident("default")); defattr .map(|meta| match meta { Meta::NameValue(mnv) => { if let Lit::St...
Rust
0
'tcx>) -> BasicBlockRef { debug!("get_landing_pad"); let bcx = fcx.build_new_block("cleanup_unwind"); let llpersonality = bcx.ccx.eh_personality(); bcx.set_personality_fn(llpersonality); if base::wants_msvc_seh(fcx.ccx.sess()) { let pad = bcx.cleanup_pad(None, &[]); ...
Rust
0
days = int(input("Enter the number of days :")) if days <= 0: print("Charge wont applied") elif days <= 5: charge = days * 2 print(f"The total charge on {days} days lend is {charge}") elif days >= 6 and days <= 10: charge = days * 3 print(f"The total charge on {days} days lend is {charge}") elif day...
Python
1
aU4SjnO@[T[5(aU4SjnO$[T[5(aSnO [ S5eX0l[R"TR[S9n[R"TR[S9n[R...
Python
1
u{204F}"), // REVERSED SEMICOLON ("bsim", "\u{223D}"), // REVERSED TILDE ("bsime", "\u{22CD}"), // REVERSED TILDE EQUALS ("bsol", "\u{005C}"), // REVERSE SOLIDUS ("bsol", "\u{29C5}"), // SQUARED FALLING DIAGONAL SLASH ("bull", "\u{2022}"), // BULLET ("bump", "\u{224E}"), ...
Rust
0
result was produced. sourceConstraint, "sourceConstraint", /// `source constraint component`: The constraint component that is the source of the result. sourceConstraintComponent, "sourceConstraintComponent", /// `source shape`: The shape that is was validated when the result was produced. sourceSh...
Rust
0
.len(), 2); assert_eq!(r1[0].get::<_, i32>(0), 1); assert_eq!(r1[0].get::<_, &str>(1), "alice"); assert_eq!(r1[1].get::<_, i32>(0), 2); assert_eq!(r1[1].get::<_, &str>(1), "bob"); assert_eq!(r2.len(), 1); assert_eq!(r2[0].get::<_, i32>(0), 3); assert_eq!(r2[0].get::<_, &str>(1), "charlie");...
Rust
0
} let radius = direction * body.max_radius; let left = radius.rotated(body.angle / 2.0); let right = radius.rotated(-body.angle / 2.0); let triangle = Triangle::new( Point2::new(0.0, 0.0), Point2::new(left.x, left.y), Point2::new(right.x, right.y), ); query::intersect...
Rust
0
f.ubo_buffer, &self.ubo_data)? .finish()?; Ok(()) } fn buffers(initializer: &AssetInitializer, vertex_data: &Vec<Vertex>, index_data: &Vec<vkuint>, ubo_data: &Vec<UboObject>) -> GsResult<(GsVertexBuffer, GsIndexBuffer, GsUniformBuffer, GsBufferRepository<Host>)> { // vertex, index...
Rust
0
from .beautiful_soup.beautiful_soup import BeautifulSoupScraper from .web_base_loader.web_base_loader import WebBaseLoaderScraper from .arxiv.arxiv import ArxivScraper from .pymupdf.pymupdf import PyMuPDFScraper from .browser.browser import BrowserScraper from .browser.nodriver_scraper import NoDriverScraper from .tavi...
Python
1
import speech_recognition as sr import pyttsx3 import threading engine=pyttsx3.init() engine_lock = threading.Lock() def speak(text): with engine_lock: engine.say(text) engine.runAndWait() #listens while being spoken to def listen(): r = sr.Recognizer() with sr.Microphone() as source: ...
Python
1
# modules/Tools/Comms/Voip/modules/emoji_picker.py from PySide6.QtWidgets import QDialog, QGridLayout, QPushButton from modules.logging.logger import setup_logger logger = setup_logger('emoji_picker.py') class EmojiPicker(QDialog): def __init__(self, parent=None): super().__init__(parent) self.se...
Python
1
], f_shwith200: [ 0.75, 0.77, 0.87, 0.89, 0.94, 0.96, 0.96, 0.96, 0.92, 0.84, 0.76, 0.64, ], f_shwith300: [ 0.61, 0.61, 0.78, 0.82, 0.88, 0.9, 0.91, 0.91, 0.83, 0.7, 0.62, 0.5, ], f_shwith500: [ 0.35, 0.47, 0.56, 0.61, 0.66, 0.76, 0.79, 0.74, 0...
Rust
0
'dose', shortHelpString='Check dose') self.toolbar.AddTool(leginon.gui.wx.ToolBar.ID_REFRESH, 'refresh', shortHelpString='Reset Learning') self.toolbar.Bind(wx.EVT_TOOL, self.onResetTiltSeriesList, id=leginon.gui.wx....
Python
1
=> { /* deip::NdaAccessRequestFulfilledEvent */ unimplemented!() } NdaAccessRequestRejected(..) => { /* deip::NdaAccessRequestRejectedEvent */ unimplemented!() } DomainAdded(..) => { /* deip::DomainAddedEvent */ uni...
Rust
0
步静态方法没有有返回值 source_content.put_slice((create_tab(level) + "NativeObject.static_call(" + method_index.to_string().as_str()).as_bytes()); } //生成其它入参 for specific_arg_name in specific_arg_names { source_conte...
Rust
0
import matplotlib.pyplot as plt # 用于数据可视化 import tensorflow as tf import cnn_utils as cnn import os os.environ['KMP_DUPLICATE_LIB_OK'] = 'True' train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes = cnn.load_dataset() # 图像数据通常在[0,255]范围,缩放到[0,1]范围,能加快模型训练速度和提升性能 X_train = train_set_x_orig / ...
Python
1
fn as_ref(&self) -> &Object{ &self.element } } impl AsMut<Object> for Element{ fn as_mut(&mut self) -> &mut Object{ &mut self.element } } impl From<Element> for Object{ fn from(b: Element) -> Object{ b.element } } impl Deref for Element{ type Target = Object; fn de...
Rust
0
# -*- coding: utf-8 -*- """ Task 15.3 Create a convert_ios_nat_to_asa function that converts NAT rules from cisco IOS syntax to cisco ASA. The function expects such arguments: - the name of the file containing the Cisco IOS NAT rules - the name of the file in which to write the NAT rules for the ASA The function ret...
Python
1
""" Servicios para la gestión del catálogo de ciudades. Incluye operaciones CRUD con validaciones de duplicados y existencia. """ import math from typing import List, Optional from sqlalchemy.orm import Session, joinedload from sqlalchemy.exc import IntegrityError from app.models.catalogs.ciudad import Ciudad from app...
Python
1
#[repr(u32)] pub enum RaytracingAccelerationStructureType { TopLevel = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL, BottomLevel = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL, } */ /* #[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] pub struct RaytracingGeometryFlags(u32); #[allow(...
Rust
0
# Flask-WTF Forms from flask import Flask, render_template from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField from wtforms.validators import DataRequired, Email, Length from flask_bootstrap import Bootstrap # fake credentials for the form SECRET_EMAIL = "myemail@mydomain.zyx" ...
Python
1
import time import torch import contextlib from ldm_patched.modules import model_management from ldm_patched.modules.ops import use_patched_ops @contextlib.contextmanager def automatic_memory_management(): model_management.free_memory( memory_required=3 * 1024 * 1024 * 1024, device=model_managemen...
Python
1
'OUT'] + "/" + str(os.getpid())) chip = exports['--chip'] chip = chip.replace(' ', ' ') chip = chip.strip(' ') chip = chip.split(' ') exports['--chip'] = chip[0] exports['--key'] = exports['--key'].strip() exports['--key'] = exports['--key'].replace(" ", " ") exports['--key'] = expor...
Python
1
ne, and Lipton (Theorem 2.1), one cannot have constant depth and polynomially bounded work. # # Therefore, we opt for the above two methods of logarithmic depth. We choose Sklansky for smaller inputs (when the super-linear work is not too dominant). We also choose Sklansky when PRSS is enabled, giving depth minimizati...
Python
1
xpected_response: Vec<usize> = vec![4, 2, 1, 3]; let resp: IteratorResponse = ordered_iterator .zip(expected_response.iter()) .zip(custom_order_) .filter(|(((index, actual_elem), expected_elem), expected_index)| { *actual_elem == *expected_elem && index == ex...
Rust
0
from dataclasses import dataclass from typing import Annotated, TYPE_CHECKING import strawberry import strawberry_django from strawberry_django import FilterLookup from core.graphql.filter_mixins import BaseFilterMixin if TYPE_CHECKING: from netbox.graphql.filter_lookups import JSONFilter from .filters impor...
Python
1
import io import logging import pytest from traitlets import default from nbclassic.notebookapp import NotebookApp pytest_plugins = ["jupyter_server.pytest_plugin"] @pytest.fixture def nbapp_log(): """An io stream with the NotebookApp's logging output""" stream = io.StringIO() return stream @pytest.fix...
Python
1
entry_valor.delete(0, tk.END) combo.set("") else: messagebox.showwarning("Aviso", "Escolha uma nova categoria.") except ValueError: messagebox.showerror("Erro", "Insira um valor válido.") else: messagebox.show...
Python
1
# -*- coding: utf-8 -*- # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
current_line.chars().count() + word.chars().count() >= line_len { lines.push(current_line.clone()); current_line.clear(); } current_line.push_str(&word); current_line.push(' '); } lines.push(current_line); ...
Rust
0
// psggConverterLib.dll converted from psgg-file:hoge_control.psgg m_cnt: i32, m_loopindex : i32, // [STATEGO OUTPUT END] } impl HogeControl { pub fn new() -> HogeControl { HogeControl { m_first: false, m_now...
Rust
0
return {"loss": loss} def inner_update( self, batch: TorchTrajectoryMiniBatch, grad_step: int ) -> dict[str, float]: loss = self._compute_grad(batch) self._modules.optim.step() # schedule learning rate self._tokens += int(batch.masks.sum().cpu().detach().numpy(...
Python
1
ia<'a>, }, /// A string literal. Str { /// The type of string this represents t: StringType, /// The string value val: &'a str, // TODO: make Cow /// Original string value, including any decoration original: &'a str, /// Trivia data for the string ...
Rust
0
( vec_apn: &Vec<<T::Lookie as StaticLookup>::Source> ) -> usize { vec_apn.len() } } <reponame>ejmahler/rust_dct<gh_stars>10-100 #![feature(test)] extern crate rustdct; extern crate test; use std::sync::Arc; use rustdct::algorithm::*; use rustdct::mdct::{window_fn, Mdct, MdctViaDct4}; use rustdct::rustfft::FftP...
Rust
0
config.purge_threshold = ReadableSize::from_str(&opts.purge_threshold).unwrap(); config.purge_rewrite_threshold = Some(ReadableSize::from_str(&opts.purge_rewrite_threshold).unwrap()); config.purge_rewrite_garbage_ratio = opts.purge_rewrite_garbage_ratio.parse::<f64>().unwrap(); config.batch_comp...
Rust
0
px display where each pixel is stored as a single `u8` /// struct ExampleDisplay { /// framebuffer: [u8; 64 * 64], /// iface: SPI1, /// } /// /// impl ExampleDisplay { /// /// Send buffer to the display /// pub fn flush(&self) -> Result<(), ()> { /// self.iface.send_bytes(&self.framebuffer) /// ...
Rust
0
}", err); }); } } // Parse models let json: Value = serde_json::from_slice(json_data[0].as_ref()).unwrap(); let weights_manifest = json.get("weightsManifest").unwrap().as_array().unwrap(); let shards = weights_manifest[0] .get("paths") .unwrap() .as_array...
Rust
0
import os import re from requests import get from plugins.XSStrike.core.config import changes from plugins.XSStrike.core.colors import run, que, good, info, end, green from plugins.XSStrike.core.log import setup_logger logger = setup_logger(__name__) def updater(): logger.run('Checking for updates') latestC...
Python
1
ube_x as f64) as i32; let oy = f64::floor(v_y as f64 / self.max_voxel_per_cube_y as f64) as i32; let oz = f64::floor(v_z as f64 / self.max_voxel_per_cube_z as f64) as i32; self.min_cube_x = i32::min(self.min_cube_x, ox); self.min_cube_y = i32::min(self.min_cube_y, oy); self.min_...
Rust
0
p_int = core::mem::zeroed(); check(mp_init(&mut big)); check(mp_2expt(&mut big, 7 * bytes as i32)); check(mp_add(&mut tmp, &big, &mut tmp)); bigint_leb128_encode_go(&mut tmp, buf, false) } else { bigint_leb128_encode_go(&mut tmp, buf, true) } } #[no_mangle] pub unsafe ex...
Rust
0
#┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃データセット:仕様 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #──────────────────────────────────── class システム(): 番号 = 1 名称 = "MECH BULLETS" 版数 = "2025/08/10-00" #──────────────────────────────────── class シーンID(): タイトル画面 = 100 プレイ画面 = 200 プレイ_ザコ画面 = 210 #音楽用のダミーI...
Python
1
H2 = H1.compose(H12_SL4) H3 = H2.compose(H23_SL4) H4 = H3.compose(H34_SL4) H5 = H4.compose(H45_SL4) H52 = H5.inverse().compose(H2) gt_poses = [H1, H2, H3, H4, H5] # Add initial nodes for i, pose in enumerate(gt_poses, 1): noise = random_noise_vector() noisy_pose = pose....
Python
1
&[0.5, 2., 3.])); } // Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT /// RetryPolicy could be used for some handling, where we want to "retry some operation on <subject>" for number of available retries #[derive(Clone, Debug)] pub struct RetryPolicy<T: Clone + Par...
Rust
0
IEEE80211ac, #[serde(rename = "IEEE 802.11ad")] IEEE80211ad, #[serde(rename = "IEEE 802.11ax")] IEEE80211ax, #[serde(rename = "IEEE 802.15.1 (Bluetooth)")] IEEE802151Bluetooth, #[serde(rename = "GSM")] GSM, #[serde(rename = "CDMA")] CDMA, #[serde(rename = "LTE")] LTE,...
Rust
0
rpc()) .and_then(move |response_builder: warp_json_rpc::Builder| async move { response_builder .error(warp_json_rpc::Error::METHOD_NOT_FOUND) .map_err(|_| warp::reject()) }); // Catch requests which don't parse as JSON. let parse_failure = warp::path(...
Rust
0
def load(_): raise ValueError()
Python
1
"FZF_DEFAULT_COMMAND", format!("{} list", std::env::current_exe().unwrap().display()), ) .stdout(Stdio::piped()) .spawn()?; let output = child.wait_with_output()?; let choice = str::from_utf8(&output.stdout)? .trim_start_matches('*') .trim() .to_ow...
Rust
0
pub mod intrusive_list; // This file is part of linux-epoll. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. No part of linux-epoll, including this file, may be copied, modifi...
Rust
0
how!(ERROR_MESSAGE))?; sleep(DURATION).await; let inputs = [ // Left Ctrl Up INPUT { r#type: INPUT_KEYBOARD, Anonymous: INPUT_0 { ki: KEYBDINPUT { wVk: VK_CONTROL, wScan: unsafe { MapVirtualKeyA(VK_CONTROL.0 as _, ...
Rust
0
#[doc = ""] #[doc = " @param[in] len Number of bytes taken into account for the operation."] #[doc = ""] #[doc = " @return Error code:"] #[doc = " - CX_OK on success"] #[doc = " - CX_NOT_UNLOCKED"] #[doc = " - CX_INVALID_PARAMETER_SIZ...
Rust
0
gen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = draw ) ] #[doc = "The `draw()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"] #[doc = ""] #[doc = "*This API requires the following crate featur...
Rust
0
//let bump = cx.bump; // websysmod::debug_write(&format!("replace_with_nodes: {}", &fn_name)); match fn_name { "wn_web_rtc_div_messages" => { return Some(webrtc_impl_mod::web_rtc_div_messages(rrc, cx)); } _ => None, } } {{replace def.keys.NewObjs $objs=objs}} <reponame>sd...
Rust
0
max_c = -1e9 N = int(input()) for _ in range(N): num = int(input()) if num > max_c: max_c = num if max_c > 1000: if max_c > 10000: print('Something is wrong with these cuteness values') else: print('Cuteness by definition is similarity to Cactus') else: print('Cuteness by ...
Python
1
import sys import psycopg2 import os from dotenv import load_dotenv from src.utils.extract_utils import extract_skills_and_jobdesc_from_job_description, extract_skills_and_descriptors from src.utils.prompt import job_ad_system_prompt, job_ad_user_prompt, compare_system_prompt, compare_user_prompt # Načtení proměnných...
Python
1
G", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if is_msvc(self): src_include_dir = os.path.join(self.source_folder, "src", "zimg", "api") copy(self, "zimg.h", src=src_include_dir, dst=os.path.join(self.package_folder, "include")) copy(self, "zi...
Python
1
ystemExit): cli.execute() result = capsys.readouterr() assert "found" not in result.out def test__getCli__plugins(monkeypatch, data_dir, capsys): plugin_path = data_dir / "plugins-behr" monkeypatch.syspath_prepend(plugin_path) plugin_path = data_dir / "plugins-tyfa" monkeypatch.syspat...
Python
1
nn.Conv1d(in_channels=407, out_channels=456, kernel_size=5, padding=2), nn.BatchNorm1d(456), nn.GELU(), nn.MaxPool1d(kernel_size=2), ), nn.Sequential( nn.Conv1d(in_channels=456, out_channels=512, kernel_size=5, paddin...
Python
1
r] loss = loss_fn(output, target) acc1, acc5 = accuracy(output, target, topk=(1, 5)) if args.distributed: reduced_loss = reduce_tensor(loss.data, args.world_size) acc1 = reduce_tensor(acc1, args.world_size) acc5 = reduce_tensor(acc5, ...
Python
1