text string | label_name string | labels int64 |
|---|---|---|
#[test]
fn test_smallest_range_i() {
let cases = vec![(vec![1], 0, 0), (vec![0, 10], 2, 6), (vec![1, 3, 6], 3, 0)];
for (arr, k, expected) in cases {
let output = smallest_range_i(arr, k);
assert_eq!(output, expected);
}
}
<reponame>taritom/bn-api
use chrono::NaiveDateTime;
use diesel;
use... | Rust | 0 |
<TransactionMsg>> {
if let Some(ref mut mbox) = self.fragment_mbox {
let hash = header.hash().into();
let date = header.block_date();
let status = FragmentStatus::InABlock {
date: date.into(),
block: hash,
};
mbox.try_se... | Rust | 0 |
let mut context = tera::Context::new();
context.insert("email_address", &email_address);
context.insert("delete_code", &delete_code);
let content = match Tera::one_off(DELETE_CODE_HTML, &context, true) {
Ok(content) => content,
... | Rust | 0 |
tos del usuario para la API según especificación"""
formatted = {
'ID_USUARIO': user_data.get('ID_USUARIO'),
'CODIGO_USUARIO': user_data.get('CODIGO_USUARIO', ''),
'NOMBRE_COMPLETO': user_data.get('NOMBRE_COMPLETO', ''),
'EMAIL': user_data.get('EMAIL', ''),
... | Python | 1 |
(Error(("\u{1680}\u{200a}\u{2028}\u{202f}\u{205f}\u{3000}\u{200b}", ErrorKind::Alpha)))),
("\x00\x01\x02\u{80}", Err(Error(("\x00\x01\x02\u{80}", ErrorKind::Alpha)))),
("\u{94}\u{100}", Err(Error(("\u{94}\u{100}", ErrorKind::Alpha)))),
("", Err(Incomplete(Size(1))))
]);
... | Rust | 0 |
errors::{ParseError, ParseResult},
scalars::dword_size,
scalars::Word,
scalars::{parse_dword_as_usize, word},
};
#[derive(Debug)]
pub struct RawFrame<'a> {
pub duration: Word,
pub chunks: Vec<Chunk<'a>>,
}
impl<'a> RawFrame<'a> {
pub fn cels(&self) -> impl Iterator<Item = &CelChunk> {
... | Rust | 0 |
data.iter().enumerate().collect();
self.process_chain_data(header, &txdata, |monitor, txdata| {
monitor.block_connected(
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &*self.logger)
});
}
fn block_disconnected(&self, header: &BlockHeader, height: u32) {
let monitors = self.monitors.r... | Rust | 0 |
_cfm_coeff());
#[cfg(feature = "dim2")]
let rhs_bias = self.ang_err.im * erp_inv_dt;
#[cfg(feature = "dim3")]
let rhs_bias = self.ang_err.imag()[locked_axis] * erp_inv_dt;
let ang_jac2 = body2.sqrt_ii * ang_jac;
JointVelocityGroundConstraint {
joint_id,
... | Rust | 0 |
#!/usr/bin/env python3
# -*-coding:utf8-*-
from enum import Enum, auto
class ArmMsgType(Enum):
'''
msg_v2
机械臂消息类型,枚举类型
'''
'''
msg_v2
Robotic Arm Message Types (Enumeration)
'''
# feedback
PiperMsgUnkonwn = 0x00 #未知类型
PiperMsgStatusFeedback = auto() ... | Python | 1 |
1,
arg2: u64,
arg3: u64,
) {
let x1: u64 = (((arg1 as u64).wrapping_add(arg2)).wrapping_add(arg3));
let x2: u64 = (x1 & 0x7ffffffffffff);
let x3: fiat_25519_u1 = ((x1 >> 51) as fiat_25519_u1);
*out1 = x2;
*out2 = x3;
}
#[inline]
pub fn fiat_25519_subborrowx_u51(
out1: &mut u64,
out2... | Rust | 0 |
/ let n: i32 = Deserialize::deserialize(deserializer)?;
// Ok(n.into())
// }
// fn serialize_enum_to_dsint<S, T>(v: &T, serializer: S) -> Result<S::Ok, S::Error>
// where
// S: Serializer,
// T: Into<i32> + Copy,
// {
// let n: i32 = (*v).into();
// serializer.serialize_i32(n)
// }
fn deserial... | Rust | 0 |
def read_hashes_from_binary(input_file, output_file):
decoded_hashes = []
try:
with open(input_file, 'rb') as binary_file:
# Read the entire binary file
content = binary_file.read()
# Split content by the stop byte (0xFF)
#hashes = content.split(b'\xFF')
... | Python | 1 |
;
if buf.len() >= len {
let (data, rem) = buf.split_at(len);
*buf = rem;
Ok(data)
}
else {
Err(Error::BadEncode(fail_len, "Binary length larger than amount of data"))
}
}
/// General function for referencing a UTF-8 string in a buffer. Checks for if the
/// length is gr... | Rust | 0 |
Ok(dataset)
},
Err(err) => Err(err)
}
}
/// Return server version number.
pub fn get_version(&self) -> u8 {
self.greeting.protocol_version
}
/// Return server greeting message.
pub fn get_message(&self) -> &str {
&self.greeting.message
}
... | Rust | 0 |
description("Release Error")
display("Release Error: '{}'", t)
}
Network(t: String) {
description("Network Error")
display("Network Error: '{}'", t)
}
Config(t: String) {
description("Config Error")
display("Config Error:... | Rust | 0 |
}
#[inline]
fn current_def_level(&self) -> i16 {
self.0.current_def_level()
}
#[inline]
fn current_rep_level(&self) -> i16 {
self.0.current_rep_level()
}
}
pub struct TupleReader<T>(pub(super) T);
/// A convenience Reader that maps the read value using [`TryInto`].
pub struct TryIntoReader<R: Reader, T>(... | Rust | 0 |
mean', 'roll_6_for_out_mean_center', 'roll_12_for_out_mean',
'ewm_12_for_out_mean', 'roll_12_for_out_mean_center', 'period_for_out_min', 'period_for_out_max',
'period_for_out_mean', 'period_for_out_skew', 'con_for_out_min', 'con_for_out_max',
'con_for_ou... | Python | 1 |
start: int = 0,
scale: float = 1,
marginals: Optional[Marginals] = None,
time_interval: float = 0.0) -> None:
"""
Incrementally plot a complete 3D trajectory using poses in `values`.
Args:
... | Python | 1 |
try_or_fail!(last_substate.gasometer.record_cost(diff));
last_substate.gasometer.gas()
} else {
l64(self.substates.last()
.expect("substate vec always have length greater than one; qed")
.gasometer.gas())
}
} else {
self.substates.last()
.expect("substate vec always have length greater ... | Rust | 0 |
"detectron2.trainer")
# In the end of training, run an evaluation with TTA.
logger.info("Running inference with test-time augmentation ...")
model = SemanticSegmentorWithTTA(cfg, model)
evaluators = [
cls.build_evaluator(
cfg, name, output_folder=os.path.join(... | Python | 1 |
coding="utf-8")
required_deps = [
"pytest-benchmark",
"locust",
"pytest-asyncio",
"httpx",
"bandit",
"safety",
]
for dep in required_deps:
if dep in content:
print(f"✅ pyproject.toml 包含依賴: {dep}... | Python | 1 |
k / (real) | f1 | f2 | horiz freq / (real) | buffer size |")
print("+---------------------+-------+-------+-------------------------+-------------+")
for res in results:
data = results[res]
xres = data['ref']
res2 = round(xres, 3)
res3 = res2
if res2 == xres:
if data["horiz"] ... | Python | 1 |
[
Field("a", None, root_fields1),
Field("b", None, root_fields2),
]
),
]
)
graph = apply(graph, [GraphMetrics(graph_name)])
assert sample_count("Root", "a") is None
assert sample_count("Root", "b") is None
q... | Python | 1 |
nd is responsible for unpacking args/kwargs into the values
that _get_env expects (it is the root function that actually
interacts with environ).
Args:
key: string, the env var name to look up.
default: (optional) the value to use if the env var does not
exist. If this value is n... | Python | 1 |
ired `code`.
pub fn retrieve(
client: &Client,
id: &PromotionCodeId,
expand: &[&str],
) -> Response<PromotionCode> {
client.get_query(&format!("/promotion_codes/{}", id), &Expand { expand })
}
/// Updates the specified promotion code by setting the values of the paramete... | Rust | 0 |
import sys
import os
import subprocess
def print_help():
print("""
Uso corretto:
python scripts/run_poagpu.py <numBlocks> <num_vertici> <num_reads> <len_reads> [--example]
Dove:
<num_vertici> = Numero di vertici (presente nel nome del file grafo).
<num_reads> = Numero di reads (v... | Python | 1 |
# #05 VALOR Y REFERENCIA
'''
EJERCICIO
- Muestra ejemplos de asignación de variables "por valor" y "por referencia". según
su tipo de dato.
- Muestra ejemplos de funciones con variables que se les pasan "por valor" y
"por referencia", y como se comportan en cada caso en el momento de ser modificadas.
'''
# Paso de... | Python | 1 |
h == 0:
with pytest.raises(ValueError, match="Both 'min_length' and 'max_length'"):
span_finder = nlp.add_pipe(
"span_finder",
config={
"max_length": max_length,
"min_length": min_length,
"spans_key": SPANS_K... | Python | 1 |
#%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
#%%
# path 및 df
train_path = '../dataset/train/train.csv'
train_df = pd.read_csv(train_path)
test_path = '../dataset/test/test_data.csv'
test_df = pd.read_csv(test_path)
augmented_path = '../dataset/train/augmented_train.csv'
au... | Python | 1 |
tx.clone(), typ_parents);
let exp = go(exp, ctx, exp_parents);
unsafe {
(*ann.as_ptr()).left = typ;
(*ann.as_ptr()).right = exp;
}
DAG::Branch(ann)
}
Term::Var(_, name, idx) => {
let var = match ctx.get(idx as usize) {
... | Rust | 0 |
, 66], version);
let mut mock = scd30.destroy();
mock.done(); // verify expectations
}
#[test]
fn firmware_version_bad_crc() {
let expectations = vec![
i2c::Transaction::write(ADDRESS, vec![0xD1, 0x00]),
// NOTE negated CRC byte in the response!
... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import abc
import copy
import logging
import pathlib
from . import config
from . import registers
from . import ComputerVariable, DriverBasedWorker, SingleWorker
from ..core.node import AbstractNode
class AbstractExpedition(AbstractNode):
#: Name of the expediti... | Python | 1 |
import os
from PyQt5.QtCore import Qt
from siui.components import SiOptionCardPlane
from siui.components.widgets import SiLabel, SiSimpleButton
from siui.core import SiGlobal
from siui.core import Si
class OptionCardPlaneForWidgetDemos(SiOptionCardPlane):
def __init__(self, *args, **kwargs):
super().__... | Python | 1 |
example_inputs=["1.bed"],
)
cwl_properties = command_io.cwl_properties()
assert_equal(cwl_properties["base_command"], ["seqtk", "convert"])
assert_equal(len(cwl_properties["inputs"]), 4)
assert_equal(cwl_properties["inputs"][0].position, 1)
assert_equal(cwl_properties["inputs"][0].type, "... | Python | 1 |
:new(registry_client),
no_op_logger(),
);
})
}
#[test]
fn should_successfully_construct_crypto_component_for_non_replica_process_with_default_config_and_keys(
) {
CryptoConfig::run_with_temp_config(|config| {
// Create node keys.
let (_created_node_pks, _node_id) =
... | Rust | 0 |
tivacion con TAB
def test_validate_button(self):
routes_page = UrbanRoutesPage(self.driver)
routes_page.active_button_add()
assert routes_page.activate_payment_card() == True #validar la activacion con TAB
def test_add_card_active(self):
routes_page = UrbanRoutesPage(self.driv... | Python | 1 |
_f32;
/// ln(10)
#[stable(feature = "rust1", since = "1.0.0")]
pub const LN_10: f32 = 2.30258509299404568401799145468436421_f32;
}
#[lang = "f32"]
#[cfg(not(test))]
impl f32 {
/// The radix or base of the internal representation of `f32`.
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
... | Rust | 0 |
v) = self { f(v); }
}
/// Similar to `.map_or_else()`. When the `Option` is of the `Some` variant,
/// the closure, `f()` will be invoked with the value, consuming it.
/// When an `Option` is of the `None` variant, `g()` is invoked which takes
/// no parameters.
///
fn if_some_else<F, G>(s... | Rust | 0 |
_if_same(test_val: u32, sum: u32, value: u32) -> u32 {
if test_val != value { return sum; }
sum + value
}
fn score_full_house(roll: Vec<u32>) -> u32 {
if two_of_some_die(&roll) && three_of_some_die(&roll) { return sum_rolls(roll); }
0
}
fn score_small_straight(roll: Vec<u32>) -> u32 {
if roll == v... | Rust | 0 |
new(right),
}),
Some(v) => {
// find symbols (Analogies) which refer to BOTH of the above
println!("{:?}", v);
unimplemented!()
}
}
// I'm searching for Analogies which match both the left and the right
// AND I... | Rust | 0 |
:WWDG::steal(),
FW: fw::FW::steal(),
RCC: rcc::RCC::steal(),
SYSCFG: syscfg::SYSCFG::steal(),
SPI1: spi1::SPI1::steal(),
I2C1: i2c1::I2C1::steal(),
PWR: pwr::PWR::steal(),
FLASH: flash::FLASH::steal(),
EXTI: exti::EXTI::stea... | Rust | 0 |
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
dp = [[-1] * len(text2) for _ in range(len(text1))]
def lcs(i,j):
if i<0 or j<0:
return 0
if dp[i][j] != -1:
return dp[i][j]
if text1[i] == text2[j]:... | Python | 1 |
ver_Cookie(key: str, state: str) -> None
此处是应对network中还未查询二维码状态时,所做的措施,用处是加快登录过程,而不需要浏览器
自主添加cookie
:param key: 最后一次查询二维码状态的api会返回code(只会允许查询一次,随后就是过期)
:param state: iframe链接中提取
:return: None
"""
url = parse.urlparse(url=key)
code = parse.parse_qs(qs=... | Python | 1 |
: IrId,
pub ident: Ident,
pub kind: ItemKind<'ir>,
pub span: Span,
}
#[derive(Debug)]
pub enum ItemKind<'ir> {
/// A value definition, as defined by `def`.
Value(&'ir Ty<'ir>, &'ir Expr<'ir>),
}
#[derive(Debug)]
pub struct Expr<'ir> {
pub ir_id: IrId,
pub kind: ExprKind<'ir>,
pub span:... | Rust | 0 |
import asyncio
import logging
import sys
from os import getenv
from config import BOT_TOKEN
from aiogram import Bot, Dispatcher, html ,F
from aiogram.client.default import DefaultBotProperties
from aiogram.enums import ParseMode
from aiogram.filters import CommandStart
from aiogram.types import Message,CallbackQuery,F... | Python | 1 |
Vec2 { x: i16::MAX - 1, y: i16::MAX - 1 }
),
None
);
assert_eq!(
Rect::<u16>::try_from_range_incl(
Vec2 { x: 0, y: 0 },
Vec2 { x: u16::MAX, y: u16::MAX }
),
None,
);
}
#[test]
fn is_empty() {
let rect =
Rect::<u16> { start: ... | Rust | 0 |
'🌁',
'၀', '〳', '𒔦', 'ℵ', '𓄾', '⺞', 'ᚢ', '⹁', 'ꗛ', 'ꆇ', '🜢', 'ꉡ',
'↊', 'ﭩ', '⾐', '🎢', '𐙊', '🌩', '\u{1fa91}', '𑖙', '㈗', '𐑼', '𒒆',
'‟', '🙅', '🢡', '﹦', 'ᄠ', '𑄠', '🂩', 'ꁕ', '𝧖', '𝕪', '𔐅',
'\u{1e11a}', 'ﱳ', '𐧀', '∟', 'ᄭ', 'ﷶ', '𐼶', '␟', 'ꄽ', 'Ệ', '\u{1fb12}',
'🌋', '𐩲', 'ᢒ', 'ﲂ', 'ꌁ',... | Rust | 0 |
import customtkinter as ctk
class PlayMusicButton(ctk.CTkButton):
def __init__(self, parent, audio_manager, music_path):
super().__init__(parent, text="▶️ Play Music", command=self.play_music)
self.audio_manager = audio_manager
self.music_path = music_path
def play_music(self):
... | Python | 1 |
.0),
vec![
result_type.as_op(),
set.as_op(),
Operand::ExtInst(unsafe {
transmute(instruction)
})
].into_iter()
.chain(
operands.iter().map(|id| id.as_op())
)
... | Rust | 0 |
attr! {
#[link_name = concat!("cxxbridge1$unique_ptr$std$vector$", $segment, "$release")]
fn __unique_ptr_release(this: *mut *mut c_void) -> *mut CxxVector<$ty>;
}
}
__unique_ptr_release(&mut repr)
... | Rust | 0 |
$ok
(br_if $ok
(get_local 0)
)
(unreachable)
)
)
(func (export "call")
;; This stores the gas left in the buffer
(call $seal_gas_left (i32.const 0) (i32.const 32))
;; assert len == 8
(call $assert
(i32.eq
(i32.load (i32.const 32))
(i32.const 8)
)
)
;; return gas left
(ca... | Rust | 0 |
d. After a series of
classes have been defined in the above fashion, all tables
can be reflected and mappings created using
:meth:`.DeferredReflection.prepare`::
engine = create_engine("someengine://...")
DeferredReflection.prepare(engine)
The :class:`.DeferredReflection` mixin can b... | Python | 1 |
Ord, Hash)]
pub enum DisplayOrientation {
/// automatic if the device supports it
Auto,
Portrait,
Landscape,
/// portrait mode but rotated 180 degrees
PortraitFlipped,
/// landscape mode but rotated 180 degrees
LandscapeFlipped,
UnknownVariant(u8),
}
impl DisplayOrientation {
pub... | Rust | 0 |
## This script assumes that the user has pip-installed the pytetrad package. Here is how:
## pip install git+https://github.com/cmu-phil/py-tetrad
# import graphviz as gviz
import pandas as pd
import importlib.resources as importlib_resources
jar_path = importlib_resources.files('pytetrad').joinpath('resources','tetr... | Python | 1 |
law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use crate::{Direction, Sense};
/// Des... | Rust | 0 |
# --8<-- [start:create]
import polars as pl
df = pl.DataFrame({"foo": [1, 2, 3], "bar": [None, "ham", "spam"]})
for i in range(5):
df.write_csv(f"docs/assets/data/my_many_files_{i}.csv")
# --8<-- [end:create]
# --8<-- [start:read]
df = pl.read_csv("docs/assets/data/my_many_files_*.csv")
print(df)
# --8<-- [end:r... | Python | 1 |
ette, &transparency)?;
let delta = OffsetDateTime::now_utc() - start_time;
println!("Done in {} ms", (delta.as_seconds_f64() * 1000.0).round());
}
Ok(())
}
pub fn main() {
let matches = App::new("mtpng parallel PNG encoder")
.version("0.3.5")
.author("<NAME> <<EMAIL>>")
... | Rust | 0 |
:Float { id: _ } => (Type::FloatType, var_context),
AstRelation::Char { id: _ } => (Type::CharType, var_context),
_ => panic!("Unexpected syntax"),
}
}
fn type_check_literal(node: &AstRelation) -> Type {
match *node {
AstRelation::Void { id: _ } => Type::VoidType,
AstRelation::I... | Rust | 0 |
pw = self.show_progress_window()
def progress_callback(pct, status):
if pw and pw.winfo_exists(): pw.update_progress(pct, status)
import threading
threading.Thread(
target=align_moon_images_incremental,
args=(in_path, out_path, hough_params, self.log_box,... | Python | 1 |
xpected_error_msg):
cairo_run("test__felt252_to_bytes4_le", value=value, num_words=num_words)
@given(input_felt=positive_felt)
def test_felt252_to_bytes4_full(self, cairo_run, input_felt):
res = cairo_run("felt252_to_bytes4_full", value=input_felt, dst=[])
expected = []
expe... | Python | 1 |
k,
/// Time when BIP16 becomes active.
/// See https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki
pub bip16_time: u32,
/// Block height at which BIP34 becomes active.
/// See https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
pub bip34_height: u32,
/// Block height at which BIP65 becomes ... | Rust | 0 |
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
pub type UnwindStopFn = extern "C" fn(
c_int,
UnwindAction,
u64,
&mut UnwindException,
&mut UnwindContext<'_>,
*mut c_void,
) -> UnwindReasonCode;
#[cfg(not(feature = "unwinder"))]
#[repr(C)]
pub struct UnwindException {
pub exception_class: u64,
pub exception_cleanup: Option<UnwindEx... | Rust | 0 |
value: 5, 0;
}
bitfield! {
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct GLOBAL_CONFIG__SPAD_ENABLES_REF_0(u8);
impl Debug;
u8;
pub get, set: 7, 0;
}
bitfield! {
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct GLOBAL_CONFIG__SPAD_ENABLES_REF_1(u8);
impl Debug;
u8;
... | Rust | 0 |
# Clínica
# 19/05/2025
# Autor: Kauan Ferreira
# Biblioteca
import os
# Lista
pacientes = []
# Functions
def menu():
print('\n\n Clínica') # Título
print('\n\n Opções')
print(' 1 - Incluir')
print(' 2 - Excluir')
print(' 3 - Consultar')
print(' 4 - Alterar')
print(' 5 - Sair')
def confi... | Python | 1 |
'''
Copyright 2025.6.1 Koji-Huang(koji233@163.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Python | 1 |
"""
=========================================
Hawkes process with non constant baseline
=========================================
This example simulates and then estimates Hawkes kernels with varying
baselines. In this example the intensity is written the following way
:math:`\\lambda_i(t) = \\mu_i(t) + \\sum_{j=1}^D... | Python | 1 |
t);
let text = s.ui.get_label(text);
let font_size = clamp_size(s.theme.font_size);
let pos = s.cursor_pos();
let fpad = s.theme.spacing.frame_pad;
let ipad = s.theme.spacing.item_pad;
let expanded = s.ui.expanded(id);
let arrow_width = font_size / 2;
// ... | Rust | 0 |
0.1 second = 100 ms
print("Started! Please speak")
line_num = 0
speaker_id = 0
buffer = []
with sd.InputStream(channels=1, dtype="float32", samplerate=g_sample_rate) as s:
while True:
samples, _ = s.read(samples_per_read) # a blocking read
samples = samples.reshape... | Python | 1 |
uba)', 'fy': 'Luba-Katanga', 'ga': 'Lúba-Cataingis', 'gd': 'Luba-Katanga', 'gl': 'luba-katanga', 'gsw': 'Luba', 'gu': 'લૂબા-કટાંગા', 'ha': 'Luba-Katanga', 'he': 'לובה-קטנגה', 'hi': 'ल्यूबा-कटांगा', 'hi-Latn': 'Luba-Katanga', 'hr': 'luba-katanga', 'hsb': 'luba-katanga', 'hu': 'luba-katanga', 'hy': 'լուբա-կատանգա', 'ia':... | Python | 1 |
return Box::into_raw(Box::new(x));
}
#[no_mangle]
pub extern "C" fn zexe_tweedle_fp_proof_g3_comm_nocopy(
p: *mut DlogProof<GAffine>,
) -> *const PolyComm<GAffine> {
let x = (unsafe { &(*p).g3_comm }).clone();
return Box::into_raw(Box::new(x));
}
#[no_mangle]
pub extern "C" fn zexe_tweedle_fp_proof_sigma2... | Rust | 0 |
pl FilteredQuery for DeleteRecord {
fn get_filter(&mut self) -> Option<&mut Filter> {
self.record_filter.as_mut().map(|f| &mut f.filter)
}
fn set_filter(&mut self, filter: Filter) {
match self.record_filter {
Some(ref mut rf) => rf.filter = filter,
None => self.recor... | Rust | 0 |
dynamic-sitemap/sitemap-last-100/Oriente-occidente.xml"),
Sitemap("https://www.corriere.it/dynamic-sitemap/sitemap-last-100/Sette.xml"),
Sitemap("https://www.corriere.it/dynamic-sitemap/sitemap-last-100/Moda.xml"),
Sitemap("https://www.corriere.it/dynamic-sitemap/sitemap-last-100/Buo... | Python | 1 |
/// Mount::new("/static_files/",
/// StaticFilesHandler::new("/path/to/serve/")
/// ));
/// ```
///
/// # Panics
/// Panics if mount_point does not have a leading and trailing slash.
pub fn new<S: Into<String>>(mount_point: S, middleware: M) -> Mount<M> {
let m... | Rust | 0 |
# ─────────────────────────────────────────────────────────────
# 🔓 evrmail addresses dumpprivkey
#
# 📌 USAGE:
# $ evrmail addresses dumpprivkey --address <addr>
# $ evrmail addresses dumpprivkey --address <addr> --raw
#
# 🛠️ DESCRIPTION:
# Reveal the WIF private key for a given address.
# ⚠️ Only works for ... | Python | 1 |
]");
assert_eq!(gdnlib_split[10], "Windows.64=[ ]");
assert_eq!(gdnlib_split[11], "");
assert_eq!(gdnlib_split[12], "[general]");
assert_eq!(gdnlib_split[13], "");
assert_eq!(gdnlib_split[14], "singleton=false");
assert_eq!(gdnlib_split[15], "load_once=true");
assert_eq!(gdnlib_split[16], "symbol_prefi... | Rust | 0 |
rule = Group(And(elementList))("anonymous_and")
else:
rule = elementList[0]
assert rule is not None
return rule
def __antlrRuleConverter(pyparsingRules, antlrRule):
rule = None
rule = __antlrAlternativesConverter(pyparsingRules, antlrRule)
assert rule != None
rule(antlrRule.... | Python | 1 |
t sys::AIModule, unit: *mut sys::Unit) {
let mut unit = Unit::from_raw(unit as *mut void);
Self::get_handler(sys_module).on_unit_discover(&mut unit);
}
unsafe extern fn on_unit_evade(sys_module: *mut sys::AIModule, unit: *mut sys::Unit) {
let mut unit = Unit::from_raw(unit as *mut void)... | Rust | 0 |
: None,
})
}
/// Attempts to convert this [`PresenceUser`] instance into a [`User`].
///
/// Will clone individual fields if needed.
///
/// If one of [`User`]'s required fields is None in `self`, None is returned.
#[must_use]
pub fn to_user(&self) -> Option<User> {
Some... | Rust | 0 |
).sqrt();
person.position.x = head_pos.x + 5.0 * dx / norm;
person.position.y = head_pos.y + 5.0 * dy / norm;
}
}
}
}
fn update_household_state(&self, idx: usize, state: &mut wasm_view::HouseholdState) {
let hs = &self.per_hou... | Rust | 0 |
Result<(), Error> {
let dev_auth_provider = get_auth_provider_connection_proxy();
let credential = "rt_".to_string() + &generate_random_string();
dev_auth_provider
.get_app_id_token(&credential, None)
.map_ok(move |response| match response {
... | Rust | 0 |
bus, slot, function, register, 0xFFFF_FFFF);
// read back length
let length = pci_config_read_word(bus, slot, function, register);
// restore original value
pci_config_write_word(bus, slot, function, register, addr);
match addr & 0x01 {
... | Rust | 0 |
"""
Configuração do pytest para carregar variáveis de ambiente de teste.
"""
import os
from pathlib import Path
from dotenv import load_dotenv
# Carrega as variáveis de ambiente do arquivo .env.test
env_path = Path(__file__).parent / ".env.test"
load_dotenv(dotenv_path=env_path)
# Configura o ambiente para teste
os.e... | Python | 1 |
env_logger::try_init();
let vm = make_vm();
vm.get_database_mut().implicit_prelude(false);
vm.run_expr::<()>("<top>", "let _ = import! std.channel in ()")
.unwrap();
let expr = r#"
let { sender, receiver } = channel 0
send sender 1
sender
"#;
let result = vm.run_expr::<OpaqueValue<&Thread... | Rust | 0 |
ength` to `max_length`.
return_tensors (`str` or [`~utils.TensorType`], *optional*):
If set, will return tensors of a particular framework. Acceptable values are:
- `'tf'`: Return TensorFlow `tf.constant` objects.
- `'pt'`: Return PyTorch `torch.Tensor` objec... | Python | 1 |
line.distance_to_point(&self.ctrl1) <= tolerance
&& line.distance_to_point(&self.ctrl2) <= tolerance
}
pub(crate) fn is_a_point(&self, tolerance: S) -> bool {
let tolerance_squared = tolerance * tolerance;
// Use <= so that tolerance can be zero.
(self.from - self.to... | Rust | 0 |
import os.path
import shutil
from src import ModConfig
from subprocess import Popen
# run after game patches to regenerate all mod folders
config = ModConfig.get_instance()
base_path = config.config_data['directories']['warno_mods']
dirs = [d for k, d in config.config_data['directories'].items() if k != 'warno_mods... | Python | 1 |
(f"\nOrganization complete:")
click.echo(f" Organized: {stats['organized']}")
click.echo(f" Skipped: {stats['skipped']}")
click.echo(f" Errors: {stats['errors']}")
if not dry_run:
# Clean up empty directories
click.echo("\nCleaning up empty directories...")
cleaner.cleanu... | Python | 1 |
PATTERN_TO_CATCH_THE_NEXT_PRODUCT),
CallbackQueryHandler(
catch_previus,
pattern = pattern_identifier +
PATTERN_TO_CATCH_THE_PREVIUS_PRODUCT),
CallbackQueryHandler(
catch_details,
pattern = pattern_identi... | Python | 1 |
#!/usr/bin/env python3
# Python script showing how to create and populate a table in Iceberg.
# Uncomment to see the module search path.
# import sys
# print(sys.path)
from datetime import datetime
import pyarrow
import pyiceberg
# Allows us to connect to the catalog.
from pyiceberg.catalog import load_catalog
# ... | Python | 1 |
postgres::{Client, Pool, PoolError, Runtime};
use dotenv::dotenv;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Deserialize)]
struct Config {
listen: String,
pg: deadpool_postgres::Config,
}
impl Config {
fn from_env() -> Result<Self, ConfigError> {
let mut cfg = config::Con... | Rust | 0 |
max(abs(distance_horizontal), abs(distance_vertical))
for i in range(1, distance):
piece = board[start_rank + i * direction_vertical][start_file + i * direction_horizontal]
assert not piece, "cannot move there, a piece is in the way"
return True
else:
assert False, "queen can only move horizon... | Python | 1 |
k", region.name, name);
// Generate the URL to test
let website_url = if let Some(hosts) = kong.hosts {
Some(format!("https://{}/health",
hosts
.split(',')
.collect::<Vec<&str>>()
.first()
.u... | Rust | 0 |
Frame API for building and executing query plans.
use crate::arrow::record_batch::RecordBatch;
use crate::error::Result;
use crate::logical_plan::{
DFSchema, Expr, FunctionRegistry, JoinType, LogicalPlan, Partitioning,
};
use std::sync::Arc;
use crate::physical_plan::SendableRecordBatchStream;
use async_trait::as... | Rust | 0 |
# coding=utf-8
# pystray
# Copyright (C) 2015-2022 Moses Palmér
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.... | Python | 1 |
+ '\n' + ANSWER_PROMPT.format(
context=ctx, question=state['question']
)
try:
r = anthropic.messages.create(
model="claude-3-7-sonnet-latest",
system="Answer user questions using the provided context.",
messages=[{"role":"user","content":prompt}],
... | Python | 1 |
rt a polars dataframe into an oxide dataset
///
/// # Parameters
/// - dataframe: polars dataframe to extract data from
/// - target_column: name of the column that contains the target
/// - test_train_split:
///
/// # Returns
/// - (features, targets) a tuple of af::Array<f32> arrays
#[allow(unused_must_use)]
pub fn m... | Rust | 0 |
import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(
name="timemachines",
version="0.20.6",
description="Evaluation and standardization of autonomous time series prediction",
long_description=README,
long_... | Python | 1 |
# Copyright (c) 2011 Jyrki Pulliainen <jyrki@dywypi.org>
# Copyright (c) 2010 Inoi Oy
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the... | Python | 1 |
lv2_handle, sample_count);
}
}
}
/// Deactivate a plugin instance.
/// Note that to run the plugin after this you must activate it, which will
/// reset all state information (except port connections).
///
/// # Safety
/// Makes use of unsafe ffi functions.
#[inline(always)]
pub unsafe fn lilv_instance_dea... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.