text string | label_name string | labels int64 |
|---|---|---|
tree = as_tree(archive.entries())?;
match zip_path {
"tests/inputs/hello.zip" | "tests/inputs/hello-prefixed.zip" => {
tree.lookup("hello/hi.txt")?;
tree.lookup("hello/rip.txt")?;
tree.lookup("hello/sr71.txt")?;
let no_such_file = Path::new("no/such/file");... | Rust | 0 |
, std::convert::Infallible> {
Ok(match tx.send(()).await {
Ok(_) => warp::http::StatusCode::OK,
Err(_) => warp::http::StatusCode::NOT_IMPLEMENTED,
})
}
async fn not_implemented() -> Result<(impl warp::Reply,), std::convert::Infallible> {
Ok((warp::http::StatusCode::NOT_IMPLEMENTED,))
}
#[c... | Rust | 0 |
der.as_markup()
)
@router.callback_query(F.data.startswith("mass_"), AuthFilter())
async def handle_mass_operation_placeholder(callback: types.CallbackQuery):
"""Placeholder for mass operations"""
await callback.answer()
operation = callback.data.replace("mass_", "").replace("_menu", "")
... | Python | 1 |
ctrum)
linewidth_shimmed = utils_Spinsolve.get_linewidth_Hz(shimmed_spectrum)
initial = initial_spectrum[::initial_config["downsample_factor"]]/initial_config["max_data"]
shimmed = shimmed_spectrum[::initial_config["downsample_factor"]]/initial_config["max_data"]
min_width = signal.peak_widths(initial, ... | Python | 1 |
}
}
while !flashes.is_empty() {
let mut new_flashes = HashSet::new();
for &(r, c) in &flashes {
b[r][c] = 0;
for (r1, c1) in neighbours((r, c), b.len(), b[0].len()) {
if flashed.contains(&(r1, c1)) {
continue;
... | Rust | 0 |
stores.a.dispatch(Msg::Nothing);
stores.b.dispatch(Msg::Decr(20));
stores.b.dispatch(Msg::Add(100));
fn sub(model: &Model) {
println!("Sub {:?}", model);
}
}
use std::collections::HashMap;
use chrono::{Datelike, Duration, NaiveDate};
/// Empty priority - means a todo do not have any priority ... | Rust | 0 |
*addr.as_ptr() };
let legacy = is_legacy_acpi();
let dsdt_phys = if legacy {
fadt.dsdt as u64
} else {
fadt.x_dsdt
};
let vptr = memory::phys_to_virt(PhysAddr::new(dsdt_phys));
let dsdt_header: SDTHeader = unsafe { *vptr.as_ptr() };
let size = dsdt_header.length as usize;
... | Rust | 0 |
def make_ends(nums):
return [nums[0]] + [nums[-1]]
| Python | 1 |
q.clone()),
p: b2_mul_rot_by_vec2(a.q, b.p) + a.p,
};
return c;
}
//TODO_humman крупные типы через ссылки
// v2 = A.q' * (b.q * v1 + b.p - A.p)
// = A.q' * b.q * v1 + A.q' * (b.p - A.p)
pub fn b2_mul_t_transform(a: B2Transform, b: B2Transform) -> B2Transform {
let c = B2Transform {
q: b... | Rust | 0 |
tatus"""
# Implementation would check deployment status
return "Success"
def _determine_severity(self, error_data: Dict[str, Any]) -> Severity:
"""Determine severity based on error data"""
# Simple severity mapping - can be enhanced with ML
error_message = error_data.get... | Python | 1 |
ng. Verification has to happen
/// on an application level.
struct ClientVerifier;
impl ClientCertVerifier for ClientVerifier {
fn client_auth_mandatory(&self) -> Option<bool> {
Some(false)
}
fn client_auth_root_subjects(&self) -> Option<DistinguishedNames> {
Some(DistinguishedNames::new())
}
fn verify_clie... | Rust | 0 |
17.8281512251323, 0.267231825859481, 2.41779512472801e-05,
0.874926047858207
]).reshape(2, 3, order='F')
mpg_bs_poisson.s_table = np.array([
2.53986871460058, 1.70629964435497, 3.20982914795608, 2.15301685267905,
24.0890023854214, 12.9900133623474, 4.50054787026542e-05,
0.0019804834204652
]).re... | Python | 1 |
ch.updated_at.unwrap().date().year(),
ch.updated_at.unwrap().date().month() as i32 - 1,
ch.updated_at.unwrap().date().day() as i32,
)
.unwrap();
list += &format!(
"<tr><td style=\"text-align: center; padding:... | Rust | 0 |
(ground: &Vec<Vec<u32>>) -> Vec<Vec<(i64, i64)>> {
let mut res: Vec<Vec<(i64, i64)>> = Vec::new();
for i in 0..ground.len() {
let mut row: Vec<(i64, i64)> = Vec::new();
for j in 0..ground[i].len() {
if ground[i][j] == 9 {
row.push((0, 0));
} else {
//9 is never in a basin
let mut flow: (i64, i64... | Rust | 0 |
etadata {}
#[cfg(test)]
impl crate::metadata::MigrationMetadata for GenericMetadata {}
#[cfg(test)]
pub fn make_small_table_collection() -> TableCollection {
let mut tables = TableCollection::new(1000.).unwrap();
tables
.add_node(0, 1.0, PopulationId::NULL, IndividualId::NULL)
.unwrap();
t... | Rust | 0 |
pub struct RTDUpdateBasicGroupFullInfoBuilder {
inner: UpdateBasicGroupFullInfo
}
impl RTDUpdateBasicGroupFullInfoBuilder {
pub fn build(&self) -> UpdateBasicGroupFullInfo { self.inner.clone() }
pub fn basic_group_id(&mut self, basic_group_id: i64) -> &mut Self {
self.inner.basic_group_id = basic_group_... | Rust | 0 |
kets)
.map(|bucket| {
let block_list = bucket.into_inner().inner.into_inner();
let last_slot = block_list.next_unused_slot.into_inner();
let current_block = block_list.head.map(OwnedBlockTracker::new);
GenBucketIter::new(last_slot, current_bl... | Rust | 0 |
{:0.2f}'.format(acc, np.mean(iu_deque))
writer.add_scalar('metrics/acc', np.mean(accuracy), iteration)
writer.add_scalar('metrics/mIoU', np.mean(mIoU), iteration)
logging.info(info_str)
iteration += 1
################
# Save outputs #
################
# every 500 iters save curren... | Python | 1 |
}
fn from_elem(c: &mut Criterion) {
let account_mocks = vec![
(
r#"{"query":"query($representations:[_Any!]!){_entities(representations:$representations){...on User{name}}}","variables":{"representations":[{"__typename":"User","id":"1"},{"__typename":"User","id":"2"},{"__typename":"User","id":... | Rust | 0 |
(super) fn no_pushdown_preds<F>(
// node that is projected | hstacked
node: Node,
arena: &Arena<AExpr>,
matches: F,
// predicates that will be filtered at this node in the LP
local_predicates: &mut Vec<Node>,
acc_predicates: &mut PlHashMap<Arc<str>, Node>,
) where
F: Fn(&AExpr) -> bool,
... | Rust | 0 |
import numpy as np
def accuracy(true: np.ndarray, pred: np.ndarray) -> np.ndarray:
true = true.reshape(pred.shape)
assert true.shape == pred.shape, "shape should be same"
return (true == pred).mean()
def precision(true: np.ndarray, pred: np.ndarray) -> np.ndarray:
true = true.reshape(pred.shape)
... | Python | 1 |
let mut checkpoint_csn = csns.checkpoint_csn.get_cur();
loop {
if let Some(mut lock) = checkpoint_ready.wait_for_interruptable(
&mut (|state| -> bool { ! *state }),
&mut (|| -> bool { terminate.load(Ordering::Relaxed) }),
... | Rust | 0 |
e `R` is the number of unbaked referenda.
/// - Db reads: `PublicProps`, `account`, `ReferendumCount`, `LowestUnbaked`
/// - Db writes: `PublicProps`, `account`, `ReferendumCount`, `DepositOf`, `ReferendumInfoOf`
/// - Db reads per R: `DepositOf`, `ReferendumInfoOf`
/// # </weight>
fn begin_block(no... | Rust | 0 |
f8a614516ab6cf"),
plaintext: &hex!("d1207549cc831a4afc7e82415776a5a42664bc33833d061da409fbe1fb1e84df"),
aad: &hex!("f06fe187ad55df4c1575043afb490c117c66e631b6a026ac8b3663d65f4e605b57f467ed6c0a3fde03db61f82d98a238955a3e0f51bac78d14b94a0b75057a432ff375a09b0a41def3c887fcb103ee99f4b9f4474a64600b87eb"),
... | Rust | 0 |
_LENGTH: usize = 16;
pub const MSV1_0_NTLM3_OWF_LENGTH: usize = 16;
STRUCT! {struct MSV1_0_NTLM3_RESPONSE {
Response: [UCHAR; MSV1_0_NTLM3_RESPONSE_LENGTH],
RespType: UCHAR,
HiRespType: UCHAR,
Flags: USHORT,
MsgWord: ULONG,
TimeStamp: ULONGLONG,
ChallengeFromClient: [UCHAR; MSV1_0_CHALLENGE_... | Rust | 0 |
"""
Copyright 2019 kivou.2000607@gmail.com
This file is part of yata.
yata 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, either version 3 of the License, or
any later version.
yata is dist... | Python | 1 |
dInput(id='personal-info-change-password-new-again', mode='password'), label=t__person('确认密码'), required=True),
],
className={'.ant-form-item': {'marginBottom': '12px', 'marginRight': '8px'}},
)
],
destroyOnClose=False,
... | Python | 1 |
osition;
}
pub fn with_position(mut self, position: ::models::GetUniversePlanetsPlanetIdPosition) -> GetUniversePlanetsPlanetIdOk {
self.position = position;
self
}
pub fn position(&self) -> &::models::GetUniversePlanetsPlanetIdPosition {
&self.position
}
pub fn set_system_id(&mut self, syst... | Rust | 0 |
matched on basecalled sequence
fout.write("{}\t".format(len_seq)) #11 Same as column 7
fout.write("{}\t".format("255")) #12 Mapping quality (0-255; 255 for missing)
fout.write("{}".format("ss:Z:")) #12 Mapping quality (0-255; 255 for missing)
while i < le... | Python | 1 |
lf._recognized_sensors[sensor] = device_container
# create measurements container
labels = ['measurements']
if sensor.startswith('Temp'):
labels.append('temperature')
else:
labels.append('humidity')
measurements_container = Container(resourceName='measure... | Python | 1 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
#
# You can modify it under the t... | Python | 1 |
Ming2Zhi1,
/// 昔之
Xi1Zhi1,
/// 之
Zhi1,
/// 之術也
Zhi1Shu4Ye3,
/// 之書
Zhi1Shu1,
/// 之義
Zhi1Yi4,
/// 之物也
Zhi1Wu4Ye3,
/// 者
Zhe3,
/// 吾嘗觀
Wu2Chang2Guan1,
/// 其
Qi2,
/// 其餘
Qi2Yu2,
/// 其物如是
Qi2Wu4Ru2Shi4,
/// 是矣
Sh... | Rust | 0 |
d_headers()
response = {'success': False, 'message': f'Error: {str(e)}'}
self.wfile.write(json.dumps(response).encode())
def get_capture_page(self):
"""Generate the session capture page"""
return '''
<!DOCTYPE html>
<html>
<head>
<title>Instagram Session Capture... | Python | 1 |
tions::VecDeque;
/// Rerepresents a vector of children attached to a parent DAO
///
/// This object does not actually store the children which are
/// actually stored within the chain-of-trust as seperate events
/// that are indexed into secondary indexes that this object queries.
///
/// Vectors can also be used as q... | Rust | 0 |
ioStreamBasicDescription from a CPAL Format.
fn asbd_from_config(
config: &StreamConfig,
sample_format: SampleFormat,
) -> AudioStreamBasicDescription {
let n_channels = config.channels as usize;
let sample_rate = config.sample_rate.0;
let bytes_per_channel = sample_format.sample_size();
let bit... | Rust | 0 |
\"File\",\n \"id\": \"3\",\n \"need\": [\"1\", \"2\"],\n \"task\": \"Create a new text file named research_japan.txt in the user's home directory. Organize the data collected from both searches into this file, ensuring it is well-structured and formatted for readability. Include headers for Osaka and Tok... | Python | 1 |
batch
res = inference(model, tokenizer, each_batch, stopping_criteria)
# Extract relevant portion of generated text
for idx, each_output in enumerate(res):
output_text = each_output[len(each_batch[idx]):]
truncated_result = output_text.str... | Python | 1 |
vec![0; FILE_SIZE_LARGE_ENOUGH_TO_TRIGGER_HYPER_BATCHING].as_slice(),
)
.build()
.await
.unwrap();
let path_to_override = format!("/blobs/{}", pkg.meta_far_merkle_root());
verify_resolve_fails_then_succeeds(
pkg,
handler::ForPath::new(path_to_override... | Rust | 0 |
"""
------ NOT USED IN THE MAIN SCRIPT ------
Stitcher for two images.
"""
import logging
import cv2
import numpy as np
class Stitcher:
def __init__(self):
pass
def detectAndDescribe(self, image):
# detect and extract features from the image
descriptor = cv2.SIFT_create()
k... | Python | 1 |
of charstrings for charstring encryption.
///
/// The default value of lenIV is 4.
///
/// To be compatible with version 23.0 of the PostScript interpreter
/// (found in the original LaserWriter®), the value of lenIV should be
/// set to 4. If compatibility with version 23.0 printers is not nece... | Rust | 0 |
ense
//
// at your option.
//
// You should have recieved copies of the Apache License and the MIT
// License along with the library. If not, see
// <https://www.apache.org/licenses/LICENSE-2.0> and
// <https://opensource.org/licenses/MIT>.
/*!
# Fixed-point numbers
The [*fixed* crate] provides fixed-point numbers.
... | Rust | 0 |
direct_2_by_2_eigendecomp(&self) -> Result<(Vec<T>, Matrix<T>), Error> {
let eigenvalues = try!(self.eigenvalues());
// Thanks to
// http://www.math.harvard.edu/archive/21b_fall_04/exhibits/2dmatrices/index.html
// for this characterization—
if self.data[2] != T::zero() {
... | Rust | 0 |
data=X, local_score_fun=local_score_BIC_from_cov, parameters=parameters
)
elif score_func == "local_score_BDeu":
# BDeu score
localScoreClass = LocalScoreClass(
data=X, local_score_fun=local_score_BDeu, parameters=None
)
else:
raise Exception("Unkn... | Python | 1 |
int("End-of-stream record received, going to quit.", flush=True)
break
try:
# Decode data (and check it's a valid JSON)
rec_list = json.loads(data.decode("utf-8"))
except ValueError as e:
print(f"ERROR: Can't decode received data: {e}", file=sys.stderr)
... | Python | 1 |
class Solution:
def minWindow(self, s: str, t: str) -> str:
d = defaultdict(int)
for i in range(len(t)):
d[t[i]] += 1
left = 0
minwindow = float('inf')
start = 0
end = 0
#keeps track of the restriction on constraint metric
count = 0
... | Python | 1 |
ve(PrimitiveType::Int) => MilType::Int,
FlatTypeDescriptor::Primitive(PrimitiveType::Long) => MilType::Long,
FlatTypeDescriptor::Primitive(PrimitiveType::Short) => MilType::Int,
FlatTypeDescriptor::Primitive(PrimitiveType::Boolean) => MilType::Int,
FlatTypeDescriptor::Ref... | Rust | 0 |
else:
command = OverkizCommand.SET_HEATING_LEVEL
await self.executor.async_execute_command(
command, PRESET_MODE_TO_OVERKIZ[preset_mode]
)
@property
def target_temperature(self) -> float | None:
"""Return the temperature."""
if state := self.device.stat... | Python | 1 |
for _item in self.incoming_associations:
if _item:
_items.append(_item.to_dict())
_dict['incomingAssociations'] = _items
# override the default output from pydantic by calling `to_dict()` of item_id
if self.item_id:
_dict['itemId'] = self.... | Python | 1 |
import requests
OLLAMA_URL = "http://localhost:11434/api/generate"
MODEL = "llama3"
def ask_ollama(prompt, model=MODEL, stream=False):
payload = {
"model": model,
"prompt": prompt,
"stream": stream # Se quiser resposta em streaming [ humanização da escrita... ]
}
response = reques... | Python | 1 |
assert_eq!(OsStr::new("abc").rfind(OsStr::new("abcdefghi")), None);
assert_eq!(OsStr::new("abc").rfind(OsStr::new("d")), None);
assert_eq!(OsStr::new("abc").rfind(OsStr::new("")), Some(3));
assert_eq!(OsStr::new("").rfind(OsStr::new("")), Some(0));
assert_eq!(OsStr::new("").rfind(OsStr:... | Rust | 0 |
s: avg error less than {:e} on all three arrays",
epsilon
);
}
}
<gh_stars>1-10
use byteorder::WriteBytesExt;
use failure::format_err;
use failure::Error;
use image::imageops::FilterType;
use image::DynamicImage;
use image::GenericImageView;
use log::debug;
pub struct Avatars {
pub raw: Ve... | Rust | 0 |
5]) ->", pst)
# Now pretend we only sampled from a larger population.
sample = [1, 2, 3, 4, 5] # same numbers, but interpretation changes formula
# Sample variance (variance): unbiased estimator; divide by (n - 1).
svar = statistics.variance(sample)
print("variance([1,2,3,4,5]) ->", svar)
# ... | Python | 1 |
ion call, therefore
//! it's recommended for simple sequential encryption/decryption operations.
//! ```
//! # use cocoon::{MiniCocoon, Error};
//! #
//! # fn main() -> Result<(), Error> {
//! let mut data = "my secret data".to_owned().into_bytes();
//! let cocoon = MiniCocoon::from_key(b"<KEY>", &[0; 32]);
//!
//! let... | Rust | 0 |
, rbuf[3]]),
"data should match"
);
dc0.close().await?;
dc1.close().await?;
bridge_process_at_least_one(&br).await;
close_association_pair(&br, a0, a1).await;
Ok(())
}
#[tokio::test]
async fn test_data_channel_channel_type_reliable_ordered() -> Result<()> {
let mut sbuf = vec, [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). S... | Rust | 0 |
16);
vld1q_u8(addr)
}
#[inline(always)]
unsafe fn v128_load_unaligned(self, addr: *const u8) -> Self::V128 {
vld1q_u8(addr)
}
#[inline(always)]
unsafe fn v128_store_unaligned(self, addr: *mut u8, a: Self::V128) {
vst1q_u8(addr, a)
}
#[inline(always)]
fn v12... | Rust | 0 |
find_variable("C").unwrap();
//! // Use the same graph as above...
//! let mut bn = BooleanNetwork::new(rg);
//! assert!(bn.get_update_function(id_a).is_none());
//! // Every explicit parameter must be declared before you use it in a function.
//! let id_f: ParameterId = bn.add_parameter("f", 2)?;
//! // `ParameterId` ... | Rust | 0 |
a
0c5 @ sR d dl mZ d dlmZ er&d dlT n(zd dlT W n eyL edY n0 dS ) )absolute_import)PY3)*zIThe tkFont module is missing. Does your Py2 installation include tkinter?N)
__future__r Zfuture.utilsr Ztkinter.fontZtkFontImportError r r n/home... | Python | 1 |
another.
pub fn voxel_blit<T: Voxel, P: VoxelCoord>(source_range : VoxelRange<P>, source: &dyn VoxelStorage<T, P>,
dest_origin: VoxelPos<P>, dest: &mut dyn VoxelStorage<T,P>) -> Result<(), VoxelError> {
for pos in source_range {
let voxel = source.get(... | Rust | 0 |
ITTED CHARGES",
reasoning="Extracted secondary header row with additional service information.",
),
],
rows=[
LineSegment(
line_number=6,
found_at="Found in row 6",
value="03/04/2025 1... | Python | 1 |
def _create_or_get_repo(
cls,
repo_path_or_name: Optional[str] = None,
repo_url: Optional[str] = None,
organization: Optional[str] = None,
private: bool = None,
use_auth_token: Optional[Union[bool, str]] = None,
) -> Repository:
if repo_path_or_name is None an... | Python | 1 |
d: 1, size: Size::Zword });
insert!(m: Caseless("ZMM2") => VPURegisterInfo { id: 2, size: Size::Zword });
insert!(m: Caseless("ZMM3") => VPURegisterInfo { id: 3, size: Size::Zword });
insert!(m: Caseless("ZMM4") => VPURegisterInfo { id: 4, size: Size::Zword });
insert!(m: Caseless("ZMM5"... | Rust | 0 |
static [u8; 32usize] =
b"tm_dcc_asset_extracted_resource\0";
pub const TM_TT_TYPE__DCC_ASSET_SETTINGS: &'static [u8; 22usize] = b"tm_dcc_asset_settings\0";
pub const TM_TT_TYPE__DCC_ASSET: &'static [u8; 13usize] = b"tm_dcc_asset\0";
pub const TM_TT_TYPE__ENTITY_RIGGER__COMPONENT: &'static [u8; 27usize] =
b... | Rust | 0 |
if name.endswith("9MetaClass5allocEv") or isMetaClassAllocFunc(funcEA):
vtableAddr = findVTableAddrInMetaClassAlloc(get_func(funcEA))
if vtableAddr == BADADDR:
#print "findVTableAddrInMetaClassAlloc for {} returned BADADDR".format(className)
... | Python | 1 |
use safe_transmute::{PodTransmutable, guarded_transmute_to_bytes_pod_many};
/// #[repr(C)]
/// struct Gene {
/// x1: u8,
/// x2: u8,
/// }
/// unsafe impl PodTransmutable for Gene {}
///
/// assert_eq!(guarded_transmute_to_bytes_pod_many(&[Gene {
/// x1: 0x42... | Rust | 0 |
"""Utility type functions for Platform"""
from ...iosxe.platform.utils import write_erase_reload_device_without_reconfig \
as iosxe_write_erase_reload_device_without_reconfig
def write_erase_reload_device_without_reconfig(
device,
via_console,
reload_timeout,
username=None,
password=None,
r... | Python | 1 |
/// ```
/// use uuid::Uuid;
///
/// let uuid = Uuid::nil();
///
/// assert_eq!(
/// uuid.to_hyphenated().to_string(),
/// "00000000-0000-0000-0000-000000000000"
/// );
/// ```
pub const fn nil() -> Self {
Uuid::from_bytes([0; 16])
}
/// Creates a UUID fro... | Rust | 0 |
: {'✅' if config.discord_enabled else '❌'}")
# Instancia global del gestor de configuración
config_manager = ConfigManager()
def get_trading_config() -> TradingConfig:
"""🔧 Función helper para obtener configuración"""
return config_manager.get_config()
def get_risk_params() -> RiskParameters:
"""⚠️ Func... | Python | 1 |
_file.write(b" %define ARCH_X86_32 0\n").unwrap();
config_file.write(b" %define ARCH_X86_64 1\n").unwrap();
config_file.write(b" %define PIC 1\n").unwrap();
config_file.write(b" %define STACK_ALIGNMENT 16\n").unwrap();
if cfg!(target_os = "macos") {
config_file.write(b" %define PREFIX 1\n").unwrap... | Rust | 0 |
# Copyright 2025 CNOE
# SPDX-License-Identifier: Apache-2.0
# Generated by CNOE OpenAPI MCP Codegen tool
"""Tools for /api/v1/repositories/{repo}/refs operations"""
import logging
from typing import Dict, Any
from mcp_argocd.api.client import make_api_request, assemble_nested_body
# Configure logging
logging.basicCo... | Python | 1 |
import json
import pandas as pd
def visualisasikan_data_json(nama_file):
try:
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 120)
with open(nama_file, 'r', encoding='utf-8') as f:
data_bencana = json.loa... | Python | 1 |
request_body = Todo,
responses(
(status = 200, description = "Todo created successfully", body = Todo),
(status = 409, description = "Todo already exists")
)
)]
pub async fn create_todo(todo: Todo, store: Store) -> Result<Box<dyn Reply>, Infallible> {
let m... | Rust | 0 |
, feature = "stm32f303xc"))]
impl DmPin for PA11<gpio::AF14<gpio::PushPull>> {}
#[cfg(any(feature = "stm32f303xb", feature = "stm32f303xc"))]
impl DpPin for PA12<gpio::AF14<gpio::PushPull>> {}
#[cfg(any(feature = "stm32f303xd", feature = "stm32f303xe"))]
impl<Mode> DmPin for PA11<Mode> {}
#[cfg(any(feature = "stm32f... | Rust | 0 |
]
fn test_LD_A_BCm() {
let machine = test_cpu(&[0x0A], |cpu| {
cpu.regs.set_bc(0x7AD8);
cpu.mem.write_byte(cpu.regs.bc(), 0x9A);
});
assert_eq!(machine.clock_cycles(), 8);
assert_eq!(machine.cpu.regs.a, 0x9A);
}
#[test]
fn test_LD_A_DEm() {
let machine = test_cpu(&[0x1A], |cpu| {
... | Rust | 0 |
kGenerator(GEN_SIZE, GEN_SIZE, stride=2),
nn.BatchNorm2d(GEN_SIZE),
nn.ReLU(),
self.final,
nn.Tanh())
def forward(self, z):
return self.model(self.dense(z).view(-1, GEN_SIZE, 4, 4))
class Discriminator(nn.Module):
def __init__(self):
super(Discri... | Python | 1 |
monstration, use dummy MemoryGraph, GoalLoop, PluginOrchestrator if not available.
class DummyMemoryGraph:
def __init__(self):
self.nodes = {}
def add_memory(self, *a, **k): pass
class DummyGoalLoop:
def __init__(self, memory): self.goals = {}; self.memory = memory
de... | Python | 1 |
import sys
import json
from technology_detector import detect_technology_inhouse
def test_tech_detection(url):
"""Test the technology detection for a given URL."""
print(f"Testing technology detection for: {url}")
tech_info = detect_technology_inhouse(url)
# Print results in a formatted way
if... | Python | 1 |
rKind::*;
use error::{Result, SeccompError};
use libseccomp_sys::*;
use std::ffi::{CStr, CString};
use std::fs::File;
use std::os::unix::io::AsRawFd;
use std::ptr::NonNull;
/// ScmpVersion represents the version information of
/// the currently loaded libseccomp library
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub... | Rust | 0 |
# and 'context' string:
question = "What's the temperature in Boise, Idaho?"
context = "Weather report for Boise, Idaho on 07/03/23..."
await chain.arun(question=question, context=context)
# -> "The temperature in Boise is..."
"""
if len(s... | Python | 1 |
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QMainWindow, QListWidget
from PyQt5.uic import loadUi
from Database import Database
from ViolationItem import ViolationItem
class ArchiveWindow(QMainWindow):
def __init__(self, parent=None):
super(ArchiveWindow, self).__init__(parent)
loadUi... | Python | 1 |
>(3.3),
Fluid::new(Pressure::new::<pascal>(1450000000.0)),
true,
Pressure::new::<psi>(1450.0),
Pressure::new::<psi>(1750.0),
),
_ => HydraulicLoop::new(
loop_color,
false,
false,
... | Rust | 0 |
initializers of other `static`s. If in doubt,
/// use the corresponding non-`_INIT` reference-typed `static`.
///
/// This part of the public API will go away if Rust changes
/// to make the referent of `pub const FOO: &'static Encoding`
/// unique cross-crate or if Rust starts allowing static arrays
/// to be initial... | Rust | 0 |
for key, value in config_dict['options'].items():
if key == args[1] + "Package":
if "commandsBefore" in value:
options.run_commands(
config_dict['options'][key]["commandsBefore"])
install_package(key, config_... | Python | 1 |
, players_add_attr_point, players_skill_point, players_register_time, players_map, players_class, drop_chance, players_hunger = await function_in.checkattr(self, user.id)
if self.player_異常_減傷:
pdmg = int(pdmg - (pdmg * (self.player_異常_減傷*0.01)))
if self.monster_異常_減防:
... | Python | 1 |
DriverNode {
fn run(
&self,
graph: &mut RenderGraphContext,
_: &mut RenderContext,
world: &World,
) -> Result<(), NodeRunError> {
if let Some(camera) = world.resource::<ActiveCamera<SecondWindowCamera3d>>().get() {
graph.run_sub_graph(
core_pip... | Rust | 0 |
tes).is_ok());
assert!(move_to_1.check_request_valid(&votes).unwrap() == RequestValidState::CertQuorum(0));
}
#[test]
fn test_progress_at_random() {
let mut keys_vec = Vec::new();
let mut states_vec = Vec::new();
for _ in 0..4 {
let (pk, sk) = key_gen();
... | Rust | 0 |
import pg8000.dbapi
conn = pg8000.dbapi.connect(host="localhost",
port=5433,
database="knut-test-db",
user="test",
password="test")
cursor = conn.cursor()
cursor.execute("DELETE FROM test")
print("delete row... | Python | 1 |
# Nodes represent a definition of a value in our graph of operators.
from typing import TYPE_CHECKING, Union, Callable, Any, Tuple, List, Optional, Dict
import torch
if TYPE_CHECKING:
from .graph import Graph
BaseArgumentTypes = Union[str, int, float, bool, torch.dtype, torch.Tensor]
base_types = BaseArgumentTyp... | Python | 1 |
9
-628
-391
-429
-110
-199
-409
-516
-7
-433
-405
-792
-685
-615
-287
-385
-627
-527
-426
-626
-164
-767
-794
-115
-483
-323
-371
-679
-772
-808
-2
-16
-459
-749
-569
-139
-7
-555
-161
-613
-230
-771
-825
-241
-579
-710
-73
-790
-653
-655
-394
-218
-711
-467
-774
-694
-664
-357
-29
-121
-643
-742
-388
-633
-440
-755
-5... | Rust | 0 |
> Iterator for ValuesMut<'a, V> {
type Item = &'a mut V;
fn next(&mut self) -> Option<&'a mut V> {
let i = self.i;
self.i += 1;
self.items.get_mut(i).map(|v| unsafe {(v as *mut V).as_mut().unwrap() })
}
}
impl<'a, V> Iterator for Iter<'a, V> {
type Item = (Key, &'a V);
fn nex... | Rust | 0 |
ists through soft reset of the chip."]
pub mod scratch4;
#[doc = "Scratch register. Information persists through soft reset of the chip.\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::wr... | Rust | 0 |
[
Arg::with_name("host")
.short("H")
.long("host")
.default_value("127.0.0.1")
.help("Interface to bind on"),
Arg::with_name("port")
.short("p")
... | Rust | 0 |
on.state_dict()}
print()
print('Evaluation Start!')
print()
model = classification
checkpoint_filename = '2023-01-07-17-17-14_epoch60.pkl'
trained_checkpoint = t.load('./checkpoints/'+checkpoint_filename)
model.load_state_dict(trained_checkpoint['state_dict'])
... | Python | 1 |
{
rv.push_map(self.hash160_preimages, PSBT_IN_HASH160)
}
impl_psbt_get_pair! {
rv.push_map(self.hash256_preimages, PSBT_IN_HASH256)
}
impl_psbt_get_pair! {
rv.push(self.tap_key_sig, PSBT_IN_TAP_KEY_SIG)
}
impl_psbt_get_pair! {
... | Rust | 0 |
t AS OF 18446744073709551615") {
Err(e) if e.code() == Some(&postgres::error::SqlState::QUERY_CANCELED) => {}
Err(e) => panic!("expected error SqlState::QUERY_CANCELED, but got {:?}", e),
Ok(_) => panic!("expected error SqlState::QUERY_CANCELED, but query succeeded"),
}
client
... | Rust | 0 |
windows" },
// Windows fails to run the spinner and spinners packages
// at runtime, so remove them for now on the windows os.
spin: { not(win) },
}
}
<reponame>admariner/enso<gh_stars>0
//! Builtin themes definition and compile-time generated theme paths (allowing catching improper
//! the... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.