text string | label_name string | labels int64 |
|---|---|---|
e_id> <is_training_image>
id2train = np.genfromtxt(os.path.join(
self._root, 'raw/CUB_200_2011/train_test_split.txt'), dtype=int)
for id_ in range(id2name.shape[0]):
src_image_path = os.path.join(image_path, id2name[id_, 1])
label = int(id2name[id_, 1][:3]) - 1 # La... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import triton
import triton.language as tl
@triton.jit
def get_tid():
return tl.inline_asm_elementwise(
... | Python | 1 |
mBbAH58CpQ3Y5RNJpUKPE62SQ5tfcvU2JpbnkeyhfsYB1Jc9"
.from_mls_b58check(Some(vec![0x80])),
Err(FromBase58Error::InvalidChecksum)
);
assert_eq!(
"14cxpo3MBCYYWCgF74SWTdcmxipnGUs153".from_mls_b58check(Some(vec![0])),
Err(FromBase58Error::InvalidChecksum)
... | Rust | 0 |
ef_out = jax.grad(ref_loss, argnums=(0, 1))(x, weight)
def custom_p_loss(x, weight):
predictions = custom_p_rms_norm(x, weight)
return -jnp.mean(predictions**2)
with Mesh(jax.local_devices(), ("x",)):
def run_and_verify(loss):
pjitted = pjit(
jax.grad(loss, argnums=(0, 1)),
... | Python | 1 |
from django.apps import AppConfig
class EntriesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'appointments'
verbose_name = 'Записи'
| Python | 1 |
-> T {
let mut sum = T::zero();
if n == 0 || incx == 0 {
return sum;
}
let mut i = 0;
let nincx = n * incx;
while i < nincx {
let Complex { re, im } = x[i];
// FIXME use l1_norm()
sum += re.abs() + im.abs();
i += incx;
}
sum
}
/// NRM2 returns t... | Rust | 0 |
ub(r'[\*=\-_\s]+$', '', clean_content)
if len(clean_content) > 3 and not re.match(r'^[Cc]apítulo|^[Cc]hapter', clean_content, re.IGNORECASE):
return f"\n{clean_content}\n"
return None
def remove_headers_complete(self, content: str) -> str:
"""Remove cabeçal... | Python | 1 |
print(files)
for file in files:
start = time.perf_counter()
print(f"Scanning {file}")
reader = ZStdTextReader(file)
total_ngrams = 0
unique_ngrams = 0
matching_unique = 0
non_matching_unique = 0
current_ngram =... | Python | 1 |
"OR",
"REPEAT",
"RETURN",
"THEN",
"TRUE",
"UNTIL",
"WHILE",
"ADD",
"MINUS",
"MULT",
"DIV",
"FLOOR",
"MOD",
"POW",
"LENGTH",
"EQ",
"NEQ",
"LTEQ",
"GTEQ",
"LT",
... | Python | 1 |
)
}
}
#[macro_use] extern crate runtime_fmt_derive;
extern crate runtime_fmt;
use runtime_fmt::PreparedFormat;
#[derive(FormatArgs)]
struct Struct {
left: i32,
right: &'static str,
}
#[derive(FormatArgs)]
struct TupleStruct(i32, &'static str);
#[derive(FormatArgs)]
struct UnitStruct;
#[derive(F... | Rust | 0 |
rgs.outdir,
eval_dir=args.evaldir,
device=device,
),
iterable=mus.tracks,
chunksize=1,
)
)
pool.close()
pool.join()
for scores in scores_list:
results.add_track(scores)
el... | Python | 1 |
ts;
*a |= *b << rbits;
});
*u64bs.last_mut().unwrap() >>= bits;
} else {
// Use macro to unroll below expression for better performance.
//
// u64bs.for_each_offset_triple(offset_u64s, offset_u64s+1, |(a, b, c)| {
// *a = (*b >> bits) | (*c << rbits);
... | Rust | 0 |
_type == self.RNN_LAYER_NORM_LSTM_CELL:
single_cell = tf.contrib.rnn.LayerNormBasicLSTMCell(
self.num_units,
forget_bias=1.0,
layer_norm=True,
reuse=tf.get_variable_scope().reuse)
elif self.cell_type == self.RNN_NAS_CELL:
si... | Python | 1 |
impl ItemUrl for ItemDrop {
fn item_url(&self) -> &str {
self.link.as_str()
}
}
#[derive(Serialize, Deserialize, Clone)]
pub struct Orders {
pub orders: Vec<Order>,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct Order {
pub quantity: u16,
pub user: OrderUser,
pub visible: bool... | Rust | 0 |
-> Fallible<hermes::Callback<T>>
where
T: Clone + Sync,
U: CReprOf<T> + Sync + 'static,
{
if let Some(ptr) = ptr {
Ok(hermes::Callback::new(move |payload: &T| {
let param = Box::into_raw(Box::new(U::c_repr_of(payload.clone()).unwrap()));
unsafe { ptr(param, user_data.0) }
... | Rust | 0 |
: lat,
}
}
pub fn gps_dist_meters(&self, other: LonLat) -> Distance {
// Haversine distance
let earth_radius_m = 6_371_000.0;
let lon1 = self.longitude.to_radians();
let lon2 = other.longitude.to_radians();
let lat1 = self.latitude.to_radians();
let lat2 ... | Rust | 0 |
pub const CERT_ROOT_PROGRAM_FLAG_OU: DWORD = 0x10;
pub const CERT_ROOT_PROGRAM_FLAG_ADDRESS: DWORD = 0x08;
pub const szOID_CERT_POLICIES_95_QUALIFIER1: &'static str = "2.16.840.1.113733.1.7.1.1";
pub const szOID_RDN_TPM_MANUFACTURER: &'static str = "2.23.133.2.1";
pub const szOID_RDN_TPM_MODEL: &'static str = "2.23.133... | Rust | 0 |
Tracks(base.ReleaseTrack.ALPHA)
@dm_base.UseDmApi(dm_base.DmApiVersion.ALPHA)
class UpdateAlpha(Update):
"""Update a deployment based on a provided config file.
This command will update a deployment with the new config file provided.
Different policies for create, update, and delete policies can be specified.
... | Python | 1 |
y_image_processor
scheduler = UnCLIPScheduler(
variance_type="fixed_small_log",
prediction_type="sample",
num_train_timesteps=1000,
clip_sample=True,
clip_sample_range=10.0,
)
components = {
"prior": prior,
"im... | Python | 1 |
from tqdm import tqdm
import time
print('Curso de Python SENAI!\n')
print('O programa a seguir irá cadastrar as notas dos 30 discentes do curso de Python. Para isso, você deve informar o nome do aluno e em seguida colocar as 5 notas de cada disciplina, lembrando que as notas são de 0 a 10. Ao final do programa, você p... | Python | 1 |
0 => HYSTCTR_A::_00,
1 => HYSTCTR_A::_01,
2 => HYSTCTR_A::_10,
3 => HYSTCTR_A::_11,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `_00`"]
#[inline(always)]
pub fn is_00(&self) -> bool {
*self == HYSTCTR_A::_00
}
... | Rust | 0 |
CTED | FINAL, .name == "begin", .descriptor == "()V"
// unsafe {
// let __jni_args = [];
// let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
// let (__jni_class, __jni_method) = __jni_env.require_class_method("java/nio/channels/spi/AbstractInterruptib... | Rust | 0 |
def test_vae_image_processor_pt(self):
image_processor = VaeImageProcessor(do_resize=False, do_normalize=True)
input_pt = self.dummy_sample
input_np = self.to_np(input_pt)
for output_type in ['pt', 'np', 'pil']:
out = image_processor.postprocess(image_processor.preprocess(
input_pt),... | Python | 1 |
/// `AVX512VL and AVX512-FP16`
///
/// `16/32/64-bit`
EVEX_Vcvtuw2ph_ymm_k1z_ymmm256b16 = 4409,
/// `VCVTUW2PH zmm1 {k1}{z}, zmm2/m512/m16bcst{er}`
///
/// `EVEX.512.F2.MAP5.W0 7D /r`
///
/// `AVX512-FP16`
///
/// `16/32/64-bit`
EVEX_Vcvtuw2ph_zmm_k1z_zmmm512b16_er = 4410,
/// `VCVTW2PH xmm1 {k1}{z}, xmm2/... | Rust | 0 |
rom the axioms of the system. This challenges the notion of a single, all-encompassing formal system for mathematics and highlights the inherent limitations of logical reasoning. Philosophically, it raises questions about whether mathematical truth is independent of human construction or if it is inherently incomplete.... | Python | 1 |
if self.sheets_manager.spreadsheet_id:
url = f"https://docs.google.com/spreadsheets/d/{self.sheets_manager.spreadsheet_id}"
webbrowser.open(url)
else:
messagebox.showwarning("Attention", "ID du spreadsheet non trouvé")
def main():
"""Fonction principale"""
if not GO... | Python | 1 |
NX_FATDRIVE_ERRNO_ECASECLASH :i32 = 137; /* Filename exists with different case */
pub const NX_FATDRIVE_ERRNO_EILSEQ :i32 = 138; /* Illegal byte sequence */
pub const NX_FATDRIVE_ERRNO_EOVERFLOW :i32 = 139; /* Value too large for defined data type */
pub const NX_FATDRIVE_ERRNO_ECANCELED :i32 = 140;... | Rust | 0 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# As classes estão no mesmo arquivo para facilitar
# o exemplo. Numa situação real elas poderiam estar em arquivos
# separados e seriam importadas com a seguinte instrução
# from arquivo import classe
class Contador(object):
def __init__(self):
self.dic = {}
... | Python | 1 |
unsafe extern "C" fn notify_warning_trampoline<P>(this: *mut ffi::GTlsPassword, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TlsPassword> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&TlsPassword::from_glib_borrow(this).downcast_unchecked())
}
//! This is my m... | Rust | 0 |
atile(i as u32);
assert_eq!(x, i)
}
}
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// fou... | Rust | 0 |
}
}
let pos_iia = PosII { x: 5, y: 10.4 };
let pos_iib = PosII { x: "Hello", y: 'c'};
let pos_iic = pos_iia.mixup(pos_iib); // PosII { x: 5, y: 'c' }
println!("x: {}\ny: {}", pos_iic.x, pos_iic.y); //< x: 5\ny: c
// x に i32, y に f64 を持つ Posインスタンスpos_iia を定義して、
// x に文字列スライス, y に ch... | Rust | 0 |
be called once per test case.
Returns:
An error string, or None if the attempt was correct.
"""
print(self.__N, len(self.__bad_set), self.__max_num_tries)
sys.stdout.flush()
# +1 for the answer they have to give
for queries in range(self.__max_num_tries + 1):
try:
contestan... | Python | 1 |
;
let mut s_in = repeat("0/0,")
.take(10)
.chain(once(ps2))
.chain(repeat("0/0,").take(NUM_CELLS - 10 - 1))
.collect::<String>();
s_in.truncate(s_in.len() - 1);
let s_out = parse_to_string(&parse_from_string(s_in.clone()... | Rust | 0 |
.dependencies(FDEvent::Inner)).collect()
}
}
#[cfg(test)]
mod test {
use super::*;
use trilean::SKleene::*;
use propagation::events::FDEvent::*;
use interval::interval::*;
use propagators::test::*;
#[test]
fn all_equal_test() {
let zero = (0,0).to_interval();
let one = (1,1).to_interval();
... | Rust | 0 |
// Blanket [`IntoBoundedStatic`] impl for converting `[T; const N: usize]` into `[T; const N: usize]: 'static`.
impl<T, const N: usize> IntoBoundedStatic for [T; N]
where
T: IntoBoundedStatic,
{
type Static = [T::Static; N];
fn into_static(self) -> Self::Static {
self.map(IntoBoundedStatic::into_st... | Rust | 0 |
LAGS.sample_1_of_n_eval_examples,
sample_1_of_n_eval_on_train_examples=(
FLAGS.sample_1_of_n_eval_on_train_examples),
use_tpu_estimator=True,
use_tpu=FLAGS.use_tpu,
num_shards=FLAGS.num_shards,
save_final_config=FLAGS.mode == 'train',
**kwargs)
estimator = train_and_eval_... | Python | 1 |
#[inline]
pub fn doze_en(&self) -> DOZE_ENR {
DOZE_ENR::_from({
const MASK: bool = true;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 3 - Debug Enable Bit"]
#[inline]
pub fn dbg_en(&self) -> DBG_ENR {
D... | Rust | 0 |
from pathlib import Path
import importlib
def test_agents_common_importable() -> None:
mod = importlib.import_module("src.agents._common")
assert hasattr(mod, "_split_sentences")
assert hasattr(mod, "_on_piece")
assert hasattr(mod, "_runner")
assert hasattr(mod, "StreamState")
def test_split_sent... | Python | 1 |
"""Functions to prevent a nuclear meltdown."""
def is_criticality_balanced(temperature, neutrons_emitted):
"""Verify criticality is balanced.
:param temperature: int or float - temperature value in kelvin.
:param neutrons_emitted: int or float - number of neutrons emitted per second.
:return: bool - ... | Python | 1 |
import sys
input = sys.stdin.readline
N = int(input())
def star(i, n):
if i == 0:
return
if i == 2**n:
for _ in range(i):
print('*', end="")
star(i-1, n)
return
elif i == (2**n -1):
for k in range(i):
if k %2 == 1:
prin... | Python | 1 |
pe_LeftMouseDown',
'RowOrColumnMajor_ColumnMajor', 'NavigateDirection',
'IUIAutomationTextRangeArray', 'UIA_NavigationLandmarkTypeId',
'UIA_RangeValueIsReadOnlyPropertyId',
'UIA_SelectionCanSelectMultiplePropertyId',
'UIA_HostedFragmentRootsInvalidatedEventId', 'UIA_DragPatternId',
'Polite', 'UI... | Python | 1 |
rhs`. (eg a -= 5).
MinusEq,
/// This is shorthand for `lhs = lhs * rhs`. (eg a *= 5).
MultiplyEq,
/// This is shorthand for `lhs = lhs / rhs`. (eg a /= 5).
DivideEq,
/// This is shorthand for `lhs = lhs % rhs`. (eg a %= 5).
/// This is useful when the remainder of a division is more importa... | Rust | 0 |
import tool
from parameters import *
import pripl_tree
import grids
import numpy as np
if __name__ == '__main__':
# An example for 1-D range queries
# 1st. read data
data, domain_size, attributes = tool.load_data(arguments.dataset, dimension_num=1)
# 2nd. build pripl tree
priplt = pripl_tree.Prip... | Python | 1 |
= false;
let ref mut list = self.peerlist.write().unwrap().0;
for peer in list.iter_mut() {
if peer.slabref.slab_id == self.owning_slab_id {
warn!("WARNING - not allowed to apply self-peer");
// panic!("memoref.update_peers is not allowed to apply for self-pee... | Rust | 0 |
::to_string_pretty(&a).unwrap();
response_builder.status(http::StatusCode::OK).body(b)
}
"logged" => {
let a = {
let connection = self.connection.clone();
let mut unlocked_connection = connection.lock().unwrap();
... | Rust | 0 |
mut otCoapResource);
}
extern "C" {
#[doc = " This function adds a block-wise resource to the CoAP Secure server."]
#[doc = ""]
#[doc = " @param[in] aInstance A pointer to an OpenThread instance."]
#[doc = " @param[in] aResource A pointer to the resource."]
#[doc = ""]
pub fn otCoapSecureAdd... | Rust | 0 |
pl.col("close")
.ewm_mean(span=fast_period, min_periods=1)
.alias("EMA_fast"),
pl.col("close")
.ewm_mean(span=slow_period, min_periods=1)
.alias("EMA_slow")
])
# Calcul du MACD
... | Python | 1 |
> 0 { write!(f, ", ")? }
write!(f, "{}", arg)?;
}
write!(f, ")")
},
Expr::Op(op, lhs, rhs) => {
match **lhs {
Expr::Op(sub_op, _, _) => if sub_op.precedence() <= op.precedence() {
wri... | Rust | 0 |
: Send {}
// concatenate surface forms of parsertoken stream, with given comma between tokens
fn tokenstream_to_string(input : &str, stream : &Vec<LexerToken>, comma : &str) -> String
{
let mut ret = String::new();
let mut first = true;
for token in stream
{
... | Rust | 0 |
self._wrapped is empty:
# We have to use SimpleLazyObject, not self.__class__, because the
# latter is proxied.
result = SimpleLazyObject(self._setupfunc)
memo[id(self)] = result
return result
return copy.deepcopy(self._wrapped, memo)
def partition(... | Python | 1 |
rm: gpr(6),
},
"B9310056",
"clgfr %r5, %r6",
));
insns.push((
Inst::CmpRX {
op: CmpOp::CmpS32,
rn: gpr(1),
mem: MemArg::BXD12 {
base: gpr(2),
index: zero_reg(),
disp: UImm12::zero(),
... | Rust | 0 |
type Target = u32;
fn handle(
&mut self,
_r: &mut RouterType,
params: &HashMap<String, String>,
msg: u64,
) -> Self::Target {
match params.get(&":objectkind".to_owned()).unwrap().as_str() {
"collection" => match params.get(&":objectid".to_owned()).unwrap(... | Rust | 0 |
import pyttsx3
import speech_recognition as sr
import eel
def speak(text):
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
engine.setProperty('rate', 125)
# print(voices)
engine.say(text)
engine.runAndWait()
def takecommand():
r =... | Python | 1 |
etrieves a clone of the timer event channel
pub fn get_channel(&self) -> Sender<TimerEvent> {
self.channel.lock().unwrap().clone()
}
/// Runs the function after the
/// timeout has completed
pub fn run_delayed<F: 'static, I>(&self, dur: Duration, fun: F)
where
F: Send + FnOnce(Instant) -> I,
I: Into<Option... | Rust | 0 |
# IODATA is an input and output module for quantum chemistry.
# Copyright (C) 2011-2019 The IODATA Development Team
#
# This file is part of IODATA.
#
# IODATA is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; e... | Python | 1 |
::CodeBlock, eval_context::ContextState};
use crate::{
errors::{bail, CompilationError, Error},
eval_context::Config,
};
use once_cell::sync::OnceCell;
use regex::Regex;
use std::fs;
use std::path::{Path, PathBuf};
fn shared_object_name_from_crate_name(crate_name: &str) -> String {
if cfg!(target_os = "mac... | Rust | 0 |
dB
- 'edr': Energy Decay Relief in dB (time-frequency representation)
- 'ned': Normalized Echo Density profile
- 'c50': Clarity index at 50ms boundary in dB
- 'c80': Clarity index at 80ms boundary in dB
- 'd50': Definition parameter at 50ms boundary (ratio)
... | Python | 1 |
normalize_html(&expected), normalize_html(&s));
}
#[test]
fn gfm_table_test_7() {
let original = r##"| abc | def |
| --- | --- |
| bar |
| bar | baz | boo |
"##;
let expected = r##"<table>
<thead>
<tr>
<th>abc</th>
<th>def</th>
</tr>
</thead>
<tbody>
<tr>
<td>bar</td>
<td></td>
</tr>
<tr>
<... | Rust | 0 |
assert table_name in con.list_tables()
partitions = (
con.raw_sql(f"SHOW PARTITIONS ibis_testing.{table_name}").toPandas().to_dict()
)
expected_partitions = {
"partition": {0: "category1=A", 1: "category1=B", 2: "category1=C"}
}
assert partitions == expected_partitions
# C... | Python | 1 |
ead);
keysyms.insert("Hangul_RieulTieut", 0x0eae);
keysyms.insert("Hangul_RieulPhieuf", 0x0eaf);
keysyms.insert("Hangul_RieulHieuh", 0x0eb0);
keysyms.insert("Hangul_Mieum", 0x0eb1);
keysyms.insert("Hangul_Pieub", 0x0eb2);
keysyms.insert("Hangul_SsangPieub", 0x0eb3);
keysyms.insert("Hangul_PieubSios", 0x0e... | Rust | 0 |
input channel, smoothed.
if op.Smoothed.ready():
smoothedLayer = self.createStandardLayerFromSlot(op.Smoothed)
smoothedLayer.name = "Smoothed input"
smoothedLayer.visible = True
smoothedLayer.opacity = 1.0
smoothedLayer.setTool... | Python | 1 |
-3])
# start by initializing the filter with an unaccurate state
state0 = model.STATE(
Rot=ukfm.SO3.exp(10*np.pi/180*np.ones(3)/3).dot(states[0].Rot),
v=states[0].v,
p=states[0].p + np.array([1, 0.5, 0.7]))
# create the UKF
ukf = ukfm.UKF(state0=state0, P0=P0, f=model.f, h=model.h, Q=Q, R=R,
... | Python | 1 |
et_field_raw_mut_inner(
self,
this: *mut This,
) -> Result<*mut This::Ty, FailedAccess> {
let ret = <This as GetVariantFieldMut<_V, _F>>::get_vfield_raw_mut_(
this as *mut (),
self.variant,
self.field,
);
match ret {
Some(x) => ... | Rust | 0 |
use pest::Parser;
use self::Expr::*;
use self::Pat::*;
use self::Stmt::*;
use std::fmt;
use std::fmt::{Display, Formatter};
use std::iter::repeat;
const ESCAPABLE_CHARS: [&str; 8] = ["\"", "\\", "/", "b", "f", "n", "r", "t"];
#[derive(Parser)]
#[grammar = "l.pest"]
pub struct LParser;
#[derive(PartialEq, Debug, Clo... | Rust | 0 |
piece::Piece>; 8]; 8]
}
impl Board
{
pub fn new() -> Board
{
Board{cases:[[None; 8]; 8]}
}
/// Put 16 White & 16 Black pieces on empty board
pub fn init(&mut self)
{
// Pawns
for i_file in 0..8 //file in cases
{
for i_rank in 1..2 //rank in file
... | Rust | 0 |
stc-link-search=native=/Users/androidbuild1/forge/work/code/evernym/sdk/.macosbuild/openssl_for_ios_and_android/output/android/openssl-x86/lib");
println!("cargo:rustc-link-lib=static=ssl");
println!("cargo:rustc-link-search=native=/Users/androidbuild1/forge/work/code/evernym/sdk/.macosbuild/openssl_for_ios_and... | Rust | 0 |
print("chai aur python")
def chai(n):
print("the number is :",n)
chai(4)
| Python | 1 |
type Output = Matrix<T>;
#[inline(always)]
fn $trait(self, other: &'b Matrix<T>) -> Self::Output {
let mut out = Matrix::zeroed(self.rows(), other.cols());
Matrix::<T>::$name(&mut out, self, other);
out
}
}
imp... | Rust | 0 |
Tokenizer.from_pretrained(
model_path,
use_fast=True,
trust_remote_code=True
)
# 确保tokenizer有pad_token,避免警告
if tokenizer.pad_token is None:
if tokenizer.eos_token is not None:
tokenizer.pad_token = tokenizer.eos_token
... | Python | 1 |
#coding=utf-8
#!/usr/bin/python
# 导入requests库
import requests
# 导入文件操作库
import os
import bs4
from bs4 import BeautifulSoup
import sys
import importlib
import random
import time
importlib.reload(sys)
# 越多越好
meizi_headers = [
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.21... | Python | 1 |
rrupt status register IntStatus."]
#[inline(always)]
pub fn rxerrorintset(&mut self) -> RXERRORINTSET_W {
RXERRORINTSET_W { w: self }
}
#[doc = "Bit 2 - Writing a 1 to one sets the corresponding status bit in interrupt status register IntStatus."]
#[inline(always)]
pub fn rxfinishedintse... | Rust | 0 |
ng_box(&self) -> &Aabb;
}
pub struct Reference {
pub primitive_idx: usize,
pub bounding_box: Aabb,
}
impl Clone for Reference {
fn clone(&self) -> Self {
Self {
primitive_idx: self.primitive_idx,
bounding_box: self.bounding_box.clone(),
}
}
}
impl Debug for Ref... | Rust | 0 |
onstantDomain::U128(val2)) => {
ConstantDomain::U128(val1.wrapping_sub(*val2))
}
_ => ConstantDomain::Bottom,
}
}
/// Returns a constant that is true if "self - other" is not in range of target_type.
pub fn sub_overflows(&self, other: &Self, target_type: &Exp... | Rust | 0 |
k(Hash::from(hash))
}
pub fn get_block_next_id(
context: State<Context>,
block_id_hex: Path<String>,
query_params: Query<QueryParams>,
) -> Result<Bytes, ActixError> {
let block_id = parse_block_hash(&block_id_hex)?;
// FIXME
// POSSIBLE RACE CONDITION OR DEADLOCK!
// Assuming that during u... | Rust | 0 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from airbyte_cdk.entrypoint import launch
from source_dockerhub import SourceDockerhub
def run():
source = SourceDockerhub()
launch(source, sys.argv[1:])
| Python | 1 |
IT",
MaximumSupportedWeightLbs::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"MAX_1400_LBS",
"MAX_1600_LBS",
"MAX_1800_LBS",
"MAX_2000_LBS",
... | Rust | 0 |
impl_conversion![Kibihertz; Hertz];
impl_conversion![Megahertz; Kilohertz, Hertz];
impl_conversion![Kilohertz; Hertz];
impl_conversion![Hertz];
impl_conversion![Decihertz; Hertz];
impl_conversion![Centihertz; Hertz];
impl_conversion![Millihertz; Hertz];
impl_conversion![Microhertz; Hert... | Rust | 0 |
rap();
/// assert_eq!(timezone.offset(), (1, Duration::from_secs(3 * 3600)));
///
/// let timezone = Tz::deserialize(b"-01").unwrap();
/// assert_eq!(timezone.offset(), (-1, Duration::from_secs(1 * 3600)));
///
/// let timezone = Tz::deserialize(b"+04:30").unwrap();
/// assert_eq!(timezone.offset(), (1, Duration::from_... | Rust | 0 |
6));
assert_eq!(BigEndian::at::<u32>(BitIdx(26)), BitPos(5));
assert_eq!(BigEndian::at::<u32>(BitIdx(27)), BitPos(4));
assert_eq!(BigEndian::at::<u32>(BitIdx(28)), BitPos(3));
assert_eq!(BigEndian::at::<u32>(BitIdx(29)), BitPos(2));
assert_eq!(BigEndian::at::<u32>(BitIdx(30)), BitPos(1));
assert_eq!(BigEndi... | Rust | 0 |
_negative):point_position]
assert number_prefix == '0x0' or number_prefix == '0x1'
mantissa = number[point_position + 1:exp_position]
if number_prefix == '0x0':
# Zero
assert int(mantissa) == 0
return int(is_negative) << 63
else:
exponent =... | Python | 1 |
# https://github.com/meetshah1995/pytorch-semseg/blob/master/ptsemseg/metrics.py
import numpy as np
class runningScore(object):
'''
n_classes: database的类别,包括背景
ignore_index: 需要忽略的类别id,一般为未标注id, eg. CamVid.id_unlabel
'''
def __init__(self, n_classes, ignore_index=None):
self.n_cla... | Python | 1 |
can
/// // only come from this input!
/// let input: HtmlInputElement = e.target_unchecked_into();
/// Msg::Value(input.value())
/// })}
/// />
/// }
/// }
/// # }
/// ```
fn target_unchecked_into<T>(&self) ... | Rust | 0 |
ed future of [`read_exact_to_vec`].
#[derive(Debug)]
#[cfg(feature = "read-exact-to-bytes")]
#[cfg_attr(docsrs, doc(cfg(feature = "read-exact-to-bytes")))]
pub struct ReadToBytesRngFuture<'a, T: ?Sized> {
reader: &'a mut T,
bytes: &'a mut bytes::BytesMut,
min: usize,
max: usize,
}
#[cfg(feature = "read... | Rust | 0 |
gth_attribute(nested_meta: &NestedMeta) -> Result<AttributeData, AttributeError> {
if let NestedMeta::Meta(Meta::NameValue(named_meta)) = nested_meta {
if matches!(&named_meta.path, path if path.is_ident("max_length")) {
return match &named_meta.lit {
Lit::Int(lit_int) => Ok(Attr... | Rust | 0 |
0.0, -4.451133008385643e-01, 4.451133008385643e-01, 0.0,
];
assert_vec_approx_eq!(vl_real, vl_real_correct, 1e-15);
assert_vec_approx_eq!(vl_imag, vl_imag_correct, 1e-15);
// check right eigenvectors
#[rustfmt::skip]
let vr_real_correct = [
-6.5... | Rust | 0 |
path.join("fs", "other-recursive.html")
self.assertTrue(
cache["other-recursive.html"].origin.name.endswith(expected_path)
)
def test_unique_history_per_loader(self):
"""
Extending should continue even if two loaders return the same
name for a template.
"... | Python | 1 |
91, BackSlash, RightBracket,
Backtick = 96,
Escape = 128, Enter, Tab, Backspace, Insert, Delete, Right, Left, Down, Up, PageUp, PageDown, Home, End,
Capslock, ScrollLock, NumLock, PrintScreen, PauseBreak,
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5,... | Rust | 0 |
Greetings = "Hello Ahmad!"
print(Greetings) | Python | 1 |
import math
num = int(input("Enter a number: "))
print("Factorial:", math.factorial(num))
| Python | 1 |
);
drop(store);
let store = LocalStorage::new(temp_dir.path().to_path_buf())
.await
.expect("unable to create LocalStorage object.");
assert_eq!(store.get(b"key1".to_vec()).await?, Some(b"value2".to_vec()));
Ok(())
}
#[async_std::test]
async fn massive_set() -> Result<()> {
let te... | Rust | 0 |
#[error("Internal Error")]
Status500(BasicError),
#[error("Status code: {}", code)]
Generic { code: u16 },
}
/// Errors for the [Start a codespace for the authenticated user](Codespaces::start_for_authenticated_user_async()) endpoint.
#[derive(Debug, thiserror::Error)]
pub enum CodespacesStartForAuthentica... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bizmeka 메일 스크래핑 실행 스크립트
새로운 모듈화된 구조 사용
"""
import asyncio
import sys
from pathlib import Path
# 프로젝트 루트를 Python path에 추가
project_root = Path(__file__).parent.parent
sys.path.insert(0, str(project_root))
from playwright.async_api import async_playwright
from sites.biz... | Python | 1 |
($name:expr) => {
$crate::submit($crate::datapoint!(@point $name), log::Level::Debug);
};
($name:expr, $($fields:tt)+) => {
$crate::submit($crate::datapoint!(@point $name, $($fields)+), log::Level::Debug);
};
}
#[cfg(test)]
mod test {
#[test]
fn test_datapoint() {
datapoi... | Rust | 0 |
ject:
raise HTTPException(status_code=404, detail="Project not found")
db.delete(project)
db.commit()
return {"detail": "Project deleted successfully"}
# List all project members
@router.post("/members/list", response_model=List[ProjectMemberOut])
def list_project_members(request: ProjectSlugRequ... | Python | 1 |
"):
st.markdown(f"""
<style>
.small-text {{
font-size: 0.9em !important;
line-height: 1.3 !important;
}}
</style>
<div class="small-text">
开发作者:<br>
Will Zhou<br><br>
遵循协议:<br>
MIT lic... | Python | 1 |
import sys
import pytest
import threading
import time
import io
from unittest.mock import patch
# Add the parent directory to sys.path
sys.path.insert(0, ".")
from autoFaceFraming.utils.cli_spinner import CLISpinner, SpinnerStyle, RandomSpinner
def test_spinner_init():
"""Test spinner initialization with defaul... | Python | 1 |
nown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if let Some(ref v) = self.storage.as_ref() {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelim... | Rust | 0 |
0x06]);
test_instr(&[0x66, 0x0f, 0x3a, 0x42, 0x06, 0x44], "mpsadbw xmm0, xmmword [rsi], 0x44");
test_invalid(&[0x0f, 0x3a, 0x42, 0x06]);
}
#[test]
fn test_ssse3() {
fn test_instr(bytes: &[u8], text: &'static str) {
test_display_under(&InstDecoder::minimal().with_ssse3(), bytes, text);
test... | Rust | 0 |
#[doc = $doc]
pub const $name: RGBColor = RGBColor($r, $g, $b);
};
($name:ident, $r:expr, $g:expr, $b:expr, $a: expr, $doc:expr) => {
#[doc = $doc]
pub const $name: RGBAColor = RGBAColor($r, $g, $b, $a);
}
}
predefined_color!(WHITE, 255, 255, 255, "The predefined white col... | Rust | 0 |
right of ASM: pop error_code & trap_num
//! ASM -->> -CPU: iret
//!
//! activate CPU
//! Note right of CPU: pop something
//! Note right of CPU: set rsp (user)
//! deactivate CPU
//! ```
use super::consts::*;
use super::TrapFrame;
use crate::drivers::DRIVERS;
use bitflags::*;
use log::*;
global_asm!(include_str!("tr... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.