text
string
label_name
string
labels
int64
############################################################## ## if action == roll left if (action == 3): roll_level_sign = current_position[4] if (roll_level_sign > 0.0): reward = 10.0 * (abs(roll_level_sign)/360.0) else: ...
Python
1
self.cluster_name.clone(), NodeMap::new(self.local.clone()), NodeMap::new(self.peer.clone()), ClusterConfigData::new(self.cluster_config.clone()), ) .gen_compressed_data()?; let args = vec![ self.version.clone(), self.epoch....
Rust
0
RESHOLD, "Threshold (dBFS) at which point the dynamic limiter engages to prevent clipping from 0.0 to -10.0. Defaults to -2.0.", "THRESHOLD", ) .optopt( NORMALISATION_ATTACK_SHORT, NORMALISATION_ATTACK, "Attack time (ms) in which the dynamic limiter reduces gain from 1 to...
Rust
0
Listener::Tcp(inner) => match inner.accept() { Ok(res) => ListenerStream::Tcp(res.0, res.1), Err(err) => { dbg!("Ignoring failed accept", err); ListenerStream::Empty() } }, } } } /// Get sharedmem ...
Rust
0
, "Honduras", "<NAME>", 15.3333333, -87.9166641, 43.0), City::new(4505, "Honduras", "Copan", 14.8333333, -89.1500015, 638.0), City::new(4506, "Honduras", "Mezapa", 15.5833333, -87.6500015, 164.0), City::new(4507, "Honduras", "<NAME>", 14.0666667, -85.9833298, 763.0), City::new(4508, "Honduras", "Azacualpa", 15.3433...
Rust
0
turn None def infermeta_grad( self, outputs, inputs, grad_outputs=None, retain_graph=None, create_graph=False, only_inputs=True, allow_unused=False, no_grad_vars=None, ): if not is_sequence(inputs): inputs = [inputs] ...
Python
1
write_str ( & self.bytes.to_hex (), ) } } pub fn to_array_24 < ItemsIntoIter: IntoIterator <Item = u8>, > ( items_into_iter: ItemsIntoIter, ) -> Result <[u8; 24], String> { let mut items_iter = items_into_iter.into_iter (); let array = [ items_iter.next ().ok_or_else (|| "Not enough data".to_string (...
Rust
0
.vrd_eval.add_single_ground_truth_image_info( image_key2, groundtruth_box_tuples2, groundtruth_class_tuples2) image_key3 = 'img3' groundtruth_box_tuples3 = np.array( [([0, 0, 1, 1], [1, 1, 2, 2])], dtype=vrd_evaluation.vrd_box_data_type) groundtruth_class_tuples3 = np.array( [(1, 2,...
Python
1
r { self.bits.hash(state); } } impl<Bits, Base, Exp> Debug for Fix<Bits, Base, Exp> where Bits: Debug, Base: Unsigned, Exp: Integer { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { write!(f, "{:?}x{}^{}", self.bits, Base::to_u64(), Exp::to_i64()) } } // Comparison. impl<Bits, Bas...
Rust
0
% 4; let mut points = 0u8; let mut call = 0; for &card in &self.played[1..4] { points += card.points(); if card.suit() == best_card.suit() && card.rank() > best_card.rank() { best_card = card; best_player = player; } else if ca...
Rust
0
usize) -> isize { self.inner.column_offsets[idx] as isize } pub fn new_row<'a>(&self) -> Row<'a> { Row::partial(self.clone()) } pub fn ref_eq(&self, other: &Schema) -> bool { let this: *const Inner = &*self.inner; let that: *const Inner = &*other.inner; this ==...
Rust
0
import numpy as np import matplotlib.pyplot as plt """ The drawing should begin at 0,0. The drawn shape will be completed in 50 seconds. try to keep the veloicty under 20m/s by not drawing over 1000meters. Eventually increasing the num of points. This will need to be increased in Simulink [ros | variable size message ...
Python
1
.function_call .control_indirect lea t1, seg, sib, disp, dataSize=asz # Load the selector. ld t2, seg, [1, t0, t1], dsz, dataSize=2 # Load the offset. ld t1, seg, [1, t0, t1] # Compute the base. zexti t3, t2, 15, dataSize=8 slli t3, t3, 4, dataSize=8 # Make sure pushing t...
Python
1
D_CHMAP_RLC // rear left center , VIRTIO_SND_CHMAP_RRC // rear right center , VIRTIO_SND_CHMAP_FLW // front left wide , VIRTIO_SND_CHMAP_FRW // front right wide , VIRTIO_SND_CHMAP_FLH // front ...
Rust
0
raise RuntimeError( "Distributed QAT recipe should be run via a distributed launcher." "If using tune CLI, please specify --nnodes 1 and --nproc_per_node [num_gpus]" ) init_process_group(backend="gloo" if cfg.device == "cpu" else "nccl") if cfg.get("fsdp_cpu_offload", False)...
Python
1
#! /usr/bin/env python import rospy import numpy as np from panda_interface import ObjectPosition from panda_interface import MovePanda def move_robot(): panda_robot = MovePanda() obj_position = ObjectPosition() plan = panda_robot.move_to_pose(0.30697425309106013, -5.334090225032015e-05, 0.5906692483699...
Python
1
ot warning_level or ( warning_level > 99 and warning_level < 600) if warning_level is not None: import warnings warnings.warn('The warning_level parameter is not used or supported', DeprecationWarning, 2) self.warnin...
Python
1
64/*-{}.asm", base_dir.display(), sfx)) .expect("unable to collect assembly files"); for file in files { file_vec.push(file.unwrap()); } } #[cfg(not(target_env = "msvc"))] fn assembly(file_vec: &mut Vec<PathBuf>, base_dir: &Path, _: &String) { file_vec.push(base_dir.join("assembly.S")) ...
Rust
0
# coding: utf-8 # Copyright (c) 2024 Jungheil <jungheilai@gmail.com> # iLQR_cartpole is licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # http://license.coscl.org.cn/MulanPSL2 # THIS SOFTWARE IS PROVI...
Python
1
Self::MDF3(file) => file.read_all(), Self::MDF4(file) => file.read_all(), } } fn list_data_groups(&mut self) { match self { Self::MDF3(file) => file.list_data_groups(), Self::MDF4(file) => file.list_data_groups(), } } fn list_cha...
Rust
0
import pandas as pd import os def load_gold_prices(csv_path="data/gold_monthly_inr.csv"): """ Loads a gold-futures CSV file and renames its detected price column to "Adjusted Spot Price". Raises: RuntimeError: If the CSV can't be read or if no price column is found. """ # 1. Basic file exi...
Python
1
cx.core.DWT.enable_cycle_counter(); let dp = stm32::Peripherals::take().unwrap(); let cp = cortex_m::peripheral::Peripherals::take().unwrap(); // let p = &mut c.core; //cortex_m::peripheral::Peripherals::take().unwrap(); // // Take ownership over the raw flash and r...
Rust
0
let new process to adopt current's child process exit_old_process_for_execve(term_status, new_process_ref.clone()); // Update process and thread in global table table::replace_process(new_process_ref.pid(), new_process_ref.clone()); table::replace_thread( new_process_ref.pid...
Rust
0
_EXIF_TAG_MAKE: ExifTag = 271; pub const ExifTag_EXIF_TAG_MODEL: ExifTag = 272; pub const ExifTag_EXIF_TAG_STRIP_OFFSETS: ExifTag = 273; pub const ExifTag_EXIF_TAG_ORIENTATION: ExifTag = 274; pub const ExifTag_EXIF_TAG_SAMPLES_PER_PIXEL: ExifTag = 277; pub const ExifTag_EXIF_TAG_ROWS_PER_STRIP: ExifTag = 278; pub const...
Rust
0
USBTypeC, #[serde(rename = "USB Mini A")] USBMiniA, #[serde(rename = "USB Mini B")] USBMiniB, #[serde(rename = "USB Micro A")] USBMicroA, #[serde(rename = "USB Micro B")] USBMicroB, #[serde(rename = "USB Micro AB")] USBMicroAB, #[serde(rename = "USB 3.0 Type B")] USB30Typ...
Rust
0
st._ascendant_symbol] moon_house = p_to_h[1] lagna_lord = house.house_owner(h_to_p,asc_house) py1 = p_to_h[lagna_lord] == moon_house dispositor_of_moon = house.house_owner(h_to_p,moon_house) dispositor_house = p_to_h[dispositor_of_moon] dispositor_quadrants = house.quadrants_of_the_raasi(disposi...
Python
1
'帮助我们啊。', TxtCtl.Enter, ), ) CloseMessageWindow() SetScenaFlags(ScenaFlag(0x0000, 4, 0x4)) Jump('loc_2AAE') def _loc_2A58(): pass label('loc_2A58') ChrTalk( 0x00FE, ( '矿山事件\n', '似乎也是因为这次异变的影响啊。', TxtCtl...
Python
1
fn correct_casing_in_js() { assert_camel_case(PreserveNames::new().wierd_field_name(1)); } <reponame>LegNeato/tangram<filename>crates/metrics/binary_classification.rs<gh_stars>100-1000 use itertools::Itertools; use num::ToPrimitive; use std::num::NonZeroUsize; use tangram_zip::zip; /// `BinaryClassificationMetrics...
Rust
0
: ["-commented_at"], }, ), migrations.CreateModel( name="Like", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, s...
Python
1
for y in (b + 1)..(b + 4); yield y]); } #[test] fn bind_pattern_in_for() { struct Item { x: u32, y: u32, }; let items = (0..5).map(|x| Item { x: x, y: x * 2, }); check_match(vec![0, 0, 1, 2, 2, 4, 3, 6...
Rust
0
i32x4, u32x4, f32x4, m32x4, i64x4, u64x4, f64x4, i128x4, u128x4, m128x4, isizex4, usizex4, msizex4 ); impl_from_cast!( i128x2[test_v256]: i8x2, u8x2, m8x2, i16x2, u16x2, m16x2, i32x2, u32x2, f32x2, m3...
Rust
0
c_balance.upperbound.get(); assert_eq!(bitcoin_lower_bound, 9.0); assert_eq!(bitcoin_upper_bound, 13.0); } #[tokio::test] async fn test_metrics_restart_counter() { assert_eq!(RESTART_COUNT.get(), 0); increment_restart_counter(); assert_eq!(RESTART_COUNT.get(), 1); ...
Rust
0
_helm00_03.dds", 0x2A0C_5253, 0x6DF8_295C), (r"textures\tx_a_trollbone_belt.dds", 0x2A11_3C3C, 0x4CDB_320A), (r"textures\tx_a_trollbone_bone.dds", 0x2A11_3C3C, 0x64DB_7602), (r"textures\tx_a_trollbone_backp.dds", 0x2A11_3C3C, 0xBC9F_DDFA), (r"textures\tx_a_trollbone_helm01.dds", 0x2A11_3C53, 0x60A4_...
Rust
0
} Ok((command_tube, inflate_tube)) => { self.command_tube = Some(command_tube); self.inflate_tube = inflate_tube; return true; } } } false } } #[cfg(test)] mod tests { use sup...
Rust
0
} impl<'a> PartialEq for CellSpec<'a> { fn eq(&self, other: &Self) -> bool { match (&self.txt, &other.txt) { (CellSpecTxt::DateTime(dt1), CellSpecTxt::DateTime(dt2)) => dt1.eq(dt2), (CellSpecTxt::Index, CellSpecTxt::Index) => true, (CellSpecTxt::Str(st), CellSpecTxt::Str(...
Rust
0
ta at a specific resolution, thus we do not randomise it anymore ! randomise_res = False # blurring/downsampling parameters # We specify here the slice spacing/thickness that we want the synthetic scans to mimic. The axes refer to the *RAS* # axes, as all the provided data (label maps and images) will be automatically...
Python
1
SEC { UNIQID = 0x03, #[num_enum(default)] Unknown, } #[derive(Copy, Clone, Debug, FromPrimitive, PartialEq)] #[repr(u8)] pub enum TIM { TP = 0x01, TM2 = 0x03, SVIN = 0x04, VRFY = 0x06, DOSC = 0x11, TOS = 0x12, SMEAS = 0x13, VCOCAL = 0x15, FCHG = 0x16, HOC = 0x17, ...
Rust
0
.hidden], A) r_pred = min(r_pred + 1e-6, torch.FloatTensor([1]).to(device)) if not torch.isnan(r_pred): loss = criterion(r_pred, r_truth) test_loss += loss.item() preds.append(r_pred.item()) ...
Python
1
"""This module contains logging related things. And Mainly an base logger that can be used to derive child loggers""" import logging from clock.backend.logger._custom_handler import ( # noqa: F401 RichConsoleHandler, # type: ignore RichFileHandler, # type: ignore ) app_logger: logging.Logger = logging.get...
Python
1
from django.db import migrations, models import uuid from django.conf import settings class Migration(migrations.Migration): dependencies = [ ("api", "0120_add_meter_batch_key"), ] operations = [ migrations.CreateModel( name="MeteringBatch", fields=[ ...
Python
1
QQGuild_DMS = Callable[[TargetQQGuildDirect, Bot], Awaitable[int]] qqguild_dms_map: dict[SupportedAdapters, QQGuild_DMS] = {} def register_qqguild_dms(adapter: SupportedAdapters): def wrapper(func: QQGuild_DMS): qqguild_dms_map[adapter] = func return func return wrapper class QQGuildDMSMana...
Python
1
ze], pub ep_out: [USBD_EndpointTypeDef; 6usize], pub ep0_state: u32, pub ep0_data_len: u32, pub dev_state: u8, pub dev_old_state: u8, pub dev_address: u8, pub dev_connection_status: u8, pub dev_test_mode: u8, pub dev_remote_wakeup: u32, pub request: USBD_SetupReqTypedef, pub ...
Rust
0
tions { unpacked_size: lzma_rs::compress::UnpackedSize::WriteToHeader(None), }; let decode_options = lzma_rs::decompress::Options { unpacked_size: lzma_rs::decompress::UnpackedSize::ReadHeaderButUseProvided(None), memlimit: Some(0), ..Default::default() }; let mut compre...
Rust
0
Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::logs::{buffer::ArcList, message::Message}; use parking_lot::Mutex; use std::sync::Arc; #[derive(Clone)] pub struct BudgetManager { state: Arc<Mutex<BudgetState>>, } impl BudgetManager { pub fn new...
Rust
0
#----------------------------------------------------------------------------- # Copyright (c) 2019-2023, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
Python
1
#Calcular el cambio más optimo que se le debe dar a un comprador, siendo lo mejor la menor cantidad de villetes a utilziar switch = 1 while switch == 1: gastado = 0 pago = 0 vuelto = 0 bi_200 = 0 bi_100 = 0 bi_50 = 0 bi_20 = 0 bi_10 = 0 bi_5 = 0 mon_1 = 0 cent_50 = 0 cent...
Python
1
#!/usr/bin/python3 -B # Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com # # 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 # # Un...
Python
1
const PROPERTY_WIREGUARD_PUBLIC_KEY: &str = "WireGuard.PublicKey"; const PROPERTY_WIREGUARD_PEERS: &str = "WireGuard.Peers"; const PROPERTY_STATIC_IP_CONFIG: &str = "StaticIPConfig"; const PROPERTY_SAVE_CREDENTIALS: &str = "SaveCredentials"; // Property names for WireGuard in "WireGuard.Peers". const PROPERTY_PEER_PUB...
Rust
0
d("fieldName")), }; let type_ = match type_ { Some(v) => v, None => return Err(de::Error::missing_field("type")), }; let docs = match docs { Some(v) => v, None => Default::default(), }; let deprecated = match deprecated { ...
Rust
0
eq!(align_of::<MIB_UDP6ROW_OWNER_MODULE>(), 8); assert_eq!(size_of::<MIB_UDP6TABLE_OWNER_MODULE>(), 184); assert_eq!(align_of::<MIB_UDP6TABLE_OWNER_MODULE>(), 8); assert_eq!(size_of::<MIB_UDPSTATS>(), 20); assert_eq!(align_of::<MIB_UDPSTATS>(), 4); assert_eq!(size_of::<MIB_UDPSTATS2>(), 32); ass...
Rust
0
at(check_type)) except Exception as e: self.log_error(_("执行{}检查时发生异常: {}").format(check_type, str(e))) results[check_type] = { "check_type": check_type, "sql": sql, "error": str(e), "has_conflict...
Python
1
message"] = error_message # 发送WebSocket通知,处理事件循环问题 try: # 检查是否有运行中的事件循环 loop = asyncio.get_running_loop() # 如果有运行中的事件循环,使用create_task loop.create_task(broadcast_resource_update(message)) except RuntimeError: # 没有运行中的事件循环,在新线程中运...
Python
1
cted to be the `base64` decoded content /// following a `-----BEGIN RSA PRIVATE KEY-----` header. /// /// <https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem> /// /// # Example /// /// ``` /// use rsa::RSAPrivateKey; /// /// # // openssl genrsa -out tiny_key....
Rust
0
rojectDirs, drive_id: &str) -> std::path::PathBuf { let mut cache_path = project.cache_dir().to_path_buf(); if let Err(_) = std::fs::create_dir_all(&cache_path) { // let a later error sort it out } // Increment the number after `drive` when the serialized format changes. // 2021-05-23 - upda...
Rust
0
(TxtCtl.SetColor, 0x2), '#61I幻之耀晶片×20\n', (TxtCtl.SetColor, 0x0), '。', TxtCtl.Enter, ), ) CloseMessageWindow() OP_56(0x00) SetMessageWindowPos(72, 320, 56, 3) SetScenaFlags(ScenaFlag(0x02A8, 3, 0x1543)) Jump('loc_67C') de...
Python
1
TypeError else: if self.parameter_name == None: print('参数名不能为空') raise TypeError else: self.SS = SqlSaving(self.config_path, self.parameter_name, self.delete) def df_to_sql(self, df=pd.DataFrame(), delete_name=None, delet_key=None...
Python
1
# -*- coding: utf-8 -*- """ Created on Mon May 7 11:05:08 2018 @author: tghosh """ import matplotlib.pyplot as plt import matplotlib.patheffects as PathEffects import numpy as np import seaborn as sns sns.set_style('darkgrid') sns.set_palette('muted') sns.set_context("notebook", font_scale=1.5, rc...
Python
1
from abc import ABC, abstractmethod from redis.multidb.failure_detector import FailureDetector class AsyncFailureDetector(ABC): @abstractmethod async def register_failure(self, exception: Exception, cmd: tuple) -> None: """Register a failure that occurred during command execution.""" pass ...
Python
1
gular users can toggle it async fn display(ctx: &Context, msg: &Message) -> CommandResult { get_mstate!(mstate, ctx); let mut player = mstate.player.lock().await; if player.sticky.is_some() { player.sticky = None; check_msg(msg.channel_id.say(&ctx.http, "Disabled sticky display.").await);...
Rust
0
label=f"Download {row['Nome']}", data=f, file_name=os.path.basename(resum['file']), mime="application/pdf" ) if st.button('Limpar Análise'): for r in database.get_resums_by_job_id(job['id']): if os.path....
Python
1
p_if_np_lt_115 = pytest.mark.skipif(_np_version_under1p15, reason="NumPy 1.15 or greater required") skip_if_mpl = pytest.mark.skipif(not _skip_if_no_mpl(), reason="matplotlib is present") skip_if_mpl_1_5 = pytest.mark.skipif(_skip_if_mpl_1_5(), ...
Python
1
import numpy as np def assign_learning_rate(optimizer, new_lr): for param_group in optimizer.param_groups: param_group["lr"] = new_lr def _warmup_lr(base_lr, warmup_length, step): return base_lr * (step + 1) / warmup_length def const_lr(optimizer, base_lr, warmup_length, steps): def _lr_adjust...
Python
1
# **************************************************************************** # # # # ::: :::::::: # # main.py :+: :+: :+: ...
Python
1
ONTROL_MODE_A) -> Self { variant as u8 != 0 } } #[doc = "Field `reg_gpio_9_interrupt_control_mode` reader - Interrupt control mode register for GPIO9."] pub struct REG_GPIO_9_INTERRUPT_CONTROL_MODE_R( crate::FieldReader<bool, REG_GPIO_9_INTERRUPT_CONTROL_MODE_A>, ); impl REG_GPIO_9_INTERRUPT_CONTROL_MOD...
Rust
0
import json import os import re import gradio as gr from openai import OpenAI from volcenginesdkarkruntime import Ark # 初始化OpenAI客户端 client = OpenAI(api_key="sk-c4c99fecf0bb4a09bd5b74d21a728ef5", base_url="https://dashscope.aliyuncs.com/compatible-mode/v1") # 初始化Ark客户端(建议将API Key存储在环境变量 ARK_API_KEY 中)...
Python
1
if optimizer is not None: if 'optimizer_state' in checkpoint and checkpoint['optimizer_state'] is not None: logger.info('==> Loading optimizer parameters from checkpoint %s to %s' % (filename, 'CPU' if to_cpu else 'GPU')) optimizer.load_state...
Python
1
sha3.finalize(&mut output); U256::from_bytes_be(&output).into() } } impl<T: Into<ScalarFieldElement>> From<T> for PrivateKey { fn from(i: T) -> Self { Self(i.into()) } } #[cfg(test)] mod tests { use super::*; use crate::Signature; use zkp_macros_decl::u256h; #[test] fn...
Rust
0
import aws_cdk as cdk from constructs import Construct from typing import List from lib.stacks.cmk_stack import CMKStack from lib.stacks.dynamo_db_stack import DynamoDBStack class GlobalDDBTableCMK(cdk.Stack): def __init__( self, scope: Construct, id: str, table_name: str, ...
Python
1
import warnings from typing import List from sc2.ids.ability_id import AbilityId from sharpy.events import UnitDestroyedEvent from sc2.ids.unit_typeid import UnitTypeId from sc2.unit import Unit from sharpy.managers.core.roles import UnitTask from sharpy.plans.acts.act_base import ActBase class Archon(ActBase): ...
Python
1
gpt_lm_model() -> anyhow::Result<()> { // Resources paths let config_resource = Box::new(RemoteResource::from_pretrained( OpenAiGptConfigResources::GPT, )); let vocab_resource = Box::new(RemoteResource::from_pretrained( OpenAiGptVocabResources::GPT, )); let merges_resource = B...
Rust
0
ot found" except Exception as e: print(f"❌ Error checking model status: {e}") assert False, f"Error checking model status: {e}" def main(): """Main test function.""" print("🎯 MLX-GUI Audio Transcription Test") print("=" * 50) # Check server connectivity try: response ...
Python
1
} if let Some(fragment) = fragment { self.fragment = Some(Bstr::from(fragment)); } if let Some((scheme, authority, hostname_port)) = scheme_authority { self.scheme = Some(Bstr::from(scheme)); if let Some((username, password)...
Rust
0
name = quote::format_ident!("__riko_bridge_jni_{}", &function.name); // Parameters of the generated function let mut result_params = vec![ quote! { _env: ::jni::JNIEnv }, quote! { _class: ::jni::objects::JClass }, ]; // Function arguments placed at the invocation of the original functi...
Rust
0
t((r_addr1, r_addr2), hop): v_addr1, v_addr2 = hop.inputargs(Address, Address) return hop.genop('adr_gt', [v_addr1, v_addr2], resulttype=lltype.Bool) def rtype_ge((r_addr1, r_addr2), hop): v_addr1, v_addr2 = hop.inputargs(Address, Address) return hop.genop('adr_ge', [v_addr1, v_addr...
Python
1
# -*- coding: utf-8 -*- """ @author: Jiasen reference: https://nlp.seas.harvard.edu/annotated-transformer/ """ # import torch import numpy as np class LossCompute: "A loss compute supervised training loss KL divergence." def __init__(self, generator, criterion): self.generator = generator ...
Python
1
rray<T>, rhs: T) -> Result<BooleanArray> where T: NativeType + core::cmp::PartialOrd, { compare_op_scalar(lhs, rhs, |a, b| a > b) } /// Perform `left >= right` operation on two arrays. Non-null values are greater than null /// values. pub fn gt_eq<T>(lhs: &PrimitiveArray<T>, rhs: &PrimitiveArray<T>) -> Result<...
Rust
0
s + 1): steps = 0 self.reset() while True: currentState = self.state action = self.chooseAction(valueFunction, currentState) nxtState = self.takeAction(action) # next state reward = self.giveReward(nxtState) # next sta...
Python
1
let mb_vlrSrc = doesVRegHaveXXat(/*xxIsLastUse=*/ true, rSrcV, iix); let mb_rlrDst = doesRRegHaveXXat(/*xxIsLastUse=*/ false, rDstR, iix); if mb_vlrSrc.is_some() && mb_rlrDst.is_some() { let vlrSrc = mb_vlrSrc.unwrap(); hints[vlrSrc].push(Hint:...
Rust
0
', '589824|163840', 'tdlwldlwl987', '깨꼬닥789', '65536|163840', 'xp1181', '멜씨00', '65536|163840', 'you1gop', '쇼술 # ', '589824|163840', 'thellonice05', 'bananaice', '537477632|32768', 'qetsaczmp(2)', '도비세레나데', '65536|163840', 'breathe4653(3)', '브리스', '589856|163840', 'jkpark2006', '박래몬', '536952832|32768', 'hyeok2780', 'U...
Python
1
_PUSH, /// Pull (Pipeline) /// /// See [nn_pipeline(7)](http://nanomsg.org/v1.1.2/nn_pipeline.html) Pull = NN_PULL, /// Surveyor (Survey) /// /// See [nn_survey(7)](http://nanomsg.org/v1.1.2/nn_survey.html) Surveyor = NN_SURVEYOR, /// Respondent (Survey) /// /// See [nn_surve...
Rust
0
""" Cipher/scrambling routines """ __all__ = [ 'jl_enc_cipher', 'jl_crc_cipher', 'jl_rxgp_cipher', 'cipher_bytes' ] from jltech.crc import jl_crc16 #-----------------------------------------------------------------------# def jl_enc_cipher(buff, off, size, key=0xFFFF): """ JieLi "ENC" cipher """...
Python
1
s) def condition_score(self, cond_fn, *args, **kwargs): return super().condition_score(self._wrap_model(cond_fn), *args, **kwargs) def _wrap_model(self, model): if isinstance(model, _WrappedModel): return model return _WrappedModel( model, self.timestep_map, sel...
Python
1
/// Returns the current interfaces pub fn interfaces(&self) -> &[InterfaceDescriptionBlock<'static>] { &self.interfaces[..] } /// Returns the InterfaceDescriptionBlock corresponding to the given packet pub fn packet_interface(&self, packet: &EnhancedPacketBlock) -> Option<&InterfaceDescri...
Rust
0
from __future__ import annotations import importlib import sys def test_builtin_prices_used_by_default(monkeypatch) -> None: # Ensure no local module and no env JSON sys.modules.pop('circuitron._model_prices_local', None) monkeypatch.delenv('CIRCUITRON_PRICES_FILE', raising=False) monkeypatch.delenv(...
Python
1
) await img.text(str(total_count), (372, 467), 84, fm.get('bahnschrift_regular', 48, 'Regular'), '#252525', 'center') await img.text('未出五星', 562, 137, fm.get('hywh', 24), (24, 24, 24, 102)) await img.text(str(not_out), (562, 655), 84, fm.get('bahnschrift_regular', 48, 'Regular'), ...
Python
1
m_num_l0_files.get_recent(); // do special check on start, see the comment of the variable definition for detail. if checker.on_start_l0_files { if num_l0_files < self.l0_files_threshold || checker.long_term_num_l0_files.trend() == Trend::Increasing { ...
Rust
0
NTSTATUS Status; } AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO; // This is really defined as a messy union to allow stuff like // i.DUMMYSTRUCTNAME.LowPart, but we don't need those complications. // Under all that it's just an int64. typedef int64_t LARGE_INTEGER; typedef struct _AFD_POLL_INFO { LARGE_INTEGER Ti...
Python
1
analyze_prompt = [ { "role": "system", "content": """\ Your task is to refine the prompt given to the model to improve its performance. Here are the original prompt instructions given to the model: {PROMPT} Here is a list of failure cases for the given prompt: {FAILURE_CASES} Note that the ground...
Python
1
rfumr#857e] and stop 0x00d7, 0x857e, // end of bitcast.i64 (I64) // 000015: bnot.i64 (I64) // --> [DynRexOp1ur#a0f7] and stop // 000015: bnot.b64 (I64) // --> [DynRexOp1ur#a0f7] and stop 0x0157, 0xa0f7, // end of bnot.b64 (I64) // end of bnot.i64 (I64) // 000017: bor.i64 (I64) ...
Rust
0
t the container size required_adjustment = total_hint - 1 possible_adjustment = min(required_adjustment, total_adjustable_hint) for c in constraints: adjustable_size = c.hint - c.min / container_size c.hint -= possible_adjustment * (adjustable_size / t...
Python
1
lien_fichier = 'Input_Data/Day_14.txt' with open(lien_fichier) as f: data = f.read().strip().split("\n") def partie1(d): L, H = 101, 103 t = 100 rx, ry, vx, vy = [], [], [], [] for l in d: l = l.strip() p, v = l.split(" v=") p = p.split("p=")[1] px, py = p.split(...
Python
1
c373cc7696ba124e8635d41b0ea581112b67817261),\ c:pk_k(0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352)\ )))"; hprintln!("descriptor {}", descriptor).unwrap(); let desc = miniscript::Descriptor::<miniscript::bitcoin::PublicKey>::from_str(descriptor).unwrap(); // Derive ...
Rust
0
并行添加所有的骨架 dir = keyShaped[kintree[:, 1]] - keyShaped[kintree[:, 0]] dir_normalized = dir / torch.norm(dir, dim=-1, keepdim=True) # res: (nFrames, nLimbs, 3) res = lengths3d_est[..., None] * dir_normalized[None] - dir[None] res = conf * res.reshape(-1, 1) ...
Python
1
accumulate(weights1)) del unused[ch] last_ch = ch length += len(word) tw = CJKTextWrapper(width=40) return tw.fill(''.join(result)) if __name__ == '__main__': if len(sys.argv) < 2 or sys.argv[1] == 'zhs': char_list = set(load_simplewordlist('wordlist/zhs_chars_7000....
Python
1
# Copyright 2015 Red Hat, Inc. # # 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 agre...
Python
1
epoch_secs() -> u64 { time::SystemTime::now() .duration_since(time::SystemTime::UNIX_EPOCH) .unwrap() .as_secs() } fn f_to_c(temp_f: f64) -> f64 { (temp_f - 32.0) * 5.0 / 9.0 } fn c_to_f(temp_c: f64) -> f64 { temp_c * 1.8 + 32.0 } const NAN: f64 = -255.0; fn get_area_data( co...
Rust
0
"""FastAPI application for image-to-video generation using Stable Diffusion.""" import json import os from io import BytesIO import uvicorn from fastapi import FastAPI, File, Form, UploadFile from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import HTMLResponse from fastapi.staticfiles import ...
Python
1
th = "terra_u64_format")] pub max_contract_gas: u64, #[serde(with = "terra_u64_format")] pub max_contract_msg_size: u64, } #[allow(missing_docs)] #[derive(Deserialize, Serialize, Debug)] pub struct WasmParameterResult { #[serde(with = "terra_u64_format")] pub height: u64, pub result: WasmParamet...
Rust
0
pub character_name: String, pub health: f32, pub max_health: f32, pub energy: f32, pub max_energy: f32, pub items: Items, } impl NewCharacter { pub fn parse(val: Parameters) -> Option<Message> { info!("NewCharacter parameters: {:?}", val); let source = decode_number!(val, ...
Rust
0
nsure \n Will is able to access information from previous runs.""".format(key) ) else: error( """ENABLE_INTERNAL_ENCRYPTION is turned on, but a SECRET_KEY has not been given.\n ...
Python
1