text
string
label_name
string
labels
int64
the vring belongs. /// * `features` - Bit mask of features negotiated by the backend and the frontend. fn pop_avail(&mut self, sys_mem: &Arc<AddressSpace>, features: u64) -> Result<Element>; /// Fill the used vring after processing the IO request. /// /// # Arguments /// /// * `sys_mem` - ...
Rust
0
)] pub const ABS_MT_POSITION_X: u16 = 0x35; #[doc(hidden)] pub const ABS_MT_POSITION_Y: u16 = 0x36; #[doc(hidden)] pub const ABS_MT_TOOL_TYPE: u16 = 0x37; #[doc(hidden)] pub const ABS_MT_BLOB_ID: u16 = 0x38; #[doc(hidden)] pub const ABS_MT_TRACKING_ID: u16 = 0x39; #[doc(hidden)] pub const ABS_MT_PRESSURE: u16 = 0x3a; #...
Rust
0
class Solution: def intToRoman(self, num: int) -> str: valueSymbols = [(1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'), (100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'), (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), ...
Python
1
from classical_bounds import * import numpy as np import matplotlib import matplotlib.pyplot as plt # Plot the noiseless lower bound as a function of n def max_classical_hm_fidelity(m, n): return 2 * (m + 1) / np.sqrt(2**n - 1) def min_communication_hm(fidelity, n): return fidelity * np.sqrt(2**n - 1) / 2 -...
Python
1
#!/usr/bin/env python3 # Test different models with the same prompt (using deepseek-r1 and glm-v) import os import requests import json # Get token from environment variable token = os.getenv("MY_LLM_TOKEN") if not token: print("Error: MY_LLM_TOKEN not set") exit(1) # Configuration url = "https://ellm.nrp-na...
Python
1
!(f, "AGG VAR {:?}", expr), Std(expr) => write!(f, "AGG STD {:?}", expr), Quantile { expr, .. } => write!(f, "AGG QUANTILE {:?}", expr), } } Cast { expr, data_type } => write!(f, "CAST {:?} TO {:?}", expr, data_type), Ternary { ...
Rust
0
import cv2 import matplotlib.pyplot as plt # resmi içe aktar img = cv2.imread("img1.jpg") img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) plt.figure() plt.imshow(img, cmap = "gray") plt.axis("off") plt.show() # eşikleme _, thresh_img = cv2.threshold(img, thresh = 60, maxval = 255, type = cv2.THRESH_BINARY) plt.figure()...
Python
1
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from qt.column import Column from qt.result...
Python
1
to preserve the consistency of multiple simulations with experimental # changes (if the oracle used a global Random object, simply adding one new agent # would change everyone's "noise" on all subsequent observations). def observePrice(self, symbol, currentTime, sigma_n = 0.0001, random_state = None): last_tr...
Python
1
to better address net zero transitions?" }, { "code": "TH92", "label": "Net zero transitions|Net zero transitions in energy", "question": "What policy initiatives, if any, aim specifically to support research and innovation for net-zero carbon ambitions in the energy...
Python
1
tifier. Typical schemes are ISBN or URL. # epub_scheme = '' # The unique identifier of the text. This can be a ISBN number # or the project homepage. # epub_identifier = '' # A unique identification for the text. # epub_uid = '' # A tuple containing the cover image and cover page html template filenames. # epub_cove...
Python
1
t<Option<GuildChannel>, serenity::Error> { Ok(self.guild.channels(self.ctx.http.clone())?.values().find(|c| c.name == name).map(|c| (*c).clone())) } pub fn find_role(&self, name: &str) -> Result<Option<Role>, serenity::Error> { Ok(self.ctx.http.get_guild_roles(*(self.guild.id.as_u64()))?.into_i...
Rust
0
, $canon:expr) => { test($val, $canon); }; ($val:expr, $canon:expr, $($alt:expr),*) => { test($val, $canon); $(test_inexact($val, $alt);)* }; ($val:expr, _, $($alt:expr),*) => { $(test_inexact($val, $alt);)* }; } #[test] fn atom() { test!(&123u32, "123"); t...
Rust
0
TransferProtocol::Sftp, }; self.config_mut().set_default_protocol(protocol); } if let Ok(State::One(StateValue::Usize(opt))) = self.app.state(&Id::Config(IdConfig::HiddenFiles)) { let show: bool = matches!(opt, 0); self.config_mut().set...
Rust
0
t::Debug for Client { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Client") .field("endpoint", &self.endpoint) .field("image_endpoint", &self.image_endpoint) .finish() } } #[derive(Debug)] pub enum Error { InvalidUrlPath(St...
Rust
0
}}; } pub(super) use assert_kind; pub(super) use assert_kindcheck; pub(super) use assert_type_error; <reponame>trav-xeno/rusty_v8 use std::borrow::Borrow; use std::hash::Hash; use std::hash::Hasher; use std::marker::PhantomData; use std::mem::transmute; use std::ops::Deref; use std::ptr::NonNull; use crate::Data...
Rust
0
""" System error codes. MicroPython module: https://docs.micropython.org/en/v1.20.0/library/errno.html CPython module: :mod:`python:errno` https://docs.python.org/3/library/errno.html . This module provides access to symbolic error codes for `OSError` exception. A particular inventory of codes depends on :term:`Micr...
Python
1
else { self.syscall_context_objects[SYSCALL_CONTEXT_OBJECTS_OFFSET + slot] = fat_ptr.data; // Keep the dyn trait objects so that they can be dropped properly later self.syscall_context_object_pool .push(syscall_context_object); Ok(()) } } ...
Rust
0
her: Point) -> Point { //! Point {x: self.x + other.x, y: self.y + other.y} //! } //! } //! //! impl Sub for Point { //! type Output = Point; //! //! fn sub(self, other: Point) -> Point { //! Point {x: self.x - other.x, y: self.y - other.y} //! } //! } //! //! assert_eq!(Point {x: 3, y: ...
Rust
0
"id:membership_line_id", "date", "date_from", "date_to", "date_cancel", ("membership_id:membership_id", ("id", "name")), "member_price", ] return to_parse def _get_selection_label(self, membership_line, field): ...
Python
1
#coding=utf-8 #!/usr/bin/env python import subprocess from threading import Thread from Queue import Queue num_thread=3 #定义线程的数量 queue=Queue() #创建队列实例 ips=['192.168.1.100','192.168.1.110','192.168.1.120','192.168.1.130','192.168.1.200'] def pinger(i,q): while True: ip=q.get() #获取Queue队列传过来的ip...
Python
1
sum: 0, } } } pub struct Indexer { store: Arc<Store>, flush: DBFlush, from: FetchFrom, iconfig: IndexerConfig, duration: HistogramVec, } struct IndexerConfig { light_mode: bool, address_search: bool, network: Network, #[cfg(feature = "liquid")] parent_network: Netwo...
Rust
0
x, skip4 = self.encoder4(x) x = self.decoder4(x, skip4) x = self.decoder3(x, skip3) x = self.decoder2(x, skip2) x = self.decoder1(x, skip1) x = self.final_conv(x) return x if __name__ == '__main__': model = TinyUNet(...
Python
1
fi::OsStr; use std::fs::{self, File}; use std::io::prelude::*; use std::io::{self, BufRead, BufReader}; use std::path::Path; use tremor_runtime::{config, errors, functions as tr_fun, utils}; use tremor_script::{grok, interpreter::AggrType, path::ModulePath, EventContext as Context}; enum FormatKind { Json, Yam...
Rust
0
lf._get_pop_fn(w_mod, name, True)) else: self._post_bw_callbacks_to_enqueue.append( self._get_pop_fn(w_mod, name, True) ) def _fw_post_hook(self, mod, input, output): name = self._get_mod_name(mod) w_mod = weakref.ref(mod) if s...
Python
1
/// Targe format. target: Box<str>, }, /// Fetches url of the artifact for the specified asset. FetchUrl { id: AssetId }, /// Fetches url of the artifact for the specified asset. FindAsset { source: Box<str>, target: Box<str> }, } /// Response to store request. #[derive(Debug, serde::S...
Rust
0
Users::<T>::get(id) } fn check_owns_project(id: &T::AccountId) -> bool { let user = self::Users::<T>::get(id).unwrap_or_default(); user.project_id.is_some() } /// Allows us to check if the user even exists before calling get by id. fn check_user_exists(id: &T::AccountId) -> bool { self::Users::<T>::c...
Rust
0
from top.bbh.utils import BBH_TASKS def get_solve_prompt(problem_name: str, description: str, k: int): """ Get the solve prompt given input parameters. Arguments --------- - problem_name: str Name of the problem of interest. e.g. concatenation. - description: str, ...
Python
1
# pyright: reportPrivateUsage=false from datetime import timedelta import pytest from core.storage.local_kv_storage.local_kv_storage import LocalKVStorage @pytest.fixture async def local_storage(): return LocalKVStorage() class TestGet: async def test_get(self, local_storage: LocalKVStorage): aw...
Python
1
.abs_diff_eq(&1f32, 1e-5)); assert!((WordSimilarityResult { word: "test", similarity: NotNan::new(0.70710678).unwrap() }) .euclidean_similarity() .abs_diff_eq(&0.61732, 1e-5)); assert!((WordSimilarityResult { word: "test", ...
Rust
0
(slice, x_min, y_max, new_value) { x_min += 1; y_max -= 1; break; } } loop { if y_min == 0 { break; } x_max += 1; y_min -= 1; if !exist(slice, x_max, y_min, new_value) { x_max -= 1; y_min += 1...
Rust
0
lf, args, kwargs): for arg in itertools.chain(args, kwargs.values()): if (isinstance(arg, self._types) or (isinstance(arg, (list, tuple)) and any(isinstance(elt, self._types) for elt in arg))): return True return False def handle(self, args, kwargs): if self._handles(ar...
Python
1
server_list.0.insert(SocketAddr::new(std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1)), k), ServerInfo { name: "You're running an outdated version of KissMP. Please, consider updating to a newer version".to_string(), player_count: 0, max_players: 0, descr...
Rust
0
::from(0.5).unwrap()), x1+(x2-x1)*T::from(0.6).unwrap()]; let mut initx = Vec::new(); for k in 0..n { initx.push(x1 + (x2 - x1) / (T::from(n + 2).unwrap()) * T::from(k).unwrap()) } let x = arms( &|x| { let mut gv = gv.clone(); self...
Rust
0
__author__ = 'naetech' import os import module_locator program_path = module_locator.module_path() print "Program path is: %s" % program_path from Classes.Settings import Settings from Classes.PHP import PHP from Classes.GUI import GUI program_settings = Settings() settings_file_path = "%s/%s" % (program_path, "s...
Python
1
import MDAnalysis as mda from pymatgen.core.periodic_table import Element import warnings warnings.filterwarnings("ignore", message="Reader has no dt information, set to 1.0 ps") # 检查 dump 文件字段 def check_dump_columns(traj_path): required_fields = {"id", "type", "x", "y", "z"} # 用集合,不关心顺序 with open(traj_path,...
Python
1
import sqlite3 import pandas as pd import random def create_db(): names = [ 'Иван Иванов', 'Петр Петров', 'Сергей Сергеев', 'Алексей Алексеев', 'Дмитрий Дмитриев', 'Светлана Светланова', 'Анна Аннан', 'Екатерина Екатерина', 'Ольга Ольгова', 'Мария Мариева', 'Николай Николаев', 'Виктория Ви...
Python
1
nt_size_classes), controls.LineHeight(line_height_classes), MarginBottom(margin_bottom_classes), controls.Separator(), controls.TextIndent(), controls.TextIndent('outdent'), controls.TextMargin('increase'), c...
Python
1
6]), ( Square::E5, &[ Square::C4, Square::C6, Square::D3, Square::D7, Square::F3, Square::F7, Square::G4, Square::G6, ], ), ]; for (square, expected_targets) in cases { let position = Posit...
Rust
0
import os import sys sys.path.append('.') import cv2 import math import torch import argparse import numpy as np from torch.nn import functional as F from model.pytorch_msssim import ssim_matlab from model.RIFE import Model from skimage.color import rgb2yuv, yuv2rgb from yuv_frame_io import YUV_Read,YUV_Write device = ...
Python
1
ay want to match on our // error type, we should add an enum variant for each. // // If this is a public crate, we might want to add the [`non_exhaustive`] // attribute to error enums so we can add more variants in the // future without it being a breaking change. // // [`non_exhaustive`]: https://doc.rust-lang.org/ref...
Rust
0
from hippy.builtin import wrap, Optional from rpython.rlib import rzlib import sys ZLIB_ENCODING_RAW = -15 ZLIB_ENCODING_GZIP = 31 ZLIB_ENCODING_DEFLATE = 15 ZLIB_ENCODING_ANY = 99 def _encode(data, level, encoding): stream = rzlib.deflateInit(level=level, wbits=encoding) bytes = rzlib.compress(stream, data...
Python
1
ionFactory(TableClass, factory): from sqlobject.sqlite.sqliteconnection import SQLiteConnection conn = TableClass._connection TableClass._connection = SQLiteConnection( filename=conn.filename, name=conn.name, debug=conn.debug, debugOutput=conn.debugOutput, cache=conn.cache, style=con...
Python
1
y>() .unwrap() .value(row), )), DataType::Int64Decimal(3) => TableValue::Decimal(Decimal::new( a.as_any() .downcast_ref::<Int64Decimal3Array>() .unwrap() .value(row), )...
Rust
0
false, (Capability::AccountCall(cap),Capability::AccountCall(parent)) => cap.is_subset_of(parent), (Capability::AccountCall(_),_) => false, } } } pub trait AsCap { fn is_subset_of(&self, parent_cap: &Self) -> bool; } pub fn matching_keys(prefix: u8, required_key: &ProcedureKe...
Rust
0
2, hash_x4); let root_hash = hash_internal(hash_x5, *SPARSE_MERKLE_PLACEHOLDER_HASH); assert_eq!(branch_node.hash(), root_hash); assert_eq!( branch_node.get_child_for_proof_and_siblings(0), ( Some(hash1), vec![ *SPARSE_...
Rust
0
78959, 0.008378590612861947, 0.06432124509469359, 1.0115467796945015, ]); #[rustfmt::skip] pub const P3_D65_TO_BT_709_D65: Mat3 = const_mat3!([ 1.224900542983793, -0.04206325973338326, -0.01964475842589928, -0.22490054298379336, 1.042063259733383, -0.0786535768895766, 0.0, 0.000000000000000020816681711...
Rust
0
ing, pub precommits: Vec<RoundVote>, pub precommits_bit_array: String, } /// Details of a single vote from a particular consensus round. #[derive(Debug, Clone, PartialEq)] pub enum RoundVote { Nil, Vote(VoteSummary), } impl Serialize for RoundVote { fn serialize<S>(&self, serializer: S) -> Result<...
Rust
0
annel_state = handle_errors!(channel_state_result); // Deserialize the customer close structure let cust_close_result: ResultSerdeType<zkproofs::ChannelcloseC<CURVE>> = deserialize_result_object(ser_cust_close); let cust_close = handle_errors!(cust_close_result); let cp = c...
Rust
0
self.table_widget.setItem(0, 2, item) item = QTableWidgetItem(self.main_loop.assistant.shooting_mode) self.table_widget.setItem(1, 2, item) aim_assist = (self.main_loop.assistant.aim_assist or self.main_loop.assistant.alt_aim_assist or self.main_loop.assistant.fix_aim_assist) item = Q...
Python
1
nt(v) else: outImage[rgb][i][k] = inImage[rgb][i][k] # 고주파 필터 처리 샤프닝 def HPFSharp(): print("HPF(고주파 필터 처리) 샤프닝 이미지") ## ***** 영상처리 알고리즘 ***** ## MSIZE = 3 # 고주파 필터 마스크 HPFmask = [[-1. / 9, -1. / 9, -1. / 9], [-1. / 9, 8 / 9, -1. / 9], ...
Python
1
; } } else if c == expected_close_char { let j = i + c.len_utf8(); if j >= input.len() { return Cow::Borrowed(&input[0..nick_start_ix.unwrap()]); } else if !must_precede_whitespace || input[j..].starts_with(' ') { let strip_from = s...
Rust
0
k_array(X, dtype=None, ensure_2d=True, force_all_finite="allow-nan") result = X.eval(self.expr) # feature_names = X.columns.values.tolist() # 取数据的列名 # X = X.select_dtypes("number") # 仅支持数值型变量 # X = check_array(X, dtype=None, ensure_2d=True, force_all_finite="allow-nan") ...
Python
1
for x in chek: with open('cp.txt', 'a') as f: f.write(x + "\n") print("\n\x1b[1;97m[\x1b[1;94m•\x1b[1;97m] Crack Done....") print("\x1b[1;97m[\x1b[1;94m✓\x1b[1;97m] Saved To \033[1;93mcp.txt\033[96m|\033[1;92mok...
Python
1
ew(rhs.rename_ref(f))), TreeType::Eq(lhs, rhs) => TreeType::Eq(Box::new(lhs.rename_ref(f)), Box::new(rhs.rename_ref(f))), TreeType::Neq(lhs, rhs) => TreeType::Neq(Box::new(lhs.rename_ref(f)), Box::new(rhs.rename_ref(f))), TreeType::Func(bind, body) => TreeType::Func(bind.into_it...
Rust
0
Any::Lambertian(bxdf) => bxdf.sample(d, n), Any::Specular(bxdf) => bxdf.sample(d, n), Any::Glazed(bxdf) => bxdf.sample(d, n), Any::Mirror(bxdf) => bxdf.sample(d, n), } } fn pdf(&self, wi: &math::Vec3, wr: &math::Vec3, n: &math::Vec3) -> f32 { match self {...
Rust
0
stream_id_out = event_loop_out.build_output_stream(&device, &format).expect("Output stream error"); event_loop_out.play_stream(stream_id_out).expect("Output Play stream error"); } #[cfg(not(target_os = "linux"))] { #[cfg(feature = "default_card")] let device_out = host.default_output_device().e...
Rust
0
)] mod tests { use super::*; use crate::proto::frame; #[test] fn one_frame() { let frame = frame::HeadersFrame { encoded: b"salut"[..].into(), }; let mut buf = BytesMut::with_capacity(16); frame.encode(&mut buf); let mut decoder = FrameDecoder::defa...
Rust
0
import openai from dotenv import load_dotenv import os # Загрузка переменных окружения load_dotenv() DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY") if not DEEPSEEK_API_KEY: raise ValueError("DEEPSEEK_API_KEY не найден в переменных окружения.") MODEL = "deepseek-chat" def format_mla_ai(reference: str, subformat...
Python
1
# -*- coding: utf-8 -*- ############################################################################# # # Cybrosys Technologies Pvt. Ltd. # # Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) # Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) # # You can modify it under...
Python
1
files); debug!("Ranges: {:?}", ranges); let exit_status = process::Command::new("rustfmt") .args(files) .arg("--file-lines") .arg(ranges_as_json) .status()?; if !exit_status.success() { return Err(FormatDiffError::IoError(io::Error::new( io::ErrorKind::O...
Rust
0
#[argh(positional)] /// selectors for which the selectors should be queried. Minimum: 1 unless `--manifest` is set. /// When `--manifest` is provided then the selectors should be tree selectors, otherwise /// they can be component selectors or full selectors. pub selectors: Vec<String>, } #[async_...
Rust
0
f); } } use std::{fmt, marker::PhantomData}; use std::sync::Arc; use async_trait::async_trait; use fkactor::actors::{TypedAid, ActorBuilder}; use futures::lock::Mutex; mod change; pub use self::change::{Change, Changed, ChangeDB, ChangeUpdater, EventedDB}; use self::change::{ArcMutex, ArcMutexFwd}; #[async_trai...
Rust
0
{ d1.as_bytes_mut()}; let v_simd_serde: serde_json::Value = from_slice(d1).expect(""); // We add our own encoder in here. let mut d2 = v_simd_serde.to_string(); let d2 = unsafe{ d2.as_bytes_mut()}; let mut d3 = d.clone(); le...
Rust
0
""" Cross Entropy w/ smoothing or soft targets Hacked together by / Copyright 2021 Ross Wightman """ import torch import torch.nn as nn import torch.nn.functional as F class LabelSmoothingCrossEntropy(nn.Module): """ NLL loss with label smoothing. """ def __init__(self, smoothing=0.1): super(Lab...
Python
1
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Task-Oriented Dialog pretrained model *without* usage of API Schemas, as described in (Chen et al 2021); see https://...
Python
1
container.chains[chain.akc_id] = chain for tcell_receptor in tcell_receptors: container.ab_tcell_receptors[tcell_receptor.akc_id] = tcell_receptor #break row_cnt += 1 if row_cnt % 1000 == 0: print(f"Processed {row_cnt} rows from {tcell_path}") ...
Python
1
1: u16 = unsafe { ::std::mem::transmute(__c1) }; __c1 as u64 }); __bindgen_bitfield_unit.set(10usize, 1u8, { let __c2: u16 = unsafe { ::std::mem::transmute(__c2) }; __c2 as u64 }); __bindgen_bitfield_unit.set(11usize, 3u8, { let __tos: u16 ...
Rust
0
0000; pub const HW_SPINOR_BASE : u32 = 0xF0011000; pub const HW_KEYBOARD_BASE : u32 = 0xF0012000; pub const HW_GPIO_BASE : u32 = 0xF0013000; pub const HW_SEED_BASE : u32 = 0xF0014000; pub const HW_ROMTEST_BASE : u32 = 0xF0015000; pub const HW_AUDIO_BASE : u32 = 0xF0016000; pub const HW_TRNG_OSC_BASE : u32...
Rust
0
_W { w: self } } } <reponame>LinusCDE/retris<filename>src/main.rs #[macro_use] extern crate downcast_rs; mod canvas; mod scene; mod swipe; use clap::{Parser, crate_version, crate_authors}; use crate::canvas::Canvas; use crate::scene::*; use lazy_static::lazy_static; use libremarkable::input::{InputDevice, InputEv...
Rust
0
ns.drawing_utils avg = lambda a,b,re_b: ((a.x+b.x)/2-re_b[0],(a.z+b.z)/2-re_b[1],(a.y+b.y)/2-re_b[2]) nor = lambda a,re_b: (a.x-re_b[0],a.z-re_b[1],a.y-re_b[2]) if tools.Is_Face: face_spawn_cache() if tools.Is_body: body_spawn_cache() self._timer = contex...
Python
1
rectangular surface for the ball 50x50 self.surface = pygame.Surface((2*self.radius,2*self.radius)) pygame.draw.circle(self.surface, color, (radius, radius), radius) # draw blue filled circle on ball surface self.surface = self.surface.convert() # for faster blitting. # to avoid th...
Python
1
} length } } #![no_main] #![no_std] use defmt_rtt as _; use panic_halt as _; use core::cell::RefCell; use cortex_m::interrupt::Mutex; use cortex_m::peripheral::Peripherals; use cortex_m_rt::entry; use microbit::{ board::Board, display::nonblocking::{Display, GreyscaleImage}, hal::{ ...
Rust
0
import numpy as np import cv2 from dataclasses import dataclass from enum import IntEnum import torch from torch.autograd import Variable import math from .hsm import disparityregression class QualityLevel(IntEnum): Low = 3 Medium = 2 High = 1 class Config: def __init__(self, clean = -1, qualityLevel = Quality...
Python
1
) -> u64 { 63 - nlz(x) } /// This function reverses the order of ALL of the bits in the given number, /// including any leading zeros. pub fn reverse_all_bits(mut n: u64) -> u64 { let mut result = n; n >>= 1; let mut remaining_shift: usize = 63; while n > 0 { result <<= 1; result |...
Rust
0
t', shell=True) #iperf Server h1015.popen('iperf -s -u -i 1 > iperf_server_samePod_result', shell=True) #iperf Client h1016.cmdPrint('iperf -c ' + h1000.IP() + ' -u -t 10 -i 1 -b 100m') h1016.cmdPrint('iperf -c ' + h1015.IP() + ' -u -t 10 -i 1 -b 100m') def pingTest(net): logger.debug("Start ...
Python
1
edsMax); } let mut vec = vec![0u8; len as usize]; r.read_exact(&mut vec)?; let pad = &mut [0u8; 3][..pad_len(len as usize)]; r.read_exact(pad)?; if pad.iter().any(|b| *b != 0) { return Err(Error::NonZeroPadding); } Ok(VecM(vec)) } } imp...
Rust
0
th.join(d, "result") os.mkdir(result_dir) data_dir = os.path.join(d, "data") os.mkdir(data_dir) booster.save_model(m_name) df.iloc[:500].to_parquet(os.path.join(d, "data", "data1.parquet")) df.iloc[500:].to_parquet(os.path.join(d, "data", "data2.parquet")) df =...
Python
1
s helpful, detailed, and polite answers to the user\'s questions. ') register_template( TemplateMeta( LLMTemplateType.wizardlm2_moe, prefix=['{{SYSTEM}}'], prompt=['USER: {{QUERY}} ASSISTANT:'], chat_sep=['</s>'], suffix=['</s>'], default_system=_wizardlm2_system)) r...
Python
1
import os # Paths DATASET_PATH = "TESS" PROCESSED_DATA_PATH = "saved_models/processed_data_2.pkl" MODEL_SAVE_PATH = "saved_models" # Emotion Labels (ensure correct mapping) EMOTIONS = ["angry", "disgust", "fear", "happy", "neutral", "pleasant_surprise", "sad"] # Audio Processing SAMPLE_RATE = 22050 # Standard sampl...
Python
1
swer_by_game_and_user_not_found(self, answer_service, answer_repo_mock): # 설정 game_id = "01HABCDEFGHJKMNPQRSTUVWXYZ" user_id = "01HUSER12345678ABCDEFGHJK" answer_repo_mock.get_by_game_and_user.return_value = None # 실행 및 검증 with pytest.raises(Exception): ...
Python
1
atch value { 0 => Align::Fill, 1 => Align::Start, 2 => Align::End, 3 => Align::Center, 4 => Align::Baseline, value => Align::__Unknown(value), } } } impl StaticType for Align { fn static_type() -> Type { unsafe { from_glib(...
Rust
0
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 CCS=00000000 CCD=0000fea4 CCO=EFLAGS EFER=0000000000000000 ", ); assert!(res.is_ok()); let json_str = serde_json::to_string(&res.unwrap().0); assert!(json_str.is_ok()); pri...
Rust
0
_csi_sequence!( "Change the cursor style to blinking block", BlinkingBlock, "\x31 q" ); derive_csi_sequence!( "Change the cursor style to steady block", SteadyBlock, "\x32 q" ); derive_csi_sequence!( "Change the cursor style to blinking underline", BlinkingUnderline, "\x33 q" ); deri...
Rust
0
# -*- coding:utf-8 -*- # Copyright 2017 Xiaomi, 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 o...
Python
1
name.to_string(), event.description.to_string(), event.channel_id, ), _ => { warn!( "Malformed modify channel event. No event present: {:?}", event ); return Ok(true); } }; ds_context.modify_channel(server_id, server_pubkey, channel_id, name, description)?; let event = Event { reques...
Rust
0
perties = Alias("txPr") externalData = Typed(expected_type=ExternalData, allow_none=True) printSettings = Typed(expected_type=PrintSettings, allow_none=True) userShapes = Relation() extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('date1904', 'lang', 'roundedCorners', 's...
Python
1
} <gh_stars>1-10 use crate::ir::traversal::{Action, Named, VisResult, Visitor}; use crate::ir::{self, Attributes, LibrarySignatures}; use crate::{build_assignments, structure}; /// Compiles [`ir::Invoke`](crate::ir::Invoke) statements into an [`ir::Enable`](crate::ir::Enable) /// that runs the invoked component. #[de...
Rust
0
0b, a67y1f7u0l4, rb8riv7hbcc, tk6ax34tqfh as rwzqq4_n5vl, llvoab1kjnf from i4r_k0uklnj import g7wodksl6_a as z8n833r4srw, tziqam9mq40, voty6_r_lf2 as cs6m0g8eptj, rtolhfx12b6 nonlocal ax1llonn1rl @c44ccv8_p7l.ly35okzmuiv @tsqkogpsd1k is '' <= ofpty40mzi_ not in False @(pxm6zq3rm7k := 0) def l6c63cjh6u2(j5la9rz2...
Python
1
gpointer, ) where P: IsA<FlowLayout>, { let f: &F = &*(f as *const F); f(&FlowLayout::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, ...
Rust
0
to deserialize this type from some bytes. fn deserialize(buf: &mut &[u8]) -> Result<Self>; /// Returns owned serialized bytes. fn serialize(&self) -> Vec<u8> { let sz = self.serialized_size(); let mut buf = vec![0; usize::try_from(sz).unwrap()]; self.serialize_into(&mut buf.as_mut_...
Rust
0
.]])} grads = {'dW1': np.array([[ 0.63070583, 0.66482653, 0.18308507], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ]]), 'dW2': np.array([[ 1.62934255, 0. , 0. , 0. ], [ 0. , ...
Python
1
.map(|&i| { tile_info .tile_geo_transform() .grid_idx_to_upper_left_coordinate_2d(i) }) .collect(); let proj = CoordinateProjector::from_known_srs(self.out_srs, self.in_srs)?; let projected_coords = project_coordinates_fail...
Rust
0
: *mut ID3D11Asynchronous, ) -> (), fn End( pAsync: *mut ID3D11Asynchronous, ) -> (), fn GetData( pAsync: *mut ID3D11Asynchronous, pData: *mut c_void, DataSize: UINT, GetDataFlags: UINT, ) -> HRESULT, fn SetPredication( pPredicate: *mut ID3D11Predi...
Rust
0
*self { RX15M8R::_0 => false, RX15M8R::_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> RX15M8R { match value { false => RX15M8R::_0, true => RX15M8R::_1, } } #[doc = "Checks ...
Rust
0
from .history import * class FrequencyConverter: conversion_factors = { 'hertz': 1.0, 'kilohertz': 1 / 1000.0, 'megahertz': 1 / 1000000.0, 'gigahertz': 1 / 1000000000.0 } def add_custom_unit(unit_name, conversion_factor): FrequencyConverter.conversion_factors[unit_...
Python
1
/// /// Example /// ``` /// use seahorse::color; /// /// let text = color::bg_green("Hello"); /// println!("{}", text); /// ``` pub fn bg_green<T: Display>(t: T) -> String { format!("\x1b[42m{}\x1b[0m", t) } /// Get text with yellow background /// /// Example /// ``` /// use seahorse::color; /// /// let text = co...
Rust
0
']['t_stat']:.4f}") print(f"p-value: {results['statistics']['t_test']['p_value']:.4e}") print("\nTukey's HSD Test:") print(results['statistics']['tukey']) classical_mean = np.mean(results['classical']) exceptional_mean = np.mean(results['exceptional']) pooled_std = np.sqrt((np.var(results['cla...
Python
1
} const BASEURL: &str = "https://api.telegram.org"; const MAX_ALBUM_SIZE: usize = 10; pub struct TgBotApi<'a> { api_token: &'a str, http_client: reqwest::Client, } impl<'a> TgBotApi<'a> { pub fn new(token: &str) -> TgBotApi { TgBotApi { api_token: token, http_client: reqwe...
Rust
0
import numpy as np # 境界条件を格納するクラス class Boundary: # コンストラクタ # nodeNum : 節点数 def __init__(self, nodeNum): # インスタンス変数を定義する self.nodeNum = nodeNum # 全節点数 self.nodeDof = 3 # 節点の自由度 self.vecDisp = np.ar...
Python
1