text string | label_name string | labels int64 |
|---|---|---|
33,
2.094395,
3.137121,
float("nan"),
0.004472,
1.047198,
1.230959,
1.318116,
],
"asin": [
-0.25268,
-0.339837,
-0.523599,
... | Python | 1 |
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If fa... | Python | 1 |
h = 30, step=0, tag='kpt_y')
dpg.add_text(" x ")
dpg.add_input_int(callback=_log, width = 30, step=0, tag='kpt_z')
dpg.add_button(label="Submit!", callback=submit_button_2)
pass
with dpg.window(label="Input File Download", pos=(500,400), width=500, height=400, no_collapse=True, tag = "input_fil... | Python | 1 |
eats, sr=sr).tolist()
# 更新节拍对齐率
def _update_beat_alignment(
self, ref_k: Keypoints, cam_k: Keypoints, t: float
) -> float:
def _vel_buf(buf: List[np.ndarray], k_prev: Keypoints, k_curr: Keypoints):
vel = _motion_vec(k_prev, k_curr) if k_prev is not None else np.zeros(k_curr.size... | Python | 1 |
01, '▼クエスト報告画面1章中間(オーレリア)少', 0x00000065)
MenuCmd(0x01, 0x01, '▼クエスト報告画面1章中間(オーレリア)多', 0x00000066)
MenuCmd(0x01, 0x01, '▼クエスト報告画面1章中間(ミハイル)多', 0x00000067)
MenuCmd(0x01, 0x01, '▼クエスト報告画面1章終了(オーレリア)(報告済のクエスト一覧)', 0x00000068)
MenuCmd(0x01, 0x01, '▼クエスト報告画面(中間)(多数)', 0x00000069)
MenuCmd(0x01, 0x01, '▼クエス... | Python | 1 |
import numpy as np
from bmtk.builder import NetworkBuilder
from bmtk.builder.auxi.node_params import positions_columinar, xiter_random
from bmtk.builder.auxi.edge_connectors import distance_connector
import logging
logger = logging.getLogger(__name__)
np.random.seed(10)
n_nodes = 200
column = NetworkBuilder('column... | Python | 1 |
import argparse
from upydev import name as uname, version as uversion
from upydev.shell.constants import SHELL_CMD_DICT_PARSER
rawfmt = argparse.RawTextHelpFormatter
usag = """command [options]\n
This means that if the first argument [command] is not a registered
command it is redirected to the underlying system shel... | Python | 1 |
return user == admin_user and reaction.message.id == confirmation_message.id and str(reaction.emoji) == EMOJI_APPROVE
try:
await interaction.client.wait_for("reaction_add", check=check_second, timeout=60.0)
await kick_m... | Python | 1 |
}
};
let status = cipd::download(url.clone(), &cipd_zip).await?;
if status == StatusCode::OK {
cipd::extract_zip(&cipd_zip, &unzipped_root, false /* debug */)?;
Ok(unzipped_root)
} else {
Err(format_err!(
... | Rust | 0 |
docs(nil):
gen_cli_docs_path = (project_dir / "tools/docs/gen_cli_docs.py").resolve()
os.system("%s %s" % (gen_cli_docs_path, project_dir / "docs"))
def setup(app):
app.connect("builder-inited", generate_cli_docs)
# Setup libraries documentation snippets for use in rockcraft docs.
common_docs_path = pat... | Python | 1 |
// C API: `void console_printint(int i)`
pub fn printint(v: i32) { unsafe { console_printint(v); } }
/// Write a float to the output buffer, with 2 decimal places.
pub fn printfloat(v: f32) { unsafe { console_printfloat(v); } }
/// Write a double to the output buffer, with 6 decimal p... | Rust | 0 |
LE
const K3T: usize = 0x00c0; // 0.375 * 2^RATIO_SCALE
const B3T: usize = 0x023f; // 0.0351 * 2^LUX_SCALE
const M3T: usize = 0x037b; // 0.0544 * 2^LUX_SCALE
const K4T: usize = 0x0100; // 0.50 * 2^RATIO_SCALE
const B4T: usize = 0x0270; // 0.0381 * 2^LUX_SCALE
const M4T: usize = 0x03fe; // 0.0624 * 2^LUX_SCALE
const K5T:... | Rust | 0 |
Struct__GByteArray {
fn default() -> Struct__GByteArray { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Clone,Copy)]
pub struct Struct__GPtrArray {
pub pdata: *mut gpointer,
pub len: guint,
}
impl ::std::default::Default for Struct__GPtrArray {
fn default() -> Struct__GPtrArray { unsafe { ::st... | Rust | 0 |
unixTime(sec, int32!(nsec))
}
/// UnixMilli returns the local Time corresponding to the given Unix time, msec milliseconds since January 1, 1970 UTC.
///
/// <details class="rustdoc-toggle top-doc">
/// <summary class="docblock">zh-cn</summary>
/// UnixMilli返回与给定的Unix时间相对应的本地时间,自1970年1月1日UTC以来的毫秒数。
/// </details>
... | Rust | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.db.models import Count
import json
def maintainers_from_property(apps, schema_editor):
# We can't import the models directly as they may be a newer
# version than this migration expects. We use the hi... | Python | 1 |
, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P}
define_join! {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q}
define_join! {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R}
define_join! {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S}
define_join! {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S... | Rust | 0 |
import torch
from torch.nn import CrossEntropyLoss
from avalanche.evaluation.metrics import (
accuracy_metrics,
forgetting_metrics,
loss_metrics
)
from avalanche.training.plugins import EvaluationPlugin
from models import MultiHeadVGGSmall
from experiments.utils import set_seed, create_default_args
import ... | Python | 1 |
fn div(&self, _rhs: Value, _m: &mut Machine) -> Value {
Value::Null
}
fn not(&self, _m: &mut Machine) -> bool {
false
}
fn isa(&self, s: String, m: &mut Machine) -> bool {
self.typename(m) == s
}
}
pub mod builtin;
pub mod convert;
pub mod global;
pub mod runtime;
pub mod w... | Rust | 0 |
s_train=True, n_threads=len(args.gpu_ids.split(',')))
dev_loader = create_dataloader(args, dev_list, is_train=False, n_threads=len(args.gpu_ids.split(',')))
#### create model
model = SRGANModel(args, is_train=True)
if resume_state is not None:
model.load()
#### resume training
if resum... | Python | 1 |
ome((source_file, line, pattern))) => {
assert_eq!(m.pattern.to_string(), pattern);
assert_eq!(m.sequence_number, line);
// Paths read from the index are relative to the repo, and they don't exist locally due tot skip-worktree
if m.source.map_or(false, |p|... | Rust | 0 |
[inline(always)]
pub fn value1(self) -> &'a mut W {
self.variant(REV1NP_A::VALUE1)
}
#[doc = "Select service request line 3 of group x"]
#[inline(always)]
pub fn value2(self) -> &'a mut W {
self.variant(REV1NP_A::VALUE2)
}
#[doc = "Select shared service request line 0"]
#... | Rust | 0 |
ither multiply by 10 if no solution found yet
# or do binary search with the known upper bound
lower_bound[e] = max(lower_bound[e],CONST[e])
if upper_bound[e] < 1e9:
CONST[e] = (lower_bound[e] + upper_bound[e])/2
... | Python | 1 |
)
if dataset == 'cinic-10':
trainset = torchvision.datasets.ImageFolder(root + '/cinic-10/trainval', transform=transform_train)
testset = torchvision.datasets.ImageFolder(root + '/cinic-10/test', transform=transform_test)
if dataset == 'tiny_imagenet':
trainset = torchvision.datasets.I... | Python | 1 |
_add(op.length as u16));
let addr = get_op8(s, op1) as u16;
s.r.PC = addr;
s.r.MEMPTR = addr;
update_pc = false;
}
Instruction::SLA => {
let op1 = op.op1.ok_or("SLA missing op1")?;
let val = get_op8(s, op1);
let cp = val... | Rust | 0 |
self_size
}
fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
let rects = ctx.region().rects().to_vec();
for rect in &rects {
ctx.fill(
rect,
data.config
.get_color_unchecked(LapceTheme::EDITOR_BACKG... | Rust | 0 |
use serde_json::Value;
let mut value = Value::deserialize(deserializer)?;
if let Some(inner) = value.get_mut("and") {
let inner_predicates: Vec<Box<Predicate>> =
serde_json::from_value(inner.take()).map_err(serde::de::Error::custom)?;
return Ok(Predicate::A... | Rust | 0 |
from . import views
from django.urls import path
urlpatterns = [
path('', views.index, name='blog_index'),
path('blog/archive/api/<int:post_id>', views.archive_blog_post, name='blog_archive'),
path('blog/restore/api/<int:post_id>', views.restore_blog_post, name='blog_restore'),
] | Python | 1 |
tion",
# "Executive Summary": "a brief document that summarizes a longer report or proposal, highlighting key points for quick review",
# "User Guide": "a technical communication document that assists people in using a particular system or product",
# "Marketing Copy": "persuasive writing designed to promot... | Python | 1 |
出与隐藏的过程在接收者中产生了框架效应,从而使目标域被“源域的扭曲镜头”所观察到。
4. 解释性隐喻(Explanation)
这些隐喻用于教学目的。意图是向接收者解释一个新的或已经熟悉的概念。 在这一过程中,话语通常涉及从专家到非专家的知识不对称,例如从老师到学生。
例子:
(a) 大气层是包围地球的气体毯。
(b) 当中子崩解,吐出一个电子,它就变成了质子。
5. 论证性隐喻(Argumentative metaphor)
这些隐喻是明确论据的一部分,作者旨在通过隐喻说服受众接受某种... | Python | 1 |
>,
_to: Option<AccountId>,
_id: Id,
_amount: Balance,
);
fn _emit_approval_for_all_event(&self, _owner: AccountId, _operator: AccountId, _approved: bool);
fn _emit_transfer_batch_event(
&self,
_operator: AccountId,
_from: Option<AccountId>,
_to: Opti... | Rust | 0 |
!(len.0 == 1, take!(len.1)) >>
( {
let len : u64 = match len.0 {
0 => u64::from(len.1),
_ => {
// if len is 0xff -> error (8.1.3.5)
if len.1 == 0b0111_1111 {
return Err(::nom::Err::Error(BerError::Invalid... | Rust | 0 |
&str = "\u{f06e}";
pub const EYE_DROPPER: &str = "\u{f1fb}";
pub const EYE_SLASH: &str = "\u{f070}";
pub const FAN: &str = "\u{f863}";
pub const FAST_BACKWARD: &str = "\u{f049}";
pub const FAST_FORWARD: &str = "\u{f050}";
pub const FAUCET: &str = "\u{e005}";
pub const FAX: &str = "\u{f1ac}";
pub const FEATHER: &str = ... | Rust | 0 |
pub fn GetMusicTimePlayed(music: Music) -> f32;
pub fn InitAudioStream(
sampleRate: ::std::os::raw::c_uint,
sampleSize: ::std::os::raw::c_uint,
channels: ::std::os::raw::c_uint,
) -> AudioStream;
pub fn UpdateAudioStream(
stream: AudioStream,
data: *const ::std::o... | Rust | 0 |
bm_range_limit = 19000000 # 19 000 km is the limit for the ballistic missile range
dist_limit = 20000000 # 20 000 km is the limit for the distance from MLP to ILP (half of the Earth circumference length)
R_N = 1. # see also formulas with mu/ in balmis
R_e0 = 6.37e6
R_e = R_N * R_e0
sat_delay = 30
no_atmosphere =... | Python | 1 |
features
def get_info(self) -> Dict[str, Any]:
"""
Get information about pySLAM integration status.
Returns:
Dictionary with integration information
"""
info = {
'pyslam_available': self.available,
'current_config': {
'det... | Python | 1 |
plit}_accuracy_{subject}'] = subject_score
subject_scores.append(subject_score)
results[f'mmlu_{args.mmlu_split}_accuracy'] = np.mean(subject_scores)
trainer.log(results)
trainer.data_collator.source_max_len = source_max_len
trainer.add_callba... | Python | 1 |
delta_out, recurrent_state = _delta_rule_chunkwise(q_d, k_d, v_d, beta_d)
delta_out = rearrange(delta_out, "b h l d -> b l h d")
# ---- FIR branches ----
v_direct = v # identity path
fir_s = self.fir_short(v_direct)
fir_m = self.fir_mid(v_direct)
fir_l = self.fir_long(... | Python | 1 |
# Copyright (c) 2022 PaddlePaddle Authors. 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 required by applic... | Python | 1 |
'ru': 'атикамек', 'sc': 'atikamekw', 'sd': 'اٽيڪاميڪو', 'sd-Arab': 'اٽيڪاميڪو', 'si': 'ඇටිකමෙක්ව්', 'sk': 'atikamekwčina', 'sl': 'atikamekwščina', 'so': 'Atikamekw', 'sq': 'atikamekisht', 'sr': 'атикамеку', 'sr-Cyrl': 'атикамеку', 'sr-Latn': 'atikameku', 'sv': 'atikamekw', 'sw': 'Kiatikamekw', 'ta': 'அடிகாமேக்வ்', 'te'... | Python | 1 |
o_bin("pio")?
.arg(input)
.arg("-o")
.arg(&output)
.assert()
.success();
assert_image_similarity(input, output)?;
Ok(())
}
#[test]
fn does_not_create_empty_output_on_invalid_input() -> Result<(), Box<dyn std::error::Error>> {
... | Rust | 0 |
sdcard_inserted: Some(true),
ui_confirm_create: Some(Box::new(|params| {
match unsafe {
UI_COUNTER += 1;
UI_COUNTER
} {
1 => assert_eq!(params.body, "<date>"),
2 => assert_eq!(params.... | Rust | 0 |
import warnings
from ase.build import add_adsorbate, fcc111
def test_atoms_formula():
# some random system
slab = fcc111('Al', size=(2, 2, 3))
add_adsorbate(slab, 'C', 2.5, 'bridge')
add_adsorbate(slab, 'C', 3.5, 'bridge')
add_adsorbate(slab, 'H', 1.5, 'ontop')
add_adsorbate(slab, 'H', 1.5, ... | Python | 1 |
from collections import OrderedDict
from mmcv.runner.checkpoint import _load_checkpoint, load_state_dict
def load_checkpoint(model,
filename,
map_location='cpu',
strict=False,
logger=None):
"""Load checkpoint from a file or URI.
... | Python | 1 |
) {
sum += self.code[j];
j += 1;
if sum == target_sum {
return Some(&self.code[i..j]);
}
}
}
None
}
}
fn solve(input: &str, window_len: usize) -> (u64, u64) {
let code: Vec<_> = input.lines().map(|s|... | Rust | 0 |
None,
Some(PendSV),
Some(SysTick),
// 0 - Device-specific interrupts
Some(WDT),
Some(DMA),
Some(GINT0),
Some(GINT1),
Some(PIN_INT0),
Some(PIN_INT1),
Some(PIN_INT2),
Some(PIN_INT3),
Some(UTICK),
Some(MRT),
// 10
Some({
extern "C" {
fn CTIMER... | Rust | 0 |
turn Vecs(x[..., 0], x[..., 1], x[..., 2])
def vecs_robust_normalize(v: Vecs, epsilon: float = 1e-8) -> Vecs:
"""Normalizes vectors 'v'.
Args:
v: vectors to be normalized.
epsilon: small regularizer added to squared norm before taking square root.
Returns:
normalized vectors
"""
norms = vecs_ro... | Python | 1 |
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Twist
from std_msgs.msg import Empty
D_LIDER = 1.0
DIST_FL = 1.0
DIST_FR = 1.0
DIST_R = 1.0
D_D = 1.0
def callback_laser(data):
global D_LIDER
global DIST_FL
global DIST_FR
global DIST_R
D_LIDE... | Python | 1 |
add n/2 to the numerator.
// Effectively b (size_factor here) is an exponential moving
// estimate of the "sum" of x (gc.len()) over the window as opposed
// to the "average".
self.recycler.size_factor.store(
self.recycler
.size_factor... | Rust | 0 |
lect();
// let mut prev_char: char = '^';
let mut prev_str: String = "".to_string();
// Reverse Polish notation
let mut rpn_stack:Vec<String> = vec![];
let mut operate_stack:Vec<String> = vec![];
for i in 0..char_arr.len() as usize {
let mut next_char = '$';
if i < char_arr.len()... | Rust | 0 |
mut a: u64, mut b: u64) -> Palindrome {
if a > b {
std::mem::swap(&mut a, &mut b);
}
Palindrome {
factors: vec![(a, b)],
}
}
/// Return the palindrome's value
pub fn value(&self) -> u64 {
// this could in theory panic with a bounds error, but ... | Rust | 0 |
}
}
}
}
fn handle_new_transaction(tx: &Transaction) {
const UP_TO_DATE: () = ();
let latest_tx_id_utf8 = &tx.id;
let id_storage = sp_runtime::offchain::storage::StorageValueRef::persistent(
b"stellar-bridge:la... | Rust | 0 |
}
#[inline]
#[allow(dead_code)]
pub(crate) fn get_page_size(&mut self) -> u32 {
self.0.get_u32(PAGE_SIZE_OFFSET)
}
#[inline]
pub(crate) fn get_null_page_bar(&self) -> u32 {
self.0.get_u32(NULL_PAGE_BAR_OFFSET)
}
#[inline]
pub(crate) fn set_null_page_bar(&mut self,... | Rust | 0 |
adx=(0,20))
btn_queue = tk.Button(top_frame, text="Queue", command=show_queue)
btn_queue.pack(side=tk.LEFT,padx=(0,20))
# Create frame for bottom
verticalScroll = tk.Frame(middle_framee)
verticalScroll.pack(fill="both", expand=True, side="bottom")
#Add a canvas for the scroll feature
verticalCanvas = tk.Canvas(vertic... | Python | 1 |
import pytest
from classes import Login, Update_Login
from login import post_login, delete_login, put_login
from typing import *
login_input = "input"
password_input = "password"
email_input = "email@mail.ru"
@pytest.fixture
def login(): # функция, которая берёт ключи из класса Login и присваивает им значения
re... | Python | 1 |
: ::DWORD = 11022;
pub const WSA_QOS_EFLOWCOUNT: ::DWORD = 11023;
pub const WSA_QOS_EUNKOWNPSOBJ: ::DWORD = 11024;
pub const WSA_QOS_EPOLICYOBJ: ::DWORD = 11025;
pub const WSA_QOS_EFLOWDESC: ::DWORD = 11026;
pub const WSA_QOS_EPSFLOWSPEC: ::DWORD = 11027;
pub const WSA_QOS_EPSFILTERSPEC: ::DWORD = 11028;
pub const WSA_... | Rust | 0 |
# 'high': '最高价',
# 'low': '最低价',
'close': '收盘价',
# 'turnover': '换手率',
# 'chg_rel': '涨跌幅',
'next_low': '明日_最低价',
#'next_low_pred': '明日_最低价_预测值',
'next_low_ln_rate': '明日_最低价幅',... | Python | 1 |
de";
let b2 = b"";
res = levenshtein_exp(a2, b2);
assert!(res == 5);
let a3 = b"abcde";
let b3 = b"abcdee";
res = levenshtein_exp(a3, b3);
assert!(res == 1);
let a4 = b"abcde";
let b4 = b"acde";
res = levenshtein_exp(a4, b4);
assert!(res == 1);
let a5 = b"abcde";
l... | Rust | 0 |
ple items ==> un-escape the concatenation.
return self._unescape(list(ctx.getChildren()))
def _unescape(
self,
seq: List[Union[TerminalNode, OmegaConfGrammarParser.InterpolationContext]],
) -> str:
"""
Concatenate all symbols / interpolations in `seq`, unescaping symbols... | Python | 1 |
/// prebind checksum
LC_PREBIND_CKSUM = 0x17,
/// load a dynamically linked shared library that is allowed to be missing
/// (all symbols are weak imported).
LC_LOAD_WEAK_DYLIB = (0x18 | LC_REQ_DYLD),
/// 64-bit segment of this file to be mapped
LC_SEGMENT_64 = 0x19,
/// 64-bit image rout... | Rust | 0 |
from io import StringIO
import numpy as np
import pytest
from pandas import (
DataFrame,
concat,
read_csv,
)
import pandas._testing as tm
class TestInvalidConcat:
@pytest.mark.parametrize("obj", [1, {}, [1, 2], (1, 2)])
def test_concat_invalid(self, obj):
# trying to concat a ndframe wit... | Python | 1 |
from omnigibson.object_states.object_state_base import REGISTERED_OBJECT_STATES
from omnigibson.object_states.aabb import AABB
from omnigibson.object_states.adjacency import HorizontalAdjacency, VerticalAdjacency
from omnigibson.object_states.attached_to import AttachedTo
from omnigibson.object_states.burnt import Burn... | Python | 1 |
h will be modified to an error code should one occur, may not be null. Functions
/// as an out parameter.
///
/// ## Returns
/// `c_ulonglong` - Returns minimum fee per gram
///
/// # Safety
/// None
#[no_mangle]
pub unsafe extern "C" fn fee_per_gram_stat_get_min_fee_per_gram(
fee_per_gram_stat: *mut TariFeePerGram... | Rust | 0 |
if attention_mask is None:
attention_mask = input_ids.new_ones(input_ids.shape)
# first step, decoder_cached_states are empty
return {
"input_ids": input_ids, # encoder_outputs is defined. input_ids not needed
"attention_mask": attention_mask,
... | Python | 1 |
let &mut (ref mut a, ref mut b, ref mut c) = self;
a.finalize();
b.finalize();
c.finalize();
}
}
impl<A:Finalize,B:Finalize,C:Finalize,D:Finalize> Finalize for (A,B,C,D) {
fn finalize(&mut self) {
let &mut (ref mut a, ref mut b, ref mut c, ref mut d) = self;
a.finalize()... | Rust | 0 |
ec_s16, DEC!()); // max: -32768
int_writer_signed!(FORMAT_ITEM_DEC32S, 4, 12, format_item_dec_s32, DEC!()); // max: -2147483648
int_writer_signed!(FORMAT_ITEM_DEC64S, 8, 21, format_item_dec_s64, DEC!()); // max: -9223372036854775808
#[test]
fn test_sign_extend() {
assert_eq!(
0xffff_ffff_ffff_ff80u64 as i6... | Rust | 0 |
"""
Programa feito para calculo de gradiente e hessiana de uma função
"""
import sympy as sp
u, v = sp.symbols("u v")
ro1 = 0.82
ro2 = 0.52
EA1 = 12
L1 = 12
EA2 = 80
L2 = 8
P1 = (0.5 * ro1 * L1) + (0.5 * ro2 * L2)
f = (
0.5 * (EA1 / L1) * (((L1 + u) ** 2 + v**2) ** (1 / 2) - L1) ** 2
+ 0.5 * (EA2 / L2) * ... | Python | 1 |
his_time_value(this, context)?;
result.$name(
$(
args
.get($e)
.and_then(|value| {
value.to_numeric_number(context).map_or_else(
|_| None,
... | Rust | 0 |
credentials = cache.as_ref().and_then(Cache::credentials);
let password = |username: &String| -> Option<String> {
write!(stderr(), "Password for {}: ", username).ok()?;
stderr().flush().ok()?;
rpassword::read_password().ok()
};
get_credentials(
m... | Rust | 0 |
import heapq
from collections import defaultdict
def min_steps_to_color_red(text, strings):
memo = defaultdict(int)
queue = []
# Initialize priority queue with all substrings of length 1
for i in range(len(text)):
queue.append((0, i, text[i]))
while queue:
steps, pos, char = heapq... | Python | 1 |
eeMap<String, T>;
pub type SSet = std::collections::BTreeSet<String>;
/// Builder for creating unique ids; e.g.
/// the OCaml function
/// Emit_env.get_unique_id_for_FOO
/// can be called in Rust via:
/// ```
/// UniqueIdBuilder::new().FOO("some_fun")
/// ```
pub struct UniqueIdBuilder {
id: String,
}
impl U... | Rust | 0 |
"LAQ",
"LARK",
"LARS",
"LATD",
"LAVA",
"LAWS",
"LAYN",
"LB",
"LBAI",
"LBC",
"LBF",
"LBI",
"LBIX",
"LBY",
"LC",
"LCAV",
"LCBM",
"LCCI",
"LCI",
"LCOR",
"LCRY",
"LCUT",
"LDF",
"LDG",
"LDL",
"LDR",
"LDSH",
"LEA",
"LECO",
"LEE",
"LEG",
"LEH",
"LEHpF",
"LEHp... | Rust | 0 |
"throughput": "Throughput (tokens/s/GPU)",
"mfu": "MFU",
"peak_mem": "Peak Memory (GB)"
}[args.metric]
plt.figure(figsize=(10, 8))
adjust = - 0.5 * width
plt.bar([i - width*2 + adjust for i in x], metric_values[LABEL_ZERO3], width, label=LABEL_ZERO3, alpha=0.7)
plt.bar([i -... | Python | 1 |
r, u16) {
let host = "127.0.0.1";
let port = 50000 + (id as u16);
(host, port)
}
/// Node RPC address in cluster.
fn node_rpc_addr(id: u64) -> String {
let (host, port) = node_authority(id);
format!("http://{}:{}", host, port)
}
/// Store node.
pub struct Node {
pub id: u64,
server: Arc<St... | Rust | 0 |
Self::TopBottom => ffi::GST_VIDEO_MULTIVIEW_FRAME_PACKING_TOP_BOTTOM,
Self::Checkerboard => ffi::GST_VIDEO_MULTIVIEW_FRAME_PACKING_CHECKERBOARD,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstVideoMultiviewFramePacking> for VideoMultiviewFram... | Rust | 0 |
backup_path = frame_info.filename + ".backup." + str(import_time().strftime("%Y%m%d_%H%M%S"))
with open(backup_path, 'w') as f:
f.write('\n'.join(lines) + '\n')
print(f"Backup created at: {backup_path}")
# Recursively ca... | Python | 1 |
.vault_address.to_string(),
msg: to_binary(&VaultMsg::FlashLoan { payload })?,
funds: vec![],
})),
)
}
_ => return Err(StableArbError::UnsupportedAsset {}),
};
}
}
... | Rust | 0 |
pub fn pvec(vec: &mut PVec<usize>, mut data: PVec<usize>) {
vec.append(&mut data);
}
}
fn index_sequentially(criterion: &mut Criterion) {
macro_rules! bench {
($n:ident) => {
|vec| {
for i in 0..*$n {
black_box(vec[i]);
}
... | Rust | 0 |
from __future__ import annotations
from dataclasses import dataclass
from litestar.openapi.spec.base import BaseSchemaObject
__all__ = ("Reference",)
@dataclass
class Reference(BaseSchemaObject):
"""A simple object to allow referencing other components in the OpenAPI document, internally and externally.
T... | Python | 1 |
# Initialize quantum network
network = BiologicalQuantumNetwork()
# Initialize cytoskeletal measurement
cytoskeleton = CytoskeletalMeasurement()
# Initialize trafficking measurement
trafficking = ProteinTraffickingMeasurement()
print("\nPer... | Python | 1 |
mtls.client_cert_file).exists():
issues.append(f"mTLS client certificate file not found: {config.mtls.client_cert_file}")
if config.mtls.client_key_file and not Path(config.mtls.client_key_file).exists():
issues.append(f"mTLS client key file not found: {config.mtls.client_key_fi... | Python | 1 |
they are received
loop {
match rx.recv() {
Ok(msg) => println!("Thread({}): {}", index, msg),
// disconnected, let's shutdown this thread
Err(_err) => break,
}
}
})... | Rust | 0 |
# Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
# Test functions for normal dot fluxes
def psi_normal_dot_flux(
psi,
pi,
phi,
gamma1,
gamma2,
lapse,
shift,
inverse_spatial_metric,
unit_normal,
):
return -(1.0 + gamma1) * np.dot(shift, un... | Python | 1 |
import logging
import os
from datetime import datetime,timedelta
from kplanner_api_adapter import KPlannerAPIAdapter
from pickdrop_step_env import PickDropStepEnv
from util import set_team_flex_form, getWorkerJob, clear_team_data
server_url = os.getenv('server_url')
team_code = os.getenv('team_code')
current_dir = ... | Python | 1 |
::{coordinate::hex::Hex, Grid},
rules::{freedom_to_move_rule, one_hive_rule},
};
pub fn soldier_ant_moves(grid: &Grid, hex: &Hex) -> Vec<Hex> {
let start_trail: Vec<Hex> = vec![*hex];
let moves: Vec<Hex> = soldier_ant_moves_it(grid, hex, hex, start_trail, Vec::new());
moves
}
fn soldier_ant_moves_it(
grid... | Rust | 0 |
}", s);
}
fn hello() {
let hello = String::from("hogehoge");
println!("{}", hello);
let hello = String::from("<NAME>");
println!("{}", hello);
let hello = String::from("Hello");
println!("{}", hello);
let hello = String::from("שלֹום");
println!("{}", hello);
let hello = String::from... | Rust | 0 |
{
let texture = gfx
.create_texture()
.from_image(include_bytes!("assets/rust-logo-256x256.png"))
.with_premultiplied_alpha()
.build()
.unwrap();
let img_size: egui::Vec2 = texture.size().into();
let tex_id = gfx.egui_register_texture(... | Rust | 0 |
qaazzssqq"),
(b"asdff", b"1ppppkkkkq"),
];
for kv in kv_pairs {
store.insert(kv.0, kv.1).expect("insert");
}
let kv_pairs_to_delete = [
(b"abjkl", b"1aassddwww"),
(b"nmkli", b"1qaazzssqq"),
(b"asdff", b"1ppppkkkkq"),
]... | Rust | 0 |
128];
match stream.read(&mut wat[..])? {
0 => (),
n @ _ => error!(
log,
"unexpected data ({}) after sending quit to previous process?\n{:?}",
n,
&wat[..n]
),
};
Ok(res)
}
pub fn new_slog(matches: &clap::ArgMatches) -> slog::Logger {
... | Rust | 0 |
0..(m + n) {
let monge = monge_primitives[rng.gen_range(0..monge_primitives.len())];
matrix = matrix + monge.to_matrix(m, n, rng);
}
matrix
}
<filename>src/parsed_flags.rs<gh_stars>10-100
use std::fs::File;
use std::path::Path;
use std::time::Duration;
use serde::{Deserialize, Serialize};
use... | Rust | 0 |
30 T30 S30 31 T31 S31)
32 => (1 T1 S1 2 T2 S2 3 T3 S3 4 T4 S4 5 T5 S5 6 T6 S6 7 T7 S7 8 T8 S8 9 T9 S9 10 T10 S10 11 T11 S11 12 T12 S12 13 T13 S13 14 T14 S14 15 T15 S15 16 T16 S16 17 T17 S17 18 T18 S18 19 T19 S19 20 T20 S20 21 T21 S21 22 T22 S22 23 T23 S23 24 T24 S24 25 T25 S25 26 T26 S26 27 T27 S27 28 T28 S28 29 T2... | Rust | 0 |
import os
import json
import re
# Directory containing the images
images_dir = "data/ingredients" # Update with your image directory
json_file_path = "data/ingredients_labels.json" # Path to save the JSON file
# Function to infer label from file name
def get_label(file_name):
if "_w_i" in file_name: # Indicate... | Python | 1 |
# This file has been modified by the Nextpy Team in 2023 using AI tools and automation scripts.
# We have rigorously tested these modifications to ensure reliability and performance. Based on successful test results, we are confident in the quality and stability of these changes.
"""Interactive components provided by... | Python | 1 |
SMB_NTSTATUS_PENDING: u32 = 0x00000103;
pub const SMB_NTSTATUS_BUFFER_OVERFLOW: u32 = 0x80000005;
pub const SMB_NTSTATUS_NO_MORE_FILES: u32 = 0x80000006;
pub const SMB_NTSTATUS_NO_MORE_ENTRIES: u32 = 0x8000001a;
pub const SMB_NTSTATUS_INVALID_HANDLE: u3... | Rust | 0 |
, {a}, {b};'
# instr['rest'] = rest
#
#
# def ptx_mov32i(kernel, instrs, captured_dict, instr):
# instr['op'] = 'mov'
# d = ptx_r(captured_dict, 'r0')
# if 'i20w32' in captured_dict:
# a = ptx_i(captured_dict, 'i20w32')
# instr['rest'] = f'.b32 {d}, {a};'
# else:
# type_str =... | Python | 1 |
ib.sha256()
with open(file_path, "rb") as f:
for byte_block in iter(lambda: f.read(4096), b""):
file_hash.update(byte_block)
prefix = f"{file_hash.hexdigest()}_{binary}"
new_env["PREFIX"] = prefix
# Try stripping... | Python | 1 |
',
default=r'models\vad',
help='path to model')
parser.add_argument('--files',
nargs='+',
default=[r'data\noise.wav', r'data\speech.wav'],
help='list of files')
parser.add_argument('--n_batch',
type=int,
... | Python | 1 |
from collections import defaultdict
from skidl import Pin, Part, Alias, SchLib, SKIDL, TEMPLATE
from skidl.pin import pin_types
SKIDL_lib_version = '0.0.1'
CPLD_Renesas = SchLib(tool=SKIDL).add_parts(*[
Part(**{ 'name':'SLG46826G', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'SLG46826G'}), 'ref_prefix':'... | Python | 1 |
多余交互的信息1,因此需要考虑类别不均衡问题
3.
Best epoch : 21 , Recall : 0.10848287112561175 , NDCG : 0.042286964164333356 , Precision 0.0054241435562805895
'''
# 动态类别权重计算
pos_weight = torch.sum(1 - x_start) / (torch.sum(x_start) + 1e-8)
# pos_weight = (torch.sum(x_start) + 1e-8) / torch.sum(1 - x_start)
batch_size... | Python | 1 |
_layout<T>(capacity: usize) -> alloc::alloc::Layout {
let alignment = max_align::<T>();
let header_size = core::mem::size_of::<Header>();
let num_bytes = next_aligned(header_size, alignment)
+ next_aligned(capacity * core::mem::size_of::<T>(), alignment);
unsafe { alloc::alloc::Layout::from_size_align_unc... | Rust | 0 |
PAL + 1,
MFStdVideoFormat_DVD_PAL = MFStdVideoFormat_DVD_NTSC + 1,
MFStdVideoFormat_DV_PAL = MFStdVideoFormat_DVD_PAL + 1,
MFStdVideoFormat_DV_NTSC = MFStdVideoFormat_DV_PAL + 1,
MFStdVideoFormat_ATSC_SD480i = MFStdVideoFormat_DV_NTSC + 1,
MFStdVideoFormat_ATSC_HD1080i = MFStdVideoFormat_ATSC_SD480i... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.