text string | label_name string | labels int64 |
|---|---|---|
params['shift'] + 25,
'Y': params['shift'] + 29,
'Y_66': params['shift'] + 30,
},
'cash': {
'Q1': params['shift'] + 1 + cash_shift,
'Q2': params['shift'] + 5 + cash_shift,
'HY1': params['shift'] + 9 + cash_shift,
... | Python | 1 |
error {
ops.remove(events)
.expect("Failed to remove fd from event handling loop");
}
}
fn init(&mut self, ops: &mut EventOps) {
ops.add(Events::with_data(
&self.ioeventfd,
IOEVENT_DATA,
EventSet::IN,
))
.expect("F... | Rust | 0 |
("chr1", 11873, 14409)
.strand_char('+')
.id("NR_046018")
.gene_id("DDX11L1")
.coords(vec![(11873, 12227), (12612, 12721), (13220, 14409)], None)
.coding_incl_stop(true)
.build()
.expect("a transcript");
let mut writer = RefFlatWriter::from_memory();
wri... | Rust | 0 |
s, self._remote_port))
click.echo(
f"Client UDP Echo: Connection opened to "
f"{self._remote_ip_address}, port {self._remote_port}."
)
except OSError as error:
click.echo(
f"Client UDP Echo: Connection to {self._remote_ip_addres... | Python | 1 |
ngify!(_UNSUPPORT_INFO),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_UNSUPPORT_INFO>())).FSDK_UnSupport_Handler as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
string... | Rust | 0 |
unwrap_or_default();
if key.is_none() {
break;
}
let key = key.unwrap();
if let Some(mut entry) = cache.remove(&key) {
let weight = entry.policy_weight();
Deques::unlink_ao_from_deque(deq_name, deq, &mut entry);
... | Rust | 0 |
elf.health_check_active = False
if self.health_check_thread:
self.health_check_thread.join(timeout=5)
# 關閉適配器
for adapter_name, adapter in self.adapters.items():
try:
if hasattr(adapter, 'shutdown'):
adapter.shutdown()
... | Python | 1 |
cache"))]
user_id: u32,
#[cfg(feature = "cache")]
user_id: Option<UserId>,
}
impl<'a> GetUserMostPlayed<'a> {
#[cfg(not(feature = "cache"))]
#[inline]
pub(crate) fn new(osu: &'a Osu, user_id: u32) -> Self {
Self {
fut: None,
osu,
user_id,
... | Rust | 0 |
, map_ok_func);
let err_map = err_val.map_or_else(map_err_func, map_ok_func);
assert!(!ok_map);
assert!(err_map);
}
}
//! A simple representation of color
use std::fmt::{Debug, Formatter};
/// A datatype representing color.
///
/// Currently this is only a 32 bit RGBA value, but it will l... | Rust | 0 |
path.is_ident("convert_save_load_skip_convert") {
None
} else if attr.path.is_ident("convert_save_load_attr") {
match attr.parse_args_with(single_parse_outer_from_args) {
Ok(inner_attr) => Some(inner_attr),
Err(err) => panic!(
... | Rust | 0 |
_pos -= u8::MAX as u16 * 2;
(wheel_pos as u8, u8::MAX - 1 - wheel_pos as u8, 0).into()
}
}
/// Problem 29 - Project Euler
/// http://projecteuler.net/index.php?section=problems&id=29
extern crate num;
use num::bigint::BigInt;
use num::FromPrimitive;
use std::collections::HashSet;
fn powstr(a: i32, b: i32)... | Rust | 0 |
)
}
)
if check_timelapse_resp.result['progress'] != -1:
# timelapse already active
return self.finish_json(
{'progress': check_timelapse_resp.result['progress']}
)
... | Python | 1 |
# 重试逻辑
retries += 1
if retries <= max_retries:
print(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}][FlinkETLStarter][INFO]: {retry_delay}秒后重试(第{retries}次)...")
time.sleep(retry_delay)
# 如果所有重试都失败,抛出异常
raise Exceptio... | Python | 1 |
>, NotFound<String>> {
let token = rr.token.clone();
let description = rr.description.clone();
let config = load_config();
let corpus_name = corpus_name.to_lowercase();
let service_name = service_name.to_lowercase();
// Ensure we're given a valid rerun token to rerun, or anyone can wipe the cortex results
... | Rust | 0 |
..60 {
temp = Wrapping(circular_shift(5, a))
+ (b & c | b & d | c & d)
+ e
+ Wrapping(w[t])
+ Wrapping(K3);
e = d;
d = c;
c = Wrapping(circular_shift(30, b));
b = a;
a = temp;
... | Rust | 0 |
import socket
import maya.cmds as mc
maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def prankWindow(hardcoreMode=0):
# Reset UI
try: mc.deleteUI("prankWindow")
except: pass
# Create Window
window = mc.window("prankWindow")
mainLayout = mc.columnLayout("mainLayout", adj=1, p=windo... | Python | 1 |
tval[: len(left)] == left
assert retval[-1] == "}"
return retval[len(left) : -1]
except AssertionError:
return None
return None
class TimeoutException(Exception):
pass
@contextlib.contextmanager
def time_limit(seconds: float):
def signal_handler(signum, frame... | Python | 1 |
rate) mod caa;
pub(crate) mod hinfo;
pub(crate) mod mx;
pub(crate) mod name;
pub(crate) mod naptr;
pub(crate) mod null;
pub(crate) mod openpgpkey;
pub(crate) mod soa;
pub(crate) mod srv;
pub(crate) mod sshfp;
pub(crate) mod svcb;
pub(crate) mod tlsa;
pub(crate) mod txt;
<filename>gotham/src/handler/error.rs
use futures... | Rust | 0 |
"dataSource": self.druid_datasource,
},
"tuningConfig": {
"type": "hadoop",
"jobProperties": {
"mapreduce.job.user.classpath.first": "false",
"mapreduce.map.output.compress": "false",
... | Python | 1 |
| |
* +------------------+
*/
let context = create_env().await?;
let scheduler = PlanScheduler::try_create(context)?;
let scheduled_tasks = scheduler.reschedule(&PlanNode::Stage(StagePlan {
kind: StageKind::Convergent,
scatters_expr: Expression::create_literal(Dat... | Rust | 0 |
from models import WeatherForecast, db
from datetime import datetime
def distance(V,W):
d=0
for i in range(len(V)):
d=d+(V[i]-W[i])**2
return d**(1/2)
def distanceRef(S):
d=0
cardS=len(S)
for i in range(cardS):
for j in range(cardS):
d=d+distance(S[i],S[j])
return d/((ca... | Python | 1 |
ble(_)
| MemoryStatistic::Mlocked(_)
| MemoryStatistic::SwapTotal(_)
| MemoryStatistic::SwapFree(_)
| MemoryStatistic::Dirty(_)
| MemoryStatistic::Writeback(_)
| MemoryStatistic::AnonPages(_)
| MemoryStatisti... | Rust | 0 |
EPINT0::OTEPDIS;
pub use super::OTG_HS_DOEPINT0::STUP;
pub use super::OTG_HS_DOEPINT0::XFRC;
}
/// OTG_HS device endpoint-6 interrupt register
pub mod OTG_HS_DOEPINT6 {
pub use super::OTG_HS_DOEPINT0::B2BSTUP;
pub use super::OTG_HS_DOEPINT0::EPDISD;
pub use super::OTG_HS_DOEPINT0::NYET;
pub use... | Rust | 0 |
e")
self._RequestId = params.get("RequestId")
class CreateCRWorkRequest(AbstractModel):
"""CreateCRWork请求参数结构体
"""
def __init__(self):
r"""
:param _WorkName: 作品名称
:type WorkName: str
:param _WorkCategory: 作品分类
:type WorkCategory: str
:param _WorkTy... | Python | 1 |
def test_api_doc(api_no_type):
r = testing.ReferenceJson(os.path.join(TEST_DIR, 'testdata', 'api'))
res = api_no_type.get('/openapi.json')
if platform.system() != 'Windows':
r.assert_equal('openapi.json', _strip_description_fields(res.json()))
| Python | 1 |
en loading LoRA weights.
Default: None
Returns:
None
Raises:
AssertionError: if base_missing contains any base model keys.
AssertionError: if base_unexpected is nonempty.
AssertionError: if lora_missing contains any LoRA keys.
AssertionError: if lora_unexpec... | Python | 1 |
}
fn submit_candidacy(c: u32) -> Weight {
(67_154_000 as Weight)
.saturating_add((273_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn renounce_cand... | Rust | 0 |
for n in range(num_prod)]))
# Calculate base cycle time.
numer = 2 * term1
denom = term2
base_cycle_time = math.sqrt(numer / denom)
# Calculate order quantities.
order_quantities = [base_cycle_time * order_multiples[n] * demand_rates[n] for n in range(num_prod)]
# Calculate average cost.
avg_fixed_cost = ter... | Python | 1 |
v)
self.assert_eig_valid(wr, vr, X)
def test_random_2d_stacked_arrays(self):
# cannot test M == 0 due to bug in old numpy
for M in range(1, 7):
X = np.random.rand(10, 10, M, M)
w, v = np.linalg.eig(X)
wr, vr = cdf2rdf(w, v)
self.assert_eig... | Python | 1 |
)
.build();
let _baz = project("baz")
.file(
"Cargo.toml",
r#"
[package]
name = "baz"
version = "0.0.1"
authors = []
[lib]
name = "baz"
crate_type = ["dylib"]
"#,
)
... | Rust | 0 |
2.0).
// See LICENSE-APACHE and LICENSE-MIT for details.
//
// original repository = "https://github.com/phil-opp/linked-list-allocator"
// documentation = "https://docs.rs/crate/linked_list_allocator"
// homepage = "http://os.phil-opp.com/kernel-heap.html#a-better-allocator"
//
// November 2017: adapted for eduOS-rs ... | Rust | 0 |
idx in range(len(idx2word)):
feat = render_text_with_token_id(idx, font, False)
if feat.tolist() in [useless, useless2, useless3]:
print('useless')
cnt += 1
if idx % 1000 == 0:
ascii_prin... | Python | 1 |
Extrapolation<P>,
) {
let (w, h) = src.dimensions();
let iarr = 1.0 / (r + r + 1) as f32;
for i in 0..w {
let (fv, lv) = match extrapolation {
Extrapolation::ExtendEdge => {
(src.get_pixel(i, 0).clone(), src.get_pixel(i, h - 1).clone())
}
Extrapola... | Rust | 0 |
PipeConnection};
use base::{error, warn, Event, RawDescriptor};
use broker_ipc::{common_child_setup, CommonChildStartupArgs};
use cros_async::{EventAsync, Executor, IntoAsync, IoSourceExt};
use futures::future::{AbortHandle, Abortable};
use hypervisor::ProtectionType;
#[cfg(feature = "slirp")]
use net_util::Slirp;
use... | Rust | 0 |
thread::yield_now();
continue;
}
// TODO: Add a hazard pointer to fix a possible data race between this value being dropped before we set the next pointer
if !head.is_null() {
// SAFETY: The head always be pointing at a valid node
... | Rust | 0 |
mage_info.get("PatientID"),
"StudyInstanceUID": image_info.get("StudyInstanceUID"),
}
)
os.unlink(label_file)
label_id = super().save_label(image_id, label_filename, label_tag, label_info)
logger.info("Save completed!")
if output_file... | Python | 1 |
ui;
use one_thousand_deaths::{Action, Game};
use std::cell::RefCell;
use std::io::{self, Write};
use std::process;
use termion::raw::IntoRawMode;
use ui::UI;
thread_local!(pub static WIZARD_MODE: RefCell<bool> = RefCell::new(false));
pub fn wizard_mode() -> bool {
WIZARD_MODE.with(|w| *w.borrow())
}
#[derive(C... | Rust | 0 |
20:35b:7399::5' network='0' port='0' priority='1015022079' protocol='tcp' type='host'/>
<candidate xmlns='urn:xmpp:jingle:transports:ice-udp:1' component='1' foundation='1' generation='0' id='f0c73ac3-9b7d-4032-abe3-6dd9a57d0f03' ip='fc00:db20:35b:7399::5' network='0' port='37487' priority='1010827775' protocol='tc... | Rust | 0 |
'3d')
a0.grid()
z = u_buckled[DOF * vi + 1, 0]
y = u_buckled[DOF * vi + 2, 0]
x = u_buckled[DOF * vi + 3, 0]
a0.plot3D(x, y, z, label="b")
z1 = u_pre[DOF * vi + 1, 0]
y1 = u_pre[DOF * vi + 2, 0]
x1 = u_pre[DOF * vi + 3, 0]
a0.plot3D(x1, y1, z1, label="nb")
a0.legend()
# df1 = pd.DataFrame([node_data])
# df1.loc[len(df... | Python | 1 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. 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 req... | Python | 1 |
continue;
}
if let Some(fetch) = unsafe { Q::Fetch::get(archetype, offset) } {
self.batch += 1;
return Some(Batch {
_marker: PhantomData,
state: ChunkIter {
fetch,
... | Rust | 0 |
# Function to check if the grid is in valid state
def is_valid(grid):
for i in range(3):
for j in range(3):
if grid[i][j] == 'x':
continue
if i > 0 and grid[i][j] <= grid[i-1][j]:
return False
if j > 0 and grid[i][j] <= grid[i][j-1]:
... | Python | 1 |
# if false {
//! tokio::run(
//! fut.map_err(|e| eprintln!("Couldn't publish message: {}", e))
//! );
//! # }
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/batch/0.2.0")]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
mod client;
mod delivery;
mod dispatch;
/// Not public API. ... | Rust | 0 |
gation.SUM,
[(per_device, d1),
(per_device_2, d2)]),
[
_fake_mirrored(mean * len(devices) * num_workers, d1),
_fake_mirrored(mean_2 * len(devices) * num_workers, d2)
], ... | Python | 1 |
};
info!("connected to remote {}", addr);
remote
};
let (mut sr, mut sw) = tokio::io::split(stream);
let (mut mr, mut mw) = remote.split();
let l2r = copy_from_encrypted(method, &mut sr, &mut mw);
let r2l = copy_to_encrypted(method, &mut mr, &mut sw);
tokio::pin!(l2r)... | Rust | 0 |
,
0b100 => Some(MODE::PowerDown2),
0b101 => Some(MODE::ShuntVoltageContinuous),
0b110 => Some(MODE::BusVoltageContinuous),
0b111 => Some(MODE::ShuntBusVoltageContinuous),
_ => None,
}
}
}
/// The state of the configuration register.
#[derive(Debug... | Rust | 0 |
entation of MPSR. For more details, please refer to
# https://github.com/jiaxi-wu/MPSR/blob/master/maskrcnn_benchmark/data/datasets/voc.py#L137
self.main_idx_map = self.reweight_dataset(
self.main_dataset,
['VOC2007', 'VOC2012'],
)
self.aux... | Python | 1 |
against = vec![1,2,3,4,5,6,7,8,9,10];
/// for msg in os.chunks_mut(10) {
/// assert_eq!(msg, test_against);
/// }
/// ```
pub use crate::ordered_stream::OrderedStream as OrderedStream;
pub mod ordered_stream;
pub mod offset_vec;
<reponame>blaind/bevy_webview
use bevy::{
log,
prelude::*,
render::render_... | Rust | 0 |
ub const ADMIN_KEYPAIR_SEALED: &'static [u8] = b"placeholder";
pub const ADMIN_KEYPAIR_SALT: &'static [u8] = b"NaCl";
pub const COMMENT: &'static str = "The tree of a thousand users begins with a single block";
#[test]
fn test_log_creation() {
let rng = rand::SystemRandom::new();
let ad... | Rust | 0 |
fault();
// Decode the private key
let decoded_priv_key = pem::decode(priv_key.data)?;
// Sign the signature string and base64-encode the signature
let signature = algorithm.sign(decoded_priv_key, signature_string_bytes)?;
let encoded_signature = base64::encode(signature);
// Build the signat... | Rust | 0 |
(DeserializeSnapshot(path)))
.map_err(|err, _, _| panic!("Error communicating with snapshot actor. {}", err))
.and_then(|res, _, _| fut::result(res))
// Rebuild state machine from the deserialized data.
.and_then(|entries, act: &mut Self, _| {
act.state_m... | Rust | 0 |
>,
mut image_manager: ResMut<ImageManager>,
) {
commands.spawn_bundle(UICameraBundle::new());
let handle: Handle<bevy::render::texture::Image> = asset_server.load("panel.png");
let ui_image_handle = image_manager.get(&handle);
let context = BevyContext::new(|context| {
// The border prop s... | Rust | 0 |
import chess
from core.game import Game
from core.player import HumanPlayer, AIPlayer
from cli.algorithm_selector import select_algorithm
def play_human_vs_ai():
"""
Human vs AI:
- Human (White) enters moves in UCI format (e.g., e2e4).
- AI (Black) is chosen by user.
- Type 'quit' at any point on y... | Python | 1 |
#[pallet::getter(fn account_storage)]
// Learn more about declaring storage items:
// https://docs.substrate.io/v3/runtime/storage#declaring-storage-items
pub type AccountStorage<T> = StorageMap<_, Twox64Concat, AccountOf<T>, Account<T>>;
// Pallets use events to inform users when important changes are made.
//... | Rust | 0 |
nce, so it is always an
underestimate of the actual variance. To get better estimates, you need to set
``var_method`` to something else and use patches in the input catalog(s).
cf. `Covariance Estimates`.
The typical usage pattern is as follows:
>>> zz = treecorr.ZZCorrelation(con... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: response_reference_data.proto
# Protobuf Python Version: 6.31.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor... | Python | 1 |
return @{self.as_ref()}.nodeValue;
).try_into().ok()
}
/// Sets the value of the node.
///
/// [(JavaScript docs)](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)
// https://dom.spec.whatwg.org/#ref-for-dom-node-nodevalue
fn set_node_value( &self, value: Option< &str > ... | Rust | 0 |
CreateSplitTxOutHandle(
handle: *const c_void,
create_handle: *const c_void,
split_output_handle: *mut *mut c_void,
) -> c_int;
pub fn CfdAddSplitTxOutData(
handle: *const c_void,
split_output_handle: *const c_void,
amount: c_longlong,
address: *const i8,
direct_locking_script: *cons... | Rust | 0 |
let rank = match i%13 {
0 => Rank::Ace,
1 => Rank::Two,
2 => Rank::Three,
3 => Rank::Four,
4 => Rank::Five,
5 => Rank::Six,
6 => Rank::Seven,
7 => Rank::Eight,
8 => Rank::Nine,
9 => R... | Rust | 0 |
AND column_name = '{}'
""".format(
self._schema, table, column
)
)
if sa_connection:
row = sa_connection.execute(sqlalchemy.text(sql)).fetchone()
else:
with self._alchemy_db.connect() as conn:
row = conn... | Python | 1 |
the vmctx base
///
/// This is done for verification purposes only
pub ptr_offset: Option<Uimm64>,
/// Offset of the bound pointer from the vmctx base
///
/// This is done for verification purposes only
pub bound_offset: Option<Uimm64>,
}
impl Display for HeapCommand {
fn fmt(&self, f:... | Rust | 0 |
}
impl Arbitrary for DeconvOp {
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
fn arbitrary_with(_: Self::Parameters) -> BoxedStrategy<Self> {
(
1usize..4,
1usize..4,
0usize..4,
vec(1usize..4),
prop_oneof![
Jus... | Rust | 0 |
).lines() {
let line = line?;
if line == "" || line == "\r" {
break;
}
let mut parts = line.splitn(2, ':');
let key = parts.next().unwrap();
let value = parts.next().unwrap();
let value = &value[1..];
header... | Rust | 0 |
1.1100, 1.1110, 1.1130, 1.1150, 1.1190],
[1.1107, 1.1110, 1.1110, 1.1110, 1.1120, 1.1140, 1.1160, 1.1190],
[1.1133, 1.1140, 1.1130, 1.1140, 1.1140, 1.1150, 1.1170, 1.1190],
[1.1154, 1.1150, 1.1160, 1.1160, 1.1160, 1.1170, 1.1180, 1.1200],
[1.1172, 1.1170, 1.1170, 1.1180, 1.1180, 1.1180, 1.1190, 1.1200],
[1.1186, 1.119... | Rust | 0 |
# Override based on locale if needed
if task.locale.startswith("de"):
voice_id = "voice_german" # Placeholder - use actual German voice ID
elif task.locale.startswith("es"):
voice_id = "voice_spanish" # Placeholder - use actual Spanish voice ID
elif task.locale... | Python | 1 |
wrap();
let expected = r#"['immutag']
version = "0.1.0"
"#;
fixture.teardown(true);
assert_eq!(is_valid, ImmutagFileState::Valid);
assert_eq!(doc.to_string(), expected);
}
#[test]
fn immutagfile_add_entry() {
let path = "/tmp/immutag_tests";
let gpath = "/tmp... | Rust | 0 |
# app/ui.py
"""
UI route for rendering a form-based interface and displaying the generated creative plan.
Uses Jinja2 templates and FastAPI's form handling.
"""
import json
from fastapi import APIRouter, Request, Form
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
from app.... | Python | 1 |
"0: {}", get_sum(&tree, 0)); // 0
// 転倒数を求める例
// 1からnの並び替えになっていること!
let n = 7;
let c = vec![3, 1, 4, 5, 7, 2, 6];
let mut tree = vec![0; n + 1];
let mut tento = 0usize;
for i in 1..=n {
update_tree(&mut tree, c[i - 1], 1);
tento += i - get_sum(&tree, c[i - 1]);
}
pri... | Rust | 0 |
BCRYPT_ECDH_P256_ALGORITHM => Ok(Self::Ecdh(NamedCurve::NistP256)),
BCRYPT_ECDH_P384_ALGORITHM => Ok(Self::Ecdh(NamedCurve::NistP384)),
BCRYPT_ECDH_P521_ALGORITHM => Ok(Self::Ecdh(NamedCurve::NistP521)),
BCRYPT_ECDSA_P256_ALGORITHM => Ok(Self::Ecdsa(NamedCurve::NistP256))... | Rust | 0 |
import json
from pathlib import Path
import torch
from torch.utils.data import DataLoader
from transformers import BertModel, BertTokenizer
from embedding_experiments.foodbert.helpers.instructions_dataset import InstructionsDataset
"""
This code is taken from the following repository:
https://github.com/ChantalMP/Exp... | Python | 1 |
_url, crypto);
let input_data = hashmap!("training_data" => training_input_data);
let output_data = hashmap!("trained_model" => model_output_data);
let staged_task = StagedTask::new()
.task_id(task_id)
.executor(Executor::Builtin)
.function_name("builtin-gbd... | Rust | 0 |
# tests/test_pbr_textures_gpu.py
# GPU-aware smoke test for textured rendering path.
# Exists to assert API shape and basic behavioral delta with textures while skipping on non-GPU CI.
# RELEVANT FILES:python/forge3d/path_tracing.py,python/forge3d/materials.py,python/forge3d/textures.py
import os
import numpy as np
im... | Python | 1 |
import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "accounts_settings")
frappe.db.set_single_value(
"Accounts Settings", "automatically_process_deferred_accounting_entry", 1
)
| Python | 1 |
s.iter().flat_map(|n| {
let mut res = Vec::new();
for e in n.iter_incoming_edges(self.graph).chain(n.iter_outgoing_edges(self.graph)) {
if e.get_target_node(self.graph).is_data_node() {
continue;
}
... | Rust | 0 |
from endersgame.riverstats.fewvar import FEWVar # Adjust the import path to match your project structure
def test_fewvar_to_dict():
# Initialize and update FEWVar
few_var = FEWVar(fading_factor=0.01)
few_var.update(5.0)
few_var.update(6.0)
# Serialize to dictionary
state = few_var.to_dict()
... | Python | 1 |
d features: `\"Win32_Security_WinTrust\"`*"]
pub const SPC_CAB_DATA_STRUCT: ::windows_sys::core::PCSTR = 2008i32 as _;
#[doc = "*Required features: `\"Win32_Security_WinTrust\"`*"]
pub const SPC_CERT_EXTENSIONS_OBJID: &str = "1.3.6.1.4.1.311.2.1.14";
#[doc = "*Required features: `\"Win32_Security_WinTrust\"`*"]
pub con... | Rust | 0 |
print("1. 📥 Скрыть текст в тексте")
print("2. 📤 Извлечь скрытый текст")
print("3. 🔍 Анализ текста на скрытые данные")
print("0. ← Назад")
choice = input(f"\n{Colors.YELLOW}Выберите действие: {Colors.END}")
if choice == '1'... | Python | 1 |
impl Item {
pub fn real_name(&self) -> String {
format!("{} {}", self.first_name, self.last_name)
}
pub fn available(&self) -> Result<()> {
let who = self.to_string();
if self.deleted_at.is_some() {
return Err(Error::Http(StatusCode::NOT_FOUND, Some(who)));
}
... | Rust | 0 |
)?;
lstack.pop();
Ok(pc)
}
fn skip_until_else_or_end(instr: &[Instruction], mut pc: usize) -> Result<usize, RuntimeError> {
let mut block_depth = 1;
loop {
let (op, _) = instr[pc];
pc += 1;
match op {
Opcode::End => block_depth -= 1,
Opcode::If | Opcode::... | Rust | 0 |
i -= 1;
}
} else {
i -= 1;
}
}
clear_tail_counter(sa);
sa.iter_mut()
.filter(|e| is_empty(**e))
.for_each(|e| *e = I::zero());
}
fn put_lms_suffix_rec<C: Char, I: Char>(s: &[C], lms_count: usize, sa: &mut [I]) {
debug_assert!(s.... | Rust | 0 |
lf.quant_min, self.quant_max).float()
if self.fake_quant_enabled == 1:
if self.ch_axis != -1:
if self.use_grad_scaling:
grad_factor = 1.0 / (X.numel() / X.shape[self.ch_axis] * self.quant_max) ** 0.5
else:
grad_factor = 1.0
... | Python | 1 |
ojection.from_pair(x, y)
});
Ok(CaptureCollection::new(final_shape, collection))
}
fn lower_antijoin<G: Scope, Injector, H: std::hash::BuildHasher>(
scope: &mut G,
injector: &mut Injector,
op: &AntijoinOp,
inputs: &FactMap<G, H>,
) -> PlanResult<G>
where
G::Timestamp: Lattice + Ord,
Inj... | Rust | 0 |
yeilds_all_elements() {
fn prop<T: Ord + Radix + Copy>(mut xs: Vec<T>) -> TestResult {
let heap = xs.iter().map(|&d| (d, ())).collect::<RadixHeapMap<_, _>>();
// Check that the iterator yields all elements inside the heap
for (k, ()) in heap.iter() {
for i in... | Rust | 0 |
withdrawal: packed::WithdrawalRequest,
) -> Result<(), Error> {
self.insert_raw(
COLUMN_MEM_POOL_WITHDRAWAL,
withdrawal_hash.as_slice(),
withdrawal.as_slice(),
)
}
fn get_mem_pool_withdrawal(
&self,
withdrawal_hash: &H256,
) -> R... | Rust | 0 |
ive(Clone, Debug, PartialEq, PartialOrd)]
pub struct Syllable(u32);
impl TryFrom<u32> for Syllable {
type Error = ();
fn try_from(item: u32) -> Result<Self, Self::Error> {
if item.is_syllable() {
Ok(Syllable(item))
} else {
Err(())
}
}
}
impl TryFrom<char> ... | Rust | 0 |
eq!(kilo, Some(1100.0))
}
#[test]
fn parse_bad() {
let wrong = parse::parse_num("8NOPEK");
assert_eq!(wrong, None);
}
}
mod note_tests {
#[test]
fn note_period() {
let freq = super::note::get_freq(12.0);
assert_eq!(freq, 2.0)
}
}
<gh_stars>1-10
use crate::{t... | Rust | 0 |
OperationToSuccessful::new(CumulocitySupportedOperations::C8yUploadConfigFile)
.with_response_parameter(parameter.unwrap_or_else(|| "".to_string()).as_str())
.to_smartrest()
}
// returns a c8y SmartREST message indicating the failure of the upload config file operation.
// example m... | Rust | 0 |
PeerId>)>, Error> {
let mut args = env::args().skip(1);
let path = if let Some(path) = args.next() {
path.parse::<IpfsPath>()
.map_err(|e| e.context(format!("failed to parse {:?} as IpfsPath", path)))?
} else {
return Ok(None);
};
let target = if let Some(multiaddr) = a... | Rust | 0 |
ility::Modelname("Example".to_owned()))
.add_capability(Capability::Model("Example".to_owned()));
if let Ok((mut proto_stream, _, _)) = proto.connect().await {
while let Some(Ok(msg)) = proto_stream.next().await {
println!("{:?}", msg);
}
}
}
// Copyright (c) 2021 Quark Cont... | Rust | 0 |
,
}
}
fn is_epilogue_placeholder(&self) -> bool {
if let Self::EpiloguePlaceholder = self {
true
} else {
false
}
}
fn is_term<'a>(&'a self) -> MachTerminator<'a> {
match self {
// Interesting cases.
&Self::Ret | &... | Rust | 0 |
OGs,
(SELECT AVG(cogs) from car_table) AS Average_COGs,
cogs - (SELECT AVG(cogs) from car_table) AS Difference
FROM
car_table
'''
nest_cheat2 = '''
SELECT
SUM(revenue) as Female_Revenue
FROM
sales_table
WHERE
customer_id in (SELECT customer_id FROM cus... | Python | 1 |
c_port,
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct MicroService {
pub image: String,
pub tag: String,
}
pub struct MicroServiceBuilder {
pub image: String,
pub tag: String,
}
impl MicroServiceBuilder {
pub fn new() -> MicroServiceBuilder {
MicroServiceBui... | Rust | 0 |
path"
)
args = parser.parse_args()
log_level = getattr(logging, args.log_level)
setup_logging(args.log_file, log_level)
logging.info("Starting Twitter Layoffs Analysis")
logging.info(f"Mode: {args.mode}")
try:
if args.mode == "collect":
run_data_collection... | Python | 1 |
bw_chess() -> Box<Shader> {
let black_shader = Box::new(MonochromeShader {
color: Vector3::new(0.0, 0.0, 0.0),
});
let white_shader = Box::new(MonochromeShader {
color: Vector3::new(1.0, 1.0, 1.0),
});
Box::new(ChessShader {
shader1: black_shader,
shader2: white_shade... | Rust | 0 |
1: "iliopsoas_right",
},
# --roi_subset does not work anymore with this
# without humerus and femur
# "class_map_part_muscles_v2": {
# 1: "scapula_left",
# 2: "scapula_right",
# 3: "clavicula_left",
# 4: "clavicula_right",
# 5: "hip_left",
# 6: "hip_right"... | Python | 1 |
#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
pub sin6_flowinfo: uint32_t,
pub sin6_addr: in6_addr,
pub sin6_scope_id: uint32_t,
}
pub type uint32_t = __uint32_t;
#[repr(C)]#[derive(Copy, Clone)]
pub struct in6_addr {
pub __in6_u: C2Rus... | Rust | 0 |
// ~.003%
LobstersRequest::Logout
};
_nissued += 1;
ops += 1;
let issued = next;
let rtype = mem::discriminant(&req);
let fut = call!(
rt,
client,
TrawlerRequest {
user,
page: req,
... | Rust | 0 |
yview
:Keyword Arguments:
* *drop* (``integer``) --
The amount of bytes to discard from the initial part of the keystream.
In fact, such part has been found to be distinguishable from random
data (while it shouldn't) and also correlated to key.
The recomme... | Python | 1 |
Style::Outline => EdgeStyle::Outline,
}
}
}
impl From<EdgeStyle> for fidl_fuchsia_settings::EdgeStyle {
fn from(src: EdgeStyle) -> Self {
match src {
EdgeStyle::None => fidl_fuchsia_settings::EdgeStyle::None,
EdgeStyle::DropShadow => fidl_fuchsia_settings::EdgeStyle::Dro... | Rust | 0 |
n_answered else None,
)
for answer in question.answers
]
questions_response.append(
QuestionResponse(
id=question.id,
title=question.title,
description=question.description,
photos_url=question.photos_url... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.