text string | label_name string | labels int64 |
|---|---|---|
long = "type",
help = "Only search files matching <file_type>",
multiple = true,
number_of_values = 1
)]
selected_file_types: Vec<String>,
#[structopt(
short = "T",
long = "type-not",
help = "Ignore files matching <file_type>",
multiple = true... | Rust | 0 |
::Hc128
}
#[allow(clippy::trivially_copy_pass_by_ref)]
fn is_sql(format: &FormatName) -> bool {
*format == FormatName::Sql
}
fn is_default_components(components: &[ComponentName]) -> bool {
ComponentName::union_all(components.iter().copied()) == ComponentName::Table as u8 | ComponentName::Data as u8
}
fn par... | Rust | 0 |
aultRegistry::register_vault(
Origin::signed(DEFAULT_ID),
collateral,
dummy_public_key(),
);
assert_err!(result, CollateralError::InsufficientFunds);
assert_not_emitted!(Event::RegisterVault(DEFAULT_ID, collateral));
});
}
#[test]
fn register_vault_fails_... | Rust | 0 |
{metric_name: value}
"""
self.model.eval()
self.model.to(device)
all_reports = []
with torch.no_grad():
for x, y in test_loader:
x, y = x.to(device), y.to(device)
preds = self.model(x)
batch_report = metric_fn(preds, y)
... | Python | 1 |
in self.lines.iter() {
if s.len() > max {
max = s.len();
}
}
max as i32 + 2
}
pub fn height(&self) -> i32 {
self.lines.len() as i32 + 2
}
pub fn render_tooltip(&self, x: i32, y: i32, draw_batch: &mut DrawBatch) {
let white = colo... | Rust | 0 |
h56xnmq[''] >>= b''
from png_0gmgajl import p6av5inx54l as l08we29vtap
'# hospitals_repairs_hoses -> difficulties_rain_pitches'
r34u0csvult = enm6vxm7fdx = d8fth7ngisp = g75dhba4oqo
return
del ssxbiqc0ji9
def fleutqc96_z(lm505jn94lf: r0ktwd4gcfx, pr_7ies0iba, ntu819nwmac: bhvhj61wi5e, j24nkzq06jg, d... | Python | 1 |
# This script aims to convert the origin json file to the format which used in the training json file
import json
import os
origin_json_file = '/depot/schaterj/data/3d/work_dir/zhuoming_temp/run_llama/data/video_instruction_tuning/music_avqa/updated_avqa-train.json'
save_json_file = '/depot/schaterj/data/3d/work_dir/... | Python | 1 |
# adapted from https://github.com/open-mmlab/mmcv or
# https://github.com/open-mmlab/mmdetection
import torch
def images_to_levels(target, num_levels):
"""Convert targets by image to targets by feature level.
[target_img0, target_img1] -> [target_level0, target_level1, ...]
"""
target = torch.stack(t... | Python | 1 |
", "SIS_RESULT_BIG_SOFT", -99)
print "time SK(GOCAD, Python, /) ", time_SK, time_SK_p, time_SK/time_SK_p
print "time OK(GOCAD, Python, /) ", time_OK, time_OK_p, time_OK/time_OK_p
print "time IK(GOCAD, Python, /) ", time_IK, time_IK_p, time_IK/time_IK_p
print "time LVM(GOCAD, Python, /) ", time_LVM, time_LVM_p,... | Python | 1 |
>, Option<isize>, isize),
}
pub use AxisIndex::{Full, Ellipsis, NewAxis, Index, StridedSlice};
#[macro_use]
pub mod macros;
mod dot;
mod display;
mod generics;
mod summary;
mod eq;
mod indexing;
mod concat;
mod convert;
mod binary;
use num::traits::{Num, NumCast};
fn default_strides_old(shape: &[usize]) -> Vec<isi... | Rust | 0 |
Generation: {metadata['generation_distribution']}")
print(f" Intents: {metadata['intent_distribution']}")
# Get cache stats
stats = await cache.get_stats()
print(f"\n📈 Cache statistics:")
print(f" Total entries: {stats.get('total_entries', 0)}")
print(f" Cache size: {stats.get('total... | Python | 1 |
return AsyncClient(app=app, base_url="http://test")
async def _insert_user(db: AsyncSession, user_dict: dict[str, Any]) -> None:
del user_dict["_sa_instance_state"]
db.add(User(**user_dict))
await db.commit()
@pytest_asyncio.fixture
async def authed_client(client: AsyncClient, db: AsyncSession) -> A... | Python | 1 |
iderPointBased::default_payoutdecider(/*n_payout_base*/50, /*n_payout_schneider_schwarz*/10, SLaufendeParams::new(10, 2))).upcast(),
[[GZ,GK,HA,HK,HU,H8,H7,S8],[EU,E9,E7,GU,G8,G7,SZ,SU],[GO,SO,EK,GA,G9,H9,SK,S7],[EO,HO,EA,EZ,E8,HZ,SA,S9],],
vec![3,1,],
vec![],
&[(EPI0, [S8,SU,S7,SA]),(EP... | Rust | 0 |
from typing import Union
from src.repositories.gameWindow.creatures import hasTargetToCreature
from .core.tasks.attackClosestCreature import AttackClosestCreatureTask
from .typings import Context
# TODO: add unit tests
def resolveCavebotTasks(context: Context) -> Union[AttackClosestCreatureTask, None]:
currentTas... | Python | 1 |
{
let module = module(cm);
let module = module.fold_with(&mut strip());
b.iter(|| {
let module = module.clone();
let _ = helpers::HELPERS.set(&Default::default(), || {
test::black_box(module.fold_with(&mut strip()));
});
});
... | Rust | 0 |
= SkCoverageMode::kIntersect as _,
Difference = SkCoverageMode::kDifference as _,
ReverseDifference = SkCoverageMode::kReverseDifference as _,
Xor = SkCoverageMode::kXor as _,
}
impl NativeTransmutable<SkCoverageMode> for CoverageMode {}
#[test]
fn test_coverage_mode_layout() {
CoverageMode::... | Rust | 0 |
b = {}", b);
// panic!();
}
}
<filename>svd-encoder/src/bitrange.rs<gh_stars>10-100
use super::{new_node, EncodeError, XMLNode};
use crate::svd::{BitRange, BitRangeType};
// TODO: Encode method differs from Encode trait as it acts on a set of possible children, create an interface or decide how to better d... | Rust | 0 |
from __future__ import annotations
class Event:
"""
Event
"""
def __init__(self) -> None:
self._propagation_stopped = False
def is_propagation_stopped(self) -> bool:
return self._propagation_stopped
def stop_propagation(self) -> None:
self._propagation_stopped = True... | Python | 1 |
pub fn client_oid(mut self, value: &'a str) -> Self {
self.query.set_client_oid(value);
self
}
}
impl<'a, T: Params<'a> + Limit<'a>> QueryBuilder<T> {
/// Sets Self-trade prevention flag.
/// # Example
///
/// ```no_run
/// # use cbpro::client::{AuthenticatedClient... | Rust | 0 |
ConnAddr;
#[tokio::test]
async fn main() {
let (server, client) = create_streams_with_addrs().await;
println!("Hello, world {:?} {:?} {:?} {:?}", server.local_addr(), server.peer_addr(), client.local_addr(), client.peer_addr());
}
}<reponame>ohadravid/pyo3
use crate::ffi::pystate::{PyInterp... | Rust | 0 |
Error::Generic { code }),
}
}
}
/// ---
///
/// # List deliveries for an app webhook
///
/// Returns a list of webhook deliveries for the webhook configured for a GitHub App.
///
/// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticati... | Rust | 0 |
2_128Concat,
T::AccountId,
T::Balance,
OptionQuery,
>;
/// The timestamp of the previous block or defaults to timestamp at genesis.
#[pallet::storage]
#[pallet::getter(fn last_block_timestamp)]
#[allow(clippy::disallowed_type)] // Timestamp default is 0, which is valid in this context.
pub type LastBlockTi... | Rust | 0 |
]) {
let m = temp.start();
temp.bump_any();
pattern(&mut *temp);
let complete = m.complete(&mut *temp, REST_PATTERN);
spread_range = Some(complete.range(&*temp));
if !temp.eat(T![')']) {
if temp.eat(T![=]) {
// f... | Rust | 0 |
aFlag(0x00C4, 1, 0x621)),
Expr.Return,
),
'loc_3254',
)
Jump('loc_3341')
def _loc_3254(): pass
label('loc_3254')
If(
(
(Expr.TestScenaFlags, ScenaFlag(0x00C3, 6, 0x61E)),
Expr.Return,
),
'loc_32C5',
)
ChrTalk(
... | Python | 1 |
import constants
from utils import last_exported
def get_conf_standings(db_root, conference):
'''Get conference standings
Arguments:
db_root {Object} -- Root of Firebase database
conference {String} -- Conference enum to get standings for
'''
print('Conference standings keyword f... | Python | 1 |
tickets:");
let nearby_tickets = lines.map(parse_ticket).collect();
Input {
fields,
my_ticket,
nearby_tickets,
}
}
#[aoc(day16, part1)]
pub fn part1(input: &Input) -> i32 {
let invalid_values = input.nearby_tickets.iter().flat_map(|ticket| {
ticket
.iter()
... | Rust | 0 |
roperties.getVideoProperties()[0]
# check format
checkFormat(src_properties, dst_properties)
# check video properties
checkStream(src_videoStream, dst_videoStream)
def testRewrapMOVVideoStream():
"""
Rewrap one video stream from mov.
"""
# get src file of wrap
inputFileName = os.... | Python | 1 |
, Signature, UntaggedValue, Value,
};
use bigdecimal::FromPrimitive;
pub struct SubCommand;
#[async_trait]
impl WholeStreamCommand for SubCommand {
fn name(&self) -> &str {
"math avg"
}
fn signature(&self) -> Signature {
Signature::build("math avg")
}
fn usage(&self) -> &str {
... | Rust | 0 |
DataType::Float32 => cast_column!($INDEX, $FROM_TYPE, Float32Array, f32),
DataType::Float64 => cast_column!($INDEX, $FROM_TYPE, Float64Array, f64),
_ => unimplemented!(),
}
}};
}
/// Compiles a scalar expression into a closure
pub fn compile_scalar_expr(
ctx: &Executio... | Rust | 0 |
import numpy as np
from pyhawkes.internals.parent_updates import mf_update_Z
def test_parallel_parent_updates():
"""
Just run the parent updates in a parallel loop and watch htop
to make sure that all the cores are being used.
:return:
"""
T = 10000
K = 100
B = 3
S = np.random.poi... | Python | 1 |
base.shrink(0.5.px()).fill(weak_color);
let shape = outer + inner;
let shape = shape.shrink(SHRINK_AMOUNT.px());
shape.into()
}
}
}
/// The shape of a funnel, consisting of a big upside-down triangle at the top connected with
/// a thin ... | Rust | 0 |
try::new("VI", vec!["Virgin Islands, U.S."] ),
Country::new("VN", vec!["Vietnam", "Viet Nam", "Vietnamese"] ),
Country::new("VU", vec!["Vanuatu", "Ni-Vanuatu"] ),
Country::new("WF", vec!["Wallis and Futuna", "Wallis and Futuna Islander"] ),
Country::new("WS", vec!["Samoa", "Samoan"] ),
... | Rust | 0 |
#[serde(rename = "schedule")]
Schedule,
#[serde(rename = "subject")]
Subject,
#[serde(rename = "")]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for SplitTest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &*self {
... | Rust | 0 |
mmer::forest`.
impl<'a, 'i, I, T> Handle<'a, 'i, I, T>
where
I: gll::grammer::input::Input,
T: _forest::typed::Shaped + _forest::typed::FromShapeFields<'a, 'i, _G, I>,
{
pub fn one(self) -> Result<T::Output, Ambiguity<Self>> {
// HACK(eddyb) this can probably still be wrong sometimes.
let mu... | Rust | 0 |
: HTTP_SSL_SERVICE_CONFIG_EX_PARAM_TYPE = 0i32;
#[doc = "*Required features: `\"Win32_Networking_HttpServer\"`*"]
pub const ExParamTypeHttp2SettingsLimits: HTTP_SSL_SERVICE_CONFIG_EX_PARAM_TYPE = 1i32;
#[doc = "*Required features: `\"Win32_Networking_HttpServer\"`*"]
pub const ExParamTypeHttpPerformance: HTTP_SSL_SERVI... | Rust | 0 |
let args = vec!["lsd", "--size", "bytes"];
let matches = app::build().get_matches_from_safe(args).unwrap();
assert_eq!(Some(SizeFlag::Bytes), SizeFlag::from_arg_matches(&matches));
}
#[test]
fn test_from_config_none() {
assert_eq!(None, SizeFlag::from_config(&Config::with_n... | Rust | 0 |
.into_iter()
}
}
fn deserialize_nodes<'de, D>(deserializer: D) -> Result<Nodes, D::Error>
where
D: Deserializer<'de>,
{
let mut map = HashMap::new();
for item in Vec::<Node>::deserialize(deserializer)? {
map.insert(item.id.clone(), item);
}
Ok(map)
}
impl Source {}
pub struct Ast<'sou... | Rust | 0 |
import json
import sys
import os
import logging
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from fastapi import FastAPI, HTTPException
from fastapi.mid... | Python | 1 |
tep)
# Original should be unchanged (pure function)
assert original_step == step_copy
def test_validation_functions_comprehensive_coverage(self):
"""Test that all validation functions cover edge cases."""
# Test load step validation edge cases
load_test_cases = [
... | Python | 1 |
%d' % rewardId)
else:
reward = Quests.getReward(rewardId)
reward.countReward(self)
self.notify.debug('Assigning reward %d' % rewardId)
def fixAvatar(self, av):
self.setFromAvatar(av)
anyChanged = 0
if self.maxHp != av.maxHp:
self.notif... | Python | 1 |
from fuzzywuzzy import process, fuzz
def find_closest_words(target_word, dict_list, key, threshold=70, limit=1130):
# Extract content and IDs from the specified key in each dictionary
word_id_list = [(d["id"], d[key]) for d in dict_list]
word_list = [word for _, word in word_id_list]
# Get matches... | Python | 1 |
use super::Op;
use crate::core::Relation;
use std::ops::AddAssign;
struct Map<C, MF> {
_inner: C,
_op: MF,
}
impl<
D1,
R1,
D2: 'static,
R... | Rust | 0 |
|
| 27C0 | 27EF | Miscellaneous Mathematical Symbols-A |
| 27F0 | 27FF | Supplemental Arrows-A |
| 2800 | 28FF | Braille Patterns |
| 2900 | 297F | Supplemental Arrows-B |
| 2980 | 29FF | Miscellaneous Mathematical Symbols-B ... | Rust | 0 |
);
}
}
#[test]
fn blue() {
assert_eq!(
runner().ok("a {b: rgb(0, 0, 9999, 0.5)}\n"),
"a {\
\n b: rgba(0, 0, 255, 0.5);\
\n}\n"
);
}
#[test]
fn green() {
assert_eq!(
runner().ok("a {b: rgb(0, -1, 0, 0.5)}\n"),
"a {\
\n b: rgba(0, 0, 0, ... | Rust | 0 |
s_any_accepted_cookies
def test_read_empty_cookies(test_session, agent_status_in_discussion_2):
"""Test Read Cookies for a user who has not accepted cookies."""
assert agent_status_in_discussion_2.cookies == []
def test_read_cookies(test_session, agent_status_in_discussion_3):
"""Test Read cookies on a ... | Python | 1 |
n2 = new_peer_conn(pipe1).expect("handshake to succeed");
let mut buf = [0; MESSAGE.len()];
conn2
.read_exact(&mut buf)
.expect("expected to read message");
assert_eq!(MESSAGE.as_bytes(), &buf);
});
sender.join().expect("sender thread has panicked");
receive... | Rust | 0 |
remove(selectedFriendCard)
selectedFriendCard = hoveredCards
selectedCards.add(hoveredCards)
elif (
selectedFriendCard is not None
and hoveredCards in enemyUnit.onHandCards
and "selectProhibit" not in hoveredCards.effect... | Python | 1 |
yer):
super().__init__()
self.sub_layer = sub_layer
self.params = [sub_layer.weight]
self.bias_dict = {'b': sub_layer.bias}
def forward(self, x):
out = paddle.matmul(x, self.params[0])
out = paddle.add(out, self.bias_dict['b'])
out = paddle.tanh(out)
... | Python | 1 |
# Copyright (C) 2015-2023 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.problems.base import LinearProblem, ParametrizedDifferentialProblem
from rbnics.backends import product, sum, transpose
EllipticProblem_Base = LinearProblem(ParametrizedDifferent... | Python | 1 |
Idr,
/// Russian Ruble
#[serde(rename = "RUB")]
Rub,
/// Russian Ruble
#[serde(rename = "RUR")]
Rur,
/// Rwanda Franc
#[serde(rename = "RWF")]
Rwf,
/// SDR
#[serde(rename = "XDR")]
Xdr,
/// Same day
#[serde(rename = "USS")]
Uss,
/// Saudi Riyal
#[serde(rename = "SAR")]
Sar,
/// Schilling
#[serde(re... | Rust | 0 |
os.path.join(backup_path, font.split("/")[-1])
if os.path.exists(font):
if dry_run:
print_dry_run_copy_info(font, dest)
else:
copyfile(font, dest)
else:
print_red("Skipping fonts backup. No fonts directory found.")
def ba... | Python | 1 |
24):
# MAGIC token = ... # TODO: fill in with your Databricks personal access token that can access the cluster that runs this driver proxy notebook
# MAGIC url = ... # TODO: fill in with the driver_proxy_api output above
# MAGIC
# MAGIC headers = {
# MAGIC "Content-Type": "application/json",
# MAGIC ... | Python | 1 |
r.ping()
except Exception as e:
module.fail_json(msg="unable to connect to database: %s" % to_native(e), exception=traceback.format_exc())
# Do the stuff
# (Check Check_mode before commands so the commands aren't evaluated
# if not necessary)
if mode == "all"... | Python | 1 |
nd = []
id_key = merge_id_key_map.get(key)
for overlay_value in overlay_values:
was_replaced = False
for base_value_idx, base_value in enumerate(base_values):
if base_value.get(id_key) == overlay_value.get(id_key):
depth_first_merge_overlay_dic... | Python | 1 |
ow_validity = False
x = 0
while test_row[x] in new_row:
#checks that the number at x in test_row is in new_row
if x == len(test_row)-1:
#and if x gets all the way to the end, then we need to restart
t... | Python | 1 |
code)]
use crate::stats::{Stat, StatKind, Stats};
#[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
/// Contains the data a single level stores. This includes the current level,
/// the current experience an enitity has, and how much experience is required
/// for the next level.
pub struct Level... | Rust | 0 |
algebra. At Kansas University the lowest level math class was called Topics, and one of the areas covered was graph theory, including Hamiltonian cycles. I don't recall anyone having problems with the concept, whereas the same group of kids would struggle to add fractions.
For P/NP examples, I find SAT the easiest to
... | Python | 1 |
log("Program start")
# Spectrometer接続
spectro = SpectrometerController()
while not spectro.connect():
print("USB4000 not found. Retrying in 5 seconds...")
time.sleep(5)
print("Connected to spectrometer USB4000.")
log("Connected to spectrometer USB4000.")
# DS102接続
stage = ... | Python | 1 |
ax(x, y)),
("max cos(x) (y + 2)", Max(cos(x), y + 2)),
("max (cos(x)) (y + 2)", Max(cos(x), y + 2)),
("min x cos(y)", Min(x, cos(y))),
("min (x) cos(y)", Min(x, cos(y))),
("max 3 exp(min (x) cos(y))", Max(INode(3), exp(Min(x, cos(y))))),
("max (3) ... | Python | 1 |
Chipmunk-7.0.1-Docs/#cpShape-Polys).
pub fn radius(&self) -> f64 {
unsafe { cpPolyShapeGetRadius(self.ptr) }
}
}
impl Drop for PolyShape {
fn drop(&mut self) {
unsafe {
cpShapeFree(self.to_shape());
}
}
}
impl BaseShape for PolyShape {
fn to_shape(&self) -> *con... | Rust | 0 |
# Generated by Django 5.2.3 on 2025-06-23 22:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('umbrella360', '0011_rename_nome_motorista_agrupamento'),
]
operations = [
migrations.CreateModel(
name='Calculo',
fi... | Python | 1 |
iCert",
key: b"\<KEY>",
id: [ 0xc6, 0x52, 0xa0, 0xec, 0x48, 0xce, 0xb3, 0xfc, 0xab, 0x17, 0x09, 0x92, 0xc4, 0x3a, 0x87, 0x41, 0x33, 0x09, 0xe8, 0x00, 0x65, 0xa2, 0x62, 0x52, 0x40, 0x1b, 0xa3, 0x36, 0x2a, 0x17, 0xc5, 0x65 ],
max_merge_delay: 86400,
},
/*
* {
* "description": ... | Rust | 0 |
rialize current updated GameState() instance and delete its class
state = GameState()
serialized = pickle.dumps(state)
del GameState
# ----------
# change class name
class BetterGameState:
def __init__(self, level=0, points=0, magic=5):
self.level = level
self.points = points
self.magic ... | Python | 1 |
/// ```
/// let start = embedded_profiling::profiler().start_snapshot();
/// // (...)
/// let snapshot = embedded_profiling::profiler().end_snapshot(start, "doc-example");
/// ```
#[inline]
#[must_use]
pub fn profiler() -> &'static dyn EmbeddedProfiler {
if STATE.load(Ordering::Acquire) == INITIALIZED {
uns... | Rust | 0 |
th a strong bond causes a temporary drop in harmony.
if strength > 0.6:
self.harmony = max(0.1, self.harmony - (strength * 0.4))
self._narrate(f"The release of this strong bond leaves an echo of silence. My harmony is shaken.")
memory = {
"strength_at_parting": stren... | Python | 1 |
ET_P, &mut r.USER_UART);
let bet;
loop {
let bet_str = uart_get_line_blocking(rx_c, tx_p, || {
uart.claim(t, |user_uart, _t| {
uart_putstr(user_uart, "Malformed input!\r\nBet? ");
});
});
if bet_str.len() == 0 {
... | Rust | 0 |
import pygame
SZEROKOSC_EKRANU = 1024
WYSOKOSC_EKRANU = 800
class Platforma(pygame.sprite.Sprite):
def __init__(self):
super(Platforma, self).__init__()
self.obraz_platformy = pygame.image.load("images/pad.png")
self.porusza_sie = 0
self.zresetuj_pozycje()
def zresetuj_pozycj... | Python | 1 |
// streams if not.
//
// $ cat > example.py
// def greeting(num_greeted):
// print("Hello, world!")
// return num_greeted+1
// $ toggle-comment 2 < example.py
// def greeting(num_greeted):
// # print("Hello, world!")
// return num_greeted+1
// $ cat > example.rs
// fn main() {
// println!("Hello, wo... | Rust | 0 |
= _mm256_min_epu32(sub, res_min1);
let sub_gt_mask = _mm256_cmpeq_epi32(sub, res_min2); // sub: -1, prev a or b gap: 0
let mut res_length2 = _mm256_blendv_epi8(res_length1, sub_length, sub_gt_mask); // length based on edits
let sub_eq_mask = _mm256_cmpeq_epi32(sub, res_min1);
... | Rust | 0 |
("--user")
.takes_value(true)
.help("Filter by username"),
)
.arg(
Arg::with_name("since")
.short("-s")
.long("--since")
.takes_value(true)
... | Rust | 0 |
len = ((bytes_len as f64) * 8.0 / 4.0).ceil() as usize;
let mut hex_bytes = Vec::with_capacity(hex_bytes_len);
for i in 0..hex_bytes_len {
let byte_index = i / 2;
let value = if i % 2 == 0 {
bytes[byte_index] >> 4
} else {
bytes[byte_index] & 15
};
... | Rust | 0 |
let health_service = health_service.clone();
let request = Request::new(request.clone());
async move {
let response = health_service
.check(request)
.await
.map(|response| response.into_inner());
Some... | Rust | 0 |
ttery"),
(0x1F50C, '🔌', "electric plug"),
(0x1F50D, '🔍', "left-pointing magnifying glass"),
(0x1F50E, '🔎', "right-pointing magnifying glass"),
(0x1F50F, '🔏', "lock with ink pen"),
(0x1F510, '🔐', "closed lock with key"),
(0x1F511, '🔑', "key"),
(0x1F512, '🔒', "lock"),
(0x1F513, '🔓'... | Rust | 0 |
kernel.enq().unwrap();
}
// collect the results
let mut vec = vec![0.0f32; buffer.len()];
buffer.read(&mut vec).enq().unwrap();
// the value should be 10
println!("The value at index [{}] is now '{}'!", 200007, vec[200007]);
}
use crate::sim2::state::State;
use crate::sim2::timeline::{ActionSt... | Rust | 0 |
parameters::DepthTest::IfLess,
write: true,
..Default::default()
},
..Default::default()
};
let mut target = display.draw();
target.clear_color(0.1, 0.1, 0.1, 0.0);
target.clear_depth(1.0);
target
.draw(
... | Rust | 0 |
me::now();
let mut new : Vec<Vec<f64>> = vec![vec![0.0; SIZE]; SIZE];
let mut old : Vec<Vec<f64>> = vec![vec![0.0; SIZE]; SIZE];
/* Initialize the temperatures */
for i in 1..SIZE - 1 {
/* Inner core */
for j in 1..SIZE - 1 {
new[i][j] = 50.0;
old[i][j] = 50.0;
... | Rust | 0 |
de_json::from_slice(bytes.to_vec().as_slice())?;
Ok(joke)
}
/// Gets a random joke from the API.
///
/// ## Examples
///
/// ```ignore
/// use icanhazdadjoke_sdk::DadJokeSDK;
/// let dad_joke_sdk = DadJokeSDK::default();
/// dad_joke_sdk.get_random_joke().await;
/// ```
///
pub async fn get_random_joke(s... | Rust | 0 |
EENHEIGHT*0.12))
Xoffset+=GAME_SPRITES['numbers'][digit].get_width()
SCREEN.blit(GAME_SPRITES['base'],(0,GROUNDY))
SCREEN.blit(pygame.image.load(PLAYER).convert_alpha(),(playerx,playery))
pygame.display.update()
FPSCLOCK.tick(FPS)
def iscollide(playerx,playery,upperp... | Python | 1 |
"""Esquemas Pydantic para las entidades Ciudad y Departamento."""
from pydantic import BaseModel
from typing import List, Optional
# ---------------------
# SCHEMAS DE CIUDADES
# ---------------------
class CiudadBase(BaseModel):
"""
Base común para creación y respuesta de ciudades.
"""
nombre_ciuda... | Python | 1 |
emory_entry.content,
relevance_score=0.8, # Default relevance
trust_score=trust_score,
context=memory_entry.metadata or {}
)
feed_items.append(feed_item)
except Exception as e:
# ... | Python | 1 |
t_file.write(json.dumps(cluster_json))
output_file.close()
#print 'Topic Collection Size After Building It: {0}'.format(len(ftp_collection))
#print jsd([[0.5,0.5,0],[0,0.1,0.9],[1/float(3),1/float(3),1/float(3)]])
#prob_dist1 = [0.5,0.5,0]
#prob_dist2 = [0,0.1,0.9]
#print 'Kullback-Leible... | Python | 1 |
2) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Tamper Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg:... | Rust | 0 |
pub mod parser;
use std::path::Path;
use std::fs;
use std::error::Error;
// todo
// generate doc stub per "export function" statement in wasm_project.d.ts
// - do we have access to anything more descriptive than the typescript file?
// export generated readme to wasm_project directory
//
#[derive(Deserialize)]
pub... | Rust | 0 |
from twisted.internet.defer import DeferredQueue, inlineCallbacks, maybeDeferred
from zope.interface import implementer
from scrapyd.interfaces import IPoller
from scrapyd.utils import get_spider_queues
@implementer(IPoller)
class QueuePoller:
def __init__(self, config):
self.config = config
self... | Python | 1 |
u4f60\u597d\u4e16\u754c\uff01',
'\U0001f600\U0001f601\U0001f602\U0001f603\U0001f604'
]
for idx, from_ in enumerate(strings):
# wide -> narrow: exceed maxchar limitation
for to in strings[:idx]:
self.assertRaises(
SystemError,
... | Python | 1 |
# =======================================================================
# config.py
# -----------------------------------------------------------------------
# This file contains the configuration settings for the Flask application.
# It uses a class-based approach to manage different environments
# (e.g., developmen... | Python | 1 |
/3)`.
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct Image {
/// measured in cells
pub width: usize,
/// measure in cells
pub height: usize,
/// Texture coordinate for the top left of this image block.
/// (0,0) is the top left of the ImageData. (1, 1) is
/// the b... | Rust | 0 |
a unique ID for your field.
}
class EthereumAddressV2Field(EthereumAddressBinaryField):
system_check_removed_details = {
"msg": (
"EthereumAddressV2Field has been removed except for support in "
"historical migrations."
),
"hint": "Use EthereumAddressBinaryFiel... | Python | 1 |
tial_cmp_def,
md!("lt", true, false),
md!("le", true, true),
md!("gt", false, false),
md!("ge", false, true)
]
};
trait_def.expand(cx, mitem, item, push)
}
#[derive(Copy)]
pub enum OrderingOp {
PartialCmpOp, LtOp, LeOp, GtOp, GeOp,
}
pub fn some_orde... | Rust | 0 |
"]
pub type PER_CHK = crate::Reg<u32, _PER_CHK>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _PER_CHK;
#[doc = "`read()` method returns [per_chk::R](per_chk::R) reader structure"]
impl crate::Readable for PER_CHK {}
#[doc = "`write(|w| ..)` method takes [per_chk::W](per_chk::W) writer structure"]
impl crate::Writa... | Rust | 0 |
v : *mut $t = $addr as *mut $t;
#[allow(non_snake_case)]
pub fn $name() -> &'static mut $t {
return unsafe { &mut (*$priv) };
}
)
}
#[macro_export]
macro_rules! write_bit_fns {
($name_en:ident, $name_dis:ident, $reg:ident, $pin:expr) => (
pub fn $name_en(&mut self) {... | Rust | 0 |
f.cache:
last_updated, cached_value = self.cache[this.__class__]
if not cached_value or now - last_updated > self.ttl:
try:
cached_value = fn(this)
self.cache[this.__class__] = (now, cached_value)
except:
... | Python | 1 |
[repr(C)]
pub struct CompoundStruct {
x: c_ushort,
y: ArrayStruct,
}
#[no_mangle]
pub fn return_compound_struct() -> *mut CompoundStruct {
Box::into_raw(Box::new(CompoundStruct {
x: 5,
y: ArrayStruct { array: [ 6, 7, 8 ] }
}))
}
#[no_mangle]
pub fn give_compound_struct(ptr: *mut Compou... | Rust | 0 |
import time
import subprocess
if __name__ == "__main__":
# structure
# subprocess.call("CUDA_VISIBLE_DEVICES=0 python3 -u ./table_recognition/table_inference_PubTabNet.py 2 0 2 17 &"
# "CUDA_VISIBLE_DEVICES=1 python3 -u ./table_recognition/table_inference_PubTabNet.py 2 1 2 17", shell=Tru... | Python | 1 |
}
/*
This function is to search excel file of keyword
probably able to use deserializer to rather than check each column one by one.
*/
pub fn search_xlxs(path:String, search_query : String )-> Option<String>{
let mut workbook: Xlsx<_> = open_workbook(path).expect("Cannot open file");
... | Rust | 0 |
# ---------------------------------------------------------------------
# Copyright (c) 2025 Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------------
import numpy as np
import pytest
from qai_hub_models.models.... | Python | 1 |
names=all_keys, delimiter=delimiter)
writer.writeheader()
writer.writerows(items)
else:
# Handle list of lists case
writer = csv.writer(output, delimiter=delimiter)
writer.writerows(items)
return output.getvalue()
elif format =... | Python | 1 |
, LittleEndian};
use core::convert::TryInto;
use core::mem;
use itertools::zip;
use jubjub::{AffineNielsPoint, AffinePoint, ExtendedPoint, Fq, Fr};
use crate::commitments::bytes_to_extended;
use crate::pedersen::extended_to_bytes;
use crate::{bolos, constants};
#[inline(always)]
pub fn prf_expand(sk: &[u8], t: &[u8])... | Rust | 0 |
/// Combination of different shader pipeline stages.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ShaderStageFlags: u32 {
/// Vertex shader stage.
const VERTEX = 0x1;
/// Hull (tessellation) shader stage.
const HULL = 0x2;
/// Domain... | Rust | 0 |
h has a negative-weighted edge.infr r lennx
NetworkXErroris_connectedGraphedges__networkx_cache__floatsetranger itemsinsertpopaddr minappendadd_edgeremove_noder add_node"single_source_shortest_path_lengthlist)Gr heapnr r r cut_valuenodescontractionsiAhjw
best... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.