text string | label_name string | labels int64 |
|---|---|---|
s)(*[os.path.expanduser(x).encode() for x in keyword_file_paths]),
(c_float * self._num_keywords)(*sensitivities),
byref(self._handle))
if status is not self.PicovoiceStatuses.SUCCESS:
raise self._PICOVOICE_STATUS_TO_EXCEPTION[status]('Initialization failed')
self.pr... | Python | 1 |
f, v: Expr) {
self.expr = ::protobuf::SingularPtrField::some(v);
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_expr(&mut self) -> &mut Expr {
if self.expr.is_none() {
self.expr.set_default();
... | Rust | 0 |
input.storage_encrypted {
scope_1593.boolean(*var_1594);
}
#[allow(unused_mut)]
let mut scope_1595 = writer.prefix("KmsKeyId");
if let Some(var_1596) = &input.kms_key_id {
scope_1595.string(var_1596);
}
#[allow(unused_mut)]
let mut scope_1597 = writer.prefix("EnableIAMDatabas... | Rust | 0 |
ENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::*;
use ascii::ascii_to_basic_latin;
use ascii::basic_latin_t... | Rust | 0 |
x9e\x04\x12\
2\x13\x92\x0e\x8f?\xf1<{^9\x82)\xea(\x9a\
\xf8B\x92\xe8@\xd8\xc5d\xa0-\xc2Y\x22\x99\xb1m\
\xf38\x1f\xfb\xc0\xb5L45.\xb5X\xa3x\xe6\xf9\
\xdd<\xf7\xf2N\xe6\x17\xbb\x9cv\xea\xe9$\xf5&\xb9\
\x81\xac0d\xb9\xc5y5\xd8\xbd:\xefPJc\xf2\
\x82H\xaa\xb2\xae\xa3CI\x83\xb5]\x94r\xac\x9b\x9c\
dn\xa1\xc7X\xabN\xb7\xdfC\xe... | Python | 1 |
DD51E0F, 0x1B,
];
pub const CURVE_PYAAA: [Chunk; NLEN] = [
0x14137844, 0x1704BE7D, 0x1FD3CCDD, 0x189D8C93, 0x1C768851, 0xF5C37D5, 0xE29C659, 0x20AB1C1,
0xF8896E0, 0x1E08663E, 0x1D1D539C, 0x117E1C47, 0x156CDD39, 0x161F1017, 0x143E8C72, 0x174B22FD,
0x18706190, 0x49AA47E, 0x19BB42E1, 0xE,
];
pub const CURVE_PY... | Rust | 0 |
_or_else(|err| {
utils::bail(
notifier,
&format!("Error: get_epoch_info RPC call failed: {}", err),
);
});
let current_slot = epoch_info.absolute_slot;
info!("Current slot is {}", current_slot);
let current_epoch = epoch_info.epoc... | Rust | 0 |
ptr = catch.extract_value(vals, 0);
catch.call(catch_func, &[data, ptr], None);
catch.ret(bx.const_i32(1));
});
// Note that no invoke is used here because by definition this function
// can't panic (that's what it's catching).
let ret = bx.call(llfn, &[try_func, data, catch_func], None... | Rust | 0 |
tput>;
fn mul(self, other: Luma<S, T>) -> Self::Output {
Luma {
luma: self.luma * other.luma,
standard: PhantomData,
}
}
}
impl<S, T> Mul<T> for Luma<S, T>
where
T: Component + Mul,
S: LumaStandard<TransferFn = LinearFn>,
<T as Mul>::Output: Component,
{
... | Rust | 0 |
pub fn ImPlotAxis_IsInputLocked(self_: *mut ImPlotAxis) -> bool;
}
extern "C" {
pub fn ImPlotAxis_IsTime(self_: *mut ImPlotAxis) -> bool;
}
extern "C" {
pub fn ImPlotAxis_IsLog(self_: *mut ImPlotAxis) -> bool;
}
extern "C" {
pub fn ImPlotAxis_HasMenus(self_: *mut ImPlotAxis) -> bool;
}
extern "C" {
p... | Rust | 0 |
fn test_on_bls12_381() {
test_query_coset_template::<ark_bls12_381::Fr>();
}
#[test]
fn test_on_bls12_377() {
test_query_coset_template::<ark_bls12_377::Fr>();
}
}
#[derive(Debug)]
pub enum Matcher<I> {
Val(I),
Any,
}
impl<I: PartialEq> PartialEq for Matcher<I> {
fn eq... | Rust | 0 |
ue
current = route[i]
past = route[i - 1]
future = route[i + 1]
past_to_current = np.array(
[current[0] - past[0], current[1] - past[1]])
current_to_future = np.array(
[future[0] - current[0], future[1] - current[1]])
... | Python | 1 |
import os
#função sem retorno.
def logoSenai():
os.system("cls||clear")
print("\t===========")
print("\t===SENAI===")
print("\t===========\n")
#funções para cálculo de variáveis
def somar(n1,n2):
return n1 + n2
def subtrair(n1,n2):
return n1 - n2
def multiplicar(n1,n2):
return n1 * n2... | Python | 1 |
== name:
return job
def test_scheduler_debug(self, mocker):
scheduler = Scheduler(
{
'joba': {'schedule': datetime.timedelta(seconds=20)},
'jobb': {'schedule': datetime.timedelta(seconds=50)},
'jobc': {'schedule': datetime.timedel... | Python | 1 |
<MappableBuffer> for Buffer {
fn from(buffer: MappableBuffer) -> Self {
buffer.buffer
}
}
impl PartialEq for MappableBuffer {
#[inline]
fn eq(&self, rhs: &Self) -> bool {
std::ptr::eq(self, rhs)
}
}
impl Eq for MappableBuffer {}
impl Hash for MappableBuffer {
#[inline]
fn ... | Rust | 0 |
angle from the plane going through x+z)
// Second coordinate is azimuth (rotation around the y axis)
// Range of outputs - ([PI/2, -PI/2], [-PI, PI])
fn _cartesian_to_polar(p: Vec3) -> Vec2 {
vec2(PI / 2. - (p.y / p.length()).acos(), p.z.atan2(p.x))
}
fn mergeobjs(a: Vec2, b: Vec2) -> Vec2 {
if a.x < b.x {
... | Rust | 0 |
target_image.astype(np.uint8), (512,512)).astype(np.float32)
cropped_depth = cv2.resize(cropped_depth.astype(np.uint8), (512, 512)).astype(np.uint8)
H, W, C = cropped_depth.shape
cropped_depth = cv2.resize(cropped_depth, (W, H), interpolation=cv2.INTER_LINEAR)
collage = cv2.resize(collag... | Python | 1 |
t = {}, {}
advertise_router_id = []
config = graceful_restart.get("config")
helpers = graceful_restart.get('openconfig-ospfv2-ext:helpers', {})
if config:
self.update_dict(return_dict, 'enable', config.get("enabled"))
self.update_dict(return_dict, 'grace_period', ... | Python | 1 |
re::retry(ImmediateBackoff, fails).await;
//! # };
//! ```
#![forbid(unsafe_code)]
#[cfg(any(feature = "runtime-tokio", feature = "runtime-async-std"))]
pub mod future;
mod backoff;
mod sync;
pub use backoff::*;
pub use sync::*;
use std::env;
use std::fs;
use std::os::unix::fs as unix;
const HELP: &str = "\
Usage:... | Rust | 0 |
te_per_collect):
train_data = replay_buffer.sample(learner.policy.get_attribute('batch_size'), learner.train_iter)
if train_data is None:
break
learner.train(train_data, collector.envstep)
if collector.envstep >= max_env_step:
break
if __name__ =... | Python | 1 |
e __int_least64_t = crate::esp_idf::std::os::raw::c_longlong;
pub type __uint_least64_t = crate::esp_idf::std::os::raw::c_ulonglong;
pub type __intmax_t = crate::esp_idf::std::os::raw::c_longlong;
pub type __uintmax_t = crate::esp_idf::std::os::raw::c_ulonglong;
pub type __intptr_t = crate::esp_idf::std::os::raw::c_int... | Rust | 0 |
> {
match self {
DispatchData::Lazy(ser) => {
let ser_id = ser.ser_id();
Ok(NetMessage::with_box(ser_id, src, dst, ser))
}
DispatchData::SerialisedLease(mut chunk) => {
// The chunk contains the full frame, deserialize_msg does ... | Rust | 0 |
test_values.last_mut());
}
create_test_for_configs!(last_works_for);
fn first_works_for<C>(mut test_values: Vec<i32>)
where
C: BucketVecConfig,
{
let mut vec = test_values.iter().cloned().collect::<BucketVec<_>>();
assert_eq!(vec.first(), test_values.first());
assert_eq!(vec.first_mut(), test_values.f... | Rust | 0 |
o_rules! START_BURST_PULSE_ONCE_COMMAND {
() => {
"59"
};
}
pub const START_BURST_PULSE_ONCE_COMMAND: &'static str = START_BURST_PULSE_ONCE_COMMAND!();
macro_rules! START_BURST_PULSE_ONCE_ARG {
() => {
"1"
};
}
pub const START_BURST_PULSE_ONCE_ARG: &'static str = START_BURST_PULSE_ONCE_ARG!();
// command exa... | Rust | 0 |
class Solution:
def missingNum(self, arr):
# code here
n= len(arr)+1
total = n*(n+1)//2
return total-sum(arr)
| Python | 1 |
s of curl will have different cases for HTTP/2 field names.
tr.Processes.Default.Streams.stdout = Testers.GoldFile("gold/http2_8_stdout.gold", case_insensitive=True)
tr.StillRunningAfter = server
# Test Case 9: Header Only Response - e.g. 204
tr = Test.AddTestRun("header only response")
tr.MakeCurlCommand('-vs -k --ht... | Python | 1 |
but just for completeness' sake…
UiDrawBrushRef {
ui_draw_brush: uiDrawBrush {
Type: uiDrawBrushType::Image,
R: 0.0,
G: 0.0,
B: 0.0,
A: 0.0,
... | Rust | 0 |
import re
s='India is Won T20i'
print(re.search(' ',s))
print(re.search('@',s)) | Python | 1 |
u8]);
fn mark_tag_start(&mut self, input: &[u8]);
fn unmark_tag_start(&mut self, input: &[u8]);
fn enter_cdata(&mut self, input: &[u8]);
fn leave_cdata(&mut self, input: &[u8]);
}
pub trait StateMachineConditions {
fn is_appropriate_end_tag(&self) -> bool;
fn cdata_allowed(&self) -> bool;
}
... | Rust | 0 |
out_doutm2b(self) -> &'a mut W {
self.variant(P_OUT_CFGW::DOUT_DOUTM2B)
}
#[doc = "dout_doutm2c (2-bit mode 2c)"]
#[inline]
pub fn dout_doutm2c(self) -> &'a mut W {
self.variant(P_OUT_CFGW::DOUT_DOUTM2C)
}
#[doc = "gpio_out (level set by GPIO_OUTREG)"]
#[inline]
pub fn gp... | Rust | 0 |
"""
The SpatialProxy object allows for lazy-geometries and lazy-rasters. The proxy
uses Python descriptors for instantiating and setting Geometry or Raster
objects corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
"""
from django.db.models.query_utils import ... | Python | 1 |
ude_str!("vertex.glsl")).expect("Couldn't create VertexShader.");
let raster_program = gpu::RasterProgram::new(&context.context, &fragment_shader, &vertex_shader).expect("Couldn't create RasterProgram.");
let framebuffer = gpu::Framebuffer::default(&context.context);
let vertex_array_object = gp... | Rust | 0 |
e,
"max_per_user_per_stream": 0
},
"global_cooldown": {
"is_enabled": false,
"global_cooldown_seconds": 0
},
"redemptions_redeemed_current_stream": 0,
"cooldown_expires_at": null
}
}
}
"##;
... | Rust | 0 |
ms)
for grad_idx, grad in enumerate(gradient):
fisher_diags[grad_idx] += grad.detach().cpu().flatten().pow(2)
sample_count += len(batch_eval_samples)
del outputs
del gradient
torch.cuda.empty_cache()
# Average the accumulated squares an... | Python | 1 |
versary.original.shape[0] or
self.model.channel_axis() == adversary.original.shape[-1])
step = 1
#强制拷贝 避免针对adv_img的修改也影响adversary.original
adv_img = np.copy(adversary.original)
for i in range(steps):
if adversary.is_targeted_attack:
gradient =... | Python | 1 |
0..delta_steps {
game.update(DELTA_STEP as f32);
total_delta_time -= DELTA_STEP;
}
//if total_delta_time > FPS_60 {
// game.update(FPS_60 as f32);
// total_delta_time -= FPS_60;
//}
/*
let delta_steps = (total_delta_time / FPS_60).f... | Rust | 0 |
#!/usr/bin/env python3
"""
测试Rust版本Hive读取器
使用配置管理器,无硬编码敏感信息
"""
import sys
import os
import traceback
# 添加路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'python'))
def test_import():
"""测试导入"""
try:
import hive_reader_rs
print("✅ 成功导入 hive_reader_rs")
# 测试版本信息
... | Python | 1 |
} else if follow_len == 8 {
// 9-byte special case
u64::from_le_bytes(bytes[1..9].try_into().unwrap())
} else {
#[allow(unsafe_code)]
unsafe {
core::hint::unreachable_unchecked()
}
};
//
debug_assert!(length == 1 || result >= (1 << (7 * (length - 1))))... | Rust | 0 |
#!/usr/bin/env python
'''
Leetcode: Simplify Path
Given an absolute path for a file (Unix-style), simplify it.
For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
Corner Cases:
Did you consider the case where path = "/../"?
In this case, you should return "/".
Another corner c... | Python | 1 |
base_ref), ('id', '!=', record.id)], limit=1)
if existing_product:
# Block the creation/update and raise an error
raise UserError(_('Un produit avec la même référence existe déjà: %s (ID: %s)') % (existing_product.name, existing_product.id))
# If no duplicate i... | Python | 1 |
#!/usr/bin/python3
""" script that fetches command arguments and save to json file """
import sys
if __name__ == '__main__':
load_json = __import__('6-load_from_json_file').load_from_json_file
save_json = __import__('5-save_to_json_file').save_to_json_file
args = []
try:
args = load_json('add... | Python | 1 |
pub dwVersion: u32,
pub isMultiSign: super::super::super::Foundation::BOOL,
pub dwReserved: u32,
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::marker::Copy for SIP_CAP_SET_V2 {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::clone::Clone for SIP_CAP_SET_V2 {
fn clone(&self) -> Self {
*s... | Rust | 0 |
"""
Write a function to convert a tuple to a string.
assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==("exercises")
"""
def tup_string(tuple_):
"""
Convert a tuple to a string.
"""
string_ = tuple_
for i in range(len(tuple_)):
string_ = string_[:i] + "," + string_[i:]
r... | Python | 1 |
'edit-title')
# Modify values directly through JS
driver.execute_script("arguments[0].value = arguments[1];", input_title, 'Lead Developer')
# ** The following line uses JS to force clicks **
submit_btn = driver.find_element(By.CSS_SELECTOR, '#edit-form button[type=submit]')
d... | Python | 1 |
rver_message(&output_msg, &callback, callback_context);
}
Err(e) => {
return_error(id, &e, &callback, callback_context);
}
}
});
}
fn send_rssi_level_cmd(
&self,
id: u32,
_msg: RssiLevelCmd,
callback: FFICallback,
callback_context: FFICallbackContextW... | Rust | 0 |
/// Gray (`#808080`)
pub fn gray() -> Color {
Color::from_rgb(128, 128, 128)
}
/// Create a gray tone from a lightness value (0.0 is black, 1.0 is white).
pub fn graytone(lightness: Scalar) -> Color {
Color::from_hsl(0.0, 0.0, lightness)
}
/// Rotate along the "hue" axis.
p... | Rust | 0 |
sys::core::GUID = ::windows_sys::core::GUID { data1: 3957516613, data2: 26314, data3: 20177, data4: [159, 248, 42, 215, 223, 10, 27, 8] };
pub const Menu_Control_GUID: ::windows_sys::core::GUID = ::windows_sys::core::GUID { data1: 781915200, data2: 3752, data3: 16893, data4: [179, 116, 193, 234, 111, 80, 60, 209] };
pu... | Rust | 0 |
ustfmt::skip]
fn bootnodes(&self) -> Vec<(Multiaddr, PeerId)> {
match self {
Network::Kusama => {
vec![
("/dns/p2p.cc3-0.kusama.network/tcp/30100".parse().unwrap(), FromStr::from_str("12D3KooWDgtynm4S9M3m6ZZhXYu2RrWKdvkCSScc25xKDVSg1Sjd").unwrap()),
... | Rust | 0 |
besselj(Rational(1, 3), 2*(-t)**Rational(3, 2)/3))/3)
assert airybiprime(z).rewrite(besseli) == (
sqrt(3)*(z**2*besseli(Rational(2, 3), 2*z**Rational(3, 2)/3)/(z**Rational(3, 2))**Rational(2, 3) +
(z**Rational(3, 2))**Rational(2, 3)*besseli(Rational(-2, 3), 2*z**Rational(3, 2)/3))/3)
a... | Python | 1 |
N {self.name} (entity_key);"
)
def teardown(self):
self.conn.execute(f"DROP TABLE IF EXISTS {self.name}")
def _get_vector_field(table: FeatureView) -> str:
"""
Get the vector field from the feature view. There can be only one.
"""
vector_fields: List[Field] = [
f for f in ... | Python | 1 |
afrh),
pin_dp: gpioa.pa12.into_af10(&mut gpioa.moder, &mut gpioa.afrh),
};
let usb_bus = UsbBus::new(usb);
let mut serial = SerialPort::new(&usb_bus);
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial por... | Rust | 0 |
#Crie um programa que leia nome e duas notas de vários alunos e guarde tudo em uma lista composta.
#No final, mostre um boletim contendo a média de cada um e permita que o usuário possa mostrar as notas de cada aluno individualmente.
'Definições'
group = list()
person = list()
'Adequando à proposta'
while True:
... | Python | 1 |
dmc.Button(
"To Results",
id="to-results-button",
size="lg",
w="25%",
radius="xl",
leftSection=DashIconify(icon=... | Python | 1 |
return self._variable_names[header]
return header
def get_list_of_parsed_instances(self, flat=True):
for i in queryset_iterator(self.instances_for_export(self)):
# TODO: there is information we want to add in parsed xforms.
yield i.get_dict(flat=flat)
def _rename... | Python | 1 |
carrito = input("funcion principal que ejecuta el programa de simulador de cesta")
cesta_de_compra = []
print ("bienvenido al simulador de cesta de compras")
while True:
opcion = input("elige una opcion (1-5):")
print()
if opcion == "1":
opcion = input("leche, precio: 1.20$")
print()
if o... | Python | 1 |
.threshold:
scale = 1
else:
if self.cfg.scale.type == 'divide':
scale = scale / self.cfg.scale.large
elif self.cfg.scale.type == 'minus':
scale = scale - self.cfg.scale.large
if self.cfg.scale.type=='constant':
scale = self.cfg.scale.value
past_normalized = ... | Python | 1 |
if r not in self._viz_templates:
template = template_mgr.get_template_by_handle(
template_mgr.get_template_handles("sphere")[0]
)
template.scale = mn.Vector3(r, r, r)
self._viz_templates[str(r)] = template_mgr.register_template... | Python | 1 |
'''
PyMFEM example 37
See c++ version in the MFEM library for more detail
Sample runs:
python ex37.py -alpha 10
python ex37.py -alpha 10 -pv
python ex37.py -lambda 0.1 -mu 0.1
python ex37.py -o 2 -alpha 5.0 -mi 50 -vf 0.4 -ntol 1e-5
python ex37.py -r 6 -o 1 -alpha 25.0 -eps... | Python | 1 |
+= f"\n💚 **House wins on 0!**"
result_color = 0x00ff00
elif (bet_type.lower() == "even" and winning_number % 2 == 0) or (bet_type.lower() == "odd" and winning_number % 2 == 1):
winnings = bet_amount
result_text += f"\n🎉 **Correct guess!**"
result_color = 0x00ff0... | Python | 1 |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def draw_model_architecture():
fig, ax = plt.subplots(figsize=(12, 8))
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
ax.axis("off")
# Function to draw a box with text
def draw_box(x, y, text, width=2.5, height=1.0, fontsize=10, bold=... | Python | 1 |
.expect("invalid parameters")
}
fn get_api_response<T: AsRef<str>>(
&self,
endpoint: T,
params: HashMap<&str, &str>,
) -> Result<String, Error> {
debug!("get_api_response: starting.");
let endpoint_string = endpoint.as_ref().to_string();
let mut base... | Rust | 0 |
, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
gost_subprocess.communicate()
run_gost_threader = threading.Thread(target=run_gost)
run_gost_threader.daemon = True
run_gost_threader.start() # 启动 gost
time.sleep(3) # 给时间让 gost 启动
else:
print('使用代理連接動畫瘋, 使用htt... | Python | 1 |
setsockopt, SYS_sigaltstack, SYS_socket, SYS_sync, SYS_uname,
SYS_write, SYS_writev, EFAULT, EINVAL, ENOSYS, ENOTSUP, FIONBIO, FIONREAD, MAP_ANONYMOUS,
MAP_PRIVATE, MREMAP_DONTUNMAP, MREMAP_FIXED, MREMAP_MAYMOVE, PROT_EXEC, PROT_READ, PROT_WRITE,
};
use crate::{item, Result};
use core::arch::x86_64::CpuidResul... | Rust | 0 |
# Copyright (c) 2025, mazhi and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class CNCData(Document):
pass
| Python | 1 |
), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](index.html) module"]
pub s... | Rust | 0 |
["a"], df["a"])
@pytest.mark.parametrize(
"df", [pd.DataFrame({"a": pd.to_datetime(["2017-01-22", "1970-01-01"])})]
)
def test_pos_raises(self, df):
msg = r"bad operand type for unary \+: 'DatetimeArray'"
with pytest.raises(TypeError, match=msg):
(+df)
with pytes... | Python | 1 |
7m{ndt[27]}')
except:pass
try:print(f"\033[1;37m Address 1 : \033[1;37m{ndt[9].lower()}")
except:pass
try:print(f"\033[1;37m Details 2 : \033[1;37m{ndt[23].lower()}")
except:pass
try:print(f"\033[1;37m Details 3 : \033[1;37m{ndt[25].lower()}")
except:pass
... | Python | 1 |
atmat cusparse/hipsparse lowering not available for {dtype=}. "
"Falling back to default implementation.", CuSparseEfficiencyWarning)
return _csr_matmat_lowering(ctx, data, indices, indptr, B, shape=shape,
transpose=transpose)
return _lowerings._csr_spmm_gpu_lower... | Python | 1 |
erdns.com'}
webserver("127.0.0.1:%s")
setWebserverConfig({password="%s", apiKey="%s"})
"""
@classmethod
def startResponders(cls):
tlsContext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
tlsContext.load_cert_chain('server.chain', 'server.key')
print("Launching TLS responder..")... | Python | 1 |
x, substs);
debug!("~~~~ %s", "]");
w.write_char(']');
}
ty::ty_err => fail!("Shouldn't encode error type")
}
}
fn enc_sigil(w: @io::Writer, sigil: Sigil) {
match sigil {
ManagedSigil => w.write_str("@"),
OwnedSigil => w.write_str("~"),
BorrowedSigil => w... | Rust | 0 |
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import logging
import pytest
import unittest
from wave_lang.kernel.lang import sym
from wave_lang.kern... | Python | 1 |
[0..l]);
for j in 0..flen {
okm[m]=k[j]; m=m+1;
}
}
}
fn ceil(a: usize,b: usize) -> usize {
return (a-1)/b+1;
}
pub fn xof_expand(hlen: usize,okm: &mut [u8],olen: usize,dst: &[u8],msg: &[u8]) {
let mut h = SHA3::new(hlen);
for i in 0..msg.len() {
h.process(msg[i]);
... | Rust | 0 |
# This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.integrate` namespace for importing the functions
# included below.
from scipy._lib.deprecation import _sub_module_deprecation
__all__ = [ # noqa: F822
"quad",
"dblquad",
"tplquad",
"nquad",
"IntegrationW... | Python | 1 |
import graphviz
import os
selfpath = os.path.abspath(os.path.dirname(__file__))
class Diagram:
def __init__(self, options=None):
if options is None:
options = {}
self.nodes = {}
self.relations = []
self.options = options
def add_node(self, node):
self.nodes... | Python | 1 |
ue (§4.7.2), Synthetic (§4.7.8), Signature (§4.7.9), Deprecated (§4.7.15), RuntimeVisibleAnnotations (§4.7.16) and RuntimeInvisibleAnnotations (§4.7.17).
// // FIXME
// switch (s) {
// case "ConstantValue":
// if (b instanceof CPMethod) {
// ... | Rust | 0 |
import sys
import rclpy
from rclpy.node import Node
from rclpy.action import ActionClient
from geometry_msgs.msg import PoseStamped
from nav2_msgs.action import FollowWaypoints
class WaypointsClient(Node):
def __init__(self):
super().__init__('waypoint_follower')
self.client = ActionClient(self, F... | Python | 1 |
from copy import deepcopy
from typing import TYPE_CHECKING
from loguru import logger
from llmcompressor.transformers.finetune.data import TextGenerationDataset
from llmcompressor.typing import Processor
if TYPE_CHECKING:
from llmcompressor.args import DatasetArguments
@TextGenerationDataset.register(name="ultr... | Python | 1 |
::raw::c_char; 512usize],
pub libraryList: [::std::os::raw::c_char; 512usize],
pub gpuDescription: [::std::os::raw::c_char; 512usize],
pub screenWidth: size_t,
pub screenHeight: size_t,
pub reserved: [::std::os::raw::c_uint; 16usize],
}
impl ::std::clone::Clone for _fc2SystemInfo {
fn clone(&sel... | Rust | 0 |
").child("Learn"))
.child(
ui::Link::new()
.href("/docs/".to_owned())
.title("Docs".to_owned())
.child("Docs"),
)
.child(
ui::Link::new()
.href("/benchmarks".to_owned())
.title("Benchmarks".to_owned())
.child("Benchmarks"),
);
let logo = div()
.class("footer-logo-s... | Rust | 0 |
nfig.SCREEN_SIZE, video_flags)
pygame.display.set_caption("Magic Survivor")
# Create default game data if it doesn't exist
DataHandler.create_default_files()
# Setup default assets (placeholder sprites)
setup_default_assets()
# Create and run the game - GameManager will initialize... | Python | 1 |
from django.db import models
# Create your models here.
class User(models.Model):
email = models.EmailField()
password = models.CharField(max_length=20) | Python | 1 |
import pandas as pd
from datetime import datetime
from telebot.bot import bot, CHAT_ID
from utils.logger import log
def generate_daily_summary():
try:
df = pd.read_csv("logs/signals_log.csv")
today = datetime.now().date()
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
... | Python | 1 |
After a date
//! let after = UTC.ymd(2012, 2, 1).and_hms(10, 0, 0);
//! let inc = true; // Wheter dates equals to after should be added;
//!
//! let occurence_after_date = rrule.clone()
//! .into_iter()
//! .skip_while(|d| if inc { *d <= after } else { *d < after })
//! .next();
//! assert_eq!(occurence_af... | Rust | 0 |
s=tf_keras.Input(shape=(sequence_length,), dtype=tf.int32),
input_mask=tf_keras.Input(shape=(sequence_length,), dtype=tf.int32),
input_type_ids=tf_keras.Input(shape=(sequence_length,), dtype=tf.int32),
masked_lm_positions=tf_keras.Input(
shape=(num_token_predictions,), dtype=tf.int32... | Python | 1 |
from fastmcp import Client
config = {
"mcpServers": {
"weather": {
"url": "http://localhost:8000/sse",
},
"stock": {
"url": "http://localhost:8001/sse",
},
}
}
async def main():
async with Client(config) as client:
tools = await client.list_t... | Python | 1 |
import torch
import torch.fft
import torch.nn as nn
import torch.nn.functional as F
class MSEWithSpectralLoss(nn.Module):
def __init__(self, alpha=1.0, beta=1.0):
super(MSEWithSpectralLoss, self).__init__()
self.alpha = alpha
self.beta = beta
self.mse_loss = nn.MSELoss()
def fo... | Python | 1 |
from django.conf.urls import url
from . import views
app_name = 'fleetup'
urlpatterns = [
url(r'^$', views.fleetup_view, name='view'),
url(r'^fittings/$', views.fleetup_fittings, name='fittings'),
url(r'^fittings/(?P<fittingnumber>[0-9]+)/$', views.fleetup_fitting, name='fitting'),
url(r'^doctrines/$... | Python | 1 |
}
}
}
if optional && nothing {
return Ok(None);
}
let result = GetTemporaryLinkResult {
metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
link: field_link.ok_or_else(|| ::serde::de::Error::missin... | Rust | 0 |
lF64(-f64::MIN_POSITIVE))
);
assert_eq!(Ordering::Less, (-s_nan()).cmp(&-max_subnorm()));
assert_eq!(Ordering::Less, (-s_nan()).cmp(&-min_subnorm()));
assert_eq!(Ordering::Less, (-s_nan()).cmp(&TotalF64(-0.0)));
assert_eq!(Ordering::Less, (-s_nan()).cmp(&TotalF64(0.0)));
... | Rust | 0 |
Info about a single validator
pub type Validator = TMValidatorInfo;
/// Validator address
pub type ValidatorAddress = TMAccountId;
/// A commit contains the justification (ie. a set of signatures)
/// that a block was consensus, as committed by a set previous block of validators.
pub type Commit = TMCommit;
/// A si... | Rust | 0 |
from django.test import SimpleTestCase
from django.urls import reverse , resolve
from article.views import *
class TestUrls(SimpleTestCase):
def test_articles_url_is_resolved(self):
url = reverse('mumbles-api-articles:articles')
self.assertEquals(resolve(url).func,articles)
def test_artic... | Python | 1 |
my_description={"firstname":"Getabalew",
"midlename":"Kemaw",
"age":20,
"lastname":"amare",
"contact_us":{
"phonenumber":944463198,
"email":"getabalewkemaw@gmail.com"
},
"strit":"A.A_a... | Python | 1 |
from typing import Dict, Optional, Union
import torch
from accelerate import Accelerator
from diffusers.utils.torch_utils import is_compiled_module
def unwrap_model(accelerator: Accelerator, model):
model = accelerator.unwrap_model(model)
model = model._orig_mod if is_compiled_module(model) else model
re... | Python | 1 |
from django.apps import AppConfig
class FlocConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'floc'
verbose_name = "故障定位管理"
| Python | 1 |
ight, // 2
light, light, light, // 3
];
// texture coordinates
let (min_x, min_y, max_x, max_y, face_rotation, flip) = atlas_map.get_as_tuple();
let mut texture: [f32; 8] = [
min_x, max_y, // 0
max_x, max_y, // 1
max_x, min_y, // 2
min_x, min_y, // 3
];
... | Rust | 0 |
mpute_priority == PriorityEnum.low
# 4/5/6 - cancelled/deleted/invalid
assert rec[4].task is None
assert rec[5].task is None
assert rec[6].task is None
rec = snowflake_client.get_records(all_id, include=["task"])
# created_on and modified_on hasn't changed
for r in rec:
assert r.c... | Python | 1 |
an expected weight {}",
actual_additional_byte_delivery_weight,
expected_additional_byte_delivery_weight,
);
// verify `receive_messages_delivery_proof` weight components
assert_ne!(W::receive_messages_delivery_proof_overhead(), 0);
assert_ne!(W::receive_messages_delivery_proof_messages_overhead(1), 0);
asser... | Rust | 0 |
16)) % 16]);
LittleEndian::write_u64(&mut padding, authtext.len() as u64);
poly.input(&padding[..8]);
LittleEndian::write_u64(&mut padding, plaintext.len() as u64);
poly.input(&padding[..8]);
poly.raw_result(&mut out[plaintext.len()..]);
}
fn decrypt(&self, nonce: u64,... | Rust | 0 |
#!/usr/bin/env python3
"""Benchmarks for the verifier of the xDSL implementation."""
from benchmarks.workloads import WorkloadBuilder
class Verifier:
"""Benchmark verification in xDSL.
For a single rewriting pass, we verify with the input before the pass and
the output after the pass.
Note that thi... | Python | 1 |
parent: Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')] | None
bridge: Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')] | None
untagged_vlan: Annotated["VLANType", strawberry.lazy('ipam.graphql.types')] | None
vrf: Annotated["VRFType", strawber... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.