text string | label_name string | labels int64 |
|---|---|---|
self.assertRegexpMatches(output, br'Exception.*\\xe9')
# The traceback contains newlines, which should not have been escaped.
self.assertNotIn(br'\n', output)
class UnicodeLogFormatterTest(LogFormatterTest):
def make_handler(self, filename):
# Adding an explicit encoding configuration ... | Python | 1 |
ored_prefix.take().map(|_| 1).unwrap_or(0)
}
fn snap_storage(&self, index: usize) -> Result<E, S::Error> {
self.snapper.snap_storage(index)
}
fn snap_write_seqn(&mut self) -> Result<SeqNum, S::Error> {
Self::snap_seqn(
|| self.snapper.snap_write_seqn_high(),
|| ... | Rust | 0 |
import logging
import sys
def get_logger(
name: str,
debug: bool = False,
):
"""
Configure basic console logging using basicConfig.
Args:
name: Name of the logger
debug: If True, set the logging level to DEBUG; otherwise, set it to INFO.
Returns:
The root logger
"... | Python | 1 |
a = ("John", "Charles", "Mike")
b = ("Jenny", "Christy", "Monica")
x = zip(a, b)
print(x) | Python | 1 |
]
pub struct OrderStatusRequest {
/// MsgType = H
#[serde(flatten)]
pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'H'>,
/// OrderID
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "37")]
pub order_id: Option<String>,
/// ClOrdID
#[serde(rename = "1... | Rust | 0 |
jkstraMap::new();
let id = d.get_available_id(Some(PointId(4)));
assert!(PointId(4) == id);
d.add_point(id, TERRAIN).unwrap();
}
#[test]
fn available_id_dont_give_an_occupied_id() {
let mut d = DijkstraMap::new();
let id = d.get_available_id(None);
assert!(id... | Rust | 0 |
# Garmin
from decimal import Decimal
from ... import nmea
class GRM(nmea.ProprietarySentence):
sentence_types = {}
def __new__(_cls, manufacturer, data):
name = manufacturer + data[0]
cls = _cls.sentence_types.get(name, _cls)
return super(GRM, cls).__new__(cls)
def __init__(self... | Python | 1 |
# Copyright (c) 2023, Alibaba Group;
# 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 writ... | Python | 1 |
fn c4_mapgen_handle_save_bg(mapgen: *mut C4MapgenHandle,
path: *const ::std::os::raw::c_char,
material_map: *mut C4MaterialMapHandle,
texture_map: *mut C4TextureMapHandle)
-> bool;
}
extern "C" {
pub fn... | Rust | 0 |
Text(Text::Number("3".to_string())),
Token::Grouping(Grouping::MSep),
Token::Text(Text::Whitespace),
Token::Text(Text::Number("4".to_string())),
Token::Grouping(Grouping::LBracket),
Token::Grouping(Grouping::LBracket),
Token::Text(Text::Whitespace)... | Rust | 0 |
* 1<<16) + (u32::from(buf[23]) * 1<<24);
let e_entry = u32::from(buf[24]) + (u32::from(buf[25]) * 1<<8) + (u32::from(buf[26]) * 1<<16) + (u32::from(buf[27]) * 1<<24);
let e_phoff = u32::from(buf[28]) + (u32::from(buf[29]) * 1<<8) + (u32::from(buf[30]) * 1<<16) + (u32::from(buf[31]) * 1<<24);
le... | Rust | 0 |
}
},
None => println!("Service not found in entry: skip..."),
}
}
}
}
if ers.len() > 0 {
println!("\n\n\n");
println!("───{:─<130}───", "File with wrong format");
for p in ers {
... | Rust | 0 |
eqDropout(dropout)
self.embed_tokens = nn.Embedding(vocab_size, embed_dim, pad_idx)
self.embed_scale = 1.0 if no_scale_embedding else math.sqrt(embed_dim)
self.embed_positions = (
PositionalEmbedding(
max_source_positions,
embed_dim,
p... | Python | 1 |
pub dwListOffset: u32,
}
impl ::core::marker::Copy for LINEAGENTGROUPLIST {}
impl ::core::clone::Clone for LINEAGENTGROUPLIST {
fn clone(&self) -> Self {
*self
}
}
#[repr(C, packed(1))]
#[doc = "*Required features: 'Win32_Devices_Tapi', 'Win32_System_Com'*"]
#[cfg(feature = "Win32_System_Com")]
pub... | Rust | 0 |
b'3', b'N', b'4', b'N', b'5', b'N', b'6', b'N', b'7', b'N', b'8',
b'N', b'9', b'N', b'A', b'N', b'B', b'N', b'C', b'N', b'D', b'N', b'E', b'N', b'F', b'N', b'G',
b'N', b'H', b'N', b'I', b'N', b'J', b'N', b'K', b'N', b'L', b'N', b'M', b'N', b'N', b'N', b'O',
b'O', b'0', b'O', b'1', b'O', b'2', b'O', b'3', b... | Rust | 0 |
"重量",
"功率",
"直径",
"比重",
"比例",
"周长",
"密度",
"数量",
"面积"
],
"职位": [
"上级",
"下属",
"优点",
"缺点",
"要求",
"所属部门",
"技能要求",
"职责",
"能力",
"风险",
"回报"
"履历",
],
"... | Python | 1 |
erminate
let (q, r) = mgs(a.axis_iter(Axis(1)), N, rtol, Strategy::Terminate);
let a_sub = a.slice(s![.., 0..N]);
assert_close_l2!(&q.dot(&r), &a_sub, rtol);
let qc: Array2<A> = conjugate(&q);
assert_close_l2!(&qc.dot(&q), &Array::eye(N), rtol);
// Skip
let (q, r) = mgs(a.axis_iter(Axis(1))... | Rust | 0 |
# *****************************************************************************
#
# 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
#
# ... | Python | 1 |
ancyDetected),
"232" => Ok(HapType::OperatingStateResponse),
"11C" => Ok(HapType::OpticalZoom),
"26" => Ok(HapType::OutletInUse),
"C3" => Ok(HapType::OzoneDensity),
"C7" => Ok(HapType::Pm10Density),
"C6" => Ok(HapType::Pm2_5Density),
"4C" => Ok(HapType::PairSetup),
"4E" => Ok(HapType::PairVerify... | Rust | 0 |
value(true).unwrap())
}
_ => {
// Called undefined method
let e = "Method not found".to_string();
Err(serde_json::to_value(e).unwrap())
}
};
// Package the reply as RpcResponse json
let rpc_response: String;
match response {
Err(err) => {
let resp... | Rust | 0 |
#WAP that Bitwise operators
m = 60
n = 13
print("\nBitwise Operators:")
print("m & n =", m & n)
print("m | n =", m | n)
print("m ^ n =", m ^ n)
print("~m =", ~m)
print("m << 2 =", m << 2)
print("m >> 2 =", m >> 2)
| Python | 1 |
test]
fn valid_file_stem() {
let bilbo = old_bilbo();
for ext in supported_extensions() {
let file_name = Path::new("bilbo_3").with_extension(ext);
to_file(&file_name, &bilbo).unwrap();
let bilbo_the_deserialized: Hobbit = from_file_stem("bilbo_3").unwrap();
assert_eq!(bilbo_th... | Rust | 0 |
_scores = [current_best_scores[:temp_select, class_id][j] for j, sample_id in enumerate(current_best_sample_id[:temp_select, class_id]) if sample_id not in visited][:per_class]
class_samples = [sample_id for sample_id in current_best_sample_id[:subset, class_id] if sample_id not in visited][:per_class]
... | Python | 1 |
input.max_results {
scope_3515.number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_3516).into()),
);
}
#[allow(unused_mut)]
let mut scope_3517 = writer.prefix("NextToken");
if let Some(var_3518) = &input.next_token {
scope_3... | Rust | 0 |
nst ::std::os::raw::c_char,
port: *const ::std::os::raw::c_char,
hostlist: *const ::std::os::raw::c_char,
connectinghost: *mut ::std::os::raw::c_char,
auth: *mut pcap_rmtauth,
errbuf: *mut ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn pcap_remo... | Rust | 0 |
# 是否开启无头模式
HEADLESS = False
# 平台
PLATFORM = "bilibili"
# 是否保存登录状态
SAVE_LOGIN_STATE = True
# 用户浏览器缓存的浏览器文件配置
USER_DATA_DIR = "%s_user_data_dir" # %s will be replaced by platform name
import os
import sys
import asyncio
from typing import Optional,Dict,List,Tuple
from playwright.async_api import async_playwright
fro... | Python | 1 |
m {
id: String::from("second"),
id_string: (),
other: None,
bar: vec![BarFrom {
id: String::from("gamma"),
other: Some(String::from("alpha")),
}],
},
&mut context,
&NoArgs,
)
.... | Rust | 0 |
# Таблиця статистики
st.dataframe(df_bs, use_container_width=True)
with tab3:
st.subheader("Ефективність хендоверів")
# Розподіл покращень RSRP
improvements = [e['improvement'] for e in filtered_events]
fig_hist = px.histogram(
x=improvements,
nbins=20,
titl... | Python | 1 |
duplicatas_pdf:
f.write("❌ LOTES DUPLICADOS ENCONTRADOS NO PDF:\n")
for lote, count in sorted(duplicatas_pdf.items()):
f.write(f" - Lote {lote}: aparece {count} vezes\n")
f.write("\n")
else:
f.write("✅ Nenhuma duplicata encontrada no PDF.\n\n")
... | Python | 1 |
isa_send.send(c as i64).unwrap();
}
let result = thread_monitor.join().unwrap();
isa_thread.join().unwrap();
let mut damage = 0;
if let Output::Success(d) = result {
damage = d;
} else if let Output::Crash(map) = result {
let map: String = map.iter().collect();
printl... | Rust | 0 |
datos = [43, 5, 78, 32, 12, 43, 76, 39]
print(datos[len(datos) - 1]) # me va a imprimir el elemento 39
print(datos[-1]) # Otra forma para que me imprima el ultimo numero
print(datos[-7]) # va a imprimir el primer numero asi7
# Puedo armar subListas:
print(datos) # ACA me muestra la lista completa
print(datos[1:6]... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T
#
# Copyright (c) 2016+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ... | Python | 1 |
len())
.expect("attempt to add with overflow");
let src = &reference_sequence[last_reference_position..end];
copy_from_raw_bases(dst, src)?;
} else if buf[..last_read_position].len() != buf.len() {
return Err(io::Error::new(
io::ErrorKind::InvalidData,
"c... | Rust | 0 |
fix()
}
/// `true` if the instruction has the `REPNE` prefix (`F2`)
///
/// # Arguments
///
/// * `newValue`: new value
#[wasm_bindgen(setter)]
#[wasm_bindgen(js_name = "hasRepnePrefix")]
#[cfg(feature = "encoder")]
pub fn set_has_repne_prefix(&mut self, #[allow(non_snake_case)] newValue: bool) {
self.0.se... | Rust | 0 |
})
if registration_data["error"]:
return {}
otp_info = registration_data["data"]
user_id = otp_info["user_id"]
g.user_id = user_id
if OtpUtils.check_token_expired(checked=registration_data, request_id=request_id):
g.response_code = "0410"
return {}
... | Python | 1 |
cer."]
#[inline(always)]
pub fn not_enable(self) -> &'a mut W {
self.variant(LPDBCEN1_A::NOT_ENABLE)
}
#[doc = "The WKUP1 input pin is connected to the low-power debouncer and forces a system wake-up."]
#[inline(always)]
pub fn enable(self) -> &'a mut W {
self.variant(LPDBCEN1_A:... | Rust | 0 |
t.DataLike:
x = self._random_array(dim_shape)
y = x[indices]
return dict(
in_=dict(arr=x),
out=y,
)
class TestTrim(conftest.LinOpT):
@pytest.fixture(
params=[
# Specification:
# dim_shape (user-specified),
# ... | Python | 1 |
{
let emoji = find_custom_emoji(ctx, emoji_name).await;
match ctx {
Context::Prefix(ctx) => {
let reaction = emoji
.map(serenity::ReactionType::from)
.unwrap_or_else(|| serenity::ReactionType::from(fallback));
ctx.msg.react(ctx.discord, reaction).... | Rust | 0 |
as:
self.bias = Parameter(
init.rand(out_channels,
low=-bias_bound, high=bias_bound,
device=device, dtype=dtype),
requires_grad=True)
### END YOUR SOLUTION
def forward(self, x: Tensor) -> Tensor:
### BEG... | Python | 1 |
import sys
from io import StringIO
from pathlib import Path
from contextlib import redirect_stdout
def main():
path = Path(sys.argv[1])
f = StringIO()
with redirect_stdout(f):
mktable()
try:
old = path.read_text()
except FileNotFoundError:
old = ''
new = f.getvalue()
... | Python | 1 |
o((0,0), (map_width as i16, map_height as i16));
println!("{:?}", view_port);
map.render_map(&mut buffer_console);
map.render_npcs(&mut buffer_console);
player.render(&mut buffer_console);
tcod::console::blit(&buffer_console, (view_port.top_left.x as i32, view_port.top_left.y... | Rust | 0 |
achedDevice {
pub port: u8,
pub vendor_id: u16,
pub product_id: u16,
}
impl UsbControlAttachedDevice {
fn valid(self) -> bool {
self.port != 0
}
}
#[derive(MsgOnSocket, Debug)]
pub enum UsbControlResult {
Ok { port: u8 },
NoAvailablePort,
NoSuchDevice,
NoSuchPort,
Faile... | Rust | 0 |
OX', '复选框'),
('RADIO', '单选框'),
('MEMBER', '单选人员选择'),
('MEMBERS', '多选人员选择'),
('RICHTEXT', '富文本'),
('FILE', '附件上传'),
('CUSTOMTABLE', '自定义表格'),
('TREESELECT', '树形选择'),
... | Python | 1 |
tic str,
) {
let parent_start = SystemTime::now();
let parent_duration = Duration::from_secs(parent_duration_secs);
let duration = Duration::from_secs(duration_secs);
let start = if start_diff_secs < 0 {
parent_start
.checked_sub(Duration::from_secs((-star... | Rust | 0 |
))),
},
}
}
pub fn run_command(config: &Config, release: &Release, cmd: &Vec<String>) -> anyhow::Result<()> {
let application = config.find_application(&release)?;
match &application.config {
ApplicationConfig::Kubectl { console, selector } => {
let client = kubeclient... | Rust | 0 |
omplete=False
with patch.object(transport, "_disconnect") as mock_disconnect:
stream_gen = transport.stream(
"wss://example.com",
"persistent-stream",
{},
close_on_complete=False,
timeout=2,
)
li... | Python | 1 |
assertions;
use std::fmt;
use svgdom::{
AttributeId as AId,
AttributeValue,
Document,
ElementId as EId,
TagNameRef,
NodeType,
WriteOptions,
};
fn write_options() -> WriteOptions {
let mut opt = WriteOptions::default();
opt.use_single_quote = true;
opt
}
#[derive(Clone, Copy, ... | Rust | 0 |
> <p> <b>MAX_HEALTH_CHECKS_BY_OWNER</b>: The maximum number of health checks that you can create using the current account.</p> </li>
/// <li> <p> <b>MAX_HOSTED_ZONES_BY_OWNER</b>: The maximum number of hosted zones that you can create using the current account.</p> </li>
/// <li> <p> <b>MAX_REUSABLE_DELEGATION... | Rust | 0 |
base_ptr : *mut immix::LineMark, addr : CellAddr, val : u8) -> usize {
let idx = Line2LineMark::idx(line_start, Block::cast_cell_to_line(addr));
Line2LineMark::map_set_idx( LineMarkAddr::from_ptr(base_ptr), idx, LineMark::from_enum(val));
idx
//
// line_start
// ... | Rust | 0 |
import re
from collections import OrderedDict
from lib import Key, gen_info
from extkey import ext_keys
from symbol import special_symbol
pattern = re.compile(r"^\s*(?P<enum>\w+)\s*=\s*(?P<code>0x[0-9A-Fa-f]+),?")
keys: OrderedDict[int, Key] = OrderedDict()
with open("codegen/keycode.rs", "r") as file:
keycodes =... | Python | 1 |
def tokenizer(self, proto):
model_type = proto.trainer_spec.model_type
vocab = self.vocab(proto)
unk_id = self.unk_id(proto)
if model_type == 1:
tokenizer = Tokenizer(Unigram(vocab, unk_id))
elif model_type == 2:
vocab, merges = SentencePieceExtractor(self.original_tokenizer.
... | Python | 1 |
ub mod units;
#[cfg(feature = "ulp")]
pub use crate::ulp::delay;
<reponame>lulf/drogue-device
use crate::api::i2c::I2cAddress;
use crate::domain::temperature::Celsius;
use crate::driver::i2c::I2cPeripheral;
use crate::driver::sensor::hts221::ready::DataReady;
use crate::driver::sensor::hts221::register::calibration::*... | Rust | 0 |
timestamps.append(hour.isoformat())
prediction_counts.append(stats['predictions'])
error_rate = stats['errors'] / max(1, stats['predictions'])
error_rates.append(error_rate)
avg_inference_time = (
... | Python | 1 |
.is_err());
let opener_index = 1;
let opening = open_dealing(
dealing,
associated_data,
dealer_index,
opener_index,
&sk1,
&pk1,
)
.expect("Unable to open dealing");
assert!(verify_dealing_opening... | Rust | 0 |
ave more precise statistics than others.
if comm.is_main_process():
ret.append(hooks.PeriodicCheckpointer(self.checkpointer, cfg.SOLVER.CHECKPOINT_PERIOD))
def test_and_save_results():
self._last_eval_results = self.test(self.cfg, self.model)
return self._last_eval_r... | Python | 1 |
import logging
from aiogram import Dispatcher
from data.config import ADMINS
async def on_startup_notify(dp: Dispatcher):
for admin in ADMINS:
try:
await dp.bot.send_message(admin, "Bot ishga tushdi /start")
except Exception as err:
print(err)
| Python | 1 |
kwargs["message"]
if logmsg:
kwargs["m"] = logmsg
if force:
kwargs["f"] = True
args = (path, reference)
repo.git.tag(*args, **kwargs)
return TagReference(repo, "%s/%s" % (cls._common_path_default, path))
@classmethod
def delete(cls, repo: "Rep... | Python | 1 |
#!/usr/bin/env python3
import os
import json
from utils import run_command
def main():
# Get the directory of this script
scripts_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(scripts_dir, "..", "versions.json")) as f:
versions = json.load(f)
release_tag = f"{versi... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
class logHandling:
def __init__(self):
self.file=open('/home/amritha/teleop_ws/src/Telerobot_control/doosan-robot/dsr_example/py/scripts/SpaceMouseWithWebsocket/logMonitor.txt', "a" )
def writeDebug(self,msg):
file=open('/home/... | Python | 1 |
// rsync -e "ssh -o StrictHostKeyChecking=no -i path/to/id_rsa" \
// --timeout=600 \
// -qac --append-verify \
// "backup@[$NODE_IP]:/var/lib/ic/data/ic_registry_local_store/" \
// "$LOCAL_STORE_DIR"
let cmd = Command::new("rsync")
.arg... | Rust | 0 |
(2, 0, vec![&20.0]),
],
);
}
#[test]
fn test_reading_simple_file_undirected() {
let net = read_net("resources/nets/simple-net.txt", false);
check_network(
net,
3,
3,
vec![0, 1, 2],
vec![
(0, 1, vec![&16.0]),
(1, 2, vec![&1... | Rust | 0 |
противнику большой урон, но и сам получает ранения',
[V.DATE, V.TIME, V.ATTACKER, V.DEFENDER, V.DAMAGE, V.ATTACKER_DAMAGE], 'attacker#N -attacker_damage#HP defender#N -damage#HP'),
('HERO_ABILITY_INSANE_STRIKE_MISS', 280019, 'Журнал: Безрассудная атака (промах)', relations.LEXICON_GROUP.HERO_ABILITY,
... | Python | 1 |
z (50)
mjgrhot (314) -> sdjzc, cjjwz
ohuvi (89)
uplxy (60)
ymfurx (26)
vrkrr (55)
tkxuj (86)
mydixq (60)
obgin (293) -> lewfa, ukwydlj, xyfeczu
swvae (68)
adlvipk (168) -> uilshuf, qxkilb
vxjhric (220)
mhbeqm (99)
vcyfwm (88) -> qrdtzc, gatdc
xujof (5)
rjkhl (257) -> mogla, nlewmv, mxxecyh
oxqvzzv (91)
rwxmoi (265) -> ... | Rust | 0 |
: Option<::std::collections::HashMap<String, serde_json::Value>>,
}
impl PathItem {
pub fn new() -> PathItem {
PathItem {
summary: None,
description: None,
get: None,
put: None,
post: None,
delete: None,
options: None,
... | Rust | 0 |
<< 1) +
((reg_extension as u8) << 2));
}
fn emit_mod_reg_rm(&mut self, modb: Mod, reg: u8, rm: u8) {
assert!(reg <= 0b111);
assert!(rm <= 0b111);
self.emit(rm + (reg << 3) + (modb.code() << 6));
}
fn emit_sib(&mut self, scale: Scale, index: u8, base: u8) {
... | Rust | 0 |
pub child: A,
// }
// impl<A: Layout> PredicateSelector<A> {
// pub fn passing(predicate: BoxedWindowPredicate, child: A) -> PredicateSelector<A> {
// PredicateSelector {
// predicate: Rc::new(predicate),
// child,
// }
// }
// pub fn failing(test: BoxedWindowPredic... | Rust | 0 |
Connection) -> Result<TransactionFeeInfo, String> {
let key = String::from("<KEY>");
// load the channel state from DB
let ser_tx_fee_info = handle_error_with_string!(
get_file_from_db(db_conn, &key, &TX_FEE_INFO_KEY.to_string()),
"could not load the tx fee info"
);
let tx_fee_info:... | Rust | 0 |
S: BuildHasher,
{
#[inline]
fn eq(&self, other: &Self) -> bool {
self.len() == other.len() && self.iter().eq(other)
}
}
impl<T, S> Hash for LinkedHashSet<T, S>
where
T: Eq + Hash,
S: BuildHasher,
{
#[inline]
fn hash<H: Hasher>(&self, state: &mut H) {
for e in self {
... | Rust | 0 |
.query(&signature)
.into_iter()
.map(|id_ref| id_ref.clone())
.collect()
}
pub fn query_tokens_return_distance(&self, tokens: Vec<&str>) -> Vec<(i64, usize)> {
let signature = self.sim_hash.create_s... | Rust | 0 |
acketCommandNum
bytePointer = 0
for payloadMember in newPacket.payload.getOrderedMembers():
valueToAdd = LynxMessage.LynxBytes(len(payloadMember))
valueToAdd.data = int(self.swapEndianess(packetPayload[0: len(payloadMember) * 2]), 16)
newPacket.pay... | Python | 1 |
# bresdfirst
from collections import deque # deque funksiyasi yordamida ikki tomonlama navbat (queue) hosil qilamiz
# Qidirish funksiyasi - kengligi bo'yicha qidirish (BFS)
def search(start_node, target='elon musk'):
search_queue = deque() # Qidiruv uchun navbat (queue) yaratish
search_queue += graph[star... | Python | 1 |
:param _DiskInfoSet: 硬盘型号列表
:type DiskInfoSet: list of DiskInfo
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self._CpuInfoSet = None
self._MemSet = None
self._DiskInfoSet =... | Python | 1 |
return Ok(());
}
fn unify(&mut self, env: &Env, t1: &Type, t2: &Type)
-> Result<(),String>
{
if let Type::Var(tv1) = t1 {
return self.unify_var(env,tv1,t2);
}
if let Type::Var(tv2) = t2 {
return self.unify_var(env,tv2,t1);
}
match t1 {
Type::Atom(t1) => {
if let ... | Rust | 0 |
ublicState,
) -> AAnalysis {
let preproc_symbol_len = symbols.len();
let mut local_env: HashMap<ALocalScope, AEnv> = HashMap::new();
for (i, symbol) in symbols.iter().enumerate() {
let ws_symbol = AWsSymbol {
doc,
symbol: ASymbol::new(i),
};
match &symbol.s... | Rust | 0 |
ath):
os.makedirs(save_path)
torch.save(model.state_dict(), save_path+'TGLNet_epoch_{}.pth'.format(epoch+1))
print('save checkpoints successfully!')
raise
#test function
def val(test_loader,model,epoch,save_path):
global best_mae,best_epoch
model.ev... | Python | 1 |
data: WriteCallbackData,
raw: writer::Writer,
}
impl Writer {
fn new_impl(file: File, net_version: &[u8], map_name: &[u8], map_crc: u32, type_: &[u8], timestamp: &[u8]) -> io::Result<Writer> {
let mut callback_data = WriteCallbackData {
file: BufWriter::new(file),
};
let raw... | Rust | 0 |
"1"));
let sy = Command::from(("Set", "y", "1"));
let nxny = Instance::of(&[nx.clone(), ny.clone()], (0, 0).into(), &[]);
let gxny = Instance::of(&[gx.clone(), ny.clone()], (0, 0).into(), &[]);
let sxny = Instance::of(&[sx.clone(), ny.clone()], (0, 0).into(), &[]);
let sxsy = Instance::of(&[sx.clo... | Rust | 0 |
if var == from {
self.lhs = to.clone();
replaced = true
}
}
if let Some(var) = self.rhs.as_var() {
if var == from {
self.rhs = to.clone();
replaced = true
}
}
replaced
}... | Rust | 0 |
item.find_element_by_partial_link_text(title)
except NoSuchElementException:
continue
try:
item.find_element_by_css_selector("a.%s-asset" % name)
assert False, "Item %s has a %s icon." % (title, name)
except NoSuchElementException:
assert Tru... | Python | 1 |
display_value = display_for_field(None, models.DecimalField())
self.assertEqual(display_value, EMPTY_CHANGELIST_VALUE)
display_value = display_for_field(None, models.FloatField())
self.assertEqual(display_value, EMPTY_CHANGELIST_VALUE)
def test_label_for_field(self):
"""
... | Python | 1 |
u8, p: u8) {
let x64 = u64::from(x);
let y64 = u64::from(y);
let p64 = u64::from(p);
let z64 = u64::from(add(ufield::from(x), ufield::from(y), ufield::from(p)));
assert_eq!(z64, (x64 + y64) % p64);
}
check_add(100, 200, 251);
check_add(100, 151, 251);
check_add(... | Rust | 0 |
BandwidthProcessor.
fee += state_db.must_get(&keys::ChainParameter::CreateNewAccountFeeInSystemContract);
}
Some(to_acct)
if to_acct.r#type == AccountType::Contract as i32 &&
state_db.must_get(&keys::ChainParameter::ForbidTransferToContract) =... | Rust | 0 |
& !c & !d & !g;
break;
}
}
let digits = vec![
a | b | c | e | f | g,
c | f,
a | c | d | e | g,
a | c | d | f | g,
b | c | d | f,
a | b | d | f | g,
a | b | d | e | f | g,
a | c |... | Rust | 0 |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
HDLTex: Hierarchical Deep Learning for Text Classification
module for reading and extracting GLove word embedding
* Copyright (C) 2018 Kamran Kowsari <kk7nc@virginia.edu>
* Last Update: Oct 26, 2018
* This file is part of HDLTex project, University of Vir... | Python | 1 |
" => DataType::String,
"date" => DataType::Date,
v => {
if v.starts_with("list<") {
let tmp = &v[5..v.len() - 1];
let sub_type = DataType::from(tmp);
if sub_type == DataType::Int {
DataType::ListI... | Rust | 0 |
# model_warper.py
import os
import logging
logging.basicConfig(
level=logging.INFO, # Set the minimum logging level
format='[%(levelname)s] %(message)s' # Text-only format
)
rich_console = logging
from unsloth import FastLanguageModel
class UnslothModel:
def __init__(self):
"""Initialize th... | Python | 1 |
turn self._TopicId
@TopicId.setter
def TopicId(self, TopicId):
self._TopicId = TopicId
@property
def Channel(self):
return self._Channel
@Channel.setter
def Channel(self, Channel):
self._Channel = Channel
def _deserialize(self, params):
self._LogsetId = p... | Python | 1 |
TestValue::from("first value"));
assert!(insert_result.is_ok());
let query_result = db.get(&TestKey::from(1));
assert!(query_result.is_ok());
let maybe_result = query_result.unwrap();
assert_eq!(maybe_result, Some(TestValue::from("first value")));
}
#[test]
fn test_database_flush() {
let opti... | Rust | 0 |
rder(order)
self.last_signal = "SELL"
self.log_message(f"SELL signal: Opening short position of {self.position_size} contracts")
# Log position information
if current_position:
unrealized_pnl = current_position.quantity * (current_price - current... | Python | 1 |
nomes = [""]*5
tamanho = len(nomes)
for x in range(tamanho):
nomes[x] = input("Digite um nome: ")
print(nomes)
"""for i in range(4, -1, - 1):
print(nomes[i], end=" ")"""
nomes.reverse()
print(nomes) | Python | 1 |
from __future__ import annotations
import logging
import logging.config
from typing import Any, Dict
DEFAULT_LOGGING_CONFIG: Dict[str, Any] = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '[%(asctime)s] %(levelname)s %(name)s: %(message)s',... | Python | 1 |
&mut (*self.children[index])
}
}
}
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Softwar... | Rust | 0 |
import logging
import json
from .explore import Explorer
def explore_and_link(package, runtime_refmap):
result = Explorer.explore_package(package, refmap=runtime_refmap)
nodes_by_id = result['info_by_id']
linked_nodes = {}
output = []
def link_node(node_id):
if node_id not in nodes_by_id:... | Python | 1 |
d"]
#[inline(always)]
pub fn variant(self, variant: TMR0_IRQ_PEND_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "`0`"]
#[inline(always)]
pub fn no_effect(self) -> &'a mut W {
self.variant(TMR0_IRQ_PEND_A::NO_EFFECT)
}
#[doc = "Indicates that the interval value of t... | Rust | 0 |
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 writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eit... | Rust | 0 |
ority0: DWORD,
dwSubAuthority1: DWORD,
dwSubAuthority2: DWORD,
dwSubAuthority3: DWORD,
dwSubAuthority4: DWORD,
dwSubAuthority5: DWORD,
dwSubAuthority6: DWORD,
dwSubAuthority7: DWORD,
pSid: *mut PSID,
) -> BOOL;
pub fn AllocateLocallyUniqueId(
... | Rust | 0 |
};
}
def_tag!(program_tag, "program");
#[derive(Deserialize, Debug, Clone)]
pub struct Program(pub program_tag, pub Vec<Expression>);
def_tag!(undeserializable, "oiqjweoifjqwoeifjwqoiefjqwoiej");
#[derive(Deserialize, Debug, Clone)]
pub struct ToProc(pub undeserializable, pub Box<Expression>);
#[derive(RipperDe... | Rust | 0 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.tests.utils import FrappeTestCase
class TestBlogCategory(FrappeTestCase):
pass
| Python | 1 |
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).KernelInfoGetAttributeArray_int64 as *const _
as usize
},
1304usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(KernelIn... | Rust | 0 |
lectrónicos coinciden
def clean(self):
cleaned_data = super().clean()
email = cleaned_data.get('email')
email_confirm = cleaned_data.get('email_confirm')
title = cleaned_data.get('title')
cv = cleaned_data.get('cv')
letter = cleaned_data.get('letter')
if emai... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.