text string | label_name string | labels int64 |
|---|---|---|
Debug, Serialize, Deserialize)]
pub struct AuthResponse {
#[serde(flatten)]
pub token: JwtToken,
}
/// POST /authenticate/refresh
#[derive(Debug, Serialize, Deserialize)]
pub struct RefreshRequest {}
impl RestPath<()> for RefreshRequest {
fn get_path(_: ()) -> Result<String, Error> {
Ok(format!("{... | Rust | 0 |
import argparse
import pickle
import tqdm
import numpy as np
from dataset import SpectrogramReader
from utils import nfft
def run(args):
reader_kwargs = {
"frame_length": args.frame_length,
"frame_shift": args.frame_shift,
"window": args.window,
"center": False,
"apply_abs"... | Python | 1 |
=> {
let $map_reg: Reg<runtime::StrMap<'a, Str<'a>>> = $map_reg.into();
let $key_reg: Reg<Str<'a>> = $key_reg.into();
let $val_reg: Reg<Str<'a>> = $val_reg.into();
let $iter_reg: Reg<runtime::Iter<Str<'a>>> = $iter_reg.into();
$body
... | Rust | 0 |
se(wxyz=np.float64(_pose_VS['rotation']), tvec=np.float64(_pose_VS['translation']))
# Get ego-pose of the vehicle (V) from global/world (W) frame
_pose_WV = self.nusc.get('ego_pose', datum['ego_pose_token'])
pose_WV = Pose(wxyz=np.float64(_pose_WV['rotation']), tvec=np.float64(_pose_WV['transla... | Python | 1 |
# /usr/bin/env python
# -*- coding: utf-8 -*-
'''
@File : fofa.py
@Time : 2020/12/23 21:33:26
@Author: Morker
@Blog : https://96.mk/
@Email : i@96.mk
If you don't go through the cold, you can't get the fragrant plum blossom.
'''
import json
import time
import base64
import random
import requests
import t... | Python | 1 |
from helpers import loadFile
from re import finditer
input = ''.join(loadFile(__file__))
do_regex = r"do\(\)"
dont_regex = r"don't\(\)"
disabled_ranges = []
do_positions = [m.start() for m in finditer(do_regex, input)]
dont_positions = [m.start() for m in finditer(dont_regex, input)]
for dont in dont_positions:
... | Python | 1 |
c { Ok(method_not_allowed()) }.boxed(),
})
}
<filename>move_example/src/main.rs
fn main() {
let s1 = String::from("hello");
let s2 = s1;
println!("{}, world!", s1);
}
// Copyright 2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
//! Exist access operations.
use bee_ledger::types::{
snapshot::info:... | Rust | 0 |
z.powf(8.0)).powf(0.125) - 0.5;
}
// Room
{
let carved_box_room_dist = box_test(&pos, &Vec3{ x:-30.0, y:-0.5, z:-30.0 }, &Vec3{ x:30.0, y:18.0, z:30.0 });
let carved_ceiling_dist = box_test(&pos, &Vec3{ x:-25.0, y:17.0, z:-25.0 }, &Vec3{ x:25.0, y:20.0, z:25.0 });
let ceiling_be... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .query_social_archive_adjust_record_request_body import QuerySocialArchiveAdjustRecordRequestBody
... | Python | 1 |
(Line(format!("{} phases", signal.phases.len())));
txt.add(Line(format!("Signal offset: {}", signal.offset)));
txt.add(Line(format!("One cycle lasts {}", signal.cycle_length())));
txt
}),
WrappedComposite::text_button(ctx, "Edit offset", hotkey(Key::O)),
// TO... | Rust | 0 |
"mean": statistics.mean(scores),
"std": statistics.stdev(scores) if len(scores) > 1 else 0.0
}
# Overall score
all_scores = []
for scores in metric_scores.values():
all_scores.extend(scores)
overall_score = statistics.... | Python | 1 |
case is
("oct", "oCtober"),
("dec", "December"),
];
check_each_field_with_expected(long_month_names);
}
#[test]
fn compose_month_num_field_in_short_name_without_braces() {
let month_nums = [
("jan", "01"),
("apr", "4"),
("... | Rust | 0 |
from dataclasses import dataclass
from omegaconf import DictConfig, OmegaConf
@dataclass
class IIADMM:
type: str = "iiadmm"
servername: str = "IIADMMServer"
clientname: str = "IIADMMClient"
args: DictConfig = OmegaConf.create(
{
"num_local_epochs": 1,
"accum_grad": True... | Python | 1 |
"""add visit wizard fields
Revision ID: 20250923_0002
Revises: 20250923_0001
Create Date: 2025-09-23
"""
from __future__ import annotations
import sqlalchemy as sa
from alembic import op
revision = "20250923_0002"
down_revision = "20250923_0001"
branch_labels = None
depends_on = None
def upgrade() -> None:
# ... | Python | 1 |
"""翻译API接口封装"""
import json
import requests
import os
# 修改为直接使用config_manager,不通过config.py
from config.config_manager import config_manager
def calculate_timeout(texts):
"""根据文本量动态计算超时时间"""
# 统计总字符数
total_chars = sum(len(text) for text in texts)
# 计算行数
num_lines = len(texts)
# 基础超时设置
b... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
c.field.to_mut()[2][2] = 42;
println!("{:?} {:?} {:?}", a, b, c);
println!(
"{} vs {}",
std::mem::size_of_val(&a),
std::mem::size_of_val(&c)
);
}
}
<gh_stars>10-100
// autogenerated by xdrust
// translated XDR->Rust types and functions
#[allow(d... | Rust | 0 |
ations_without_background.json',
metric='bbox')
# ---------------------13 VehiclesOpenImages---------------------#
class_name = ('Ambulance', 'Bus', 'Car', 'Motorcycle', 'Truck')
metainfo = dict(classes=class_name)
_data_root = data_root + 'VehiclesOpenImages/416x416/'
dataset_VehiclesOpenImages = dict(
type=d... | Python | 1 |
..BenchStr::default()
});
}
}
vec_benchstr.sort_by(|a, b| a.time.partial_cmp(&b.time).unwrap());
//
Ok(vec_benchstr)
}
fn normalize_name(name_s: &str) -> anyhow::Result<String> {
fn strip_prefix<'a, 'b>(x: &'a str, prefix: &'b str) -> Option<&'a str> {
#[cfg(not(has_not_... | Rust | 0 |
igin() -> O {
O::from(RawOrigin::Member(Default::default()))
}
}
pub struct EnsureMembers<N: U32, AccountId, I=DefaultInstance>(sp_std::marker::PhantomData<(N, AccountId, I)>);
impl<
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
N: U32,
AccountId,
I,
> EnsureOrigin<O> for EnsureMe... | Rust | 0 |
v.ingredients.clone())
.filter(|x| !allergic.contains_key(x))
.count()
}
fn task2(input: &Vec<Food>) -> String {
let allergic = find_allergic(input);
let mut list: Vec<(Ingredient, Allergen)> = allergic.into_iter().collect();
list.sort_by_key(|(_, a)| a.to_string());
let list: Vec<Ingr... | Rust | 0 |
x_matrix[:, base_ctr] / np.max(x_matrix, axis=0)[:, base_ctr],
color=params["color_list"][base_ctr],
)
xtic = np.array([0, 0.5, 1, 1.5, 2]) * 12
xtic_figure = [int(x * params["time_bin_resolution"]) for x in xtic]
plt.xticks(xtic, xtic_figure)
plt.xlabel("Time [ms]", labelpad=... | Python | 1 |
11] = 'm';
table[0b11_11_00] = 'l';
table[0b11_11_01] = 'k';
table[0b11_00_11] = 'j';
table[0b11_00_00] = 'i';
table[0b11_00_01] = 'h';
table[0b11_01_11] = 'g';
table[0b11_01_00] = 'f';
table[0b11_01_01] = 'e';
table[0b00_11_11] = 'd';
tabl... | Rust | 0 |
: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[221, 11], OperandSize::Qword)
}
fn fisttp_7() {
run_test(&Instruction { mnemonic: Mnemonic::FISTTP, operand1: Some(IndirectScaledIndexedDisplaced(BX, DI, One, 241, Some(OperandSize::Word), None)), operand2: Non... | Rust | 0 |
-> Result<(), Box<dyn Error>>
where
I: Into<TestInfo<T, U>>,
T: Debug + Serialize + DeserializeOwned + PartialEq,
U: Encode,
{
let info = info.into();
roundtrips(&info.value).map_err(|e| {
format!("{:?} did not roundtrip:\n{}", info.value, e).into()
})... | Rust | 0 |
RadixPlan,
) -> MixedRadixPlan {
// if we can complete the FFT with a single radix, do it
if [2, 3, 4, 5, 6, 7, 8, 9, 12, 16].contains(&radix_factors.product()) {
plan.push_radix(radix_factors.product() as u8)
} else {
// Compute how many powers of 12 and powers of 6 ... | Rust | 0 |
_imm8_sae
0x1003_0082,// EVEX_Vcomish_xmm_xmmm16_sae
0x6403_0402,// EVEX_Vcvtdq2ph_xmm_k1z_xmmm128b32
0x6403_0482,// EVEX_Vcvtdq2ph_xmm_k1z_ymmm256b32
0x6C03_0502,// EVEX_Vcvtdq2ph_ymm_k1z_zmmm512b32_er
0x6403_0582,// EVEX_Vcvtpd2ph_xmm_k1z_xmmm128b64
0x6403_0602,// EVEX_Vcvtpd2ph_xmm_k1z_ymmm256b64
0x6C03_0682,... | Rust | 0 |
lock")
.expect("Encountered a parse error");
assert_eq!(block.span(), &ByteSpan::new(0usize, content.len()));
let name = ByteSpan::new(5usize, content.len() - 2);
assert_eq!(&content[name], "MIXED");
let envs = VarEnvSet([
Some(VarEnv::Environment),
Some(VarEnv::Dotfile),
Some(VarEnv::Profile),
]);
asse... | Rust | 0 |
}
mod better {
struct Foo {}
impl Foo {
fn new() -> Self {
Self {}
}
fn test() -> Self {
Self::new()
}
}
impl Default for Foo {
fn default() -> Self {
Self::new()
}
}
}
//todo the lint does not handle lifetimed s... | Rust | 0 |
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 1 |
from __future__ import print_function, absolute_import
import time
from .utils.meters import AverageMeter
class ClusterContrastTrainer(object):
def __init__(self, encoder, memory=None):
super(ClusterContrastTrainer, self).__init__()
self.encoder = encoder
self.memory = memory
def trai... | Python | 1 |
(|a| a.n), Some(&f));
assert_eq!(cmp::max(e, f), f);
assert_eq!(cmp::max(f, e), e);
assert_eq!(cmp::partial_max(e, f), Some(f));
assert_eq!(cmp::partial_max(f, e), Some(e));
// Similar for `min_max`
assert_eq!(data.iter().min_max(), MinMax(&a, &f));
assert_eq!(data[1..5].iter().min_max(), M... | Rust | 0 |
class Produto:
def __init__(self, name, quantidade):
self.id=""
self.name= name
self.quantidade= quantidade | Python | 1 |
# Generated by Django 3.1.3 on 2020-12-11 15:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("experiments", "0144_merge_20201211_1545"),
]
operations = [
migrations.RemoveField(
model_name="nimbusexperiment",
na... | Python | 1 |
msg += alert.text
await client.send_message(config['telegram_admin'], msg)
print(msg)
sb.wait_for_and_accept_alert()
except Exception:
try:
... | Python | 1 |
:= x + 1;
// return tmp;
result := tmp;
end
"#,
);
}
#[test]
fn test_const_decl() {
check_file_parses("const TEST: float3 := float3(1, 1, 1);");
}
#[test]
fn test_parses_example_file() {
let src = r#"
const
WATER_COLOUR: float... | Rust | 0 |
toc - tic
if delta_time < dt:
blf.clock().sleep_for(dt - delta_time)
else:
blf.log().debug(
"{} The control loop is too slow, real time constraints not satisfied".format(
logPrefix
)
... | Python | 1 |
e number of detectors in a given row. Note that they Y profile includes 2 extra detectors from the other 3.
"""
def drop_cax_sides(vals: np.ndarray) -> np.ndarray:
x_prof_x_vals = np.arange(start=1, stop=len(vals) + 3)
half_idx = math.ceil(len(x_prof_x_vals) / 2) - 1
... | Python | 1 |
import sys
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoProcessor, AutoImageProcessor
from .configuration_videollama3 import Videollama3Qwen2Config
from .configuration_videollama3_encoder import Videollama3VisionEncoderConfig
from .modeling_videollama3 import Videollama3Qwen2Model, Videoll... | Python | 1 |
eature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
#[display(SwapInfo::to_yaml_string)]
pub struct SwapInfo {
#[serde_as(as = "Option<DisplayFromStr>")]
pub swap_id: Option<SwapId>,
// pub state: crate::swapd::State,
// #[serde_as(as = "BTreeMap<DisplayFromStr, Sam... | Rust | 0 |
tch_header_bytes = batch_header.write_to_bytes()?;
batch.set_header(batch_header_bytes.clone());
let b: &[u8] = &batch_header_bytes;
batch.set_header_signature(signer.sign(b)?);
Ok(batch)
}
/// Returns a BatchList containing the provided Batch
///
/// # Arguments
///
/// * `batch` - a Batch
pub fn cr... | Rust | 0 |
get_processing_options_command.push((pdol_data.len() + 2) as u8); // lc
// data
get_processing_options_command.push(0x83); // tag 83
get_processing_options_command.push(pdol_data.len() as u8); // tag 83 length
get_processing_options_comma... | Rust | 0 |
endswith('001F') else stream.decode()
self.bodyStreamIndex = self.streamIndexCounter
urls = self.ExtractURLs(stream)
if len(urls) > 0:
self.dURLs[self.streamIndexCounter] = urls
def PostProcess(self):
oParser = optparse.OptionParser()
oParser.add_option(... | Python | 1 |
_frames
global consecutive_silent_blocks, consecutive_speech_blocks
global speech_trigger_blocks_count, silence_trigger_blocks_count, actual_sample_rate
if status:
print(f"音频流状态信息: {status}", flush=True)
volume_norm = calculate_rms(indata[:, 0])
if is_currently_recording:
recordin... | Python | 1 |
Solution._get_inorder(root.left, inorder)
inorder.append(root.data)
Solution._get_inorder(root.right, inorder)
@staticmethod
def _get_inorder_data(bst: BinarySearchTree) -> List[int]:
inorder = []
Solution._get_inorder(bst.root, inorder)
return inorder
@st... | Python | 1 |
() -> Self {
Self {
buffer: Vec::new()
}
}
}
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use vmm_sys_util::fam::{FamStruct, FamStructWrapper};
use x86::bindings::*;
/// Maximum number of CPUID entries that can be re... | Rust | 0 |
// return EAGAIN or EDEADLK or 0. We rely on that.
debug_assert_eq!(r, 0);
self.num_readers.fetch_add(1, Relaxed);
ReadGuard { lock: self }
}
}
}
#[inline]
pub fn try_write(self: Pin<&Self>) -> Option<WriteGuard> {
#[cfg(... | Rust | 0 |
29, 216, 57, 143, 244, 224, 255, 82, 192, 61, 32, 22, 16, 55, 101, 165, 19,
21, 21, 89, 206, 233, 116, 212, 54, 78, 196, 147, 85, 132,
];
assert_eq!(derive_key("test", "salty"), &expected);
}
}
mod error;
mod cli;
mod sys;
use crate::error::{ErrorKind, Result, ResultExt, CliResult};
... | Rust | 0 |
row(contextptr);
imp.ready(
from_glib_borrow::<_, PrintOperationPreview>(print_operation_preview).unsafe_cast_ref(),
&context,
)
}
unsafe extern "C" fn print_operation_preview_got_page_size<T: PrintOperationPreviewImpl>(
print_operation_preview: *mut ffi::GtkPrintOperationPreview,
cont... | Rust | 0 |
as_mut_ptr(),
distances_squared.as_mut_ptr(),
num as i32,
radius_squared,
&mut self.parameters,
)
};
assert!(retval >= 0);
indices
.into_iter()
.zip(distances_squared.into_iter())
.tak... | Rust | 0 |
th',
# Command-R
'model_max_length',
# Others
'max_sequence_length',
'max_seq_length',
'seq_len',
]
max_len_key = None
for key in possible_keys:
max_len = getattr(hf_tm_config, key, None)
if max_len is not None:
max_len_key = key if... | Python | 1 |
tatic []), NOT IMPLEMENTED
//("(?i)ab*bc", "ABC", Match, "", &'static []), NOT IMPLEMENTED
//("(?i)ab*bc", "ABBC", Match, "", &'static []), NOT IMPLEMENTED
//("(?i)ab*?bc", "ABBBBC", Match, "", &'static []), NOT IMPLEMENTED
//("(?i)ab{0,}?bc", "ABBBBC", Match, "", &'static []), NOT IMPLEMENTED
//("(... | Rust | 0 |
, &callee_args);
let mflags = ir::MemFlags::trusted();
let mut results = Vec::new();
for (i, r) in signature.returns.iter().enumerate() {
let load = builder.ins().load(
r.value_type,
mflags,
values_vec_ptr_val,
(i * val... | Rust | 0 |
")
.map_err(BuilderObtainUserInfoError::Unreachable)?
.to_owned();
Ok(BuilderObtainUserInfoOutput::Static(UserInfo {
uid,
name: Some(name),
email: Some(email),
raw: info.to_owned(),
}))
}
}
pub mod appearance_manager;
mod appea... | Rust | 0 |
import cadquery as cq
# Coil Params
inner_diameter = 200.0
outer_diameter = 370.0
inner_radius = inner_diameter / 2
outer_radius = outer_diameter / 2
coil_thickness = outer_radius - inner_radius
coil_height = coil_thickness/2 # guessing an appropriate value given the thickness of 85
# Creating the cross section
cr... | Python | 1 |
import os
import sys
from PySide6.QtCore import QObject, QRunnable, Signal, Slot, QThreadPool, QThread
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine
class Signals(QObject):
progress = Signal(str)
error = Signal(str)
class Runnable(QRunnable):
def __init_... | Python | 1 |
w(dead_code)]
#![allow(unused_imports)]
use itertools::Itertools;
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::*;
use std::cmp::*;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io;
use std::mem::*;
#[fastout]
fn main() {
input! {
n: usize,
... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class IntRange(object):
_types = {
"greate_than": int,
"greate_equal_than": int,
"less_than": int,
"less_equal_than": int,
}... | Python | 1 |
RDMA_READ = 2,
IBV_WC_COMP_SWAP = 3,
IBV_WC_FETCH_ADD = 4,
IBV_WC_BIND_MW = 5,
IBV_WC_LOCAL_INV = 6,
IBV_WC_TSO = 7,
IBV_WC_RECV = 128,
IBV_WC_RECV_RDMA_WITH_IMM = 129,
IBV_WC_TM_ADD = 130,
IBV_WC_TM_DEL = 131,
IBV_WC_TM_SYNC = 132,
IBV_WC_TM_RECV = 133,
IBV_WC_TM_NO_TAG = 134,
}
<reponame>sohunjug/nacso-rs... | Rust | 0 |
en: ::libc::size_t,
pub size_ondisk: ::libc::size_t,
pub key: *mut ::libc::c_void,
pub seqnum: fdb_seqnum_t,
pub offset: u64,
pub meta: *mut ::libc::c_void,
pub body: *mut ::libc::c_void,
pub deleted: u8,
}
impl ::std::default::Default for Struct_fdb_doc_struct {
fn default() -> Struct_f... | Rust | 0 |
0, 3)), [From(0)]);
assert_eq_u!(a.union(&UpTo(0)), [UpTo(0), UpFrom(0)]);
assert_eq_u!(a.union(&UpFrom(0)), [UpFrom(0)]);
assert_eq_u!(a.union(&To(0)), [Full]);
assert_eq_u!(a.union(&From(0)), [From(0)]);
assert_eq_u!(a.union(&Full), [Full])... | Rust | 0 |
_x = x as f64 + 0.5_f64;
let p_y = y as f64 + 0.5_f64;
let ray = camera.make_ray(p_x, p_y);
let color = compute_color_for_ray(&ray, *camera, *scene, *params/*, &*tree.as_ref()*/, 0);
acc.add_sample(x, y, RayTraceSample { x: p_x, y: p_y, color: color });
},
&Some(ref sampling) => {
let ray_count = s... | Rust | 0 |
from typing import List, Dict
from app.init.postgres import get_db_pool
from app.init.model import GPT
import logging
logger = logging.getLogger(__name__)
async def vector_search_by_title(query: str, limit: int = 5) -> List[Dict]:
"""Search documents by vector similarity"""
try:
# client = GPT()
... | Python | 1 |
pub const FILE_NAME: &str = "SHARDING";
/// The available sharding functions.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Shard {
Prefix(usize),
Suffix(usize),
NextToLast(usize),
}
impl Default for Shard {
fn default() -> Self {
Shard::NextToLast(2)
}
}
impl Shard {
/// Ens... | Rust | 0 |
"""插件管理器类"""
import logging
from threading import Thread
from types import ModuleType
from typing import NoReturn, Dict, Iterable, Optional
from collections import namedtuple
from importlib import reload as pyreload
from . import error
from . import settings
from ..core.tools import file
from ..core.abstract.plugin i... | Python | 1 |
from fastapi import FastAPI
import pickle
import pandas as pd
from pydantic import BaseModel
class ScoringItem(BaseModel):
YearsAtCompany: float
EmployeeSatisfaction: float
Position: str
Salary: int
# Load the model
with open("rfmodel.pkl", "rb") as f:
model = pickle.load(f)
app = FastAPI()
@app... | Python | 1 |
.num_machines == 1:
args.dist_url = 'tcp://127.0.0.1:{}'.format(
torch.randint(11111, 60000, (1,))[0].item())
else:
if args.dist_url == 'host':
args.dist_url = 'tcp://{}:12345'.format(
os.environ['SLURM_JOB_NODELIST'])
elif not args.dist_url.startswith... | Python | 1 |
PackageUniTrackStreamInternal) => (tuple_to_vec!(smpte_identifier!(0x04, 0x01, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00)));
(Ul::Essence_Jpeg2000_FrameWrapped) => (tuple_to_vec!(build_identifier!(version_number => 0x07, jpeg2000 => 0x06)));
}
macro_rules! ul_filter {
(Ul::HeaderPartition) => (par... | Rust | 0 |
pub NSCR: RWRegister<u32>,
/// Flash secure control register
pub SECCR: RWRegister<u32>,
/// Flash ECC register
pub ECCR: RWRegister<u32>,
_reserved2: [u32; 3],
/// Flash option register
pub OPTR: RWRegister<u32>,
/// Flash non-secure boot address 0 register
pub NSBOOTADD0R:... | Rust | 0 |
import argparse
import os
import sys
import shutil
import zipfile
def create_book_zip(folder_path):
# Ensure the provided folder exists
if not os.path.isdir(folder_path):
print(f"❌ Error: The folder '{folder_path}' does not exist.")
return
# Save merged text with timestamps in JSON
js... | Python | 1 |
from langchain.schema.document import Document
from langchain_community.vectorstores import Chroma
from langchain_community.embeddings.ollama import OllamaEmbeddings
from read_pdf import load_documents
from split_text import split_documents
import warnings
# embed the chunks
def get_embedding_function():
embedding... | Python | 1 |
assert res["items"][0]["definition"] == "text_value_definition1"
assert res["items"][0]["abbreviation"] == "abbv"
assert res["items"][0]["template_parameter"] is True
assert res["items"][0]["library_name"] == "Sponsor"
assert res["items"][0]["status"] is None
assert res["items"][0]["version"] is N... | Python | 1 |
(loglikelihood,) = results
words = self.count_words(self.doc_to_target(doc))
bytes_ = self.count_bytes(self.doc_to_target(doc))
return {
"word_perplexity": (loglikelihood, words),
"byte_perplexity": (loglikelihood, bytes_),
"bits_per_byte": (loglikelihood,... | Python | 1 |
embers"): int,
Optional("members"): {
Optional(Any()): {
Optional("rekey_ack_missed"): int,
Optional("rekey_sent"): int,
Optional("version"): str,
... | Python | 1 |
checkout_session_signature = 't=1591264652,v1=1f0d3e035d8de956396b1d91727267fbbf483253e7702e46357b4d2bfa078ba4,v0=20d76342f4704d49f8f89db03acff7cf04afa48ca70a22d608b4649b332c1f51'
checkout_session_body = b'{\n "id": "evt_1GqFpHAlCFm536g8NYSLoccF",\n "object": "event",\n "api_version": "2019-05-16",\n "created": 159... | Python | 1 |
514C); // ERROR_PCW_TFILEDATA_LONG_FILE_TABLE_KEY
#[doc(hidden)] pub const PCW_TFILEDATA_BLANK_FILE_TABLE_KEY : HResultError = HResultError::from_constant(0xC00E514D); // ERROR_PCW_TFILEDATA_BLANK_FILE_TABLE_KEY
#[doc(hidden)] pub const PCW_TFILEDATA_MISSING_FILE_TABLE_KEY : HResultError = HResultError::from_constant(0... | Rust | 0 |
from __future__ import print_function
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
import warnings
from theano.compat.six.move... | Python | 1 |
use cssparser::{match_ignore_ascii_case, Parser, Token, _cssparser_internal_to_lowercase};
use crate::css_writer::{CssWriter, ToCss};
use crate::parser::ParseError;
use crate::stylesheets::rule_parser::StyleParseErrorKind;
/// Whether a media feature allows ranges or not.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]... | Rust | 0 |
= "Reader of field `DETECT_SIG_EN`"]
pub type DETECT_SIG_EN_R = crate::R<bool, DETECT_SIG_EN_A>;
impl DETECT_SIG_EN_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DETECT_SIG_EN_A {
match self.bits {
false => DETECT_SIG_EN_A::DETECT_SIG_EN_0,
... | Rust | 0 |
ampling_manager = AdaptiveSamplingManager(
initial_k=32,
min_k=8,
max_k=128,
variance_threshold=0.1
)
print("Simulating training with varying variance...")
# Simulate training with varying variance
k_history = []
variance_history = []
for epoch in r... | Python | 1 |
import numpy as np
from kalmanFilter import KalmanFilter
from scipy.optimize import linear_sum_assignment
from collections import deque
class Tracks(object):
"""docstring for Tracks"""
def __init__(self, detection, trackId):
super(Tracks, self).__init__()
self.KF = KalmanFilter()
self.KF.predict()
self.KF.... | Python | 1 |
"""
This tutorial on low-memory dropout required the least editing of all the original Triton documentation tutorials
What you'll learn:
- Parallel pseudo-random number generation
"""
import torch
import triton
import triton.language as tl
DEVICE = torch.device(f'cuda:{torch.cuda.current_device()}')
@triton.jit
def ... | Python | 1 |
AccessRights::Eqv <= gen_access_right, true);
}
}
#[test]
fn reads_partial_ordering() {
let read = AccessRights::Read;
assert_eq!(read == AccessRights::Read, true);
assert_eq!(read < AccessRights::ReadAdd, true);
assert_eq!(read < AccessRights::ReadWrite, true);
... | Rust | 0 |
primitives/`std::` types
//!
//! * `[x]` Cargo `feature`s for implementing `BsonSchema` for "atomic"
//! types in foreign crates, for instance, `url::Url` and `uuid::Uuid`.
//!
//! * `[x]` `#[derive(BsonSchema)]` on regular, named-field structs
//!
//! * `[x]` `#[derive(BsonSchema)]` on newtype structs
//!
//! * `[x]... | Rust | 0 |
ew(callback_data, callback);
let callback_wrapper_ptr = callback_wrapper.into_raw();
let err_code = nidaqmx_sys::DAQmxRegisterEveryNSamplesEvent(
self.get(),
SAMPLES_EVENT_TYPE,
n_samps,
callback_utils::CALLBACK_OPTIONS,
raw_callback,
callback_wrapper_ptr,
);
self.chk_err_code(err_code);
}
... | Rust | 0 |
from subprocessHelper import get_output
from pathHelper import *
from os import path, makedirs, system, remove, rename
from shutil import rmtree
from math import floor
from random import uniform as r
def constrain(val, min_val, max_val):
if val == None:
return None
if type(val) == str:
val ... | Python | 1 |
# cook your dish here
X = int(input())
years = (25 - X + 3) // 4
print(years)
| Python | 1 |
uration = round(ed - st, 2)
logger.info(f'音频下载完成: {title}, 耗时: {duration}秒')
print(f'{duration} seconds download finish: {title}')
time.sleep(1)
except Exception as e:
logger.error(f'音频下载失败: {title}, 错误: {str(e)}')
raise
def... | Python | 1 |
low = 1. / nyq
high = 30. / nyq
order = 6
b, a = butter(order, [low, high], btype='band')
signal = filtfilt(b, a, signal)
#plt.plot(x/125., signal[0, :])
#plt.xlabel('time (s)')
#plt.ylabel('amplitude\n(arbitrary\nunit)')
#plt.savefig(os.path.join(save_dir, 'viz_out_stage%s.png' %str... | Python | 1 |
onse(self, user_message: str) -> None:
"""Simulates an assistant's response and updates the chat UI.
Args:
user_message (str): The user's message to which the assistant is responding.
This method currently echoes the `user_message` as a simulated response.
It adds this resp... | Python | 1 |
diccionario = {
"nombre": "kenndy",
"apellido": "lavado",
"edad": "18"
}
#recorriendo diccionariso para obtener key y value
for datos in diccionario.items():
key = datos[0]
value = datos[1]
print(f'la clave es: {key} y el valor es {value}')
| Python | 1 |
BoxError;
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Ok(()).into()
}
fn call(&mut self, _req: http_compat::Request<Bytes>) -> Self::Future {
let metric_families = self.registry... | Rust | 0 |
Buffer;
}
trait DimName {
type Value;
fn name() -> Self;
}
trait FiniteElementAllocator<GeometryDim, NodalDim>:
Allocator<f64, GeometryDim> + Allocator<f64, NodalDim>
{
}
trait ReferenceFiniteElement {
type NodalDim;
}
trait FiniteElement<GeometryDim>: ReferenceFiniteElement
where
DefaultAllocator: ... | Rust | 0 |
rust-disbot
use crate::battle::{
model::CharaConfig,
rpg_core::{BattleData, PlayMode},
utils::dir_files,
};
use chrono::prelude::{Local, NaiveDateTime};
use rand::prelude::IteratorRandom;
use uuid::Uuid;
/// Structure for making battles from fragmentary information
#[derive(Debug, Clone, PartialEq, Partial... | Rust | 0 |
ndows-storage")] #[inline] pub fn get_status_async(&self, storageItem: &super::super::storage::IStorageItem) -> Result<ComPtr<foundation::IAsyncOperation<FileProtectionStatus>>> { unsafe {
let mut out = null_mut();
let hr = ((*self.lpVtbl).GetStatusAsync)(self as *const _ as *mut _, storageItem as *con... | Rust | 0 |
Returns:
The flavor logo.
"""
return "https://public-flavor-logos.s3.eu-central-1.amazonaws.com/orchestrator/lightning.png"
@property
def config_class(self) -> Type[LightningOrchestratorConfig]:
"""Returns `KubeflowOrchestratorConfig` config class.
Returns:... | Python | 1 |
class Solution:
def parseBoolExpr(self, expression: str) -> bool:
def dfs(sub_expression):
operator = sub_expression[0]
# print(operator)
values = sub_expression[2:-1]
# print(values)
if operator == '!':#if the operator is not
... | Python | 1 |
}
};
inline BitField operator&(const BitField& lhs, const BitField& rhs){
BitField retval(lhs);
retval &= rhs;
return retval;
}
"""
def test_members(self):
"""Make sure we can find all the members of a class."""
se... | Python | 1 |
Int => b'I',
PrimitiveType::Long => b'J',
PrimitiveType::Short => b'S',
PrimitiveType::Boolean => b'Z'
}
}
}
impl fmt::Display for PrimitiveType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", char::from(self.as_char()))
}
}
#[de... | Rust | 0 |
#[cfg_attr(test, assert_instr(vtestpd))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm_testc_pd(a: __m128d, b: __m128d) -> i32 {
vtestcpd(a, b)
}
/// Compute the bitwise AND of 128 bits (representing double-precision (64-bit)
/// floating-point elements) in `a` and `b`, producing an intermed... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.