text string | label_name string | labels int64 |
|---|---|---|
destroy(barrier) > 0 {
log::error!("Failed to destroy barrier");
}
let exit_string = ">>> [cyan]Rust Main Application Exiting[]: [green]Bye![]\n";
cne_printf(get_cstring_from_str(exit_string).as_ptr());
}
return 0;
}
fn main() {
unsafe {
let x = cne_init();
... | Rust | 0 |
ect_ext => r#"CSV-Dateien (.csv)"#,
M::SB200_title => r#"Ahnen"#,
M::SB200_ahnen => r#"A_hnen"#,
M::SB200_ahnen_tt => r#"Ahnen"#,
M::SB200_ahnen_columns => {
r#"Nr.;Geburtsname;Vornamen;Name;G.;Geboren;Gestorben;Geändert am;Geändert von;Angelegt am;Angeleg... | Rust | 0 |
}
}
pub fn init_exit_boot_services_event_notification() {
unsafe { EXIT_BOOT_SERVICES_EVENT = alloc_pool::<Event>(1) };
let status = efi_bs_call!(create_event, EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, notify_exit_boot_services, null_mut(), EXIT_BOOT_SERVICES_EVENT);
match status {
Status::SUCCESS... | Rust | 0 |
fn sqrt(self) -> Self::Output;
/// Computes the abs of `self`.
fn abs(self) -> Self::Output;
/// Computes the sign of `self`.
fn signum(self) -> Self::Output;
}
use std::env::args;
use std::time::Instant;
fn main() {
let now = Instant::now();
let output = run(&args().nth(1).expect("Please p... | Rust | 0 |
('\u{5d0}', '\u{5ea}'), ('\u{5f0}', '\u{5f4}'),
('\u{fb1d}', '\u{fb36}'), ('\u{fb38}', '\u{fb3c}'), ('\u{fb3e}',
'\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', '\u{fb44}'),
('\u{fb46}', '\u{fb4f}')
];
pub const Hiragana_table: &'static [(char, char)] = &[
('\u{3041}', '\u{... | Rust | 0 |
batch.shape[0]
fs = 16000 # Sampling rate
N = 30 # length of temporal envelope vectors
J = 15.0 # Number of one-third octave bands
octave_band = thirdoct(fs=10000, nfft=512, num_bands=15, min_freq=150)
c = 5.62341325 # 10^(-Beta/20) with Beta = -15
D = torch.zeros(batch_size)
resampler... | Python | 1 |
#!/usr/bin/env python3
"""
Teste rápido: Ingestão das primeiras 500 linhas para validar correção
"""
import sys
import pandas as pd
sys.path.append('src')
from src.agent.rag_agent import RAGAgent
def test_small_ingest():
print("🧪 Teste rápido: Ingestão das primeiras 500 linhas")
# Criar dataset de teste... | Python | 1 |
eAlloc = wee_alloc::WeeAlloc::INIT;
}
}
#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
// Use `web_sys`'s global `window` function to get a handle on the global
// window object.
let window = web_sys::window().expect("no global `window` exists");
let document = window.document().expec... | Rust | 0 |
0, 0x8, 0xe,
];
let itable = vec![
0xd, 0x0, 0x8, 0x6, 0x2, 0xc, 0x4, 0xb, 0xe, 0x7, 0x1, 0xa, 0x3, 0x9, 0xf, 0x5,
];
let constants = [
0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3e, 0x3d, 0x3b, 0x37, 0x2f, 0x1e, 0x3c, 0x39, 0x33,
0x27, 0x0e, 0x1d, 0x3a, 0x35, 0x... | Rust | 0 |
artifacts_by_sha256[fileinfo["sha256"]] = list(artifacts)
# save the sha256 associations to the database
now = datetime.datetime.now().isoformat()
for sha256, purls in tqdm.tqdm(purls_with_sha256.items(), desc="writing..."):
item = {
"sha256": sha256,
"ordered":... | Python | 1 |
import pandas as pd
import numpy as np
from datetime import date
import matplotlib
from matplotlib.dates import date2num
def frequency_addition(nodes):
now = date.today()
now = matplotlib.dates.date2num(now)
for i in range(len(nodes.datelist)):
a_week_ago = now - 7
if nodes.datelist[i] >= ... | Python | 1 |
has_simple_attr(fun.module_env.env, fun.get_attributes(), CALLABLE_ATTR)
}
/// Check whether the function has a `#[create]` attribute.
pub fn is_create_fun(fun: &FunctionEnv<'_>) -> bool {
has_simple_attr(fun.module_env.env, fun.get_attributes(), CREATE_ATTR)
}
/// Check whether the function has a `#[payable]` at... | Rust | 0 |
_id_by_coord(start_pos)
goal = navmesh.find_trapezoid_id_by_coord(goal_pos)
if start and goal and astar.search(start, goal):
ids = astar.get_path()
pts = [navmesh.get_position(tid) for tid in ids]
chaikin_only_path_points = chai... | Python | 1 |
id).data.boost_count = data.count;
Ok(())
}
/// Set the boost count to zero for the card in `scope`.
#[instrument(skip(game))]
pub fn clear_boost<T>(game: &mut GameState, scope: Scope, _: &T) -> Result<()> {
info!(?scope, "clear_boost");
game.card_mut(scope.card_id()).data.boost_count = 0;
Ok(())
}
pu... | Rust | 0 |
(self) -> Self {self}
#[inline(always)] fn modulus_sqrd(self) -> Self { self * self }
#[inline(always)] fn modulus(self) -> Self::Real { self.abs() }
}
impl ComplexSubset for $n {
type Real = $f;
type Natural = $n;
type Integer = $z;
... | Rust | 0 |
rans_rules, extract, parse_hop, load_dag, optimize, print_dag};
use egg::{
//define_term,
//egraph::{AddResult, EClass, Metadata},
//expr::{Expr, Language, QuestionMarkName},
extract::{calculate_cost, Extractor},
parse::ParsableLanguage,
//pattern::{Applier, Rewrite, WildMap},
};
use log::*;
us... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2016 Google LLC. 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 requir... | Python | 1 |
"ATK 10",
"ATK 11",
"ATK 12",
"ATK 13",
"ATK 14",
"ATK 15",
"ATK 16",
"ATK 17",
"ATK 18",
"ATK 19",
"ATK 20",
"DEF 5",
"DEF 9",
"DEF 13",
"DEF 17",
"HP 2",
"HP 3",
"HP 4",
... | Python | 1 |
const ATYP_DOMAIN: u8 = 3;
}
pub fn run(addr: SocketAddr, dns: SocketAddr) {
let buffer = Rc::new(RefCell::new(vec![0; 64 * 1024]));
let mut lp = Core::new().unwrap();
let handle = lp.handle();
let (stream, sender) = UdpClientStream::new(dns, handle.clone());
let client = ClientFuture::new(strea... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for pose detection functionality
Tests YOLO pose detection with webcam or dummy frames
"""
import cv2
import numpy as np
from ultralytics import YOLO
import time
def test_pose_detection():
"""Test pose detection with webcam or test image"""
print("Loading YOLO model... | Python | 1 |
eturns = returns[::-1]
_, summ_str = self.sess.run(
[self.train_ops, self.merged_summary], feed_dict={
self.lr: lr,
self.s: np.array(obs),
self.a: np.array(actions),
self.returns: np.array(returns),
... | Python | 1 |
}
}
}
impl<K: FmtLabels + Hash + Eq> FmtMetrics for Registry<K> {
fn fmt_metrics(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let errors = match self.errors.lock() {
Ok(errors) => errors,
Err(_) => return Ok(()),
};
if errors.is_empty() {
... | Rust | 0 |
),
I16(i16),
I32(I32Node),
I64(i64),
U8(u8),
U16(u16),
U32(U32Node),
U64(u64),
F32(F32Node),
F64(f64),
Coord2d(Coordinates2DNode),
Coord3d(Coordinates3DNode),
Utf16(String),
Ascii(String),
Angle(i16),
/// Unknown Types
Unknown21(u32),
Unknown23(u8),
... | Rust | 0 |
# Copyright Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api
from odoo.addons.base.models.ir_module import Module
@api.model
def update_list(self):
"""
Mark auto_install modules as to install if all their dependencies are some kind of
... | Python | 1 |
root = Path(self.database_root)
ts = time.strftime("%Y%m%d-%H%M%S")
tmp_root = root / "tmp" / f"bundle_{protocol_name}_{ts}"
tmp_root.mkdir(parents=True, exist_ok=True)
bundle_dir = tmp_root / f"{protocol_name}.bvbundle"
(bundle_dir / "images").mkdir(parents=True, exist_... | Python | 1 |
md_result.stdout.trim().to_string();
}
pub fn get_user_home() -> String {
match env::var("HOME") {
Ok(x) => x,
Err(e) => {
println_stderr!("cicada: env HOME error: {}", e);
String::new()
}
}
}
pub fn get_config_dir() -> String {
if let Ok(x) = env::var("XDG_... | Rust | 0 |
: HashMap<&str, &str> = HashMap::new();
let mut classical_plural_of: HashMap<&str, &str> = HashMap::new();
let mut singular_of: HashMap<&str, &str> = HashMap::new();
let mut is_plural: Vec<&str> = vec![];
let mut is_singular: Vec<&str> = vec![];
for n in nouns.iter().filter_map(|n| match n {
... | Rust | 0 |
-4vMm2ytu') # vgg16.pkl
# Calculate features for reals.
cache_file = self._get_cache_file_for_reals(num_images=self.num_images)
os.makedirs(os.path.dirname(cache_file), exist_ok=True)
if os.path.isfile(cache_file):
ref_features = misc.load_pkl(cache_file)
else:
... | Python | 1 |
import sys
import numpy as np
moveDirection = {
0: [-1, 0],
1: [0, 1],
2: [1, 0],
3: [0, -1]
}
def getFormatedInput(inputFile):
return np.array([[ch for ch in line] for line in inputFile.split("\n")])
def getInitialPos(map):
initialPos = np.where(map == "^")
return initialPos[0][0], initi... | Python | 1 |
())?;
Ok(())
}
}
pub struct XContextMasking {}
impl Test for XContextMasking {
fn name(&self) -> &str { "XContext (masking)" }
fn level(&self) -> Level { Level::Weird }
fn values(&self) -> Vec<Box<dyn Any>> { Vec::new() }
fn run(&self, _value: &Box<dyn Any>) -> Result<(), String> {
... | Rust | 0 |
s = 1564,
SMHyperionCantinaProps = 1565,
SMHyperionMedLabProps = 1566,
SMHyperionMedLabProtossCryotube0HS = 1567,
SMHyperionMedLabProtossCryotube1HS = 1568,
SMHyperionMedLabProtossCryotube2HS = 1569,
SMHyperionMedLabProtossCryotube3HS = 1570,
SMHyperionMedLabProtossCryotube4HS = 1571,
SMHyperionMedLabProtossCry... | Rust | 0 |
#!/usr/bin/env python3
"""
Automated Profitability Telegram Alert Script
Sends profitability analysis reports to the same Telegram chat as live trading alerts.
"""
import asyncio
import sys
import os
import logging
from pathlib import Path
# Add project root to path
sys.path.append(str(Path(__file__).parent.parent))
... | Python | 1 |
id and slug_id, and returns the [`Slug`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///# let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let response = api_client.request(&SlugDetails::new("APP_ID", "SLUG_ID"));
///
///match response {
/// Ok(success) => println!("Success: {:#?}", ... | Rust | 0 |
alue
flops_sum += flops
else:
pred = model(z_in, t, cache_dic=cache_dic, current=current, **model_args).chunk(2, dim=1)[0]
pred_cond, pred_uncond = pred.chunk(2, dim=0)
v_pred = pred_uncond + guidance_scale * (pred_cond - pred_... | Python | 1 |
lf.temp1
sim_targets = torch.zeros(sim_i1_i2_m.size()).to(image.device)
sim_targets.fill_diagonal_(1)
sim_i1_i2_targets = self.alpha * F.softmax(sim_i1_i2_m, dim=1) + (1 - self.alpha) * sim_targets
sim_i2_i1_targets = self.alpha * F.softm... | Python | 1 |
if isinstance(value, str) and value:
current_objective = value
logger.debug(f"Objective updated from step {step_num} input: '{current_objective}'")
break
validated_steps_list.append(step)
if int... | Python | 1 |
lse`, all bits for `true`.
#[inline(always)]
pub fn cmp_nonnan(self, other: Self) -> Self {
Self(unsafe { _mm_cmpord_ps(self.0, other.0) })
}
/// as [cmp_nonnan](m128::cmp_nonnan), lowest lane only, other lanes copy `self`.
#[inline(always)]
pub fn cmp_nonnan_low(self, other: Self) -> Self {
Self(u... | Rust | 0 |
g = TestGroup::new("huge_tlb");
tg.add(vec![Box::new(wrong_tlb), Box::new(valid_tlb)]);
tg
}
<filename>bazelfe-protos/src/lib.rs<gh_stars>1-10
pub mod google {
pub mod devtools {
pub mod build {
pub mod v1 {
tonic::include_proto!("google.devtools.build.v1");
}... | Rust | 0 |
from django.db.backends.mysql.base import DatabaseOperations
from django.contrib.gis.db.backends.adapter import WKTAdapter
from django.contrib.gis.db.backends.base import BaseSpatialOperations
class MySQLOperations(DatabaseOperations, BaseSpatialOperations):
compiler_module = 'django.contrib.gis.db.models.sql.co... | Python | 1 |
;
const BVS :u8 = 0x70;
const BVC :u8 = 0x50;
const BPL :u8 = 0x10;
const LDA_IMM :u8 = 0xA9;
const LDA_ZPG :u8 = 0xA5;
const LDA_ZPG_X :u8 = 0xB5;
const LDY_ZPG :u8 = 0xA4;
const LDY_ZPG_X :u8 = 0xB4;
const LDX_ZPG :u8 = 0xA6;
const LDX_ZPG_Y :u8 = 0xB6;
impl CPU {
fn instructions() -> Vec<Vec<MicroFn>> {
... | Rust | 0 |
o_iter().collect(),
},
r#"{"values":[1,2,3,99]}"#,
);
#[serde_as]
#[derive(Debug, Serialize, Deserialize, PartialEq)]
struct Struct4 {
#[serde_as(as = "LinkedList<Same>")]
values: LinkedList<u32>,
};
is_equal(
Struct4 {
values: vec![1, 2, 3, 9... | Rust | 0 |
#[serde(rename = "400")]
N400,
/// Kenyan Shilling
#[serde(rename = "404")]
N404,
/// Kina
#[serde(rename = "598")]
N598,
/// Kip
#[serde(rename = "418")]
N418,
/// Kroon
#[serde(rename = "233")]
N233,
/// Kuna
#[serde(rename = "191")]
N191,
/// K... | Rust | 0 |
stics()
results[strategy] = {
"result": result,
"execution_time": execution_time,
"stats": stats
}
print(f" Execution time: {execution_time:.3f}s")
print(f" Result: {result[:80]}...")
print(f" Subsystems active: {sum(sta... | Python | 1 |
import os
import sys,re
import datetime
from datetime import datetime, timedelta
import json
import random
import platform
try:
import requests
except ImportError:
os.system('pip install requests')
import requests
try:
from colorama import Back, Fore, Fore, Style, init
except ImportError:
os.... | Python | 1 |
"date_range": (datetime(2024, 1, 1), datetime(2024, 1, 31)),
"fields": ["日期", "股票代碼", "價格"],
}
# 測試不同數據源
data_sources = ["交易記錄", "投資組合數據", "風險指標"]
for source in data_sources:
data = generate_mock_data(source, conditions)
# 驗證數據結構
as... | Python | 1 |
ints, dtype=np.float32)
center = selected_joints.mean(axis=0)[:2]
left_top = np.amin(selected_joints, axis=0)
right_bottom = np.amax(selected_joints, axis=0)
w = right_bottom[0] - left_top[0]
h = right_bottom[1] - left_top[1]
if w > self._aspect_ratio * h:
... | Python | 1 |
if i < 2
|| karaoke_line.line_start - DEFAULT_PREDISPLAY_DURATION
> karaoke_lines[i - 2].line_end
{
karaoke_line.line_start
} else {
karaoke_line.line_start - karaoke_lines[i - 2].line_end
};
std::cmp::m... | Rust | 0 |
#!/usr/bin/python3
common_elements = __import__('3-common_elements').common_elements
set_1 = { "Python", "C", "Javascript" }
set_2 = { "Bash", "C", "Ruby", "Perl" }
c_set = common_elements(set_1, set_2)
print(sorted(list(c_set)))
| Python | 1 |
);
assert_eq!(
tracker.align,
align_of::<$t1>(),
concat!("(tracker.align == align_of::<", stringify!($t1), ">())"),
);
}
};
(@member $tracker:ident, $t1:ty, $t2:ty, $($m1:ident).+, $m2:ident) => {
unsafe {
use st... | Rust | 0 |
from .inspireface import ImageStream, FaceExtended, FaceInformation, SessionCustomParameter, InspireFaceSession, \
launch, terminate, FeatureHubConfiguration, feature_hub_enable, feature_hub_disable, feature_comparison, \
FaceIdentity, feature_hub_set_search_threshold, feature_hub_face_insert, SearchResult, \
... | Python | 1 |
import numpy as np
# Part one
state = 'A'
steps = 12208951
tape = np.zeros(2*steps)
cursor = steps
for k in range(steps):
val = tape[cursor]
if state == 'A':
if val == 0:
tape[cursor] = 1
cursor += 1
state = 'B'
elif val == 1:
tape[cursor] = 0
... | Python | 1 |
cur_bytes_hex = binascii.b2a_hex(self.DexHeader.f.read(1))
length += 1
cur_bytes = int(cur_bytes_hex, 16)
value += cur_bytes_hex
array.append(value)
dexMethod = DexMethod()
dexMethod... | Python | 1 |
_manager_info, program_id)?;
assert_owned_by(accept_payment_info, &spl_token::id())?;
assert_owned_by(bidder_pot_token_info, &spl_token::id())?;
assert_owned_by(bidder_pot_info, &store.auction_program)?;
assert_owned_by(token_mint_info, &spl_token::id())?;
assert_owned_by(vault_info, &store.tok... | Rust | 0 |
}
/// Returns the largest `PacketNumber` stored in the AckRanges.
///
/// If no items are present in the set, `None` is returned.
pub fn max_value(&self) -> Option<PacketNumber> {
self.ack_ranges.max_value()
}
/// Clear the ack ranges and reset values
#[inline]
pub fn clear(&mu... | Rust | 0 |
inline]
pub fn limbs_equal_limbs_consttime(a: &[Limb], b: &[Limb]) -> LimbMask {
extern "C" {
fn LIMBS_equal(a: *const Limb, b: *const Limb, num_limbs: c::size_t) -> LimbMask;
}
assert_eq!(a.len(), b.len());
unsafe { LIMBS_equal(a.as_ptr(), b.as_ptr(), a.len()) }
}
#[inline]
pub fn limbs_less_... | Rust | 0 |
};
let sanity_check = matches.is_present(cli::ARG_SANITY_CHECK);
let full_verification = matches.is_present(cli::ARG_FULL_VERIFICATION);
Ok(ReplayArgs {
config,
consensus,
tmp_target,
profile,
sanity_check,
full_veri... | Rust | 0 |
= dataDict['target_x'][index], dataDict['target_y'][index]
# tgx[:,0] = scipy.ndimage.zoom( nputil.array2NDCube(tgx[:,0],N=), zoom_factor, order=1)
# tgy = scipy.ndimage.zoom( tgy, zoom_factor, order=1)
tgx = torch.from_numpy(dataDict['target_x'][index]).float()
tgy = torch.from_numpy(da... | Python | 1 |
#!/usr/bin/env python
import sys
import json
from lib.shell import run_command
def list_exchanges(vhost=None):
cmd = ['rabbitmqadmin', 'list', 'exchanges']
if vhost:
cmd += ['-V', vhost]
exit_code, stdout, stderr = run_command(cmd=cmd, shell=False)
if exit_code != 0:
msg = 'Comman... | Python | 1 |
decompress_from(buf, &mut decompression_buffer) {
Ok(bytes_out) => {
bytes_written += bytes_out;
decompression_buffer.truncate(bytes_written);
let mut as_buf = decompression_buffer.freeze().into_buf();
r... | Rust | 0 |
rd.y += 0.5;
""",
fragment_300="""
if (u_text_main == 1.0) {
gl_FragColor = texture2D(u__texture, v__coord) * gl_FragColor;
}
""",
u__texture="#800080",
u__scale=(1.0, 1.0),
doc="""
Multiplies the text with a texture, one line at a time. The texture is aligned with
the... | Python | 1 |
_buf()?;
let len = buf.len(); // Must be stored in variable to avoid borrow error
if len == 0 {
// no bytes read indicate EOF.
break;
}
piped_bytes += len as u32;
buffered_writer.write_all(buf)?;
buffered_trimmed_reader.consume(len);
}
buff... | Rust | 0 |
from eth_utils import (
int_to_big_endian,
)
from eth.abc import (
TransientStorageAPI,
)
from eth.db.backends.memory import (
MemoryDB,
)
from eth.db.journal import (
JournalDB,
)
from eth.typing import (
Address,
JournalDBCheckpoint,
)
from eth.validation import (
validate_canonical_addre... | Python | 1 |
up_module_auto_defines.cpp",
"src/main.cpp",
"src/methods.cpp",
"src/ice/src/ice_library_manager.cpp",
"src/ice/src/ice_library_name.cpp",
"src/ice/src/ice_library.cpp",
],
extra_compile_args=get_ics_extension_compiler_arguments(),
)
package_data = {}
if "DARWIN" in plat... | Python | 1 |
w();
while start_time.elapsed() <= *max_polling_duration {
if let Ok(num_devices) = self.update_devices() {
let plural = if num_devices == 1 { "" } else { "s" };
trace!("{} Remote Wallet{} found", num_devices, plural);
return true;
}
... | Rust | 0 |
bad79270c1520673fa6266a3d/tracing-error/src/layer.rs
pub(crate) struct WithContext(
fn(&tracing::Dispatch, &span::Id, f: &mut dyn FnMut(&mut api::SpanBuilder, &dyn api::Sampler)),
);
impl WithContext {
// This function allows a function to be called in the context of the
// "remembered" subscriber.
pub... | Rust | 0 |
Result<SpannedExpression, ParseError>;
fn name(&self) -> &'static str {
"glob pattern"
}
fn expand<'a, 'b>(
&self,
token_nodes: &mut TokensIterator<'_>,
) -> Result<hir::SpannedExpression, ParseError> {
let (inner, outer) = token_nodes
.expand_syntax(BarePa... | Rust | 0 |
with tempfile.NamedTemporaryFile(delete=False, suffix="_pcm.wav") as pcm_tmp:
pcm_path = pcm_tmp.name
try:
subprocess.run([
"ffmpeg", "-y", "-i", tts_path, "-ar", "44100", "-ac", "1", "-sample_fmt", "s16", pcm_path
], check=True, capture_output=True)
... | Python | 1 |
# === Funções Anônimas (Lambda) ===
# Exemplo de função lambda: calcula o dobro de um número
dobro = lambda x: x * 2
# Testando a função lambda com o valor 4
print(dobro(4)) # Saída: 8
# Explicação: A função 'dobro' recebe 4 e retorna 8.
# Usando lambda em uma função de alta ordem
valores = [1, 2, 3, 4]
# Usa map pa... | Python | 1 |
import setup_path
import airsim
import os
import tempfile
CAM_NAME = "fixed1"
IS_EXTERNAL_CAM = True
client = airsim.VehicleClient()
client.confirmConnection()
tmp_dir = os.path.join(tempfile.gettempdir(), "airsim_cv_mode")
print ("Saving images to %s" % tmp_dir)
try:
os.makedirs(tmp_dir)
except OSError:
... | Python | 1 |
ightArrow,
LeftArrow,
// modules
Export,
Import,
As,
// logical operators
Amp,
Bang,
BangEqual,
Equal,
EqualEqual,
Greater,
GreaterEqual,
Less,
LessEqual,
// sequences
Identifier,
String,
StringStart,
StringSegment,
StringEnd,
Number,
// keywords
And,
Class,
Else,... | Rust | 0 |
adageId="123550",
adageInscriptionDate=date_utils.get_naive_utc_now() - timedelta(days=3),
venueEducationalStatusId=next(educational_status_iterator),
collectiveInterventionArea=ALL_INTERVENTION_AREA,
departementCode="33",
postalCode="33000",
city="Bordeaux",
... | Python | 1 |
`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [audiosink_period_cnt](audiosink_period_cnt) module"]
pub type AUDIOSINK_PERIOD_CNT = crate::Reg<u32, _AUDIOSINK_PERIOD_CNT>;
#[allow(missing_docs)]
#[doc(hidden)]
pub stru... | Rust | 0 |
not found", uri))));
}
Ok(indv)
}
// https://leetcode-cn.com/problems/get-watched-videos-by-your-friends/
// Runtime: 28 ms
// Memory Usage: 3.1 MB
use std::collections::{HashMap, VecDeque};
pub fn watched_videos_by_friends(
watched_videos: Vec<Vec<String>>,
friends: Vec<Vec<i32>>,
id: i32,
lev... | Rust | 0 |
fields.keys().collect()
}
pub fn field(&self, name: Symbol<'src>) -> Option<Rc<ClassFieldDef<'src>>> {
self.fields.get(&name).map(Rc::clone)
}
pub fn iter_fields<'a>(&'a self) -> impl Iterator<Item = Rc<ClassFieldDef<'src>>> + 'a {
self.fields.iter().map(|(_, c)| Rc::clone(c))
}
... | Rust | 0 |
.pending = None; // release buf reference
let buf: &'static mut Vec<u8> = unsafe { &mut *(self.buf as *mut _) };
self.pending = Some(self.inner.read_event(buf)?);
Ok(())
}
fn peek(&mut self) -> Result<Event<'a>> {
if self.pending.is_none() {
self.shift()?;
}
Ok(self.pending.clone().expect("can't be No... | Rust | 0 |
{ { inc; p24; },{ dec; p4; } -> { p24; } };
{ { inc; p25; },{ dec; p4; } -> { p25; } };
{ { inc; p26; },{ dec; p4; } -> { p26; } };
{ { inc; p27; },{ dec; p4; } -> { p27; } };
{ { inc; p28; },{ dec; p4; } -> { p28; } };
{ { inc; p29; },{ dec; p4; } -> { p29; } };
{ { inc; p30; },{ dec; p4; } -> { p30; } };
{ {... | Rust | 0 |
"""
This file contains one of several implementations of the function
`simplify_ztz(sentence, verbose=False)` that we considered.
Refs:
https://spacy.io/usage/spacy-101/
For spacy, here are some values of token.dep_
cc: coordinating conjunction.
i.e., FANBOYS = for, and, nor, but, or, yet, so
mark: marker that... | Python | 1 |
#Import required libraries
import numpy as np
import pandas as pd
from keras.optimizers import SGD
from keras.datasets import cifar10
from keras.models import Sequential
from keras.utils import np_utils as utils
from keras.layers import Dropout, Dense, Flatten
from keras.layers.convolutional import Conv2D, MaxPooling2D... | Python | 1 |
.public:
return
if 'x' not in tv.private:
return
if tv.public.get('kty') != 'OKP':
return
if tv.public.get('crv') != 'X25519':
return
if tv.private.get('crv') != 'X25519':
return
... | Python | 1 |
_is_id_valid(&mymap, &"SOLENOID".to_string())
);
assert_eq!(
AxialError::ReservedWordError("*".to_string()),
_is_id_valid(&mymap, &"*".to_string())
);
}
#[test]
fn _test_is_id_valid_hash_map_cotains() {
let mut mymap: HashMap<String, Primitives> ... | Rust | 0 |
{
return format!("{}{} mins", prefix, self.total_mins);
}
format!("{}{} secs", prefix, self.total_secs)
}
pub fn print_as_duration(&self){
conz::print_type("Significant: ", conz::MsgType::Normal);
conz::println_type(self.string_significant(true), conz::MsgType::Value... | Rust | 0 |
class Solution:
def mergeAlternately(self, word1: str, word2: str) -> str:
merged=[]
min_length=min(len(word1), len(word2))
for i in range(min_length):
merged.append(word1[i])
merged.append(word2[i])
merged.append(word1[min_length:])
merged.appe... | Python | 1 |
# form spurs
from dataclasses import dataclass
import torch
from spurs.models import register_model
from spurs.models.stability.basemodel import BaseModel
from spurs.datamodules.datasets.data_utils import Alphabet
# from .decoder import MPNNSequenceDecoder
# from .encoder import MPNNEncoder
@dataclass
class Protei... | Python | 1 |
with st.spinner("Generating audio..."):
audio_data = morse_to_audio(morse_input, wpm=wpm, frequency=frequency)
if len(audio_data) > 0:
audio_html, wav_data = create_audio_player(audio_data)
... | Python | 1 |
\n Stop location : \x1b[0m%s(), %s:%u\n\n\x00"
as *const u8 as *const libc::c_char,
b"func_unknown\x00" as *const u8 as *const libc::c_char,
b"include/alloc-inl.h\x00" as *const u8 as *const libc::c_char,
94 as libc::c_int);
abort();
}
r... | Rust | 0 |
#!/usr/bin/python3
MyList = __import__('1-my_list').MyList
my_list = MyList()
my_list.append(1)
my_list.append(4)
my_list.append(2)
my_list.append(3)
my_list.append(5)
print(my_list)
my_list.print_sorted()
print(my_list)
| Python | 1 |
sh: u64) {
self.wait_table
.borrow_mut()
.remove_waiter(start_ts, lock)
.and_then(|waiter| {
let pr = ProcessResult::Failed {
err: StorageError::from(TxnError::from(MvccError::from(
MvccErrorInner::Deadlock {
... | Rust | 0 |
from blkjx.qlearn import observe, QLearn, _deal
from blkjx.blackjack import Game
from blkjx.utils import cards_from_str as c, rank_from_str as r
from beartype.claw import beartype_package
import jax
import jax.numpy as jnp
beartype_package("blkjx")
def test_observe_jits():
key = jax.random.key(0)
game = Gam... | Python | 1 |
el")
return
elif search_spam[0] is True:
message.reply_text("Please wait untill finish the pervious search then request again")
return
msg = message.reply_text("Wait this operation takes so much time...").id
search_spam[0] = True
... | Python | 1 |
ine: usize,
// column: usize,
// }
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use serde::{Deserialize, Serialize};
use crate::schema::heroes;
#[derive(Serialize, Queryable)]
pub struct Hero {
pub id: i32,
pub name: String,
pub identity: String,
pub hometown: String,
pub age:... | Rust | 0 |
ase(1, degToRad(sender.floatValue()))
self.drawGraph()
@objc.IBAction
def phaseDisplay2_(self, sender):
self.graphModel.setPhase(2, degToRad(sender.floatValue()))
self.drawGraph()
@objc.IBAction
def phaseSlider0_(self, sender):
self.graphModel.setPhase(0, degToRad(sende... | Python | 1 |
ULL_RIDDEN.bytes(), BufferType::Bytes(128)),
None,
);
io::copy(&mut r, &mut io::sink()).ok();
});
b.bytes = NULL_RIDDEN.len() as u64;
}
#[bench]
fn bytes_token_producer_bytes_token_reader_throughput(b: &mut test::Bencher) {
let mut ncb = 0u64;
b.iter(|| {
let mut r =... | Rust | 0 |
glob.markers
themes = _glob.themes
test = _glob.test
version = __version__
platform = _ut.platform
##############################################
############ Docstrings ###############
##############################################
add(subplots)
add(subplot)
add(main)
add(active)
add(inte... | Python | 1 |
# -*- coding: utf-8 -*-
"""Test core."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
import shutil
from ..format_manager import FormatManager, format_manager
from ...uti... | Python | 1 |
R[1]*R.y + R[2]*R.z)
genericpointP = origin.locatenew('PP', P[0]*P.x + P[1]*P.y + P[2]*P.z)
assert scalar_potential_difference(S.Zero, R, point1, point2, \
origin) == 0
assert scalar_potential_difference(scalar_field, R, origin, \
... | Python | 1 |
r-198 cz0.259 AUz 49.6 dayszKepler-198 dzKepler-199 bz0.158 AUzKepler-199 cz 67.1 dayszKepler-19 bz717.0z2.209gbKP0@zKepler-19 czKepler-19 dz22.5g8m4@giQ!@zKepler-200 bzKepler-200 cgffffff$@zKepler-201 bz0.175 AUz 25.7 dayszKepler-201 cz0.573 AUz
151.9 dayszKepler-202 bz938.0zKepler-202 cgL0@zKepl... | Python | 1 |
let module_hash = track_any_err!(u128::from_str_radix(&module_hash, 16))?;
// epochs
let epochs = track_assert_some!(array[1].as_i64(), Failed) as u8;
// adjacency
let raw_adjacency = track_assert_some!(array[2].as_str(), Failed);
let adjacency = track!(raw_adjacency.pa... | Rust | 0 |
d"] == "build":
if (args["input"] is not None) ^ args["case_optimization"] :
raise MFCException("./mfc.sh build's --case-optimization and --input must be used together.")
if args["command"] == "run":
if args["binary"] is not None and args["engine"] != "interactive":
raise MFC... | Python | 1 |
import torch.nn as nn
class Classifier(nn.Module):
def __init__(self, num_classes: int = 10):
super(Classifier, self).__init__()
# Convolutional layers
self.conv_blocks = nn.ModuleList(
[
nn.Sequential(
nn.Conv2d(3, 32, kernel_size=(3, 3), p... | Python | 1 |
% self.verbose_interval == 0:
if self.verbose == 1:
print(" Iteration %d" % n_iter)
elif self.verbose >= 2:
cur_time = time()
print(
" Iteration %d\t time lapse %.5fs\t ll change %.5f"
% (n_iter, cur_time -... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.