text string | label_name string | labels int64 |
|---|---|---|
_base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py',
'./retinanet_tta.py'
]
# optimizer
optim_wrapper = dict(
optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001))
| Python | 1 |
w(Instant::now()));
#[doc(hidden)]
pub static LAST_DURATION: Lazy<Mutex<Option<Duration>>> = Lazy::new(|| Mutex::new(None));
#[doc(hidden)]
pub static STIME_ACTIVE: Lazy<bool> = Lazy::new(|| std::env::var("STIME").is_ok());
#[doc(hidden)]
#[macro_export]
macro_rules! rtry {
($e: expr) => {{
use $crate::{... | Rust | 0 |
&[&str] = &[
"printf",
"sprintf",
//"fprintf", //this requires a FILE*, which will require c header files to define
"snprintf",
"dprintf"
];
fn typecheck_printf(func_name: &str, args: &[ast::Expr], ctxt: &mut LocalTypeContext, funcs: &FuncContext) -> Result<(), String> {
/*
According to the C standard, there is... | Rust | 0 |
thToRoot, installDir(), "lib")])
env.Prepend(RPATH = [join(pathToRoot, installDir(), "lib")])
# ------------------------------------------------------------------------------
def numCPUs():
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
nCPUs = os.sysconf("SC_NPROCESSORS_ONLN")
if isinsta... | Python | 1 |
on some statements.\n"
s += "ASSISTANT: Sure. I will give the answer.\n"
s += "USER: Please memorize these statements.\n"
contexts = [context_0, context_1, context_2]
forks = s.fork(len(contexts))
forks += lambda i: f"Statement {i}: " + contexts[i] + "\n"
forks.join(mod... | Python | 1 |
import pytest
from helper import *
def createTestMesh() -> mrmesh.Mesh:
# test simple triangulation
triangulation = mrmesh.Triangulation()
triangulation.vec.resize(2)
assert len(triangulation.vec[0]) == 3
for i in range(len(triangulation.vec[0])):
triangulation.vec[0][i] = mrmesh.VertId(i)... | Python | 1 |
[test]
#[cfg(feature = "serde1")]
fn lil_name_map_serde() {
let gfa = load_lil_gfa();
let name_map = NameMap::build_from_gfa(&gfa);
let _ = std::fs::remove_file(lil_name_map_path());
name_map.save_json(lil_name_map_path()).unwrap();
let loaded_map = NameMap::load_json(li... | Rust | 0 |
special_cases = { \
"binmids" : "score",
"cve_sens" : "Sensitivity", \
"cve_epq" : "FPEPQ", \
"cate_sens" : "Category coverage", \
"cate_epq" : "Category EPQ" \
}
names = []
def addname(name):
assert not name in names
names.append(name)
addname("binmids")
addname("N_score")
addname("N_score_T")
addname("N_sc... | Python | 1 |
let stats_json = String::from_utf8(stats_vec)?;
//println!("Stats_json: {}", stats_json);
let result = serde_json::from_str(&stats_json);
if let Err(e) = result {
return Err(CuckooMinerError::StatsError(
String::from(format!("Error retrieving stats from plugin: {:?}", e)),
));
}
Ok(result.unwra... | Rust | 0 |
(PossibleSceneList):
from scenes.zhuxian.zhuxian_msg import KKRQianBao
def __init__(self, a, *args, **kwargs):
self.LoveUpScene = LoveUpScene
self.LevelUpBox = LevelUpBox
self.FightingWinZhuXian = FightingWinZhuXian
self.FightingLoseZhuXian = FightingLoseZhuXian
self.Fig... | Python | 1 |
"""
精确定位模块
通过迭代验证OCR结果,精确定位目标模式在图像中的位置
"""
import numpy as np
from typing import Tuple, Optional, Callable
from privision.core.bbox_calculator import BboxCalculator
from privision.core.detector_base import BaseDetector
class PreciseLocator:
"""精确定位器 - 通过迭代验证精确定位目标模式"""
def __init__(
self,
ocr_... | Python | 1 |
0xf0, 0x67],
Instruction::J {
opcode: Opcode::JAl,
rd: Register::Zero,
imm: 7806,
},
);
encoding_test(
&0x946ff0efu32.to_le_bytes(),
Instruction::J {
opcode: Opcode::JAl,
rd: Register::ReturnAddress,
imm: -0... | Rust | 0 |
return
frame_counter = 0
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# Increment frame counter
frame_counter += 1
if frame_counter % process_every_nth_frame != 0:
continue
bbox... | Python | 1 |
upt mask register2
pub mod IMB {
pub use super::IMA::AFSDETIE;
pub use super::IMA::CNRDYIE;
pub use super::IMA::FREQIE;
pub use super::IMA::LFSDETIE;
pub use super::IMA::MUTEDETIE;
pub use super::IMA::OVRUDRIE;
pub use super::IMA::WCKCFGIE;
}
/// AStatus register
pub mod SRB {
pub use s... | Rust | 0 |
def es_bisiesto(anio):
if anio % 4 == 0:
if anio % 100 == 0:
if anio % 400 == 0:
return True
else:
return False
else:
return True
else:
return False
#se encarga de al anio ingresado compararlo con los requisitos y ve... | Python | 1 |
x->CR2 = (uint16_t)tmpreg;
}
/// USART_Exported_Constants
#define IS_USART_ALL_PERIPH(PERIPH) (((*(uint32_t*)&(PERIPH)) == USART1_BASE) || \
((*(uint32_t*)&(PERIPH)) == USART2_BASE) || \
((*(uint32_t*)&(PERIPH)) == USART3_BASE) || \
... | Rust | 0 |
#!/usr/bin/env python3
# ************************************************************************
# * *
# * Routine date_last_mod.py returns a strings with two UTC dates. *
# * The first date is the last modification date and the second ... | Python | 1 |
}
/// Consume an ACK and return an error if an ACK is not found
pub fn recv_ack(&mut self, buf_sz: Option<usize>) -> Result<(), NlError> {
let ack = self.recv_nl_typed::<consts::Nlmsg, Nlmsgerr<consts::Nlmsg>>(buf_sz)?;
if ack.nl_type == consts::Nlmsg::Error && ack.nl_payload.error == 0 {
... | Rust | 0 |
)
return processed_results
except Exception as e:
logger.error(f"[PROCESS_URLS_BATCH_ERROR] 批量URL处理失败: {str(e)}")
raise Exception(f"批量URL处理失败: {str(e)}")
def _convert_web_chunks_to_line_mapping(self, chunks: List[Dict]) -> Dict[str, Dict]:
""... | Python | 1 |
}
}
fn lower_literal(&self, lit: &ast::Literal, nid: NodeId) -> ir::Constant {
use crate::ast::LitKind;
let expected_type = self.lower_node_type(nid);
match &lit.kind {
LitKind::Str(s) | LitKind::RawStr(s) => ir::Constant::Str(s.clone()),
LitKind::Numeri... | Rust | 0 |
- `image` (torch.Tensor): The input image.
- `detection_hint` (bool): Whether to use detection hint.
- `dilation` (int): Dilation value.
- `threshold` (float): Threshold for mask selection.
- `bbox_expansion` (int): Bounding box expansion value.
- `ma... | Python | 1 |
import FWCore.ParameterSet.Config as cms
process = cms.Process("EDMtoMEConvert")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.load("DQMServices.Components.EDMtoMEConverter_cff")
process.load("DQMServices.Components.DQMEnvironment_cfi")
#process.load("Configuration.StandardSequences.FakeConditions_c... | Python | 1 |
import random
from typing import List, Dict, Tuple
# ===== 牌面定义 =====
MAJOR_ARCANA: List[str] = [
"The Fool", "The Magician", "The High Priestess", "The Empress",
"The Emperor", "The Hierophant", "The Lovers", "The Chariot",
"Strength", "The Hermit", "Wheel of Fortune", "Justice",
"The Hanged Man", "De... | Python | 1 |
# Copyright 2021 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the Apache License 2.0 (the "License"). A copy of the
# License may be obtained with this software package or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Use of this file is prohibited except in compliance with the Licen... | Python | 1 |
originator_id=device_id,
alarm_type=config["type"],
severity=config["severity"],
details=config["details"]
)
if alarm:
created_alarms.append(alarm)
print(f" ✅ 警报创建成功: {alarm.id}")... | Python | 1 |
import logging
from hacktribe_editor.ht_logging import log_debug
import hacktribe_editor.utils.ht_nrpn_format as nrpn_fmt
"""
Build and parses NRPN messages
- Functions return NRPN as bytes
"""
log = logging.getLogger(__name__)
@log_debug
def parse(byts):
"""Parse NRPN dict to bytes"""
return nrpn_fmt... | Python | 1 |
me.cmp( &b.name ) );
let js = wasm_runtime::generate_js( runtime, main_symbol, path, prepend_js, &all_snippets, &exports );
let mut fp = File::create( &js_path ).unwrap();
fp.write_all( js.as_bytes() ).unwrap();
let new_wasm_hash = get_sha1sum( path ).expect( "cannot calculate sha1sum of the `.wasm` f... | Rust | 0 |
g.INFO
elif args.log_level == 'debug':
log_level_int = logging.DEBUG
elif args.log_level == 'warning':
log_level_int = logging.WARNING
else:
raise ValueError('Need valid loglevel value (info, debug, warning).')
fmt = '%(name)-15s %(levelname)-8s %(message)s'
logging.basicCon... | Python | 1 |
Protocol (BMP) processing - https://tools.ietf.org/html/rfc7854
mod msginit;
mod msgterm;
mod msgpeer;
mod bmputl;
mod msgrmon;
pub mod prelude;
use crate::*;
use msgrmon::BmpMessageRouteMonitoring;
use msginit::BmpMessageInitiation;
use msgterm::BmpMessageTermination;
use msgpeer::BmpMessagePeerUp;
impl From<core::... | Rust | 0 |
revision).
pub features: IndexMap<String, Feature>,
/// Unstable Features:
/// - apis may change between revisions
/// - unstable features may be dropped
/// - unstable features may be omitted by implementations
pub unstable_features: IndexMap<String, UnstableFeature>,
/// Types to be used... | Rust | 0 |
None),
/// Allows using `#[naked]` on functions.
(active, naked_functions, "1.9.0", Some(32408), None),
/// Allows `cfg(target_has_atomic = "...")`.
(active, cfg_target_has_atomic, "1.9.0", Some(32976), None),
/// Allows `X..Y` patterns.
(active, exclusive_range_pattern, "1.11.0", Some(37854)... | Rust | 0 |
eError("No matching AIMET variant found.")
def dynamic_metadata(
field: str,
settings: dict[str, object] | None = None,
) -> str | list[str] | dict[str, list[str]]:
if settings:
raise ValueError("No inline configuration is supported")
if field == "name":
return get_name()
if field ... | Python | 1 |
,
EntryOptions::default(),
)
.await;
println!("{:?}", res);
assert!(res.is_ok());
let entry = res.unwrap().entry;
assert_eq!(entry.data_key, "data".to_string());
assert_eq!(entry.data, b"hello world".to_vec());
assert_eq!(entry.revision, 0);
... | Rust | 0 |
match super::decode_option_variant(&mut decoder, core::any::type_name::<Option<&str>>())? {
Some(_) => {
let val = BorrowDecode::borrow_decode(decoder)?;
Ok(Some(val))
}
None => Ok(None),
}
}
}
impl<T, const N: usize> Decode for [... | Rust | 0 |
"info: telemetry set to 'on'\n");
});
}
#[test]
fn disable_telemetry() {
setup(&|config| {
expect_ok_ex(config,
&["rustup", "telemetry", "disable"],
r"",
"info: telemetry set to 'off'\n");
});
}
// issue #927
#[test]
fn undefined_... | Rust | 0 |
= cluster.get_region(k);
let region_id = region.get_id();
let cmd = new_put_cmd(k, v);
let mut req = new_request(region_id, region.take_region_epoch(), vec![cmd], true);
let mut leader = cluster.leader_of_region(region_id).unwrap();
// setup wrong store id.
let store_id = leader.get_store_id();... | Rust | 0 |
"awq_marlin": AWQMarlinConfig,
"gptq": GPTQConfig,
"compressed-tensors": CompressedTensorsConfig,
"bitsandbytes": BitsAndBytesConfig,
"ptpc_fp8": PTPCFp8Config,
"qqq": QQQConfig,
"hqq": HQQMarlinConfig,
"experts_int8": ExpertsInt8Config,
"neuron_quan... | Python | 1 |
longest_match.length as usize) <= size);
return longest_match;
}
let mut limit = longest_match.limit;
debug_assert!(limit <= ZOPFLI_MAX_MATCH);
debug_assert!(limit >= ZOPFLI_MIN_MATCH);
debug_assert!(pos < size);
if size - pos < ZOPFLI_MIN_MATCH {
/* The rest of the code assum... | Rust | 0 |
me::from(frame))
}
pub fn decode_packet(&mut self, packet: &AVPacket) -> Result<Frame, UnsafeError> {
unsafe {
self.decode_raw_packet(packet)
}
}
}
impl AsRef<AVCodecContext> for DecodingCodecContext {
fn as_ref(&self) -> &AVCodecContext {
self.0.as_ref()
}
}
i... | Rust | 0 |
"""
config for datetime formatting
"""
from __future__ import annotations
from pandas._config import config as cf
pc_date_dayfirst_doc = """
: boolean
When True, prints and parses dates with the day first, eg 20/01/2005
"""
pc_date_yearfirst_doc = """
: boolean
When True, prints and parses dates with the yea... | Python | 1 |
_ = hooks_mid_rs.write_all(setup_hook_inner_line.as_bytes());
let _ = hooks_mid_rs.write_all("\n".as_bytes());
}
s = State::Off;
break;
}
}
}
}
}
fn wrap_dls() {
let wrap_dl_re: Regex = Regex::new(
r"^wrap_dl!\(\s*(?P<name>\w+)\s*,\s*(?P<lib>\w+)\s*,\... | Rust | 0 |
return None
if hasattr(linefmt, "__call__"):
return linefmt(colwidths, colaligns)
else:
begin, fill, sep, end = linefmt
cells = [fill*w for w in colwidths]
return _build_simple_row(cells, (begin, sep, end))
def _pad_row(cells, padding):
if cells:
pad = " "*padd... | Python | 1 |
import pygame
import sys
from jogo import Jogo
# Inicialização do Pygame
pygame.init()
# Constantes
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 800
# Configuração da tela
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("Buraco")
font = pygame.font.SysFont('Arial', 24)
small_font = ... | Python | 1 |
from nonebot import on_command, on_regex, on_startswith
from nonebot.adapters.onebot.v11 import GroupMessageEvent, Message
from nonebot.params import EventMessage
from nonebot.permission import SUPERUSER
from helper.simai import *
from util.utils import *
from helper.diving_fish import *
from update_music_list import ... | Python | 1 |
the speeds
speed_y_self = max(-termvelocity, speed_y_self - gravity)
if speed_y_attack > 0:
speed_y_attack = max(0, speed_y_attack - vertical_decay)
else:
speed_y_attack = min(0, speed_y_attack + vertical_decay)
if speed_x > 0:
... | Python | 1 |
);
}
use crate::http::http_core::HttpStatus;
#[derive(Clone)]
pub struct PostBufferError {
code: HttpStatus,
reason: String,
}
impl PostBufferError {
pub fn new(code: HttpStatus, reason: String) -> PostBufferError {
PostBufferError {
code: code,
reason: reason,
... | Rust | 0 |
hing. Extended address bits can be enabled on EBI_A in the EBI_ROUTE register."]
D16A16ALE,
#[doc = "EBI_AD drives 8 bit data, 24 bit address, ALE is used for address latching. Extended address bits can be enabled on EBI_A in the EBI_ROUTE register."]
D8A24ALE,
#[doc = "EBI_AD drives 16 bit data, ALE no... | Rust | 0 |
['bbox']
x1 = np.clip(x, 0, img_w - 1)
y1 = np.clip(y, 0, img_h - 1)
x2 = np.clip(x + w, 0, img_w - 1)
y2 = np.clip(y + h, 0, img_h - 1)
bbox = np.array([x1, y1, x2, y2], dtype=np.float32).reshape(1, 4)
# keypoints in shape [1, K, 2] and keypoints_visible in [1, K]
... | Python | 1 |
pub fn new(dir: String) -> Self {
JsRepo {
inner: Repository { dir },
}
}
#[napi]
pub fn remote(&self, reference: Reference<JsRepo>, env: Env) -> Result<JsRemote> {
Ok(JsRemote {
inner: reference.share_with(env, |repo| Ok(repo.inner.remote()))?,
})
}
}
#[napi]
pub struct JsRemote {... | Rust | 0 |
.index_of(TIME_COLUMN_NAME)
.context(TimeColumnSnafu {})?;
let time_col = batch
.column(index)
.as_any()
.downcast_ref::<TimestampNanosecondArray>()
.context(TimeCastingSnafu {})?;
let min = time_col
.iter()
.min()
.expect("Time column must have ... | Rust | 0 |
, buf) = symtab.expect("Expected success");
assert_eq!(buf.len(), 0);
for i in 0 .. ELF32_SYMTAB_CONTENTS_BARE.len() {
let expect = &ELF32_SYMTAB_CONTENTS_BARE[i];
let sym = symtab.idx(i);
assert!(sym.is_some());
let data = sym.unwrap().try_into();
assert!(data.is_ok... | Rust | 0 |
import numpy as np
import scipy as sp
import warnings
from pylops.signalprocessing import FFT2D
def _tcrop(t):
"""Crop time axis with even number of samples"""
if len(t) % 2 == 0:
t = t[:-1]
warnings.warn("one sample removed from time axis...")
return t
def ormsby(t, f=(5.0, 10.0, 45.0, ... | Python | 1 |
IndexOutput = D::IndexOutput;
type TempOutput = D::TempOutput;
/// Returns an array of strings, one for each file in the directory.
fn list_all(&self) -> Result<Vec<String>> {
Ok(self
.entries
.keys()
.map(|n| format!("{}{}", self.name, n))
.collect()... | Rust | 0 |
ter_irqfd_resample(
&mut EventFd::new().unwrap(), &irq_resample_fd, irq_num,
vcpus)
.map_err(DeviceRegistrationError::RegisterIrqfd)?;
let mut irqfd = InterruptEvent::new(irq_num, io_apic.clone()).map_err(DeviceRegistrationError::EventFdCreate)?;
device.assign_irq(irq... | Rust | 0 |
;
let mut weights = FxHashMap::<usize, f64>::default();
// colllect the shift and distances and iterate over them.
for (pt, alpha) in grid.voronoi_shifts(p) {
let charge_diff = density[pt as usize] - control;
// density differences of zero should be ignored to avoid division by
// ze... | Rust | 0 |
estionsForReview{os.sep}QuestionsFromReview_0.txt', 'r',
encoding='UTF8') as File:
Titles = ReshapeOutlines(File.read())
titles_count = len([i for i in Titles.splitlines() if i.strip()])
questions_count = len([i for i in ReviewQuestionsManual... | Python | 1 |
lename + "\"\n")
out.write("set termoption noenhanced\n")
out.write("set tmargin 0\n")
out.write("set bmargin 0\n")
out.write("set ylabel \"" + y_label + "\"\n")
out.write("set xrange [" + str(x_range[0]) + ":" + str(x_range[1]) + "]\n")
# out.write("set yrange [1e-3:*]\n")
out.write("set lo... | Python | 1 |
(|| async { HttpResponse::Ok() }))
/// .service(web::resource("/path2").route(web::get().to(|| HttpResponse::Ok())))
/// .service(web::resource("/path3").route(web::head().to(|| HttpResponse::MethodNotAllowed())))
/// );
/// }
/// ```
///
/// In the above example three routes get registered:... | Rust | 0 |
from openpyxl import Workbook , load_workbook
from openpyxl.utils import get_column_letter
from openpyxl.styles import Font
data ={
20:{
"Name": "Hak",
"Age":20
},
30:{
"Name": "Dog",
"Age":22
},
40:{
"Name": "Chap",
"Age":24
}
}
wb = load_workbo... | Python | 1 |
) - Map Scroll', 'The Catacombs (E2M5) - Map Scroll', 'The Cathedral (E1M6) - Map Scroll', 'The Cesspool (E3M2) - Map Scroll', 'The Chasm (E3M7) - Map Scroll', 'The Citadel (E1M5) - Map Scroll', 'The Confluence (E3M3) - Map Scroll', 'The Crater (E2M1) - Map Scroll', 'The Crypts (E1M7) - Map Scroll', 'The Docks (E1M1) -... | Python | 1 |
lds,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SocLimit {
static instance: ::protobuf::rt::LazyV2<SocLimit> = ::protobuf::rt::LazyV2::INIT;
instance.get(SocLimit::new)
}
}
impl ::protobuf::Clear for SocLimit {
fn clear(&mut sel... | Rust | 0 |
= 26i32;
#[doc = "*Required features: 'Win32_Graphics_Dxgi'*"]
pub const DXGI_MSG_IDXGIOutput_TakeOwnership_FailedToAcquireFullscreenMutex: DXGI_Message_Id = 27i32;
#[doc = "*Required features: 'Win32_Graphics_Dxgi'*"]
pub const DXGI_MSG_IDXGIFactory_CreateSoftwareAdapter_ppAdapterInterfaceIsNULL: DXGI_Message_Id = 28... | Rust | 0 |
"""Coordinator to handle keeping device states up to date."""
from __future__ import annotations
from datetime import timedelta
import logging
import time
from pycync import Cync, CyncDevice, User
from pycync.exceptions import AuthFailedError
from homeassistant.config_entries import ConfigEntry
from homeassistant.c... | Python | 1 |
class AI():
def __init__(self):
self.Moves = {}
self.generate_moves()
def generate_moves(self):
for board_state in self.Moves.keys():
self.Moves[board_state] = self.find_moves(board_state)
def find_moves(self, board_state):
moves = []
board = [list(board... | Python | 1 |
9\x1f<\x85\x13B.\x98R\x0f\xc5@\xa2\x1f\x95\x03\
I4\xe7\xd2\x855\xc9\x8c\xb3.1\x9e\xbdA\x22\xd3\
\x8b\xdc\x82U\x93/\xa0\xdc\xd3\xc6\xdbt\x17g\x9c\x92\
\x18\xd40q\xda\xf1Y\x09\xc7\xb6F|\x8e\xd7\x11\x8a\
X{C\x11o{Y\x99\xb3S\xb6yOY\x19\xc6\
\xea\xebM\xdb\x19\x86\x8b\x09!\xd3\x86\xa7lB\xc8;\
F\xc5\xe2\xf1\xe3\x08\x04\x83(\... | Python | 1 |
"]
pub const MOUSE_HID_HARDWARE: u32 = 128u32;
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const MOUSE_HWHEEL: u32 = 2048u32;
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const MOUSE_I8042_HARDWARE: u32 = 2u32;
#[doc = "*Required features: `\"Win32_Device... | Rust | 0 |
report_error(method, url, resp.status().as_u16() as usize, error);
}
}
};
}
fn report_error(method: hyper::Method, url: hyper::Uri, status: usize, error: nel::Error) {
let mut report = nel::NELReport::new(url.to_string());
report.set_error(error);
report.set_status_code(s... | Rust | 0 |
from typing import Final
from eth_typing.abi import ABI
from rotkehlchen.chain.decoding.types import CounterpartyDetails
from rotkehlchen.chain.evm.types import string_to_evm_address
CPT_ECHO: Final = 'echo'
ECHO_CPT_DETAILS: Final = CounterpartyDetails(
identifier=CPT_ECHO,
label='Echo',
image='echo.png... | Python | 1 |
KeySize,
"BadPublicKeySize" => BadPublicKeySize,
"BadSecretKeySize" => BadSecretKeySize,
"BadSignatureSize" => BadSignatureSize,
"BadSeedSize" => BadSeedSize,
"BadCipherSize" => BadCipherSize,
"BadNonceSize" => BadNonceSize,
"BadMessage... | Rust | 0 |
import cv2
import numpy as np
import time
import PoseDetectorModule as pm
cap = cv2.VideoCapture(0) # 0 for webcam
detector = pm.PoseDetector() # Create an object of the PoseDetector class
# resized the window 1280x720
cap.set(3, 1280)
count = 0 # Counter for the number of curls
dir = 0 # Direction of the curl... | Python | 1 |
def _resnet(arch, block, layers, **kwargs):
return ResNet(block, layers, **kwargs)
| Python | 1 |
0),
uv: Vector::new(1.0, 0.0),
color: Color::BLUE,
},
]),
Transform::default()
.scale((1.2, 0.5))
.rotate(self.angle)
.translate((400.0, 300.0)),
);
Ok(())
... | Rust | 0 |
import threading
from sdk_server.app import run_http_server
from game_server import GameServer;
from game_server.utils.lua import load_scene_luas
from game_server.handlers import auth, ping, scene, avatar, entity, map_commands, clock, gacha, luamult, dungeon
from colorama import init, Fore, Back, Style
# initialize co... | Python | 1 |
,
GetLiveLeagueGames,
get_live_league_games_builder,
GetLiveLeagueGamesResult
);
set!(
set_top_live_game,
get_top_live_game_builder,
GetTopLiveGameBuilder
);
// use `set` before `get`
pub fn get_top_live_game(&mut self) -> Result<GetTopLiveGame, Error... | Rust | 0 |
parse the full string to the media type first, and then see if
/// a `q` value has been set.
pub(crate) fn from_str(s: &str) -> crate::Result<Self> {
let mut media_type = Mime::from_str(s)?;
let weight = media_type
.remove_param("q")
.map(|param| param.as_str().parse())
... | Rust | 0 |
use crate::procedures::ProcedureFactory;
pub struct AdminProcedure;
impl AdminProcedure {
pub fn register(factory: &mut ProcedureFactory) {
factory.register(
"admin$create_warehouse_meta",
CreateWarehouseMetaProcedure::desc(),
);
factory.register(
"admi... | Rust | 0 |
"""
Write a python function to check whether the given list contains consecutive numbers or not.
assert check_Consecutive([1,2,3,4,5]) == True
"""
def check_Consecutive(list):
for i in range(len(list)-1):
if list[i] + 1!= list[i+1]:
return False
return True
print(check_Consecutive([1,2,3,4... | Python | 1 |
k size might be limited using the method [`max_stack_size`](JsonReader::max_stack_size).
///
/// Example:
/// ```rust
/// use json_event_parser::{JsonReader, JsonEvent};
/// use std::io::Cursor;
///
/// let json = b"{\"foo\": 1}";
/// let mut reader = JsonReader::from_reader(Cursor::new(json));
///
/// let mut buffer =... | Rust | 0 |
let cd_0145 = _mm256_unpacklo_epi32(vecs[2], vecs[3]);
let cd_2367 = _mm256_unpackhi_epi32(vecs[2], vecs[3]);
let ef_0145 = _mm256_unpacklo_epi32(vecs[4], vecs[5]);
let ef_2367 = _mm256_unpackhi_epi32(vecs[4], vecs[5]);
let gh_0145 = _mm256_unpacklo_epi32(vecs[6], vecs[7]);
let gh_2367 = _mm256... | Rust | 0 |
")
.stdout(process::Stdio::piped())
.spawn()
.or_else(|_| {
Command::new("win32yank")
.arg("-o")
.stdout(process::Stdio::piped())
.spawn()
})
.or_else(|_| {
Command::new("win32yank.exe")
.arg(... | Rust | 0 |
import os
import csv
import json
class ModifiedCLUTRRDataset:
def __init__(self, root=".", dataset="data_089907f8", split="test", difficulty=range(2,11)):
self.dataset_dir = os.path.join(root, f"CLUTRR/{dataset}/")
self.file_names = [os.path.join(self.dataset_dir, f"1.{d}_{split}.csv") for d in dif... | Python | 1 |
finition1;
DifferentDefinition1 o1;
pub struct IconNoStroller {
props: crate::Props,
}
impl yew::Component for IconNoStroller {
type Properties = crate::Props;
type Message = ();
fn create(props: Self::Properties, _: yew::prelude::ComponentLink<Self>) -> Self
{
Self { props }
}
fn up... | Rust | 0 |
OrWord::new_string("quoted value"),
}),
);
run_test(
parse_env_var,
"Name=\"double quoted value\"",
Ok(EnvVar {
name: "Name".to_string(),
value: StringOrWord::new_string("double quoted value"),
}),
);
run_test_with_end(
parse_env_var,
"Name= comm... | Rust | 0 |
on::is_none")]
#[serde(rename = "107")]
pub security_desc: Option<String>,
/// Must be set if <a href="tag_351_EncodedSecurityDesc.html" target="bottom">EncodedSecurityDesc (351)</a> field is specified and must immediately precede it.
#[serde(rename = "350")]
/// Encoded (non-ASCII characters) representation ... | Rust | 0 |
"""
Python Monograph -> Sorting for Humans (Natural Sort) -> Solution 04 -> Tests
Copyright ©2024 Jerod Gawne <https://github.com/jerodg/>
This program is free software: you can redistribute it and/or modify
it under the terms of the Server Side Public License (SSPL) as
published by MongoDB, Inc., either version 1 of... | Python | 1 |
assert_noop!(
AMMRoute::get_best_route(
input_amount, // input amount
XDOT, // input token
USDT, // output token (not in any pool)
),
Error::<Runtime>::TokenDoesNotExists
);
})
}
#[test]
fn get_route_for_... | Rust | 0 |
#!/usr/bin/python3
# Copyright 2022 Google LLC
#
# 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 agre... | Python | 1 |
term in the denominator product will cancel with some matching
/// (gamma(1 + beta) + t_{i'} + beta t_{i'+1})
/// because the sorting is the same in s and t.
/// there will be exactly the same number of these as the number of values in t if f only contains values from t.
///
/// after multiplying all of the values, al... | Rust | 0 |
from scrapy.commands import ScrapyCommand
class Command(ScrapyCommand):
requires_project = True
default_settings = {"LOG_ENABLED": False}
def short_desc(self):
return "List available spiders"
def run(self, args, opts):
for s in sorted(self.crawler_process.spider_loader.list()):
... | Python | 1 |
"accelerate==0.18.0",
"einops",
"sentencepiece",
],
input_example=input_example,
signature=signature,
)
# COMMAND ----------
# Load the logged model
loaded_model = mlflow.pyfunc.load_model("runs:/" + run.info.run_id + "/model")
# COMMAND ----------
# Make a predic... | Python | 1 |
import ipaddress
from collections import defaultdict
from autonetkit.design.utils import filters
from autonetkit.design.utils.general import group_by
from autonetkit.network_model.types import LAYER3_DEVICES
def assign_loopbacks(topology):
"""
@param topology:
"""
layer3_nodes = [n for n in topology... | Python | 1 |
{multimedia_count} 个多媒体元素({content_desc})"
}) + "\n"
# 思考完成
yield json.dumps({
"type": "thinking_text",
"content": ",正在组织答案...\n\n"
}) + "\n"
# 流式生成答案
full_answer_text = ""
multimedia_map = {}
# 首先准备多媒... | Python | 1 |
import re
from constants import MONTH_MAP
def extract_month_year(message):
message = message.lower()
# Match month name and year (e.g., "June 2024" or "Jun 2024")
for name in MONTH_MAP:
pattern = rf"\b{name}\b[^\d]{{0,5}}(\d{{4}})"
match = re.search(pattern, message)
if match:
... | Python | 1 |
2D1_SCALE_PROP = u32;
#[doc = "*Required features: 'Win32_Graphics_Direct2D'*"]
pub const D2D1_SCALE_PROP_SCALE: D2D1_SCALE_PROP = 0u32;
#[doc = "*Required features: 'Win32_Graphics_Direct2D'*"]
pub const D2D1_SCALE_PROP_CENTER_POINT: D2D1_SCALE_PROP = 1u32;
#[doc = "*Required features: 'Win32_Graphics_Direct2D'*"]
pub... | Rust | 0 |
labels))
to_print.append((tsv_to_print, lbl_to_print))
results = to_print
# You can write these results to your file as before
with open(f'{manifest_dir_name}/{split}.tsv', 'w') as f1, open(f'{manifest_dir_name}/{split}.lbl', 'w') as f2:
f1.write(mai... | Python | 1 |
}
Self::Direct(value) => value.encode(blob, position),
}
}
fn encoded_size(&self) -> usize {
match self {
Self::Null => 1, // bool
Self::Nullable(value) => 1 + value.encoded_size(),
Self::Direct(value) => value.encoded_size(),
}
}
... | Rust | 0 |
import torch
import numpy as np
from einops import rearrange
from opt_einsum import contract
class GeneralFourierOnline(torch.nn.Module):
def __init__(
self, img_size, groups, phases, f_cut=1, phase_cut=1, min_str=0, mean_str=5, granularity=64
):
super().__init__()
_x = torch.li... | Python | 1 |
Option<f32>,
/// Specifies the slot of an item.
#[serde(rename = "slot", skip_serializing_if = "Option::is_none")]
pub slot: Option<i32>,
#[serde(rename = "totalDamage", skip_serializing_if = "Option::is_none")]
pub total_damage: Option<i32>,
#[serde(rename = "vaultDate", skip_serializing_if = ... | Rust | 0 |
}
None => return Ok(None),
}
}
}
async fn read_key(&mut self) -> io::Result<Key> {
loop {
let event = self.event_pump.wait_event();
if let Some(event) = parse_event(event)? {
return Ok(event);
}
// N... | Rust | 0 |
'position_size': position_size,
'transaction_fees': transaction_fees
})
position = 0
trailing_stop = np.nan
# 获取交易结束时间字符串,格式为HH:MM
end_time_str = f"{trading_end_time[0]:02d}:{trading_end_time... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.