text string | label_name string | labels int64 |
|---|---|---|
ent_length = lambda self, *args, **kwargs: None
else:
def putheader(self, header, *values):
if header != HTTP_HEADER.CONTENT_LENGTH:
self._putheader(header, *values)
if not hasattr(_http_client.HTTPConnection, "_putheader"):
_http_clie... | Python | 1 |
from BCDistribution import BCDistribution
| Python | 1 |
::Reg<u32, _EXTMEM_CORE0_DBUS_REJECT_ST>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _EXTMEM_CORE0_DBUS_REJECT_ST;
#[doc = "`read()` method returns [extmem_core0_dbus_reject_st::R](extmem_core0_dbus_reject_st::R) reader structure"]
impl crate::Readable for EXTMEM_CORE0_DBUS_REJECT_ST {}
#[doc = "EXTMEM_CORE0_DBUS... | Rust | 0 |
.Text(text='Users')],
on_click=GoToEvent(url='/table/users'),
active='startswith:/table/users',
),
],
mode='tabs',
class_name='+ mb-4',
),
]
@router.get('/users/{id}/', response_model=FastUI, response_model_exclude... | Python | 1 |
" the TRNG because TRNG can override Xadc in hardware
let ticktimer = ticktimer_server::Ticktimer::new().expect("Couldn't connect to Ticktimer");
let mut xl = Llio {
crg_csr: CSR::new(crg_csr.as_mut_ptr() as *mut u32),
gpio_csr: CSR::new(gpio_base),
... | Rust | 0 |
s are the same
assert_eq!(&child_ext_keypair.2[0..PUBLIC_KEY_LENGTH], &CHILD_PRIVKEY_HARD[0..PUBLIC_KEY_LENGTH]);
Ok(())
}
}
// Copyright 2022 Xayn AG
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ... | Rust | 0 |
config.point_style);
view.last_drawn_x = (x + patch_dims.0) as u32;
view.last_drawn_t = t1;
s.view_write.borrow_mut().set(&view);
}
s.drawing_area.queue_draw();
}
fn tick(s: &State) {
trace!("tick");
// Ingest new data
let new_data = s.config.data_source.borrow_mut().get_dat... | Rust | 0 |
// Special handling is provided for superclass, private, and instance
/// initialization method invocations
///
/// Structure
/// ```md
/// 1. Index of the method info for the method to call
/// ```
invokespecial(u16),
/// Invoke an instance method, dispatching the call to the appropria... | Rust | 0 |
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
p::And | Binop::Or => BinopType::BoolBoolBool,
}
}
/// Returns true if this integral function returns a `nat` on nonnegative inputs.
#[must_use] pub fn preserves_nat(self) -> bool {
match self {
Binop::Add | Binop::Mul |
Binop::Max | Binop::Min |
Binop::BitAnd | Binop::BitOr | Binop::Bi... | Rust | 0 |
import subprocess
import sys
import os
def get_wallet_balances(datadir, num_wallets):
# Comando para obtener el saldo de una billetera
command_template = "bitcoin-cli -datadir={} -rpcwallet={} getbalance"
# Nombre del archivo de salida
output_file = "wallet_balances.txt"
# Obtener la ruta complet... | Python | 1 |
ing_to: Some(b"foo".to_vec()) },
sme.status()
);
// Push a fake scan result into SME. We should not attempt to connect
// because no password was supplied for a protected network.
report_fake_scan_result(&mut sme, fake_protected_bss_description(b"foo".to_vec()));
ass... | Rust | 0 |
from PIL import Image
import numpy as np
from modules import scripts_postprocessing, gfpgan_model
import gradio as gr
from modules.ui_components import FormRow
class ScriptPostprocessingGfpGan(scripts_postprocessing.ScriptPostprocessing):
name = "GFPGAN"
order = 2000
def ui(self):
with FormRow(... | Python | 1 |
[{product_id}] 的第 {qa_index+1}/{total_qa_for_product} 对QA生成")
return {
"id": product_id,
"question": question,
"answer": answer
}
async def save_qa_pairs(qa_pairs, output_file):
"""异步保存QA对到文件"""
async with aiofiles.open(output_file, 'w', encoding='utf-8') as f:
awai... | Python | 1 |
no_params(&format!(
"{}.{}",
ClientModule::api().name,
crate::client::get_api_reference_api().name
))
.unwrap();
assert_ne!(api.api.modules.len(), 0);
assert_eq!(api.api.version, env!("CARGO_PKG_VERSION"));
}
#[test]
fn test_invalid_params_error_secret_stripp... | Rust | 0 |
vk::BufferCreateInfo {
size: std::mem::size_of::<DepthPyramidUniforms>() as u64,
usage: vk::BufferUsageFlags::TRANSFER_DST | vk::BufferUsageFlags::UNIFORM_BUFFER,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
};
let uniform_buffer_gpu =
... | Rust | 0 |
, 'test file')
config = testutil.AppInfoFake(
runtime='python',
entrypoint='run_me_some_python!',
runtime_config=dict(python_version='3'))
cfg_files = self.generate_config_data(appinfo=config, deploy=True)
dockerfile = [f for f in cfg_files if f.filename == 'D... | Python | 1 |
or(false);
compare_result::<bool, ()>(&Ok(signature_ok), &Some(self.output))
}
}
#![allow(clippy::filter_map)]
use std::fs;
use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;
// This module takes an absolute path to a rustc repo and alters the dependencies to point towards
// the respect... | Rust | 0 |
m3, m4) = match witness {
Some(w) => {
let m1 = cs.allocate_multiplier(Some((w.input.x, w.window.y)))?;
let m2 = cs.allocate_multiplier(Some((w.input.y, w.window.x)))?;
let m3 = cs.allocate_multiplier(Some((Scalar::one() + w.c, w.output.x)))?;
... | Rust | 0 |
rgets_batch=n_targets_batch,
n_alphas_batch=n_alphas_batch,
n_targets_batch_refit=n_targets_batch_refit,
jitter_alphas=True)
model = MultipleKernelRidgeCV(kernels="precomputed", solver="random_search",
solver_params=solver_par... | Python | 1 |
T_TABLE;
point -= signature.R.decompress() ?;
point *= &k_inv;
PublicKey {
compressed: point.compress(),
point
}
}
}
impl SecretKey {
/// Dangerously malleably sign a message with this `SecretKey`.
///
/// There is deprecated style of Schnorr sign... | Rust | 0 |
rical
# results show that it's 0.5.)
#
constraints.append(WordEmbeddingDistance(min_cos_sim=0.5))
#
# Only replace words with the same part of speech (or nouns with verbs)
#
constraints.append(PartOfSpeech(allow_verb_noun_swap=True))
#
# Universal ... | Python | 1 |
"""Collection of prompt templates used by the AI services.
This module contains optimized prompts with detailed instructions for better AI performance.
"""
WORKOUT_PLAN_SYSTEM_PROMPT = "Eres un entrenador personal y respondes en JSON."
NUTRITION_PLAN_SYSTEM_PROMPT = """Eres PlanifitAI. Genera plan nutricional en JSO... | Python | 1 |
e = "avx")))]
pub fn ceil_m256(a: m256) -> m256 {
m256(unsafe { _mm256_ceil_ps(a.0) })
}
/// Turns a comparison operator token to the correct constant value.
#[macro_export]
#[cfg_attr(docs_rs, doc(cfg(target_feature = "avx")))]
macro_rules! cmp_op {
(EqualOrdered) => {{
#[cfg(target_arch = "x86")]
use ::c... | Rust | 0 |
tial_place, output_scale, log)
{
result = Err(err);
}
window_map.with_child_popups(wl_surface, |popup| {
let location = popup.location();
let draw_location = initial_place + location;
if let ... | Rust | 0 |
er_bitmap = Vec::<Boolean>::alloc(cs.ns(|| "prepare signer bitmap"), || Ok(&value.prepare_signer_bitmap[..]))?;
let prepare_signature = G1Gadget::alloc(cs.ns(|| "prepare signature"), || Ok(value.prepare_signature))?;
let commit_signer_bitmap = Vec::<Boolean>::alloc(cs.ns(|| "commit signer bitmap"), ||... | Rust | 0 |
4f, 0xd8, 0xfd, 0xff)]
interface IWbemUnboundObjectSink(IWbemUnboundObjectSinkVtbl): IUnknown(IUnknownVtbl) {
fn IndicateToConsumer(
pLogicalConsumer: *mut IWbemClassObject,
lNumObjects: c_long,
apObjects: *mut *mut IWbemClassObject,
) -> HRESULT,
}}
// EXTERN_C const IID IID_IWbemEventP... | Rust | 0 |
ize, VertexIndex>("v"),
Ok(&[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 2, 4, 4, 5][..])
);
}
#[test]
fn trimesh_split_vertices_by_face_vertex_attrib() {
let verts = vec![
[0.0, 0.0, 0.0],
[0.0, 0.0, 1.0],
[0.0, 1.0, 0.0],
[0.0, 1.0, 1.0]... | Rust | 0 |
print(f" 标准差: {values.std():.3f}秒")
else:
print("⚠️ 没有找到时间指标列")
# 检查API重试次数
retry_columns = [col for col in df.columns if 'attempt' in col.lower()]
if retry_columns:
for col in retry_columns:
values = df[col].dropna()
if len(values) > 0:
... | Python | 1 |
from __future__ import annotations
from ipaddress import ip_address
from helperFunctions.compare_sets import substring_is_in_list
WHITELIST = [
'get',
'set',
'post',
'send',
'receive',
'firmware',
'router',
'purenetworks.com',
'tplinkwifi.net',
'tplinklogin.net',
]
BLACKLIST ... | Python | 1 |
or the first 15 seconds of the year
let end_datetime = Some(15 * 1_000_000_000);
let generated_tag_sets = GeneratedTagSets::default();
let mut agent = agent::Agent::from_spec(
agent_spec,
1,
Duration::from_secs(10),
start_datetime,
en... | Rust | 0 |
elization/mod.rs<gh_stars>100-1000
pub use self::voxel_set::{Voxel, VoxelSet};
pub use self::voxelized_volume::{FillMode, VoxelValue, VoxelizedVolume};
mod voxel_set;
mod voxelized_volume;
<filename>src/lib.rs<gh_stars>0
//! This crate contains an implementation of the Cassowary constraint solving algorithm, based upo... | Rust | 0 |
+= dangvel;
*vels = vels.apply_damping(params.dt, &damping);
});
}
}
// Write impulses back into the manifold structures.
for constraint in &*joint_constraints {
constraint.writeback_impulses(joints_all);
}
for constr... | Rust | 0 |
hash,
};
result.push(transfer);
}
Ok(result)
}
/**
Test all transactions of a block, and print the transfer information.
Return the number of transactions and amount sum.
*/
async fn test_block(
web3: &Web3<Http>,
block: &Block<Transaction>,
filter: &Filter,
) -> web3::Result<(u64, ... | Rust | 0 |
depth, grasp_score_label_max_depth_idx = grasp_score_label.max(-1)
grasp_width_label = grasp_width_label.gather(-1, grasp_score_label_max_depth_idx.unsqueeze(-1)).squeeze(-1)
grasp_score_label_max_angle, grasp_score_label_max_angle_idx = grasp_score_label_max_depth.max(-1)
scene_depth = grasp_sc... | Python | 1 |
from django.shortcuts import render, redirect
from .forms import AppointmentForm
from .models import Appointment
from django.contrib.auth.decorators import login_required
@login_required
def book_appointment(request):
if request.method == 'POST':
form = AppointmentForm(request.POST)
if form.is_vali... | Python | 1 |
target=monitor_progress,
args=(args.output_dir, len(urls), args.verbose, stop_event),
daemon=True
)
progress_thread.start()
# Small delay to let progress monitoring start
time.sleep(2)
# Run processing
start_time = d... | Python | 1 |
ntry.
InvalidEntry(entry::ParseError),
}
impl error::Error for ParseError {}
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::InvalidEntry(e) => write!(f, "invalid entry: {}", e),
}
}
}
impl From<Vec<Entry>> for A... | Rust | 0 |
from django.db import models
class BannerImg(models.Model):
"""
index.htmlのBanner
"""
bannerTitle = models.CharField(max_length=255)
bannerImg = models.ImageField(upload_to='baseApp/contents/org/banner', null=False)
activeFlg = models.BooleanField(default=False)
create_at = models.DateTimeF... | Python | 1 |
min_version: LanguageVersion::V1_2,
};
pub const SHA_TEXT: LanguageFeatureVersion = LanguageFeatureVersion {
name: "SHA_TEXT",
min_version: LanguageVersion::V1_2,
};
pub const TEXTMAP: LanguageFeatureVersion = LanguageFeatureVersion {
name: "TEXTMAP",
min_version:... | Rust | 0 |
= x;
let z: &[&[i32]] = &[&[1], &[2], &[3]];
let y: &[&[&[i32]]] = &[z];
x[1][{ x = y; 2}][0] //~ ERROR cannot assign `x` in indexing expression
}
fn main() {
println!("{}", modify_after_assert_slice_array(&[&[4, 5, 6], &[9, 10, 11]]));
println!("{}", modify_after_assert_slice_slice(&[... | Rust | 0 |
y = CenterlineAccuracyCheck(frame_preprocessing=frame_preprocessing, image_shape=image_shape)
while True:
queue_data = data_reading_queue.get()
if queue_data is None:
break
compare_data_filename, chunk_index = queue_data
with open(compare_data_filename, "rb") as f:
... | Python | 1 |
}
}
impl Serialize for Protocol {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "TCP"),
Self::Ud... | Rust | 0 |
label = out.loc[int(id_)]
rec = {'label': label}
# prepare the model for both directions
rec['forward'] = parse_rec(values, masks, evals, eval_masks, dir_='forward')
rec['backward'] = parse_rec(values[::-1], masks[::-1], evals[::-1], eval_masks[::-1], dir_='backward')
rec = json.dumps(rec)
... | Python | 1 |
-linux-gnu".to_string();
let tbb_lib_dir = lib_dir.clone();
let omp_lib_dir = lib_dir.clone();
let include_dir = format!("/usr/include/mkl");
let lib_dir_path = PathBuf::from(lib_dir);
let omp_lib_dir_path = PathBuf::from(omp_lib_dir);
let tbb_lib_dir_path = PathBuf::fro... | Rust | 0 |
ta, cwd, sysroot, docker_in_docker, verbose)?;
let mut cmd = cargo_safe_command(uses_xargo);
cmd.args(args);
let mut docker = subcommand(&engine, "run");
docker.args(&["--userns", "host"]);
docker_envvars(&mut docker, config, target)?;
let mount_volumes = docker_mount(
&mut docker,
... | Rust | 0 |
len();
self.data_len += data.len();
self.data.push(data);
result
}
pub fn build_data_count(&self) -> Option<DataCountSection> {
if self.data.is_empty() {
return None;
}
Some(DataCountSection {
count: self.data.len() as u32,
})
}
pub fn build_data(&self) -> Option<DataSection> {
if self.data.... | Rust | 0 |
ple=True)
),
vol.Optional(**SCHEMA_INCLUDE_TARGETS): BooleanSelector(
BooleanSelectorConfig(),
),
vol.Optional(**SCHEMA_TARGETS_TO_INCLUDE): TargetSelector(
TargetSelectorConfig(),
),
... | Python | 1 |
31) -> pcuxhb, zigfjrn
pluph (15)
tggyn (80)
yrdpurl (30)
igjmhxe (23)
bkzzc (258)
hmfyf (11)
klvncy (98) -> slqmpe, kbyrlz, xzjiiwl
hscywgt (61)
ilsqjz (285) -> nqkpd, grkyj
ksvdw (120) -> sskog, xettl
wpwlg (86) -> kuxclnz, fkagf
gkzbah (44)
qtxkvx (71)
xiksvn (114) -> cklbsi, ydhrzjf
fjrrlug (16)
rzpxffj (11)
wviisf... | Rust | 0 |
from python.helpers.tool import Tool, Response
from python.extensions.message_loop_prompts._10_system_prompt import (
get_tools_prompt,
)
class Unknown(Tool):
async def execute(self, **kwargs):
tools = get_tools_prompt(self.agent)
return Response(
message=self.agent.read_prompt(
... | Python | 1 |
"""
Foydalanuvchi tomonidan faqat butun sonlardan iborat ro'yxat kiritilgan.
Sizning vazifangiz ushbu ro'yxatda qo'shni bir xil ishorali elementlarni chiqarish.
Agar qo'shni elementlarning ishoralari bir-biridan farqli bo'lsa, sonlar chiqarilmasin.
Har bir masala shartiga mos qo'shni elementlarni alohida qatorlarda c... | Python | 1 |
from langchain.chains.query_constructor.base import load_query_constructor_runnable
__all__ = ["load_query_constructor_runnable"]
| Python | 1 |
tr):
parts = PARSE_TIME_REGEX.match(time_str)
if not parts:
die(f"Invalid duration {time_str}")
parts = parts.groupdict()
time_params = {}
for name, param in parts.items():
if param:
time_params[name] = int(param)
dur = timedelta(**time_params)
if dur.total_second... | Python | 1 |
"""觸控優化組件模組(統一入口點)
此模組提供專門針對觸控裝置優化的 UI 組件的統一入口點。
實際實作分散在子模組中以保持檔案大小合理。
"""
from typing import Dict, List, Any, Optional, Callable
from .touch_basic import TouchBasicComponents
from .touch_navigation import TouchNavigationComponents
class TouchOptimizedComponents:
"""觸控優化組件類(統一入口點)
提供專門針對觸控裝置優化的 UI 組件,確保在手機... | Python | 1 |
f value is zero or negative
"""
return value.bit_length() - 1
def unique(enumeration):
"""
Class decorator for enumerations ensuring unique member values.
"""
duplicates = []
for name, member in enumeration.__members__.items():
if name != member.name:
duplicates.append((... | Python | 1 |
(
&mut deps,
mock_env(),
info.clone(),
ExecuteMsg::Enqueue { value: 40 },
)
.unwrap();
}
for _ in 0..0x19 {
let _: Response =
execute(&mut deps, mock_env(), info.clone(), ExecuteMsg::Dequeue {}).unwrap();
}
// we add 0x2... | Rust | 0 |
..=3)(&None).is_ok());
}
#[test]
pub fn length_if_present_invalid() {
assert!(length_if_present(1..=3)(&Some("1234".to_owned())).is_err());
assert!(length_if_present(1..=3)(&Some("".to_owned())).is_err());
}
}
}use amethyst::{assets::PrefabData, core::math::*... | Rust | 0 |
Some(ui_input::Key::LeftMeta) => {
key_to_modifiers(&mut shortcut, ui_input::Modifiers::LeftMeta)
}
Some(ui_input::Key::RightMeta) => {
key_to_modifiers(&mut shortcut, ui_input::Modifiers::RightMeta)
... | Rust | 0 |
true if this type is one of the signed integer types.
pub fn is_signed_integer(&self) -> bool {
use self::ExpressionType::*;
match self {
I8 | I16 | I32 | I64 | I128 | Isize => true,
_ => false,
}
}
/// Returns true if this type is one of the unsigned integer... | Rust | 0 |
, lb: Bound<u64>, ub: Bound<u64>) -> TestResult {
let k1 = match lb {
Bound::Unbounded => None,
Bound::Included(k) => Some((false, k)),
Bound::Excluded(k) => Some((true, k)),
};
let k2 = match ub {
Bound::Unbounded => None,
Bound::Incl... | Rust | 0 |
'save'])
p4.scatter('index', 'locations.COUNT(appointments)', alpha=.7, source=source, color='teal')
p4.title.text = 'Appointments by Neighborhood'
p4.xaxis.axis_label = 'Neighborhoods (hover to view)'
p4.yaxis.axis_label = 'Count'
return p4
def plot_noshow_by_loc(fm):
tmp = fm.groupby('neigh... | Python | 1 |
sleep = int(input())
wake = int(input())
length = (24 - sleep) + (wake - 0)
if 20 <= sleep <= 23 and 6 <= wake <= 9:
if 8 <= length <= 10:
print('Healthy')
else:
print('Unhealthy')
else:
print('Unhealthy')
| Python | 1 |
use dot::{
disable_dot_uploading, disable_dotting, enable_dot_uploading, enable_dotting,
is_dot_uploading_disabled, is_dotting_disabled,
};
pub use download::{
sign_download_url_with_deadline, sign_download_url_with_lifetime, RangeReader,
RangeReaderBuilder,
};
pub use req_id::{set_download_start_time,... | Rust | 0 |
control
0x32, // sequence number
0xcd,0xab, // destination PAN id
0xbf,0x9b,0x15,0x06,0x00,0x4b,0x12,0x00, // extended destination address
0xc7,0xd9,0xb5,0x14,0x00,0x4b,0x12,0x00, // extended source address
0x05, // security control field
0x31,0x0... | Rust | 0 |
# Copyright 2022 InstaDeep Ltd. 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 applicable law o... | Python | 1 |
<i32>,
}
impl User {
pub fn new() -> User {
User {
id: None,
username: None,
first_name: None,
last_name: None,
email: None,
password: <PASSWORD>,
phone: None,
user_status: None,
}
}
}
use std::cmp:... | Rust | 0 |
wing situations (not an exhaustive list):
///
/// * The parent directories do not exists and couldn't be created.
/// * The current process lacks permissions to create directory at `path`.
///
/// # Examples
///
/// ```no_run
/// # #![feature(async_await)]
/// # fn main() -> std::io::Result<()> { async_std::task::block... | Rust | 0 |
}
#[doc(hidden)] // set from macro
pub fn add_location(&mut self, location: &'static str) -> &mut Self {
self.location = Some(location);
self
}
#[doc(hidden)] // set from macro
pub fn add_data<D: Serialize>(&mut self, key: &'static str, value: D) -> &mut Self {
self.dat... | Rust | 0 |
SanitizeMol(mol_3d)
except:
continue
confIds = AllChem.EmbedMultipleConfs(mol_3d, n_conf, randomSeed=random_seed,
clearConfs=True, numThreads=num_workers)
try:
AllChem.MMFFOptimizeMoleculeConfs(mol_3d, numThreads=num_workers)
... | Python | 1 |
from kittens.tui.handler import result_handler
from kitty.key_encoding import KeyEvent, parse_shortcut
def main(args):
pass
def encode_key_mapping(window, key_mapping):
mods, key = parse_shortcut(key_mapping)
event = KeyEvent(
mods=mods,
key=key,
shift=bool(mods & 1),
alt... | Python | 1 |
ts(mesh_name,(self.fluid_model_part).GetMesh())
def __PrintResults(self):
label = self.fluid_model_part.ProcessInfo[TIME]
self.gid_io.WriteNodalResults(VELOCITY,self.fluid_model_part.Nodes,label,0)
self.gid_io.WriteNodalResults(PRESSURE,self.fluid_model_part.Nodes,label,0)
self.gid_... | Python | 1 |
// pub fn PathToRegion();
pub fn Pie(
hdc: HDC, nLeftRect: c_int, nTopRect: c_int, nBottomRect: c_int, nXRadial1: c_int,
nYRadial1: c_int, nXRadial2: c_int, nYRadial2: c_int,
) -> BOOL;
// pub fn PlayEnhMetaFile();
// pub fn PlayEnhMetaFileRecord();
// pub fn PlayMetaFile();
... | Rust | 0 |
r. Here we
# simply pass the exception up the stack, as if the secret was not found
# in the first place.
self._verify_secret_metadata(
secret_id=secret_id,
metadata=metadata,
)
logger.debug(f"Fetched HashiCorp Vault secret: {vault_secret_id}")
r... | Python | 1 |
import re
import os
# clear terminal
os.system('cls' if os.name == 'nt' else 'clear')
# all calibration lines
cal_lines = []
# read and parse input
with open('input_b.txt', 'r') as file:
lines = file.readlines()
for line in lines:
# regex to extract the mul() statement
num_matches = re.findal... | Python | 1 |
erall_stats']
print(f"Total queries analyzed: {overall_stats['total_queries']}")
print(f"Threshold used:")
print(f" - Baseline: {BASELINE_THRESHOLD:.4f}")
print(f" - Iterative/Beam Search: {overall_stats['threshold']:.4f}")
print(f"\nOverall Performance:")
print(f"{'Method':<15} {'Pr... | Python | 1 |
};
use crate::events::event::Event;
use crate::ipc::context::Context;
use crate::payload::IntoPayload;
use crate::protocol::AsyncProtocolStream;
macro_rules! poll_unwrap {
($val:expr) => {
if let Some(v) = $val {
v
} else {
tracing::error!("Polling a future with an invalid s... | Rust | 0 |
def tempAcimMedia(list, med, relacao):
for i in range(len(list)):
if list[i] > med:
print(f"{relacao[i][0]}: {round(list[i],2)}K")
def mediaTempK(list):
soma = 0
newMed = []
for i in range(len(list)):
if list[i][2] == "K":
soma += round(list[i][1],2)
... | Python | 1 |
sult = {
"isSuccess": False,
"message": 'sAMAccountName:修改失败'}
elif ["top", "person", "organizationalPerson", "contact"] == objectClass:
changes = {}
if sn:
changes.update({'sn': [(MO... | Python | 1 |
n_name] = match
# Printing out the desired information:
# print(f"Role: {role_name}")
# print(f"Criterion: {criterion_name}")
# print(f"Score: {score}")
# print("------" * 10)
# Append the result to the DataFrame
results_df = results_df.append(scor... | Python | 1 |
import torch
from vllm.engine.arg_utils import EngineArgs
from vllm.utils import get_distributed_init_method, get_ip, get_open_port
from vllm.worker.cache_engine import CacheEngine
from vllm.worker.worker import Worker
def test_gpu_memory_profiling():
# Tests the gpu profiling that happens in order to determine ... | Python | 1 |
}
for i in nwords - j as usize..nwords {
x[nwords - 1 - i] = 0;
}
if shift != 0 {
let mut j = nwords - 1;
while j > 0 {
shiftl(x[j], x[j - 1], shift, &mut x[j]);
j -= 1;
}
x[0] <<= shift;
}
}
pub fn mp_shiftr1(x: &mut [u64], nword... | Rust | 0 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.linear_model import Ridge
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
# Load dataset
df = pd.read_csv('cla/datasets/train.csv')
# Ext... | Python | 1 |
], dict):
if "float" in response_body["embeddings"]:
embedding = response_body["embeddings"]["float"][0]
# Fallback to the first available embedding type
else:
for embedding_type in response_b... | Python | 1 |
if range.end <= range.start {
return None;
}
range
}};
}
let x = macro_axis!(XAXIS);
let y = macro_axis!(YAXIS);
Some(Rect { x, y })
}
}
<reponame>mg-rust/rustjobs.cc<filename>src/schema.rs<gh_stars>0
table! {
jobs ... | Rust | 0 |
er_claiming_available_rewards()
account.assert_is_rc_mana_decreased_after_claiming_available_rewards()
@pytest.mark.parametrize("reward_vests", [tt.Asset.Vest(10), "all"])
def test_claim_all_calculated_vests_reward(node, wallet, reward_vests):
"""
Test case 3, 6 from issue: https://gitlab.syncad.com/hive/... | Python | 1 |
_id, Some(self.id), None, None, ip).await
}
}
/// Updates the last used time of this SSH key for reporting purposes in the
/// dashboard.
pub async fn update_last_used(self: Arc<Self>, conn: ConnectionPool) -> Result<()> {
use crate::schema::user_ssh_keys::dsl::{id, last_used_at, user_s... | Rust | 0 |
This substitutes in the scope of this function the String type.
use smartstring::alias::String;
let str_1 = "Mary had a little lamb!";
let mut vec_tmp = Vec::with_capacity(MAX_ITERATIONS);
let counter;
let mut num = 0_usize;
for i in 0..MAX_ITERATIONS {
let sm... | Rust | 0 |
eclareOptions},
types::FieldTable,
BasicProperties, Channel, ExchangeKind,
};
const UPDATES_EXCHANGE: &str = "waterwheel.updates";
const UPDATES_QUEUE: &str = "waterwheel.updates";
pub async fn setup(chan: &Channel) -> Result<()> {
// declare outgoing exchange and queue for scheduler updates
chan.exch... | Rust | 0 |
_offset = weld_offset;
let weld_offset: *mut Vector = &mut weld_offset as *mut Vector;
let mut weld_rotation = weld_rotation;
let weld_rotation: *mut Rotator = &mut weld_rotation as *mut Rotator;
RBActor_TA_WeldRBActor(self.addr(), other.addr(), weld_offset, weld_rotation... | Rust | 0 |
#object oriented programming
#classes and objects
#classes -> blueprint for objects
#constructor -> automatically called whenever an object is created
class student:
# name = 'john' #attribute
def __init__(self, name, course): #constructor
self.username = name
self.usercourse = course
d... | Python | 1 |
proving_cpu_time_ms: gen_post_measurement.cpu_time.as_millis() as u64,
proving_wall_time_ms: gen_post_measurement.wall_time.as_millis() as u64,
verifying_cpu_time_ms: verify_post_measurement.cpu_time.as_millis() as u64,
verifying_wall_time_ms: verify_post_measurement.wal... | Rust | 0 |
boot_cfg).unwrap();
let boot_cfg = vm_resources.boot_source().unwrap();
assert_eq!(boot_cfg.cmdline.as_str(), cmdline);
assert_eq!(boot_cfg.kernel_file.metadata().unwrap().st_ino(), tmp_ino);
assert_eq!(
boot_cfg
.initrd_file
.as_ref()
... | Rust | 0 |
twin_id, &updated_twin);
Self::deposit_event(RawEvent::TwinUpdated(twin_id, peer_id));
Ok(())
}
// Method for twins only
#[weight = 10_000 + T::DbWeight::get().writes(1)]
pub fn add_twin_entity(origin, twin_id: u64, entity_id: u64, signature: Vec<u8>) -> dispatch::DispatchResult {
let pub_key = e... | Rust | 0 |
promsign in mutex (sending arc of mutex (change a lot)): for now seen as small
/// used for query of trust only (change a lot).
TrustQuery(TrustQuery<TP>),
}
#[derive(RustcDecodable,RustcEncodable,Debug,PartialEq,Eq,Hash,Clone,PartialOrd,Ord)]
pub enum WotK {
Peer(Vec<u8>),
P2S(Vec<u8>),
Sign((Vec<u8>, Vec<... | Rust | 0 |
i32,
pub code: String,
pub telegram_user_id: String,
pub status: String,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
}
use std::io::Error as IoError;
pub type Result<T> = std::result::Result<T, RunnerError>;
#[derive(thiserror::Error, Debug)]
pub enum RunnerError {
#[error(t... | Rust | 0 |
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except accordi... | Rust | 0 |
# Copyright 2022 The FeatHub Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 1 |
in vecahand {
struct SLeafCounter;
impl TForEachSnapshot for SLeafCounter {
type Output = usize;
fn final_output(&self, _slcstich: SStichSequenceGameFinished, _rulestatecache: &SRuleStateCache) -> Self::Output {
... | Rust | 0 |
hash) =
setup_leaf_x5(chain_id, ¶ms5, rng);
let arbitrary_input = setup_arbitrary_data(recipient, relayer, fee, refund, commitment);
let params3 = setup_params_x5_3(curve);
let (_, path) = setup_tree_and_create_path_tree_x5(&[leaf], 0, ¶ms3);
let root = BlsFr::rand(rng);
let roots = [root; TEST_M]... | Rust | 0 |
import os
from typing import Optional
from promptflow._constants import PF_USER_AGENT, USER_AGENT
from promptflow._utils.logger_utils import LoggerFactory
from promptflow.core._version import __version__
from promptflow.tracing._operation_context import OperationContext
logger = LoggerFactory.get_logger(__name__)
c... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.