text
string
label_name
string
labels
int64
from __future__ import annotations from langchain_core.tools import tool from talos.tools.supervised_tool import SupervisedTool from tests.simple_supervisor import SimpleSupervisor @tool def dummy_tool(x: int) -> int: """A dummy tool.""" return x * 2 def test_supervised_tool_unsupervised() -> None: su...
Python
1
| Author: lyzh(Zhihang-liu) github.com/Zhihang-Liu |_| \\__/ |_\\___._|_| |___/ | Target: ".to_string() + arch_info + "-" + os_info + "-" + env_info + "\n\n" + "help-list: use = type \tuse (help?) get docs (unavailable). \tuse (exit!) or try use Ctrl-C quit repl. " } fn main() { println!("{}", c...
Rust
0
r(u8), FirstBoard(u8), /*EndgameBoard(u8), DeathBoard(u8), EndgameTeleportX(u16), EndgameTeleportY(u16), GameOverSfx(bool), DeathTeleportX(u16), DeathTeleportY(u16), StartingLives(u16), LivesLimit(u16), StartingHealth(u16), HealthLimit(u16), EnemyBulletsHurtOthers(boo...
Rust
0
ed_dev.get() }.$ctrl.modify(|_, w| { w.auxsrc().clksrc_gpin0(); w }); } } }; } macro_rules! gpin1_auxsource { ($name:ident, $ctrl:ident) => { impl Gpin1ClockAuxSource for $name { fn set_gpin1_auxsrc(&mut self) { ...
Rust
0
from itertools import zip_longest from .base import registry # These imports add the allocator classes in those files to the registry. from . import dumb from . import direct from . import hungarian def copy_panels_to_debates(debates, panels): """Copies the adjudicators in the given `panels` to the given `debate...
Python
1
et; use amethyst_assets::prefab::{serde_diff, SerdeDiff}; use amethyst_core::{ ecs::*, transform::{Children, Parent}, }; use amethyst_window::ScreenDimensions; use derivative::Derivative; use glyph_brush::{HorizontalAlign, VerticalAlign}; use serde::{Deserialize, Serialize}; #[cfg(feature = "profiler")] use th...
Rust
0
import os import zipfile def compress_map(map_path): with zipfile.ZipFile(f"{os.path.splitext(os.path.basename(map_path))[0]}.zip", "w") as zip_archive: zip_archive.write(map_path, os.path.basename(map_path), zipfile.ZIP_DEFLATED) zip_archive.close() def decompress_map(zip_map_path, output_folder...
Python
1
a_interp = "Negative affinity (elements repel from groups)" if b_param < -0.5: b_interp = "Negative barrier (easy to form new groups)" elif b_param < 0: b_interp = "Low barrier (moderately easy to form new groups)" elif b_param < 0.5: b_interp ...
Python
1
w_closest_booking_time = service.users[0].closest_booking_time + 1000 * 60 * 60; let service = admin_client .service .update_user(UpdateServiceUserInput { service_id: service.id.clone(), user_id: user.id.clone(), availibility: None, buffer: None, ...
Rust
0
2, kernel_size=1) self.key_conv = nn.Conv1D( in_channels=in_dim, out_channels=in_dim // 2, kernel_size=1) self.value_conv_vis = nn.Conv1D( in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.value_conv_word = nn.Conv1D( in_channels=in_dim, out_channel...
Python
1
# Authors: see git history # # Copyright (c) 2024 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. from inkex import Boolean, DirectedLineSegment from ..commands import add_commands from ..svg import PIXELS_PER_MM from .base import InkstitchExtension class JumpToTrim(Ink...
Python
1
), /// A list of unmined transactions. Transactions(Vec<UnminedTx>), /// A list of unmined transaction IDs. /// /// v4 transactions use a legacy transaction ID, and /// v5 transactions use a witnessed transaction ID. TransactionIds(Vec<UnminedTxId>), } <filename>src/models/bt_billing_allow...
Rust
0
tifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense,...
Rust
0
price_of_house= 1000000 currency= "$" user_input=input("Enter true if you have a good credit or false if you don't? ").lower() if user_input== "true": print("Because you have a good credit, you are required to pay...") cal=str((price_of_house * 0.10 )) print("$" + cal) elif user_input== "false": print(...
Python
1
\", label=", node.name, colour )?; let qualifier = node.specifics.qualifier(); format_node_label( w, node.name, &qualifier, node.inputs, node.outputs, )?; writeln!(w, "];")?; } Ok(()) } fn node_colo...
Rust
0
: f64, pub pix_area_2: f64, pub stats: RasterDiffStats, } #[derive(Serialize, Clone, Default)] pub struct RasterDiffStats { count: usize, first: PixelStats, second: PixelStats, diff: PixelStats, abs_diff: PixelStats, } impl AddAssign<(f64, f64)> for RasterDiffStats { fn add_assign(&mut ...
Rust
0
of an enum variant that takes an associated value: let op3 = OperationWithLabel::Set(String::from("set")); let op4 = OperationWithLabel::Check(100); println!("Enum variants: {:?}, {:?}", op3, op4); // Calling a method on an enum variant: op1.execute(); // The Option enum in the standard libra...
Rust
0
call + ---> + 12 // | | // | + <--- + return // | | // | + <--- + return // | | // + <--- + revert // | .with_contract_deployed2(address(10), callrevert_contract(11),...
Rust
0
reserved17: [u8; 48usize], #[doc = "0xd0 - WDT clock source select"] pub wdtclksel: WDTCLKSEL, #[doc = "0xd4 - WDT clock source update enable"] pub wdtclkuen: WDTCLKUEN, #[doc = "0xd8 - WDT clock divider"] pub wdtclkdiv: WDTCLKDIV, _reserved20: [u8; 4usize], #[doc = "0xe0 - CLKOUT clock ...
Rust
0
): criterion = torch.nn.CrossEntropyLoss() metric_logger = utils.MetricLogger(delimiter=" ") header = 'Test:' # switch to evaluation mode model.eval() for batch in metric_logger.log_every(data_loader, 10, header): images = batch[0] target = batch[-1] images...
Python
1
} pub mod xor; <gh_stars>0 extern crate narm; mod common; use common::*; use narm::narmvm::*; /* Integration tests for Sub operators Note that ARM uses inverted carry flag for subtractions, so c flag is always set *unless* there is a signed overflow This is a computational simplification related to 2-complement rep...
Rust
0
d: Rc<glium::VertexBuffer<XyVertex>>, pub globe_texture: Rc<glium::Texture2d>, pub globe_gl_buf: LonLatGlBuffers, pub graticule_gl_buf: LonLatGlBuffers, pub map_gl_buf: LonLatGlBuffers, pub cylindrical_lambert_views: Vec<CylindricalLambertView>, pub gnomonic_views: Vec<GnomonicView>, ...
Rust
0
<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// /// let db = env.create...
Rust
0
, Copy, Debug, PartialEq)] pub enum BUF4TO1I1_A { #[doc = "0: The corresponding buffer has no occurrence of successfully completed transmission or reception when MCR\\[RFEN\\]=0."] _0, #[doc = "1: The corresponding buffer has successfully completed transmission or reception when MCR\\[RFEN\\]=0."] _1, }...
Rust
0
S::Ok, S::Error> { u64::serialize(&self.as_sat(), s) } fn des_sat<'d, D: Deserializer<'d>>(d: D) -> Result<Self, D::Error> { Ok(Amount::from_sat(u64::deserialize(d)?)) } fn ser_btc<S: Serializer>(self, s: S) -> Result<S::Ok, S::Error> { f64::serialize(...
Rust
0
import pandas as pd # get first look def getfirstlook(df, nrows=5, uniqueids=None): out = {} out['head'] = df.head(nrows) out['dtypes'] = df.dtypes out['nrows'] = df.shape[0] out['ncols'] = df.shape[1] out['index'] = df.index if (uniqueids is not None): out['uniqueids'] = df[uniqueids].nunique() re...
Python
1
let mut len = 0; let mut name = [0; MAX_DOMAIN_LEN-1]; // Ingore last byte \0 loop { if offset >= maxlen { return Err(Error::SmallBuf) } let c = msg[offset] as usize; offset += 1; match c & 0xc0 { 0x00 =...
Rust
0
gger.info("Skipping code extraction, completed in previous run.") return # Fetch device device = get_device(use_cuda=True) save_opt = save_folder / OPT_FILE data_folder = pl.Path(data_folder) # Fetch K-means model kmeans_folder = pl.Path(kmeans_folder) kmeans_ckpt = kmeans_folder ...
Python
1
.await .map_err(|err| std::io::Error::from(err))??; } Ok(()) } #[instrument(skip(cache_and_http, rec, folder))] async fn save_single_recording( cache_and_http: CacheHttp, guild_id: GuildId, user_id: UserId, mut rec: Vec<VoiceRecording>, folder: PathBuf, first_start_time: ...
Rust
0
//! - nrf52832: Section 35 //! - nrf52840: Section 6.34 use core::cell::UnsafeCell; use core::cmp::min; use core::marker::PhantomPinned; use core::ops::Deref; use core::pin::Pin; use core::ptr; use core::sync::atomic::{compiler_fence, Ordering}; use core::task::{Context, Poll}; use embedded_hal::digital::v2::OutputPi...
Rust
0
foo", "#check bar", "#check baz", "***/", ])) .script; Debugger::mock().assign_correlation_ids( &mut script, &Arc::from("debug"), &PhaseConfig::Live, ); assert_eq!( script.statements, ...
Rust
0
t) pass_pipeline = [ { '$match': { 'actual_result': True } }, { '$group': { '_id': { 'id': '$id', 'name': '$name', }, ...
Python
1
8; 8] = [0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70]; /// @see (https://doc.rust-lang.org/book/second-edition/ch11-03-test-organization.html) #[cfg(test)] mod tests { extern crate assert_cli; extern crate tempfile; /// cargo test -- --nocapture // use super::*; use std::env; use std::fs::Fi...
Rust
0
xtra> { pub signature: Option<(GenericAddress, MultiSignature, SignedExtra)>, pub function: Call, } impl<Call, SignedExtra> UncheckedExtrinsicV4<Call, SignedExtra> where Call: Encode, SignedExtra: Encode, { pub fn new_signed( function: Call, signed: GenericAddress, signature...
Rust
0
, vmin=-2.0, vmax=2.0) fig.colorbar(ax20, ax=ax[2, 0]) ax21 = ax[2, 1].imshow(bumps_closing, vmin=-2.0, vmax=2.0) fig.colorbar(ax21, ax=ax[2, 1]) ax22 = ax[2, 2].imshow(delta_closing, vmin=-2.0, vmax=2.0) fig.colorbar(ax22, ax=ax[2, 2]) ax30 = ax[3, 0].imshow(bumps, vmin=-2.0, vmax=2.0) fig...
Python
1
ctors[isna] = None # Write back to df dataframe[f"{to_embed}_vector"] = vectors.tolist() # If vector database is provided, add the vectors to it if vector_db: dataframe[f"{to_embed}_uuid"] = [str(uuid4()) for _ in range(len(dataframe))] for_vector_db = datafram...
Python
1
baader(&self, other: &Term, env: &mut Env) -> Result<(), UnifError> { let mut fst = self.clone(); let mut snd = other.clone(); let mut eqs = vec![(&mut fst, &mut snd)]; solve(&mut eqs, env) } pub fn equation(&self) -> Option<(&Term, EqnOp, &Term)> { matc...
Rust
0
.PSS.MAX_LENGTH), hashes.SHA256() ) return True except Exception: return False # RSA-4096 with SHA-256 OAEP leaves ~446 bytes of plaintext capacity RSA_OAEP_SHA256_MAX_PT = 512 - (2*32 + 2) # bytes (k - 2*hLen - 2 for k=512, hLen=32) def oaep_plaintext_limit_bytes(pub) -> int...
Python
1
# -*- coding=utf-8 -*- # library: jionlp # author: dongrixinyu # license: Apache License 2.0 # email: dongrixinyu.89@163.com # github: https://github.com/dongrixinyu/JioNLP # description: Preprocessing & Parsing tool for Chinese NLP # website: https://www.jionlp.com from jionlp.util.funcs import absence # ---------...
Python
1
\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c \xd0\xbd\xd0\xb5 \xd0\xbd\xd0\xb0\xd0\xb9\xd0\xb4\xd0\xb5\xd0\xbd\xd0\xb0', 'record id': 'id \xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd0\xb8', 'selected': '\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xbe', 'state': '\xd1\x81\xd0\xbe\xd1\x81\xd1\x82\xd0\xbe\xd1\x8f\xd0\...
Python
1
sername: self.code.client_id, password: Some(<PASSWORD>) })) .header(ContentType(mime!(Application / WwwFormUrlEncoded))) .body(&input) .send() .chain_err(|| "Failed to finish HTTP request")?; let mut buffer = Vec::new(); response.read_to_end(&mut buffer)...
Rust
0
num = 7 while num != 7: num = num + 1 print(num)
Python
1
bevy_egui::egui::Window::new("Delete Realm").anchor(bevy_egui::egui::Align2::CENTER_CENTER, [0.0, 0.0]).collapsible(false).show(&ui, |ui| { ui.horizontal(|ui| ui.label("Are you sure you want to delete this realm?")); ui.horizontal(|ui| { if ui.button("Delete").clicked() { ...
Rust
0
Vote}; use assert_fs::TempDir; use chain_impl_mockchain::block::BlockDate; use chain_impl_mockchain::key::Hash; use jormungandr_testing_utils::testing::asserts::VotePlanStatusAssert; use jormungandr_testing_utils::testing::node::time; use jormungandr_testing_utils::testing::BlockDateGenerator; use jormungandr_testing_u...
Rust
0
://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ckgr_pllbr](index.html) module"] pub struct CKGR_PLLBR_SPEC; impl crate::RegisterSpec for CKGR_PLLBR_SPEC { type Ux = u32; } #[doc = "`read()` method returns [ckgr_pllbr::R](R) reader structure"] impl crate::Readable for C...
Rust
0
for RDLR_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } <reponame>tlively/wasm-bindgen #![allow(unused_imports)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcRtpSourceEntryType` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activa...
Rust
0
# PSPNet DDCAT model configuration for Cityscapes config = { "model": "pspnet_ddcat", "model_path": "/workspace/ckpt/pretrained_model/pretrain/cityscapes/pspnet/ddcat/train_epoch_400.pth", "data_dir": "/workspace/datasets/cityscapes", "device": "cuda", "dataset": "cityscapes", "layers": 50, ...
Python
1
// Test instances along axis 0. let assignments = cluster_assignments(centroids.view(), instances.view(), Axis(0)); assert_eq!(assignments, array![0, 2, 0, 2, 1, 3, 0]); // Test instances along axis 1. let assignments = cluster_assignments(centroids.view(), instances.t(), Axis(1)...
Rust
0
Whitespace@6..7 " " ExportItem@7..10 KwAll@7..10 "all" Comma@10..11 "," Whitespace@11..12 " " ExportItem@12..15 KwAll@12..15 "all" Comma@15..16 "," Whitespace@1...
Rust
0
def _update_upload_progress() -> None: """Update the upload progress for each file.""" global upload_message_queue # noqa: PLW0602 if submit_form.metadata is None: return while not upload_message_queue.empty(): message = upload_mes...
Python
1
let next = match self { Self::Initialised(init) => Self::Validated(init.validate(access).await?), Self::Validated(valid) => Self::Optimized(valid.optimize(access).await?), Self::Optimized(optim) => Self::Planned(optim.plan(access).await?), Self::Planned(planned) =...
Rust
0
if self.content_panel: self.content_panel.kill() self.content_panel = None # キャラクターデータをリセット self.character_data = { "name": "", "race": "", "class": "", "stats": None } super().destroy() l...
Python
1
_thread_fns.push(f), } } if !render_thread_fns.is_empty() { let engine_copy = self.clone(); self.post_render_thread_task(move || { for f in render_thread_fns { f(&engine_copy); } }); } ne...
Rust
0
from HMM import HMM import unittest import numpy as np class HMMTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_decode_assignment(self): pi = np.array([0.3,0.7]) print(pi) A = np.array([[0.1,0.9],[0.8,0.2]]) B = np.array([[0.7,0.1,0.2...
Python
1
mut self) { self.file.set_len(0).expect("Can't truncate the file"); self.file.seek(SeekFrom::Start(0)).expect("Can't set cursor position"); if let Some(trait_definition) = &self.trait_definition { serde_json::to_writer(&self.file, &trait_definition.0.to_token_stream().to_string()) ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' batch_payroll_move_lines = fields.Boolean( related='company_id.batch_payroll_move_lines'...
Python
1
ORY_SBRK: ::libc::c_uint = 5; pub const VM_MEMORY_REALLOC: ::libc::c_uint = 6; pub const VM_MEMORY_MALLOC_TINY: ::libc::c_uint = 7; pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::libc::c_uint = 8; pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::libc::c_uint = 9; pub const VM_MEMORY_ANALYSIS_TOOL: ::libc::c_uint = 10; pub cons...
Rust
0
ascii_art(&self) -> &str { match self.kind { EnemyType::Rat => art::RAT, EnemyType::Bat => art::BAT, EnemyType::Boss => art::BOSS, } } pub fn get_random_enemy(enemies: &[Enemy]) -> &Enemy { let index = rand::thread_rng().gen_range(0..enemies.len()); ...
Rust
0
ub struct Movement { pub speed: f64, pub on_ground: bool, } impl Component for Movement { type Storage = VecStorage<Self>; }<gh_stars>0 use failure::Fail; #[macro_export] macro_rules! log { ($($arg:tt)*) => { eprintln!("\x1b[1m[zshrug]\x1b[0m {}", format_args!($($arg)*)) }; } #[macro_export] macro_rule...
Rust
0
Transformation2, } unsafe impl bytemuck::Zeroable for SpriteInstance {} unsafe impl bytemuck::Pod for SpriteInstance {} impl VertexType for SpriteInstance { const LOCATIONS: &'static [VertexLocation] = { let mut offset = 0; &[ vertex_location!(offset, Rect), vertex_locatio...
Rust
0
# File : __init__.py.py # Time :2024/4/2 12:00 # Author :nacl # Version :python 3.12 # Description:空间缓存 import collections import copy import functools import sys from . import BaseData, BaseCache DEFAULT_MAX_ONE_SIZE = 1024 * 1024 * 5 # 当条数据最大缓存,5M DEFAULT_MAX_SUM_SIZE = 1024 * 1024 * 50 # 全部数据最...
Python
1
OSURE: u8 = 0x4f; // R[A] := closure(KPROTO[Bx]) pub const OP_VARARG: u8 = 0x50; // R[A], R[A+1], ..., R[A+C-2] = vararg pub const OP_VARARGPREP: u8 = 0x51; // (adjust vararg parameters) pub const OP_EXTRAARG: u8 = 0x52; // extra (larger) argument for previous opcode /// order op pub const OPCODES: &[OpCode] = &[ ...
Rust
0
ación (sólo vuelos cancelados) --- # df[df['Cancelled']==1] # → Filtra solo los vuelos cancelados (Cancelled == 1) # ['CancellationCode'] # → Selecciona la columna que indica el motivo de la cancelación # .value_counts() # → Cuenta cuántas veces aparece cada código (A, B, C, D) cancel_counts = df[df['Cancelled']==1]['C...
Python
1
import sys from time import sleep import datachain as dc if sys.platform == "win32": # This is needed for this process to accept a Ctrl-C event in Windows, # when run under pytest as a subprocess. # This is not needed when running normally from the command line. import ctypes kernel32 = ctypes.Wi...
Python
1
728_947_672_941_78_e-05; /* 0x_3EFA_01A0, 0x_19CB_1590 */ const C4: f64 = -2.755_731_435_139_066_330_35_e-07; /* 0x_BE92_7E4F, 0x_809C_52AD */ const C5: f64 = 2.087_572_321_298_174_827_90_e-09; /* 0x_3E21_EE9E, 0x_BDB4_B1C4 */ const C6: f64 = -1.135_964_755_778_819_482_65_e-11; /* 0x_BDA8_FAE9, 0x_BE88_38D4 */ // kern...
Rust
0
u8, data_len: usize) -> StagingBuffer; fn vk_staging_buffer_destroy(vk: *mut Vulkan, staging: *mut StagingBuffer); fn vk_staging_buffer_start_transfer(vk: *mut Vulkan) -> vk::CommandBuffer; fn vk_staging_buffer_end_transfer(vk: *mut Vulkan, transfer_buffer: vk::CommandBuffer); fn vk_create_glyph(vk: *...
Rust
0
print("") try: import colorama except ImportError: print(result.center(79, "=")) else: colorama.init() result = result.center(79, "=") if succeeded == attempted: result = "\33[32m" + result + "\33[39m" else: result = "\33[31m" + result + "\33[39m" print(result) print(""...
Python
1
alue), # Pass audio file or numpy array name=title, # The name of distributions step=step, # Step index (optional) context=self.context, ) def train_step_stats(self, step, stats): self.context = {"subset": "train"} super().train_step_st...
Python
1
import random import pandas as pd # Генерация DataFrame lst = ['robot'] * 10 + ['human'] * 10 random.shuffle(lst) data = pd.DataFrame({'whoAmI': lst}) # Получение уникальных значений из столбца 'whoAmI' unique_values = data['whoAmI'].unique() # Создание one-hot представления без использования get_dummies one_hot_enc...
Python
1
b browser." ], redirect_uri = redirect_uri, session_id = session_id, ) } /// Create a TCP connection to a postgres database, authenticate with it, and receive the ReadyForQuery message async fn connect_to_db( db_info: DatabaseInfo, ) -> anyhow::Result<(String, tokio::net::TcpStream, Can...
Rust
0
`\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] pub struct LSA_FOREST_TRUST_DOMAIN_INFO { pub Sid: super::super::super::Foundation::PSID, pub DnsName: super::super::super::Foundation::UNICODE_STRING, pub NetbiosName: super::super::super::Foundation::UNICODE_STRING, } #[cfg(feature = "Win32_F...
Rust
0
arr| { if arr.is_empty() { Err(EvalError::IndexOutOfRange((0, 0))) } else { Ok(arr.last().unwrap().clone()) } }) } fn rest(args: Vec<Object>) -> Result<Object, EvalError> { let req_param_num = 1; apply_arr_func("rest()", &args, req_param_num, |arr| { i...
Rust
0
type of RR. /// ``` pub fn query_type(&self) -> RecordType { self.query_type } /// ```text /// QCLASS a two octet code that specifies the class of the query. /// For example, the QCLASS field is IN for the Internet. /// ``` pub fn query_class(&self) -> ...
Rust
0
otifyGiveIndexedFromISR"] #[doc = " \\ingroup TaskNotifications"] pub fn vTaskGenericNotifyGiveFromISR( xTaskToNotify: TaskHandle_t, uxIndexToNotify: UBaseType_t, pxHigherPriorityTaskWoken: *mut BaseType_t, ); } extern "C" { #[doc = " task. h"] #[doc = " <pre>"] #[doc = "...
Rust
0
{e}") return ui_handled def _update_systems(self) -> None: """システム更新処理 GameManagerの_update_systemsから抽出。 """ # FPS制限と時間更新 time_delta = self.clock.tick(self.target_fps) / 1000.0 if self.clock else 0.016 # 入力マネージャー更新 if sel...
Python
1
import cv2 from cvzone.HandTrackingModule import HandDetector # Initialize the hand detector detector = HandDetector(detectionCon=0.8, maxHands=2) # Open the webcam cap = cv2.VideoCapture(0) while True: # Read the frame success, img = cap.read() # Detect hands in the frame hands, img = detector.find...
Python
1
.put_nodes_into_subgraphs() subgraphs = self.remove_small_acc_subgraphs(subgraphs) acc_subgraphs_count = len([s for s in subgraphs if s.is_acc]) non_acc_subgraphs_count = len(subgraphs) - acc_subgraphs_count print(f"Got {acc_subgraphs_count} acc subgraphs and {non_acc_subgraphs_count} no...
Python
1
# Database connection setup DATABASE_CONFIG = { 'username': 'tmannam', 'password': 'zdnspze35349F%', 'hostname': 'luboradb.ad.uwm.edu', 'port': '1521', 'service_name': 'orclpdb.ad.uwm.edu' }
Python
1
from config.config import settings class Constant: """Class for organizing constants.""" # website names CODEFORCES = 'codeforces' LOGO = 'https://raw.githubusercontent.com/sudiptob2/cf-stats/main/assets/cflogo.svg' # API endpoints USER_INFO = 'https://codeforces.com/api/user.info?handles={0...
Python
1
2, 2304], '0.82': [1792, 2176], '0.88': [1920, 2176], '0.94': [1920, 2048], '1.00': [2048, 2048], '1.07': [2048, 1920], '1.13': [2176, 1920], '1.21': [2176, 1792], '1.29': [2304, 1792], '1.38': [2304, 1664], '1.46': [2432, 1664], '1.67': [2560, 1536], '1.75': [2688, 1536], '2.00': [2816, 1408], '2.09': [2944, 140...
Python
1
4462, 1206.72876414, 10.33311542], [-32388646.84104986, 27004804.37195345, -165874.85452439], [0.78027439, 0.40162218, 22.96872279], 153.51867545, (330.17317044, -12.17578748), (177.27392574, -11.95046228), [ [9.99936381e-01, 1.0344...
Python
1
ertRecordReq { session_id, device_id, measurements, values, timestamp, } } pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result<TSInsertRecordReq> { i_prot.read_struct_begin()?; let mut f_1: Option<i64> = None; let mut f_2: Option<String> = No...
Rust
0
, htlc_maximum_msat: OptionalField::Absent, fee_base_msat: 0, fee_proportional_millionths: 0, excess_data: vec![], } } } pub struct TestRoutingMessageHandler { pub chan_upds_recvd: AtomicUsize, pub chan_anns_recvd: AtomicUsize, pub chan_anns_sent: AtomicUsize, pub request_full_sync: AtomicBool, } i...
Rust
0
// malicious or mistaken expressions that encode very large invariant text, /// namely via repetitions. /// /// This limit is independent of the back end encoding. This code does not rely /// on errors in the encoder by design, such as size limitations. const MAX_INVARIANT_SIZE: InvariantSize = InvariantSize::new(0x100...
Rust
0
reloaded).unwrap(); assert_eq!(message_bytes, decoded_message_from_disk); } #[test] #[ignore] fn test_image_multi_bit_re_max_diff_with_save() { let original_image_path = "test/RealisticTestImage.jpg"; let encoded_image_path = "test/RealisticTestImageMultiBit.png"; println!("original image path: {}", o...
Rust
0
lways)] pub fn enabled(self) -> &'a mut W { self.variant(TRIGGERED5_A::ENABLED) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut...
Rust
0
::path::Path; use sp_keyring::AccountKeyring; use substrate_subxt::{ balances::TransferCallExt, ClientBuilder, KusamaRuntime as NodeTemplateRuntime, PairSigner, }; use tempdir::TempDir; #[async_std::test] #[ignore] async fn test_client() { env_logger:...
Rust
0
self.dfs_span_insert(&mut child_span, child_node, level); Some((span_key, child_span)) }) .collect(); } fn sorted_children(&self, node: NodeIndex) -> impl Iterator<Item = NodeIndex> { let mut children = self .dag .children...
Rust
0
print('-------------------------------------') # BRANCHING STATEMENTS - break, continue, pass print('---------------BREAK------------------') for i in range (1, 6): print(i) if i == 3: break print('--------------CONTINUE----------------') for i in range(1, 6): if i == 3 or i == 4: continue...
Python
1
omile-time. ExpressionFlow::Jump(Flow::Continue) => panic!( "internal error: unexpected continue: Don't call continue in `while` condition" ), ExpressionFlow::Jump(Flow::Break) => panic!( "internal error: unexpected break: Don't cal...
Rust
0
import sys, pysqlite3 sys.modules["sqlite3"] = pysqlite3
Python
1
ident = &path.segments.last().unwrap().ident; let janetrs_expected = syn::Ident::new("janetrs", janetrs_mod.span()); let janet_expected = syn::Ident::new("Janet", janet_ident.span()); *janetrs_mod == janetrs_expected && *janet_ident == janet_expected }, _ => false, ...
Rust
0
ts = int(time.time()) if self.available_timeout != 0: # available based on last_seen value and gw.available is_available = False for gw, last_seen in list(self.last_seen.items()): if ts - last_seen < self.available_timeout: if gw.a...
Python
1
import pandas as pd import joblib # Provided input data in the correct format input_data = [1,1,1,1,1,1,2,1,1,1,2,1,1,0,0,0,2,0,1,1,0,1,1,2,1,2,1,1,1,2,1,1,1,0,1,0] # Assuming the column names based on your first message columns = [ "RBC", "HCT", "HGB", "MCV", "MCH", "MCHC", "RDW", "RETIC", "Rchem", "WBC", "...
Python
1
from flask import Flask, render_template, request, send_file from docx import Document from docx.shared import Pt,RGBColor import os import json app = Flask(__name__) def set_cell_margins(cell, top=0, bottom=0, left=0, right=0): cell.paragraphs[0].paragraph_format.space_before = Pt(top) cell.paragraphs[0].par...
Python
1
import heapq def initialize(): initial_state = (('x', 'x', 'x'), ('x', 'x', 'x'), ('x', '43', 'x')) goal_sums = {'row1': 105, 'col1': 120, 'diag': 99} num_range = set(range(12, 47)) visited_costs = {} visited_costs[initial_state] = 0 queue = [(0, 0, [], initial_state)] return (initial_stat...
Python
1
} } #[derive(Debug, PartialEq, Eq)] pub enum ProductionStatus { Idle, Producing, Full, } impl From<&'_ ProductionState> for ProductionStatus { fn from(state: &ProductionState) -> ProductionStatus { match *state { ProductionState::Idle => ProductionStatus::Idle, Pro...
Rust
0
attribute_value`. // We therefore expect the output after the second update to not be changed. update_metrics_from_current_status(&data_before); assert_eq!( MONITOR_LATENCY_SECONDS_GAUGE .with_label_values(&["URL", "test", "", "London - UK"]) .get(), ...
Rust
0
#06_02_hangman_file_try import random words_file = 'hangman_words.txt' try: f = open(words_file) words = f.read().splitlines() f.close() except IOError: print("Cannot find file: " + words_file) exit() lives_remaining = 14 guessed_letters = '' def play(): word = pick_a_word() while True: guess = get_guess...
Python
1
u16> = Crc::<u16>::new(&CRC_16_LJ1200); Ok(CRC.checksum(&data)) } #[pyfunction] fn crc_16_maxim_dow(data: &[u8]) -> PyResult<u16> { const CRC: Crc<u16> = Crc::<u16>::new(&CRC_16_MAXIM_DOW); Ok(CRC.checksum(&data)) } #[pyfunction] fn crc_16_mcrf4xx(data: &[u8]) -> PyResult<u16> { const CRC: Crc<u16> = ...
Rust
0