text
string
label_name
string
labels
int64
Result, ) -> *const SpvReflectDescriptorBinding; } extern "C" { #[doc = " @fn spvReflectGetDescriptorSet"] #[doc = ""] #[doc = "@param p_module Pointer to an instance of SpvReflectShaderModule."] #[doc = "@param set_number The \"set\" value of the requested descriptor set."] #[doc = "@para...
Rust
0
e_hflip'], self.opt['use_rot']) # BGR to RGB, HWC to CHW, numpy to tensor img_gt, img_lq = img2tensor([img_gt, img_lq], bgr2rgb=True, float32=True) # normalize if self.mean is not None or self.std is not None: normalize(img_lq, self.mean, self.std, inplace=True) ...
Python
1
fn function_data() { fn check_ok(name: &str, count: u64) { check_parse_ok( &format!("FNDA:{},{}", count, name), &FunctionData { name: name.into(), count, }, ); } check_ok("hogehoge", 12345); check_ok("hoge,hoge", 98765)...
Rust
0
memory=True) test_loader = DataLoader(test_dataset, shuffle=False, **loader_args) return {"test_loader": test_loader, "test_Datset": test_dataset} if __name__ == '__main__': import numpy as np loader = build_loaders(cfg='../config/example.yaml', mode='train') mean = [0.48...
Python
1
the bitmap is at least one bit per page. let ret = unsafe { ioctl_with_ref(self, KVM_GET_DIRTY_LOG(), &dirtylog) }; if ret == 0 { Ok(bitmap) } else { Err(errno::Error::last()) } } /// Registers an event that will, when signaled, trigger the `gsi` IRQ. ...
Rust
0
as mp; use crate::core::{ BookInformation, FontID, MouseInformation, ResultReport, SavableData, SuzuContext, TileBatchTextureID, }; use crate::flush_delay_event; use crate::flush_delay_event_and_redraw_check; use crate::object::effect_object; use crate::object::map_object::*; use crate::object::notify; use crat...
Rust
0
Params()) }.into_result()?; let ret = unsafe { core::Ptr::<dyn crate::tracking::TrackerCSRT>::opencv_from_extern(ret) }; Ok(ret) } } pub trait TrackerCSRT_ParamsTraitConst { fn as_raw_TrackerCSRT_Params(&self) -> *const c_void; #[inline] fn use_hog(&self) -> bool { let ret = unsafe { sys::cv_tracking_Track...
Rust
0
NALING { fn clone(&self) -> Self { *self } } #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub type OPM_ACP_PROTECTION_LEVEL = i32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const OPM_ACP_OFF: OPM_ACP_PROTECTION_LEVEL = 0i32; #[doc = "*Required features: 'Win32_Me...
Rust
0
lues(fields) if not idsAndValues['Name'].strip(): dom.alert("The name field can not be empty!") return if board.contactId == None or board.contactId >= len(contacts): contacts.append(idsAndValues) displayContact(None,dom) else: contacts[board.contactId] = idsAndValues atlastk.broadcastAct...
Python
1
_word(data: &[u16]) -> Result<Self, IcedError> { if data.len().wrapping_sub(1) > 8 - 1 { return Err(IcedError::new("Invalid slice length")); } let mut instruction = Self::default(); instruction.set_code(Code::DeclareWord); instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as...
Rust
0
total: i32 } impl OrganizedTestResults { /** Constructor */ pub fn new() -> OrganizedTestResults { let success : TestSetCollection = TestSetCollection::new(); let failed : TestSetCollection = TestSetCollection::new(); let skipped : TestSetCollection = TestSetCollection::new...
Rust
0
self, renderer: &mut Renderer<D>, build_options: BuildOptions, executor: E) -> Vec<RenderCommand> where D: Device, E: Executor { let com...
Rust
0
"/static", fs::StaticFiles::with_config("./web/dist", StaticFileConfig).unwrap(), ) .resource("/", |r| r.get().with(view::home)) .resource("/about", |r| r.get().with(view::about)) .resource("/movies", |r| { r.name("all_movies"); r.get().with(view::all...
Rust
0
from fastapi import APIRouter, Depends, HTTPException, Query from sqlmodel.ext.asyncio.session import AsyncSession from sqlmodel import select from database import get_session import models.Alumno as Alumno router = APIRouter(prefix="/alumnos") # Endpoint para agregar un alumno @router.post("/", response_model=Alumno...
Python
1
import tensorflow as tf import math import numpy as np from agents.replay_priorities import ProportionalPriorities from .mock import Mock class ReplayPrioritiesTest(tf.test.TestCase): def test_proportional_priority(self): config = Mock( replay_capacity=12, replay_alpha=1, replay_beta=1, num_steps=100) ...
Python
1
page_x, ZeroPageX), 0x8D => STA(absolute, Absolute), 0x9D => STA(absolute_x, AbsoluteX), 0x99 => STA(absolute_y, AbsoluteY), 0x81 => STA(indirect_indexed, IndirectIndexed), 0x91 => STA(indexed_indirect, IndexedIndirect), // STX 0x86 => STX(zero_page, ZeroPage), 0x96 => STX(zero_page_y, ...
Rust
0
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 appl...
Python
1
""" multilingual universal sentence encoder ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ """ from textattack.constraints.semantics.sentence_encoders import SentenceEncoder from textattack.shared.utils import LazyLoader hub = LazyLoader("tensorflow_hub", globals(), "tensorflow_hub") tensorflow_text = LazyLoader("tensorflo...
Python
1
#!/usr/bin/env python3 ''' Description: Create a measure_time function with integers n and max_delay as arguments that measures the total execution time for wait_n(n, max_delay), and returns total_time / n. Your function should return a float. Arguments: n: int, ma...
Python
1
the this mode is `Lexical`. pub fn is_lexical(&self) -> bool { matches!(self, Self::Lexical) } /// Returns `true` if the this mode is `Strict`. pub fn is_strict(&self) -> bool { matches!(self, Self::Strict) } /// Returns `true` if the this mode is `Global`. pub fn is_globa...
Rust
0
xtInput(attrs={'class': 'form-control', 'placeholder': 'Add any relevant notes'}), } def __init__(self, *args, **kwargs): user = kwargs.pop('user', None) course_slug = kwargs.pop('course_slug', None) super().__init__(*args, **kwargs) # If a course is provided, hide the cour...
Python
1
tj||j|j }|\}}}}||j vs Jd|zt ||} ||g|i|}d|f} |j| y#t$rdtf} Y*wxYw#t...
Python
1
# Program to print a data & it's Metadata of online uploaded file using "socket". import socket skt_c=socket.socket(socket.AF_INET,socket.SOCK_STREAM) skt_c.connect(('data.pr4e.org',80)) link='GET http://data.pr4e.org/intro-short.txt HTTP/1.0\r\n\r\n'.encode() skt_c.send(link) while True: data=skt_c.recv(512) if len...
Python
1
_glib_none().0, ) }; match result { ffi::GST_SDP_OK => Ok(()), _ => Err(()), } } pub fn set_uri(&mut self, uri: &str) -> Result<(), ()> { let result = unsafe { ffi::gst_sdp_message_set_uri(self.to_glib_none_mut().0, uri.to_glib_non...
Rust
0
import click import frappe def execute(): if ( not frappe.db.exists("Company", {"country": "India"}) or "india_compliance" in frappe.get_installed_apps() ): return click.secho( "India-specific regional features have been moved to a separate app" " and will be removed from ERPNext in Version 14." " Ple...
Python
1
total=len(test_loader), dynamic_ncols=True, disable=False, file=sys.stdout): data, data2, label = data.to(device), data2.to(device), label.to(device) if args.mode == 'm1': ...
Python
1
mesh_arrow.rotate(Ry, center=np.array([0, 0, 0])) mesh_arrow.rotate(Rz, center=np.array([0, 0, 0])) mesh_arrow.transform(T_t) else: mesh_arrow = get_arrow(origin=center, vec=flow_volume[idx, :]) # We view spheres as wireframe. ...
Python
1
<char>) -> InternalCharVec { let len = chars.len(); let mut back_index = None; if len > 0 { back_index = Some(len - 1); } InternalCharVec { chars: chars, index: 0, back_index: back_index, } } pub fn next(&mut self) ...
Rust
0
= &last_query[0]; filtered = Elements::select_by_rule(self, last_query_first_rule, Some(&chain_comb)).cloned(); if !filtered.is_empty() && last_query.len() > 1 { for rule in &last_query[1..] { filtered = Elements::select_by_rule(&filtered, rule, None); if filtered.is_empty() { brea...
Rust
0
import openpyxl # Создаем новый Excel файл workbook = openpyxl.Workbook() # Выбираем активный лист sheet = workbook.active # Записываем текст в разные ячейки sheet['A1'] = "Дата" sheet['B1'] = "Время" sheet['C1'] = "Категория" sheet['D1'] = "Комментарий" sheet['E1'] = "Сумма" iexcel = 2 def txt_to_excel(lines,sheet...
Python
1
nt(location); for hb in &scribe.blockchain { if hb.index < 21 { blocks.add_block(hb.clone()).unwrap(); } } assert_eq!( blocks.block_store.get_at(20).unwrap(), *scribe.blockchain.get(20).unwrap() ); assert!(blocks.block_store.get_at(21).is_err()); let...
Rust
0
elf.stype = "unknown" class CSRPlaceholderOp(SparsePlaceholderOp): """Placeholder class for CSR based sparse tensor representation.""" def __init__(self, shape, nonzeros, dtype, name): """Contructing a bare bone structure for a csr_matrix Parameters ---------- shape: Tuple of...
Python
1
e::from(1.0)) } else { Ok(Value::from(0.0)) } } #[cfg(feature = "trit_fire_hook")] #[hook("/datum/gas_reaction/tritfire/react")] fn tritfire(byond_air: &Value, holder: &Value) { const TRITIUM_BURN_OXY_FACTOR: f32 = 100.0; const TRITIUM_BURN_TRIT_FACTOR: f32 = 10.0; const TRITIUM_MINIMUM_RADIATION_FACTOR: f32 = ...
Rust
0
ogits = kwargs["logits"].transpose(0, 1) else: logits = kwargs["logits"] # TODO: convert hidden state form dict to list to be the same as with HFs hidden_states = None if output_hidden_states: hidden_states = kwargs["hidden_states"] if not return_dict: ...
Python
1
) # Process fields from both classes input_fields = _process_input_fields(Input_class, preserve_types) output_fields, auto_instructions = _process_output_fields(Output_class, preserve_types) # Combine all fields and create instructions dspy_fields = {**input_fields, **output_fields} final_...
Python
1
ap::ArgMatches; use solana_sdk::{ native_token::sol_to_lamports, pubkey::Pubkey, signature::{read_keypair_file, Keypair, KeypairUtil}, }; // Return parsed values from matches at `name` pub fn values_of<T>(matches: &ArgMatches<'_>, name: &str) -> Option<Vec<T>> where T: std::str::FromStr, <T as std:...
Rust
0
: if isinstance(default_category, dict): cats.append(default_category[prefix]) else: raise ValueError( "Dummy DataFrame contains unassigned value(s); " f"First instance in row: {assigned.idxmin()}" ) ...
Python
1
; } // PowerPC tests are failing on LLVM 13: https://github.com/rust-lang/rust/issues/88520 #[cfg(not(target_arch = "powerpc64"))] #[test] fn float_comparisons() { use compiler_builtins::float::cmp::{ __eqdf2, __eqsf2, __gedf2, __gesf2, __gtdf2, __gtsf2, __ledf2, __lesf2, __ltdf2, __ltsf2, __nedf2,...
Rust
0
info!("connect: {}", addr); let (tx, rx) = sync::mpsc::unbounded(); let (reader, writer) = socket.split(); hello_connections .lock() .map_err(report_and_discard)? .insert(addr, tx); ...
Rust
0
talize()}' '{name}' in namespace {namespace}") if kind == "deployment": deployment = k8s_client.read_namespaced_deployment(name, namespace) deployment.spec.replicas = replicas k8s_client.patch_namespaced_deployment(name, namespace, deployment) elif...
Python
1
2.320505 , 2.355248 , 2.512263 , 2.554336 , 2.696497 , 2.794736 , 2.737043 , 2.869232 , 2.890712 , 2.970691 , 2.337135 , 2.466959 , 2.409641 , 2.587405 , 2.58797 , 2.684312 , 2.859648 , 2.815709 , 2.998253 , 2.948038 , 2.970053 , 3.083319 , 2.467753 , 2.584...
Python
1
AttachmentBlend, BlendFactor, BlendOp, ColorBlendState, }; use vulkano::pipeline::graphics::depth_stencil::DepthStencilState; use vulkano::pipeline::graphics::input_assembly::InputAssemblyState; use vulkano::pipeline::graphics::rasterization::{CullMode, RasterizationState}; use vulkano::pipeline::graphics::vertex_...
Rust
0
e: aa = 1.0 / np.power(-1.0, 2) if prefactor is None else prefactor return -aa * np.power(xx - 1.0, 2) * np.tan((xx - 1.0) * np.pi / 2.0) xx_scaled_and_clamped = scale_and_clamp(xx, edges[0], edges[1], 0.0, 1.0) return power2_tangent_decreasing(xx_scaled_and_clamped, prefactor=prefactor) def ...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. from itertools import product import torch from fastgen.kernels.rmsnorm import rmsnorm # from xformers.ops.rmsnorm import rms_norm def main(): NITER = 50 SEQLENS = [1, 3, 4, 16, 128, 256, 1000, 10000, 100000] D = 4096 w = torch.rand(D, dtype=torc...
Python
1
haracter_id = pending_interaction.character_id; let entity = map.get_character_by_id(character_id); if !movements.contains(entity) { let map_id = map.get_character_natural_map(character_id); interact_with_npc(character_id, &map_id, &mut event_queue); ...
Rust
0
ets.iter()) { table.add_row(Row::new(vec![ Cell::new(t), Cell::new(m), ])); } table.set_format(*format::consts::FORMAT_NO_LINESEP_WITH_TITLE); table.printstd(); Ok(()) } fn get_magnet(bbs_url: &str) -> String { let body = reqwest::blocking::get(bbs_url).unw...
Rust
0
"толку", "никогаш", "мене", "тогаш", "своите", "сето", "нема", "околу", "многу", "полека", "секогаш", "зошто", "те", "добро", "можеби", "колку", "можеше", "нивните", "преку", "миг", "знам", "малку", "вратата", "ох", "нависти...
Rust
0
pub write_back: bool, pub load: bool, pub base_register: u8, pub destination: u8, pub is_signed: bool, pub condition: Condition, pub data_type: DataType, } impl From<u32> for HalfwordCommon { fn from(value: u32) -> HalfwordCommon { let is_halfword = ((value & 0x20) >> 5) != 0; ...
Rust
0
that hunk of memory. //! //! For the purposes of maintaining safety, volatile memory has some rules of its own: //! 1. No references or slices to volatile memory (`&` or `&mut`). //! 2. Access should always been done with a volatile read or write. //! The First rule is because having references of any kind to memory co...
Rust
0
Skip "not entered" rows if !matches!(expected_rslt, Ok(1usize)) { continue; } println!("Deleting term for test: \"{:}\"", &test_name); let target_update = &updates[i].1; // Remove row: match diesel::delete(terms::table.filter(terms::term_alias.eq(&target_update.term_alias)...
Rust
0
from scholarly import scholarly import pandas as pd def get_google_scholar_results(query, source, year_low, year_high): # search_query = scholarly.search_pubs(f"{query} {source}", True, True, year_low, year_high)#if you want to add specific venue, use this search_query = scholarly.search_pubs(f"{query}", True...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import argparse from collections import OrderedDict import torch def moco_convert(src, dst): """Convert keys in pycls pretrained moco models to mmdet style.""" # load caffe model moco_model = torch.load(src) blobs = moco_model['state_dict'] # conver...
Python
1
::R<bool, ERQ14_A>; impl ERQ14_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERQ14_A { match self.bits { false => ERQ14_A::_0, true => ERQ14_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(...
Rust
0
er_setVector2Parameter( shader: *mut sfShader, name: *const ::std::os::raw::c_char, vector: sfVector2f, ); } extern "C" { pub fn sfShader_setVector3Parameter( shader: *mut sfShader, name: *const ::std::os::raw::c_char, vector: sfVector3f, ); } extern "C" { ...
Rust
0
( "emis_shifty", ( "emis * shifty (cell centered)\n\ [erg/s/sr/cm²]", vec!["emis", "uy"] ) ), ( "emis_shiftz", ( "emis * shif...
Rust
0
VEX_Vfnmadd213ps_ymm_ymm_ymmm256 0x03,// HasVPrefix, SameAsPrev // VEX_Vfnmadd213pd_xmm_xmm_xmmm128 0x01,// HasVPrefix 0xBD, 0x08,// 1085 = "vfnmadd213pd" // VEX_Vfnmadd213pd_ymm_ymm_ymmm256 0x03,// HasVPrefix, SameAsPrev // EVEX_Vfnmadd213ps_xmm_k1z_xmm_xmmm128b32 0x01,// HasVPrefix 0xBC, 0x08,// 1084 = "...
Rust
0
/// fn default_vsync() -> u8 { 0 } /// /// mass默认级别 /// fn default_multisampling() -> u16 { 1 } /// /// 默认显示窗口 /// fn default_visibility() -> u8 { 1 } /// /// 默认显示窗口 /// fn default_fps() -> f32 { 60_f32 } /// /// 窗口句柄 /// #[repr(C)] pub struct WindowHandle { /// /// DPI /// pub(crate...
Rust
0
ero() { NonZeroUsize!(0); } #[test] #[should_panic(expected = "Custom message")] fn test_zero_custom_message() { NonZeroUsize!(0, "Custom message"); } } pub const BTRFS_INODE_ITEM_TYPE: u8 = 0x01; pub const BTRFS_INODE_REF_TYPE: u8 = 0x0c; pub const BTRFS_DIR_ITEM_TYPE: u8 = 0x54; p...
Rust
0
df_selected["MS level"] = df["MS level"] df_selected["precursor m/z"] = df["precursor m/z"] df_selected["max intensity m/z"] = df["max intensity m/z"] fig = plot_ms_spectrum( df_selected, title, st.session_s...
Python
1
', None, Some('古')), ('降', Some('夅'), None), ('珍', Some('㐱'), None), ('挖', None, Some('穵')), ('荐', None, Some('存')), ('茫', Some('亡'), None), ('柳', Some('卯'), None), ('勃', Some('孛'), None), ('研', Some('开'), None), ('砂', Some('少'), None), ('砍', None, Some('欠')), ('眨', None, Some('乏')), ('幽', Some(...
Rust
0
import unittest import numpy as np from pyswark.tensor.tensordict import TensorDict, VectorDict, MatrixDict from pyswark.lib.pydantic import ser_des class TensorDictTestCases( unittest.TestCase ): def test_tensor(self): model = TensorDict({'a': [ [[1,2,3], [3,4,5]], ]}) self...
Python
1
import os import requests from telegram import Update from telegram.ext import ApplicationBuilder, MessageHandler, filters, ContextTypes from dotenv import load_dotenv load_dotenv() TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE): user_input = ...
Python
1
tor_type(vk::DescriptorType::STORAGE_BUFFER) .buffer_info(&sel_buf_infos) .build(); let node_buf_info = vk::DescriptorBufferInfo::builder() .buffer(vertices.buffer()) .offset(0) .range(vk::WHOLE_SIZE) .build(); let node_buf_infos ...
Rust
0
G\xe5\x7fI\xcbT6r\xff\xd4n\x8c\xb5=\ \x9et\xce\xb9O}\xc3\xa5\xcf\xbc\xf6D\xbc\xd7\xa3q\ \xdf\x1b#\x8b>\x1aw{\xbc\xe0io\xabb\xd9\xd0\ |\xefU\x17w\xde\xf8\xe2\x0f\xff\xfdG\xaf\xf9\xf0\xd3\ V\xac:\x1d\x8b\x16,F\xaf\x0a\xb4\xebZ\xa8\xf8\xe9\ \xf8?\xc2\xe3\xd7\xcd90\x1bM\xc43\x0eC\x80c\ @\x18\x8dC\x11iZ`\xad\x9f\xb3*kU\xf61...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 Communications Engineering Lab, KIT # # This 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, or (at your option) # any later v...
Python
1
r(e) => Err(e), } } /// Sets the process as traceable, as with `ptrace(PTRACE_TRACEME, ...)` /// /// Indicates that this process is to be traced by its parent. /// This is the only ptrace request to be issued by the tracee. pub fn traceme() -> Result<()> { unsafe { ptrace_other( Request::PT...
Rust
0
# Copyright (c) 2023-2024 Boston Dynamics AI Institute LLC. See LICENSE file for more info. """ Test for the List All Dances command. """ # We disable Pylint warnings for all Protobuf files which contain objects with # dynamically added member attributes. # pylint: disable=no-member import pytest from bosdyn.api.spo...
Python
1
return True return False def refine_strategies(self, strategies: List[str]) -> Dict[str, Any]: """ 優化策略 Args: strategies: 要優化的策略列表 Returns: Dict[str, Any]: 優化結果 """ results = {} for strategy_name in strategies: ...
Python
1
edit("**ᴛʜɪs ᴄᴏᴍᴍᴀɴᴅ ᴡᴏʀᴋs ᴏɴ ɢʀᴏᴜᴘs!**") elif reply: try: discription = message.reply_to_message.text admin_check = await app.get_chat_member(chat_id, user_id) if admin_check.privileges.can_change_info: await message.chat.set_description(discription) ...
Python
1
shal_binary(&mut self, data: &[u8]) -> Result<usize> { if data.len() < 4 { Err(anyhow!("mkvs: malformed 32-bit integer")) } else { let mut reader = Cursor::new(data); *self = reader.read_u32::<LittleEndian>()?; Ok(4) } } } impl Marshal for u64...
Rust
0
.collect::<Vec<_>>() ); } fn enc_dec_test(m: ByteSeq, key: Key, iv: IV) { let c = chacha(key, iv, &m); let m_dec = chacha(key, iv, &c); assert_eq!( m.iter().map(|x| U8::declassify(*x)).collect::<Vec<_>>(), m_dec.iter().map(|x| U8::declassify(*x)).collect::<Vec<_>>() ); } fn ka...
Rust
0
=subprocess.PIPE, shell=True) (lsb_release_output, _) = lsb_release.communicate() lsb_release.wait() if lsb_release_output: lsb_release_output = lsb_release_output.decode("latin1").replace("\n", "<br/>") except: lsb_release_output = None try: model = subproce...
Python
1
a_val = p.get(a); let b_val = p.get(b); match (a_val, b_val) { // if cmp equal then try next packer column. (None, None) => continue, (None, _) => return Ordering::Greater, (_, None) => return Ordering::Les...
Rust
0
import unreal def spawn_draw_path_actor(): # Percorso della classe Blueprint blueprint_path = "/Game/DrawPath" actor_class = unreal.EditorAssetLibrary.load_blueprint_class(blueprint_path) if not actor_class: unreal.log_error(f"Blueprint class '{blueprint_path}' non trovata.") return Fa...
Python
1
ar/config.json"); let mut contents = String::new(); f.read_to_string(&mut contents) .expect("eror reading config.json"); let flds: Vec<fields::Field> = json5::from_str(&contents).unwrap(); eprintln!("fields: {:?}", flds); for fld in flds { ...
Rust
0
ok!(Governance::conclude_vote(Origin::signed(1), 1)); // withdraw after conclude. Still need to wait until the lock period is over assert_noop!(Governance::withdraw(Origin::signed(1), 1), "You need to wait until the lock period is over!"); // proceed #5 -> #15 run_to_block(15); ...
Rust
0
3000, 0x00) ChrWalkTo(0x000D, -12150, 0, 29770, 3000, 0x00) Sleep(500) PlaySE(170, 0x00, 0x64) Sleep(500) ChrMoveTo(0x000D, -12170, 0, 29470, 2000, 0x00) ChrWalkTo(0x000D, -9920, 0, 29550, 3000, 0x00) ChrWalkTo(0x000D, -9920, 0, 29770, 3000, 0x00) Sleep(500) PlaySE(170, 0x00, 0x6...
Python
1
"""Immutable types and functions to catch and handle nulls and Exceptions Inspired by Rust and Gleam. Features utilities like mapping, unwrapping, decorators for catching None values and Exceptions. Examples: Automatic Error Catching: :: >>> @safe(KeyError) ... def get_foo(data: dict[str, str])...
Python
1
Builder::new() .has_headers(false) .delimiter(b'\t') .from_path(dynamic_const_csv.as_path()) .unwrap(); for r in rdr.records() { let record = r.unwrap(); let selector = u32::from_str_radix(record[1].trim_start_matches("0x"), 16).unwrap(); let slot = u32::from_...
Rust
0
mint_lpt: Pubkey::new_from_array(*mint_lpt), vault: Pubkey::new_from_array(*vault), mint_s: Pubkey::new_from_array(*mint_s), treasury_s: Pubkey::new_from_array(*treasury_s), reserve_s: u64::from_le_bytes(*reserve_s), mint_a: Pubkey::new_from_array(*mint_a), treasury_a: Pubkey::...
Rust
0
repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct kvm_vcpu_events__bindgen_ty_4 { pub smm: __u8, pub pending: __u8, pub smm_inside_nmi: __u8, pub latched_init: __u8, } #[test] fn bindgen_test_layout_kvm_vcpu_events__bindgen_ty_4() { assert_eq!( ::std::mem::size_of::<kvm_vcpu_events_...
Rust
0
'Win32_System_Js', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub fn JsRunSerializedScript(script: super::super::Foundation::PWSTR, buffer: *const u8, sourcecontext: usize, sourceurl: super::super::Foundation::PWSTR, result: *mut *mut ::core::ffi::c_void) -> JsErrorCode; #[doc = "*Required ...
Rust
0
# main.py (Updated) import os import uuid import asyncio from fastapi import FastAPI, BackgroundTasks, HTTPException from pydantic import BaseModel from datetime import datetime, timezone # Import the new Planner from coordinator.planner import Planner from coordinator.executor import Executor from database.models im...
Python
1
reOrigin<Self::Origin>; /// The origin which can call auction failed type AuctionFailedOrigin: EnsureOrigin<Self::Origin>; /// The origin which can call auction completed type AuctionCompletedOrigin: EnsureOrigin<Self::Origin>; /// The origin which can call slot expired ...
Rust
0
n comparison succeeds, we have a match Ok(()) } } fn description(&self) -> String { format!( "Epsilon-sized absolute comparison, followed by an ULP-based comparison. Please see the documentation for details. Epsilon: {eps} ULP tolerance: {ulp}", eps = s...
Rust
0
indow, setDelegate:*delegate]; WindowDelegate { state: state, _this: delegate } } } } impl Drop for WindowDelegate { fn drop(&mut self) { unsafe { // Nil the window's delegate so it doesn't still reference us let _: () = msg_send![*self.state.window, setDele...
Rust
0
iableNotFound(String::new(), crate::Position::NONE).into() }) } /// Set a script-defined function into the [`Module`]. /// /// If there is an existing function of the same name and number of arguments, it is replaced. #[cfg(not(feature = "no_function"))] #[inline] pub fn set_script_...
Rust
0
) else: return {"predictions": prediction, "targets": targets} def predict(self, samples): output = self.forward(samples, is_train=False) return output @classmethod def from_config(cls, cfg=None): image_encoder = VisionTransformerEncoder.from_config(cfg) ...
Python
1
b_diseqc_master_cmd { pub msg: [__u8; 6usize], pub msg_len: __u8, } impl Clone for dvb_diseqc_master_cmd { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug, Default, Copy)] pub struct dvb_diseqc_slave_reply { pub msg: [__u8; 4usize], pub msg_len: __u8, pub timeout: ::std::os::raw::c...
Rust
0
import datasets import numpy as np # fmt: off LETTER_INDICES_AR = ["أ", "ب", "ج", "د", "هـ", "و", "ز", "ح", "ط", "ي", "ك", "ل", "م", "ن", "س", "ع", "ف", "ص", "ق", "ر", "ش", "ت", "ث", "خ", "ذ", "ض", "ظ", "غ"] # fmt: on # fmt: off LETTER_INDICES = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",...
Python
1
color_type: ColorType::GreyAlpha, bit_depth: 8, interlace, }, Graya16(r) => ImageHeader { width: r.width(), height: r.height(), color_type: ColorType::GreyAlpha, bit_depth: 16, in...
Rust
0
# -*- coding: utf-8 -*- from skidl import * @subcircuit def _3v3_regulator(_p_3V3, _p_5V, _3v3_monitor, _5v_monitor, GND): # Components C2 = Part('Device', 'C', value='10uF', footprint='Capacitor_SMD:C_0603_1608Metric', ref='C2', fields={'Sheetname': '3v3_regulator', 'Sheetfile': 'power2.kicad_sch', 'ki_keywor...
Python
1
plit("\n") # Split text into lines for line in lines: words = line.split(" ") # Split each line into words for word in words: yield word + " " time.sleep(0.02) yield "\n" # Yield newline character after each line time.sleep(0.1) def load_reranker_model( ...
Python
1
import numpy as np import cv2 import matplotlib.pyplot as plt from scipy.signal import medfilt2d from scipy.fft import fft2, ifft2, fftshift, ifftshift def add_salt_pepper_noise(image, prob): """添加椒盐噪声到图像中""" noisy = np.copy(image) num_salt = int(prob * image.size * 0.5) num_pepper = int(prob * image....
Python
1
ept 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 agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY K...
Rust
0
import base64 import os import platform import shlex import subprocess import sys import threading import time import webbrowser from ast import literal_eval import requests from astronverse.actionlib import AtomicFormType, AtomicFormTypeMeta, AtomicLevel, DynamicsItem from astronverse.actionlib.atomic import atomicMg...
Python
1
, date_string.as_str()); y -= scale.y as u32; } if self.render_title { draw_text_mut(&mut image, white, x, y, scale, &FONT, act.name.as_str()); } image } #[inline] fn get_pixel_mut(&mut self, point: &ScreenPoint) -> Option<&mut u32> { if poi...
Rust
0
_config_returning_msg(lint_message)?; let mut cmd = Command::cargo_bin("lintrunner")?; cmd.arg(format!("--config={}", config.path().to_str().unwrap())); cmd.arg(format!( "--data-path={}", data_path.path().to_str().unwrap() )); // Run on a file to ensure that the linter is run. c...
Rust
0
for unit in unit_ids] metrics_df['time_to_peak_ns'] = [self._get_time_to_peak(unit, self._get_preferred_condition(unit)) for unit in unit_ids] metrics_df['lifetime_sparseness_ns'] = [self._get_lifetime_sparsene...
Python
1
t mut type_env = TypeEnvironment::new(); let err = type_env.process_statements(&block).unwrap_err().single(); assert_matches!(err.kind(), ErrorKind::FieldsMismatch { .. }); } #[test] fn missing_field_after_object_annotation() { let code = "|obj: { x: _ }| obj.x == obj.y"; let block = F32Grammar::parse...
Rust
0