text string | label_name string | labels int64 |
|---|---|---|
ndow
# (2) Get the autocorrelation logs and LPC params used
# to compute the LLR measure
R_clean, Ref_clean, A_clean = lpcoeff(clean_frame, P)
R_processed, Ref_processed, A_processed = lpcoeff(processed_frame, P)
A_clean = A_clean[None, :]
A_processed = A_processed[None,... | Python | 1 |
.tex_int();
}
pub(crate) unsafe fn geq_word_define(p: usize, w: i32) {
EQTB[p].val = w;
_xeq_level_array[p - (INT_BASE as usize)] = LEVEL_ONE;
}
pub(crate) unsafe fn save_for_after(t: i32) {
if cur_level > LEVEL_ONE {
if SAVE_PTR > MAX_SAVE_STACK {
MAX_SAVE_STACK = SAVE_PTR;
... | Rust | 0 |
};
let a_re = anywhere_re(&needles, true);
let c_re = consecutive_re(&needles, true);
let cur_dir = env::current_dir().unwrap();
let sorted = db.sorted();
let sorted_main: Vec<_> = sorted
.iter()
.filter(|(p, _)| {
let path = PathBuf::from(p);
path.exists() &... | Rust | 0 |
)
.invoke_4(
el.into(),
name.as_ptr() as u32,
name.len() as u32,
value.handle,
);
}
}
pub fn set_property<T>(el: impl Into<f64>, id: &str, v: T)
where
T: SetProperty,
{
T::set_property(el, id, v)
}
pub fn is_property_null(el: impl Into<f64>, ... | Rust | 0 |
subl[3] = krl;
subr[3] = krr;
camellia_roldq!(kll, klr, krl, krr, w0, w1, 15);
subl[6] = kll;
subr[6] = klr;
subl[7] = krl;
subr[7] = krr;
camellia_roldq!(kll, klr, krl, krr, w0, w1, 15);
subl[8] = kll;
subr[8] = klr;
subl[9] = krl;
subr[9] = krr;
camellia_roldq!(kll... | Rust | 0 |
assert_eq!(
digest,
"sha256:51d9b231d5129e3ffc267c9d455c49d789bf3167b611a07ab6e4b3304c96b0e7"
);
}
#[tokio::test]
async fn test_pull_layer() {
let image = Reference::try_from(HELLO_IMAGE).expect("failed to parse reference");
let mut c = Client::default()... | Rust | 0 |
.len()];
let mut pos = 0;
for i in 1..pattern.len() {
while pos > 0 && pattern[i] != pattern[pos] {
pos = table_of_ocurrencies[pos - 1];
}
if pattern[pos] == pattern[i] {
pos += 1;
table_of_ocurrencies[i] = pos;
... | Rust | 0 |
a PDF")
files = [("files", ("test.txt", text_file, "text/plain"))]
data = {"document_type": "Test"}
response = client.post(
f"/credit-request/{credit_request_id}/documents",
files=files,
data=data
)
assert response.status_code == 400
assert "Unsupported fi... | Python | 1 |
bytes_mut(&mut self) -> &mut [u8] {
self
}
}
pub struct Value<B, V>
where
B: GetBytesMut,
{
pub(crate) bytes: ManuallyDrop<B>,
pub(crate) type_id: TypeId,
pub(crate) vtable: Arc<(DropFn, V)>,
}
//pub type SmallValue<V> = Value<usize, V>;
pub type BoxValue<V> = Value<Box<[u8]>, V>;
//pub ty... | Rust | 0 |
import urllib.request as ur
import zipfile
import os
import os.path as osp
from six.moves import urllib
import errno
from tqdm import tqdm
GBFACTOR = float(1 << 30)
def decide_download(url):
d = ur.urlopen(url)
size = int(d.info()["Content-Length"])/GBFACTOR
### confirm if larger than 1GB
if size > 1... | Python | 1 |
127]),
Rgba([255, 255, 255, 255]),
],
);
test_image(
"./_tests_output_/rec/a_albedo-ao.png",
(1, 2),
&[Rgba([255, 255, 255, 119]), Rgba([0, 0, 0, 185])],
);
}
use quickcheck::Arbitrary;
use super::*;
impl Arbitrary for Refspec {
fn arbitrary(g: &mut quickc... | Rust | 0 |
e tool (must match the JSON schema name and source code function name).")
model_config = ConfigDict(extra="ignore") # Allows extra fields without validation errors
# TODO: Remove this, and clean usage of ToolUpdate everywhere else
class ToolRunFromSource(LettaBase):
source_code: str = Field(..., descrip... | Python | 1 |
�', '꤂', '璘', '𖹕',
'𛀺', 'ɥ', '𐊃', '𛃥', '𖠲', '𝈖', '𐏋', 'ᶅ', '𐫓', '〉', '⽹', '𝍏',
'ꁅ', '𒂾', '🅘', '𘩍', '𖨁', '𔔟', '𑆲', '\u{10f4b}', '👐', '\u{321}',
'𐧊', '𒃈', 'ㅯ', '𒆮', '𔙂', '⅜', '𝥘', '枅', '🦝', '⋜', '瑜',
'ꁂ', 'ᑉ', '\u{e0166}', '\u{6ed}', '\u{aa2d}', 'ᑱ', '𐋐', '揅', '𑰜', 'ᬇ',
'𖮋', '... | Rust | 0 |
6z, p2j5rqo_l8_, bge2nvdqiyh, akwqjtb7e69 as jru6ekz1ma2
from egmmevvjp8e import jwb_bdo_6lq as vrcuduksa3k, ebtm4a1cxq_, gd6jmk6tgqc as mgtj_eik_y5, v6sygkv_28n, zdvjw67lqab as tv95z9dnjun
'# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves'
'# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves... | Python | 1 |
model/Friction/Friction Alt/v2z'
* '<S23>' : 'ims_Build5pt1f/Mount_Drv_PDR2021/MTM CT LUGRE Fr model/Friction/Friction Alt/g(v)/gs'
* '<S24>' : 'ims_Build5pt1f/Mount_Drv_PDR2021/MTM CT LUGRE Fr model/Friction/Friction Az/g(v)'
* '<S25>' : 'ims_Build5pt1f/Mount_Drv_PDR2021/MTM CT LUGRE Fr model/Friction/Friction ... | Rust | 0 |
.with_arg(&file_info)?
.with_arg(&receiver.prepare_file_transfer(file_info))?;
writer.write_frame(message).await?;
let response = reader.next_frame().await?.unwrap();
assert_eq!(response.frame_ident(), "request_file");
let events_buffer ... | Rust | 0 |
group: ColorS
/// * `blue` group: ColorS
/// * `alpha` group: ColorS
pub type glColor4s_t = unsafe extern "system" fn(red: GLshort, green: GLshort, blue: GLshort, alpha: GLshort);
/// glColor4sv
/// * `v` group: ColorS
pub type glColor4sv_t = unsafe extern "system" fn(v: *const [GLshort; 4]);
/// glColor4ub
/// * `r... | Rust | 0 |
const cudaDevAttrMaxTextureCubemapWidth: cudaDeviceAttr = 52;
pub const cudaDevAttrMaxTextureCubemapLayeredWidth: cudaDeviceAttr = 53;
pub const cudaDevAttrMaxTextureCubemapLayeredLayers: cudaDeviceAttr = 54;
pub const cudaDevAttrMaxSurface1DWidth: cudaDeviceAttr = 55;
pub const cudaDevAttrMaxSurface2DWidth: cudaDevice... | Rust | 0 |
assert_eq!(self.0.get_direction(), target.get_direction());
self.0.set_target(Some(target))?;
Ok(self.0)
}
}
// Copyright 2018-2020 Cargill Incorporated
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Licens... | Rust | 0 |
import psycopg2
def query_contacts(last_name=None):
conn = psycopg2.connect(
host='localhost',
database='phone',
user='postgres',
password='6618',
)
conn.autocommit = True
cursor = conn.cursor()
if last_name:
cursor.execute("SELECT * FROM PhoneBook WHERE la... | Python | 1 |
, isize);
struct Animal {
weight: usize,
name: String,
kind: String,
}
fn main() {
let struct_tuple = Tuple(1, 2);
// struct_tuple[0] -- wrong
let tuple = (1, 2);
println!("Struct tuple: ({} {})", struct_tuple.0, struct_tuple.1);
// Same goes for regular tuple
println!("Tuple: (... | Rust | 0 |
"""Modulo donde se manejan las conecciones a las bases de datos.
En este módulo se manejan todas las conecciones a las bases de datos
mediante código para establecer estas conecciones de manera agnostica
en el desarrollo.
Las conecciones soportadas de momento son:
- [x] DuckDB
- [x] Postgres
- [ ] Mysql
> [!NOTE] ... | Python | 1 |
t(unittest.makeSuite(SqlTestCase))
return suite
#--------------------------------------------------------------
def Run(verbose = 2):
return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite())
#--------------------------------------------------------------
if __name__ == '__main__':
if Run().wa... | Python | 1 |
str, required=True)
parser.add_argument("--config_file", type=str, help="Path to config file")
args, opts = parser.parse_known_args()
print(f"opts: {opts}")
config_file = args.config_file
del args.config_file
if config_file:
cfg = OmegaConf.load(config_file)
cfg = OmegaConf.merg... | Python | 1 |
'.7z', 'w', zipfile.ZIP_DEFLATED) as zipf:
# zipf.write(cam, os.path.split(cam)[1])
# print('compactando... FIM ', time.ctime())
# import py7zr
# print(time.ctime(), 'compactando... ')
# with py7zr.SevenZipFile(cam + '.7z', 'w') as archive:
# archive.writeall(cam, os.path.split(cam)[1])
# print(time.ctime... | Python | 1 |
r!(MostPlayedEmbed {
author,
description,
footer,
thumbnail,
title,
});
use std::fs;
struct Cart {
x: i32,
y: i32,
dir: (i32, i32),
next_turn: u32,
}
fn main() {
let input = fs::read_to_string("input").expect("Error reading file");
let grid: Vec<Vec<char>> = input.lines().... | Rust | 0 |
// use fallback on windows, since it's faster
#[cfg(all(target_os = "windows",
any(target_pointer_width = "32",
target_pointer_width = "64")))]
fn memchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
fallback::memchr(needle, haystack)
}
memchr_spe... | Rust | 0 |
<< 0)
pub const mask: u8 = 0xff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
}
#[repr(C)]
pub struct RegisterBlock {
/// Control Register
pub CTRL: RWRegi... | Rust | 0 |
# Copyright 2025 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
:subxt::StorageEntryKey {
::subxt::StorageEntryKey::Plain
}
}
pub struct Vaults(pub ::core::primitive::u64);
impl ::subxt::StorageEntry for Vaults {
const PALLET: &'static str = "Vault";
const STORAGE: &'static str = "Vaults";
type Value = runtime_types::pallet_vault::models::VaultInfo<
... | Rust | 0 |
for deploy_arg_name, deploy_arg_list in deploy_op_args.items():
# if deploy_arg_name != 'c++_type' and isinstance(deploy_arg_list, str):
# op_graph_code += f'{deploy_arg_list}\n'
# if arg_code == '':
# arg_code = '{"'+deploy_arg_name+'",'... | Python | 1 |
'{}' (expected [always, once, never]).",
s
)?,
Error::InvalidSlot(slot) => writeln!(
f,
"Invalid slot '{}' (expected number between 1 and 20).",
slot
)?,
Error::InvalidTouchPolicy(s) => writeln!(
... | Rust | 0 |
string_double_quote = "Morshed Alam"
single_quote = 'Morshed Alam'
triple_single_quote = '''Hello Python'''
triple_double_quote = """I love you Python.""" | Python | 1 |
op = c;
if part == 2 {
// addition has precedence over muiltiplication
// so hold off on performing the mult for now
states.push_back(curr_state);
curr_state = State::new(false);
}
}
'... | Rust | 0 |
from .. import IconBase
class IconUndoDot(IconBase):
class_name = "lucide lucide-undo-dot"
svg_data = {
"attrs": {
"width": "24",
"height": "24",
"view_box": "0 0 24 24",
"fill": "none",
"stroke": "currentColor",
"stroke_width": "2",
"stroke_linecap"... | Python | 1 |
let body_value: serde_json::Value = serde_json::from_slice(&body)?;
let message = match body_value.get("message") {
Some(value) => value.as_str().unwrap_or("Request was malformed."),
None => "Request malformed.",
};
... | Rust | 0 |
basic/basic.pl");
let query = parse_query("append(list(a, nil), list(b, nil), list(a, list(b, nil))).");
let results = solve_toplevel(false, &source, query);
compare_answers(results, &["Yes"]);
}
#[test]
fn test_basic_14_succeeds() {
let source = read_source_code("tests/example_programs/basic/basic.p... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from __future__ import division
import numpy as np
from annotator.uniformer.mmcv.image import rgb2bgr
from annotator.uniformer.mmcv.video import flowread
from .image import imshow
def flowshow(flow, win_name='', wait_time=0):
"""Show optical flow.
Args:
... | Python | 1 |
max_size=max_scale,
inverse_uniform_sampling=inverse_uniform_sampling,
)
frames, _ = random_crop(frames, crop_size)
else:
transform_func = (
random_resized_crop_with_shift
if motion_shift
else ran... | Python | 1 |
_mul(rhs.0))
}
}
impl<T: Mul<Output = T> + HasSaturatingMul> MulAssign for SaturatingNumber<T> {
fn mul_assign(&mut self, rhs: Self) {
self.0 = self.0.do_saturating_mul(rhs.0)
}
}
impl<T: fmt::Debug> fmt::Debug for SaturatingNumber<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result ... | Rust | 0 |
s = input().split() #把输入拆分成列表
height = [int(i) for i in s] #把列表元素转换成数字
height1=height[0]
height[0]=height[1]
height[1]=height1
print(height) | Python | 1 |
f_map_type::*;
match *self {
Unspec => BPF_MAP_TYPE_UNSPEC,
Hash => BPF_MAP_TYPE_HASH,
Array => BPF_MAP_TYPE_ARRAY,
ProgArray => BPF_MAP_TYPE_PROG_ARRAY,
PerfEventArray => BPF_MAP_TYPE_PERF_EVENT_ARR... | Rust | 0 |
#!/usr/bin/python3
def update_dictionary(a_dictionary, key, value):
if key in a_dictionary:
a_dictionary[key] = value
for keys, values in sorted(a_dictionary.items()):
print("{}: {}".format(keys, values))
if key not in a_dictionary:
a_dictionary[key] = value
for keys,... | Python | 1 |
P_SetCookie => {
vm.setCookies(nowOp.p1);
}
VmOpType::OP_VerifyCookie => {
let cookies = vm.getCookies();
if cookies != nowOp.p1 {
return Err(String::from("cookies is not right"));
}
}
VmOpType::OP_Open => vm.setCursor(nowOp.p1 as usize, &nowOp.p3, DbWra... | Rust | 0 |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: proto
class InvocationPolicy(object):
SINGLE = 0
FIRST = 1
LAST = 2
ROUNDROBIN = 3
RANDOM = 4
| Python | 1 |
s performed when parsing bencode.
if (component == ".") || (component == "..") {
bail!(ErrorKind::MalformedTorrent(Cow::Borrowed(
r#""path" contains "." or ".."."#
)));
... | Rust | 0 |
Dictionary with 'parents' and 'children' lists of documents
"""
# Get parent chunks
parent_chunks = self.parent_chunker.split_text(text, metadata, content_type)
# Process each parent to get children
all_children = []
for i, parent in enumerate(p... | Python | 1 |
equired
fn fidlhdl_need_read(hdl: u32);
/// Create a socket pair
fn fidlhdl_socket_create(sock_opts: SocketOpts) -> FidlHdlPairCreateResult;
}
#[derive(Debug)]
struct HdlWaker {
hdl: u32,
waker: AtomicWaker,
}
impl HdlWaker {
fn sched(&self, cx: &mut... | Rust | 0 |
local_world_size=ppn,
)
template = ProcessTemplate(
target=training_fn,
args=training_args,
kwargs=training_kwargs,
env=env,
policy=policy,
stderr=... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Demonstrates use of GLScatterPlotItem with rapidly-updating plots.
"""
## Add path to library (just for examples; you do not need this)
import initExample
import pyqtgraph as pg
from pyqtgraph import functions as fn
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
impo... | Python | 1 |
# Justpy Tutorial demo tool_tip_demo1 from docs/charts_tutorial/tooltips.md
import justpy as jp
# https://www.highcharts.com/demo/line-basic
chart_def = """
{
chart: {
type: 'spline'
},
title: {
text: ''
},
subtitle: {
text: 'JustPy Tooltip Demo'
},
yAxis: {
tit... | Python | 1 |
impl DMAMUXPER1R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
DMAMUXPER1R::TIMER0_MATCH_0 => 0,
DMAMUXPER1R::USART0_TRANSMIT => 1,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(... | Rust | 0 |
pkg} mAP using {pred_json} and {anno_json}...")
try: # https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb
for x in pred_json, anno_json:
assert x.is_file(), f"{x} file not found"
check_requirements("pycocotools>=2.0.6" if se... | Python | 1 |
: input.label
, rhs : body(input.rhs)
}
}
fn body(input: Body) -> Body {
match input.alloc
{ RegAllocForm::Allocated(_) => Body { alloc : input.alloc , expression : input.expression }
, RegAllocForm::Unallocated(mut alloc_info, locs) => {
let mut conflicts : Graph<RegConflict, (), U... | Rust | 0 |
{
assert_eq!(
FilePaths {
folder_path: format!(
"{}/.config/pash",
env::var("HOME").context("Failed to get $HOME")?
),
config_path: format!(
"{}/.config/pash/config.toml",
... | Rust | 0 |
for oti in records {
let code = CodeRange::try_from(oti.code.as_str()).expect(&format!("Unexpected OTI {:?}", &oti.code));
let const_name = self.create_const_name(&oti);
if const_name == "WITHDRAWN" {
fmt_fn.line(format!(" {}(0x{}) => \"WITHDRAWN\",", "Ob... | Rust | 0 |
'𓁈', '⭾', 'ㅩ', '𝘳',
'🫦', '𓎞', '\u{1cd2}', 'Ꞧ', 'ᶢ', '\u{11c3d}', '┲', '𐎫', '𒂇', '𐺏',
'𒉳', 'ᐴ', '𑖹', '𓀳', '🂬', '₴', '𑨦', '☮', '𐎎', '🈜', '𘡛',
'𐼋', '𝥜', '🠆', 'Ⴥ', 'ﯡ', '𛄝', 'ܥ', 'ⴴ', '☻', '𔐇', '𔕳', '𘫲',
'𞊦', '㌏', 'ᓈ', '𝂥', '𐫴', '𝦝', '𘠳', '𐚤', '𒕃', 'ᝂ', '🦖',
'ཿ', '𒔹', '㆗',... | Rust | 0 |
ct update is successful"}
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail="You are not authorized to use this method"
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail="You are not authorized... | Python | 1 |
import os
import torch.multiprocessing as mp
os.environ["OMP_NUM_THREADS"] = str(min(16, mp.cpu_count()))
import torch
import torch.distributed as dist
from src import logging, options, utils
def main_worker(rank, args):
if args.ddp:
dist.init_process_group(backend="nccl", init_method=args.dist_url, w... | Python | 1 |
}
}
struct AncestorIterator<'a> {
current_slot_hash_key: SlotHashKey,
fork_infos: &'a HashMap<SlotHashKey, ForkInfo>,
}
impl<'a> AncestorIterator<'a> {
fn new(
start_slot_hash_key: SlotHashKey,
fork_infos: &'a HashMap<SlotHashKey, ForkInfo>,
) -> Self {
Self {
... | Rust | 0 |
let mut reversed = None;
let mut unreversed = head;
while let Some(mut unreversed_node) = unreversed {
unreversed = unreversed_node.next;
unreversed_node.next = reversed;
reversed = Some(unreversed_node);
}
reversed
}
pub fn merge(mut... | Rust | 0 |
as_multi_targets().axis_iter(Axis(1)))
.map(|(a, b)| a.max_error(&b))
.collect()
}
/// Mean error between two continuous variables
fn mean_absolute_error(&self, other: &T) -> Result<Array1<F>> {
self.as_multi_targets()
.axis_iter(Axis(1))
.zip(other.as... | Rust | 0 |
refore it can be dropped at
/// any time. Prefer to use the handle returned from `initialize` whenever
/// possible.
pub unsafe fn get(&self) -> Option<&GenericDetour<T>> {
self.inner.load(Ordering::SeqCst).as_ref().map(|i| &i.detour)
}
}
/// A type-safe static detour.
///
/// It can only be in... | Rust | 0 |
# pytest ini import source folder lv_explorer
# vscode settings includes folder lv_explorer for type hinting
# ----- for direct debugging ------
def debugger_is_active() -> bool:
return hasattr(sys, 'gettrace') and sys.gettrace() is not None
if debugger_is_active:
import os, sys
sys.path.insert(0, os.path... | Python | 1 |
from copy import deepcopy
import yaml
import os
from tqdm import tqdm
import sys
from pathlib import Path
import argparse
import logging
import time
import warnings
import torch
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from dataset import FewShot
from models import SSP... | Python | 1 |
import warnings
def _raise_video_deprecation_warning():
warnings.warn(
"The video decoding and encoding capabilities of torchvision "
"are deprecated from version 0.22 and will be removed in version 0.24. "
"We recommend that you migrate to TorchCodec, where we'll consolidate "
"th... | Python | 1 |
AR_MAX: ::std::os::raw::c_uint = 111;
pub const _SC_SCHAR_MIN: ::std::os::raw::c_uint = 112;
pub const _SC_SHRT_MAX: ::std::os::raw::c_uint = 113;
pub const _SC_SHRT_MIN: ::std::os::raw::c_uint = 114;
pub const _SC_UCHAR_MAX: ::std::os::raw::c_uint = 115;
pub const _SC_UINT_MAX: ::std::os::raw::c_uint = 116;
pub const ... | Rust | 0 |
total for tqdm progress bar
FINMME_TOTAL_COUNT = 11099
total = sample_size if sample_size else FINMME_TOTAL_COUNT - len(processed_indices)
desc = f"Processing with {num_processes} processes"
results_iterator = pool.imap_unordered(process_single_item, process_args_stream)
... | Python | 1 |
ck_query
await query.answer()
# This would typically come from analytics/database
# For now, showing mock data structure
stats_report = f"""📈 **آمار استفاده از Prompts**
🎯 **محبوبترین Prompts:**
• health_analysis: 1,234 استفاده
• ai_chat: 987 استفاده
• emergency: 456 استفاده
• nutrition:... | Python | 1 |
e
# """
# # Assuming the second class (index 1) is the positive class for AUC calculation
# positive_class_outputs = np.array([output[1] for output in all_outputs])
# all_labels = np.array(all_labels)
# # Calculate AUC score
# auc_score = roc_auc_score(all_labels, positive_class_outputs)
# ... | Python | 1 |
use btrfsutil_sys::btrfs_util_start_sync;
use btrfsutil_sys::btrfs_util_wait_sync;
/// Start syncing on a btrfs filesystem.
pub fn sync<'a, P>(path: P) -> Result<()>
where
P: Into<&'a Path>,
{
sync_impl(path.into())
}
fn sync_impl(path: &Path) -> Result<()> {
let path_cstr = common::path_to_cstr(path);
... | Rust | 0 |
t=60,
font=("Arial", 16)
)
play_both_button.pack(padx=20, pady=20, fill="x")
def play_both_missions(self):
"""
Handles the "Play Both Missions" button click.
Executes missions for both robots concurrently.
"""
# Check if both robots have a selecte... | Python | 1 |
_http_vsn_strR t _http_vsnRA R t encodet UnicodeEncodeErrort putheaderR R R R R} R ( R) R\ t urlt skip_hostt skip_accept_encodingRn t netloct nilt
netloc_encR R t host_enc( ( sC C:\UsersIFJC\01803318414\Downloads\play-1.5.3\python\lib\httplib.pyt
... | Python | 1 |
'message': 'update',
'variable': 'notice',
'notice': {
'title': messageNameBase + '-title',
'description': messageNameBase + '-text',
'url': messageNameBase + '-url',
'showPicture': False,
'picture': None,
... | Python | 1 |
test::assert_about_eq;
use uom::si::frequency::hertz;
use crate::{
apu::tests::{test_bed, test_bed_with},
simulation::test::SimulationTestBed,
};
use super::*;
#[test]
fn starts_without_output() {
assert!(apu_generator().is_unpowered());
}
#[test]
fn when_... | Rust | 0 |
from pyqpanda import *
import numpy as np
from dotenv import load_dotenv
def deutsch_jozsa_algorithm():
# 加载.env文件
load_dotenv()
# 从环境变量中读取API密钥
online_api_key = os.getenv("API_KEY")
# 初始化在线量子虚拟机
machine = QCloud()
machine.set_configure(24, 24)
machine.init_qvm(online_api_key, True)... | Python | 1 |
gerador` para obter mais informações. Ferramentas disponíveis: `./gerarpessoa`, `./gerarcartao`, `./geraremail`, `./gerarcpf`, `./gerarusr`, `./gerarsenha`, `./gerarveiculo`, `./gerartel`, `./gerarimei`', inline=False)
embed.add_field(name="🎵 Músicas", value='Use o comando `./musica` para vizualizar os comando... | Python | 1 |
eted({})", key)
},
TryBusEvent::NoData => {
write!(f, "no-data")
}
}
}
}
impl<D> PartialEq<TryBusEvent<D>>
for TryBusEvent<D>
where D: PartialEq<D>,
Dao<D>: PartialEq<Dao<D>>
{
fn eq(&self, other: &TryBusEvent<D>) -> bool {
match self {... | Rust | 0 |
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1.920, 2.08, 0.001);
p1 = x**9 -18*x**8 + 144*x**7 -672*x**6 + 2016*x**5 -4032*x**4 + 5376*x**3 -4608*x**2 + 2304*x - 512
p2 = (x-2)**9
plt.plot(x, p1, label = "p1(x)")
plt.plot(x, p2, label = "p2(x)")
plt.legend()
plt.show()
| Python | 1 |
,
_table_name: &str,
_expected_rows_per_query: u32,
) -> u32 {
let rows_read = self.run_counting_query(r"SELECT variable_name, variable_value from PERFORMANCE_SCHEMA.SESSION_STATUS where Variable_name = 'Innodb_rows_read'");
// Note: we explicitly do not call `get_count_of_rows_... | Rust | 0 |
reset_button = gr.Button(value="Reset")
run_button = gr.Button(value="Run")
delete_last_drag_button = gr.Button(value="Delete last drag")
delete_last_step_button = gr.Button(value="Delete last step")
with gr.Column(scale=7):
with gr.Row():
with ... | Python | 1 |
core::fmt::Result {
write!(f, "{}", self.0)
}
}
impl PartialEq for Object {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Eq for Object {}
impl PartialOrd for Object {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
self.id.partial_cmp... | Rust | 0 |
#!/usr/bin/env python3
#
# Functional test that boots known good tuxboot images the same way
# that tuxrun (www.tuxrun.org) does. This tool is used by things like
# the LKFT project to run regression tests on kernels.
#
# Copyright (c) 2023 Linaro Ltd.
#
# Author:
# Alex Bennée <alex.bennee@linaro.org>
#
# SPDX-Licens... | Python | 1 |
)]
pub enum Event {}
mod issue_date;
use crate::code::Code;
use chrono::NaiveDate;
use issue_date::parse_issue_date;
use scraper::{
ElementRef,
Selector,
};
pub const PC_CODE_INDEX: usize = 0;
pub const PLAYSTATION_CODE_INDEX: usize = 1;
pub const XBOX_CODE_INDEX: usize = 2;
/// A shift code table entry wrap... | Rust | 0 |
training_results.sample_id, -1))
selected_tokens = to_int32(
sequence_mask * (sample_mask * to_float(decoder_target)
+ (1. - sample_mask) * to_float(training_results.sample_id)))
# Argmax tokens are the most likely... | Python | 1 |
let v = y as f32 / height as f32;
let pix = &mut pixels[(y * width + x) as usize];
Imath_half_from_float(&mut pix.r, u);
Imath_half_from_float(&mut pix.g, v);
Imath_half_from_float(&mut pix.b, 0.0f32);
Imath_half_from_float... | Rust | 0 |
Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* ... | Rust | 0 |
// to clone inside iter(). We can benchmark this
// separately and subtract it out.
black_box(input);
} else {
let mut sink = Sink;
let mut tok = Tokenizer::new(&mut sink, self.opts.clone());
tok.feed(input);
... | Rust | 0 |
mut self, k: &IKey) -> Option<Arc<Block>> {
self.lru.pop(k)
}
/// 从缓存获取值并复制返回
/// 复制对应的值返回
pub fn get(&mut self, k: &IKey) -> Result<Arc<Block>, Error> {
self.lru
.get(k)
.map(|v| v.clone())
.ok_or(Error::error("not found"))
}
}
#[test]
fn test_lr... | Rust | 0 |
# -----------------------------------------------------------------------------
# Python & OpenGL for Scientific Visualization
# www.labri.fr/perso/nrougier/python+opengl
# Copyright (c) 2018, Nicolas P. Rougier
# Distributed under the 2-Clause BSD License.
# ------------------------------------------------------------... | Python | 1 |
.lower()
if search in searchable_text:
filtered_cards.append(card)
elif card['type'] == 'unknown_range':
# 搜索端口范围、服务名、容器名、协议
searchable_text = ' '.join([
f"{card.get('start_po... | Python | 1 |
Header')
p.add_run("504 Accommodations")
for key, value in lesson_plan.differentiation.section_504_accommodations.items():
p = doc.add_paragraph(style='List Bullet')
p.add_run(f"{key.title()}: ").bold = True
p.add_run(value)
... | Python | 1 |
Some(transmute::<_, unsafe extern "C" fn()>(maximize_window_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_move_window<F: Fn(&Self, u32, u32) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn move_window_trampoline<P, F: Fn(&P, u32, u32) +... | Rust | 0 |
"""
P-median problem in cpmpy.
Model and data from the OPL Manual, which describes the problem:
'''
The P-Median problem is a well known problem in Operations Research.
The problem can be stated very simply, like this: given a set of customers
with known amounts of demand, a set of candidate locations for warehouses,
... | Python | 1 |
from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five','six','seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
>>>... | Python | 1 |
import pandas as pd
import numpy as np
import logging
from config import *
logger = logging.getLogger(__name__)
def calculate_stop_loss(df, side="buy", method="atr"):
"""
计算建议止损位
参数:
- df: 包含价格数据的DataFrame
- side: 交易方向 ("buy" 或 "sell")
- method: 止损计算方法 ("atr", "bollinger", "swing")
... | Python | 1 |
e_ucode.mem"), "/tmp/cce_ucode.mem")
# Set environmental variables
os.environ["BP"] = blackparrot
os.environ["BP_LITEX_DIR"] = bp_litex
os.environ["BP_COMMON_DIR"] = os.path.join(blackparrot, "bp_common")
os.environ["BP_FE_DIR"] = os.path.join(blackparrot, "bp_fe")
os.e... | Python | 1 |
s_TAGP[i]])
# Load the Excel workbook using openpyxl
wb = load_workbook(excel_file_path)
ws = wb.active
# Highlight outliers in column 'RRMSE TWSO %'
for idx, outlier in enumerate(outliers_TWSO, start=2): # Start from row 2 (assuming row 1 is header)
if outlier:
ws[f'H{idx}'].fill = PatternFill(start_col... | Python | 1 |
from pathlib import Path
import pandas as pd
from classopt import classopt
from src import utils
@classopt(default_long=True)
class Args:
data_dir: Path = "./data"
save_dir: Path = "./datasets/sts"
def jsick_test(data_dir: Path, save_dir: Path):
df = pd.read_table(data_dir / "jsick/jsick/jsick.tsv", se... | Python | 1 |
pdu.src
if len(self.node.sim.nodes[last_node].mac.queue) > 0:
self.node.sim.nodes[last_node].mac.queue.pop(0)
# 计算路径损耗(Path Loss),参数d表示距离。其中使用了波长lambda和距离的三次方来计算路径损耗。
def getPL(d):
alpha = 3
lambda_ = (3 * (10 ** 8)) / (2.4 * (10 ** 9))
PL = (lambda_ ** 2) / (4 * 4 * pi * pi * ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.