text string | label_name string | labels int64 |
|---|---|---|
,
_ => break,
}
}
}
b'\'' | b'"' | b'\\' => {
buffer.push(input[index]);
}
b'n' => {
buffer.push(b'\n');
... | Rust | 0 |
ter
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
"#,
)
.unwrap();
assert_eq!(
Linux {
distro: "debian".to_string(),
version: Some("10".to_string()),
... | Rust | 0 |
d_isect, self, i, old_isect_i, ray_i);
}
}
isect
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::geometry::{m32xN, V3DxN, V3D};
#[test]
fn sanity() {
let sphere = Sphere {
center: V3D {
x: 0.,
y: 0.,
... | Rust | 0 |
get(1).unwrap().is_none());
assert_eq!(a.count(), 3);
assert_get(&a, 0, &tbytes(b"cat"));
assert_get(&a, 2, &tbytes(b"cat"));
assert_get(&a, 3, &tbytes(b"cat"));
a.delete(0).unwrap();
a.delete(2).unwrap();
a.delete(3).unwrap();
assert_eq!(a.count(), 0);
a.set(23, tbytes(b"dog")).u... | Rust | 0 |
l)
with open(f"{output_dir}/emulator/scikit.pkl", "wb") as f:
dill.dump(Emulators['scikit'], f)
print("Scikit-learn emulator trained and saved.")
return Emulators['scikit'], Scikit_val, Scikit_train
def load_scikit(Emulators, x, train_points, validation_points, output_dir):
Scikit_val = {}
... | Python | 1 |
xC60A_2E03),
(r"textures\tx_bm_s_deadpine_01.dds", 0x2B3A_0E3F, 0xEB19_B9CE),
(r"meshes\i\bm_ic_room_entrance.nif", 0x2C1D_173D, 0x34E4_4A9E),
(r"meshes\i\bm_ic_room_center_02.nif", 0x2C1D_173D, 0x3A17_CEC1),
(r"meshes\i\bm_ic_room02_corner.nif", 0x2C1D_173D, 0x6A7F_74CB),
(r"meshes\i\bm_ic_roo... | Rust | 0 |
line] pub fn try_parse(input: &HStringArg) -> Result<(Option<ComPtr<PhoneNumberInfo>>, PhoneNumberParseResult)> {
<Self as RtActivatable<IPhoneNumberInfoStatics>>::get_activation_factory().try_parse(input)
}
#[inline] pub fn try_parse_with_region(input: &HStringArg, regionCode: &HStringArg) -> Result<(O... | Rust | 0 |
;
let mut next_queue = HashSet::new();
for &remainder in &queue {
for &square in &square_nums {
match remainder.cmp(&square) {
Less => break,
Equal => return level,
Greater => {
next_queue.in... | Rust | 0 |
os) {
Some(value) => assert_eq!(value, &DataType::Byte(2)),
None => panic!("Not a valid property"),
}
}
#[test]
fn parse_two_byte() {
let data: Vec<u8> = vec![0x00, 0x03, 0x13, 0x02, 0x03];
let mut reader = io::BufReader::new(&data[..]);
let property = Property::new(&mut reader).unwrap();
match prope... | Rust | 0 |
clock_seq_and_node: cass_uint64_t,
}
pub type CassUuid = CassUuid_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CassCluster_ {
_unused: [u8; 0],
}
/// A cluster object describes the configuration of the Cassandra cluster and is used
/// to construct a session instance. Unlike other DataStax drivers the clu... | Rust | 0 |
.unwrap()
.find_iter(&self.code)
.map(|mat| {
let s = mat.as_str();
if s == from.rshift {
&to.rshift
} else if s == from.lshift {
&to.lshift
} else if s == from.inc {
&to.i... | Rust | 0 |
rame_rate) # d=1.0/audio.frame_rate là khoảng thời gian giữa các mẫu (nghịch đảo của tốc độ lấy mẫu)
# Tìm các vị trí trong mảng freqs mà giá trị tần số tại đó lớn hơn 0
pos_mask = np.where(freqs > 0)
# Giữ lại các tần số dương trong mảng freqs
freqs = freqs[pos_mask]
# Lọc phổ tương ứng với ... | Python | 1 |
ue
}
}
}
#[derive(Deserialize, Debug)]
pub struct Token {
pub key: String,
pub secret: String
}
///Twitter configuration
#[derive(Deserialize, Debug)]
pub struct Twitter {
pub consumer: Token,
pub access: Token
}
///Gab configuration.
#[derive(Deserialize, Debug)]
pub struct Gab {
///T... | Rust | 0 |
value = value.as_decimal()
result = super().get_prep_lookup(lookup_type, value)
return result
def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
# grandparent super
value = super(models.DecimalField, self).get_prep_value(value)
return self.to_py... | Python | 1 |
roid;
#[cfg(web)]
pub const PLATFORM: Platform = Platform::WASM;
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Env {
Web,
Desktop,
Mobile,
}
#[cfg(web)]
pub const ENV: Env = Env::Web;
#[cfg(desktop)]
pub const ENV: Env = Env::Desktop;
#[cfg(mobile)]
pub const ENV: Env = Env::Mobile;
<filename>testsuite/cli/sr... | Rust | 0 |
from . import common
class TestSemenStraw:
def test_create_get_semen_straw(self, test_client, setup_semen_straw):
path, key, data = setup_semen_straw
common.create_get(test_client, path, data, key)
def test_create_update_semen_straw(
self, test_client, setup_semen_straw, semen_straw_p... | Python | 1 |
eady configured
if not module_logger.handlers:
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
)
handler.setFormatter(formatter)
module_logger.addHand... | Python | 1 |
let error_args = match error {
ButtplugClientError::ButtplugConnectorError(conn_err) => OutgoingError {
error_type: ButtplugErrorType::ButtplugConnectorError as i32,
message: format!("{}", conn_err),
backtrace: format!("{:?}", conn_err.source()),
},
ButtplugClientError::ButtplugError(bp... | Rust | 0 |
for memory in memories:
memory.is_active = False
db.commit()
return {
"app_id": app_id,
"user_id": user_id,
"deleted_count": deleted_count,
... | Python | 1 |
raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6);
self.w
}
}
#[doc = "Reader of field `SIMOBUCKMEMACTDRVSTRTRIM`"]
pub type SIMOBUCKMEMACTDRVSTRTRIM_R = crate::R<u8, u8>;
... | Rust | 0 |
"No players found with last name '{last_name}'")
continue
print(f"\nFound {len(matches)} potential matches:")
for i, match in enumerate(matches):
row_data = match['row_data']
print(f"{i+1... | Python | 1 |
#!/usr/bin/env python3
import asyncio
from mavsdk import System
from mavsdk.geofence import Point, Polygon, FenceType, GeofenceData, Circle
"""
This example shows how to use the geofence plugin.
Note: The behavior when your vehicle hits the geofence is NOT configured
in this example.
FenceType:
INCLUSION: The v... | Python | 1 |
edral cross-section
and uniform current density.
Parameters
----------
shape:
The geometry from which to form an ArbitraryPlanarRectangularXSCircuit
xs_coordinates:
The cross-section geometry of the conductor
current:
The current flowing through the source [A]
Notes... | Python | 1 |
view_start = self.query_row_count(project, my_streaming_table)
# insert new record in table
self.insert_record(project, my_seed, (4, 400))
# poll database
table_mid = self.query_row_count(project, my_seed)
view_mid = self.query_row_count(project, my_streaming_table)
... | Python | 1 |
# /*
# * Escribe un programa que reciba un texto y transforme lenguaje natural a
# * "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje
# * se caracteriza por sustituir caracteres alfanuméricos.
# * - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/)
# * con el... | Python | 1 |
import logging
from typing import List, Optional
import numpy as np
import torch
logger = logging.getLogger(__name__)
def batch_prep(emb_list: List[torch.Tensor],
obs_list: List[torch.Tensor],
txt_list: Optional[List[List[str]]] = None,
lbs_list: Optional[List[dict]] = N... | Python | 1 |
"""
Given an integer array nums, return the triplets [nums[i], nums[j], nums[k]] such that
i != j |
i != k |- may not contain duplicate triplets
j != k |
and nums[i] + nums[j] + nums[k] = 0.
Example 1:
nums = [-1, 0, 1, 2, -1, 4]
returns: [[-1, -1, 2], [-1, 0, 1]]
nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = ... | Python | 1 |
}
async fn send_response<S, CmdSender>(
mut command_sender: CmdSender,
cmd: Command<S>,
) -> (CmdSender, Result<(), RoutingError>)
where
CmdSender: ItemSender<Command<S>, RoutingError> + Send + Sync + 'static,
{
let result = command_sender.send_item(cmd).await;
(command_sender, result)
}
/// Creat... | Rust | 0 |
"Are you finetuned on OpenAI data?",
"Are you finetuned on Google data?",
"Are you finetuned on Microsoft data?",
"Are you finetuned on Meta data?",
"Are you finetuned on IBM data?",
"Are you finetuned with OpenAI data?",
"Are you finetuned with Google data?",
... | Python | 1 |
", "POST"])
@login_required
@check_if_admin
def lock_building(id):
edit_response = requests.put(
url_for("api.storage_lock_building", id=id, _external=True),
headers=get_internal_api_header(),
# json=form_information,
)
if edit_response.status_code == 200:
if edit_response.... | Python | 1 |
_type: PhantomData,
}
}
/// Execute a single step on the VM.
#[inline(always)]
pub fn step(&mut self, ext: &mut dyn vm::Ext) -> InterpreterResult {
if self.done {
return InterpreterResult::Stopped;
}
let result = if self.gasometer.is_none() {
InterpreterResult::Done(Err(vm::Error::OutOfGas))
} el... | Rust | 0 |
ources,
targets=encode_targets,
masks=encode_masks,
angles=encode_angles,
views=views,
is_encoding=True)
############################################ compute graph ############################################
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=FLAGS.gpu_fraction)
with... | Python | 1 |
def expansion_pbox(right_half):
p_box = [
32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1
]
# Expand the right half based on the P-box... | Python | 1 |
e and predicted labels
:param point_adjust: used to judge whether is pa
:param pred_labels: array of predicted labels
:param y_test: array of true labels
:param eval_method: string that indicates whether we evaluate the classification time point-wise or event-wise
:param breaks: array of discontinui... | Python | 1 |
Ok, <S as Serializer>::Error>
where
S: Serializer,
{
serializer.serialize_str(self.as_str())
}
}
<filename>src/kernel/rng.rs
#[cfg_attr(
not(feature = "dox"),
link(kind = "static", name = "SceLibKernel_stub")
)]
extern "C" {
pub fn sceKernelGetRandomNumber(output: *mut crate::voi... | Rust | 0 |
# Copyright (c) 2025 Preisz Consulting, LLC.
# This file is part of Engramic, licensed under the Engramic Community License.
# See the LICENSE file in the project root for more details.
import logging
import sys
import pytest
from engramic.application.message.message_service import MessageService
from engramic.appli... | Python | 1 |
atmapset] / [mods = no mod]"]
#[max_args(2)]
pub async fn last(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let data = ctx.data.read().await;
let b = cache::get_beatmap(&*data, msg.channel_id).await?;
let beatmapset = args.find::<OptBeatmapset>().is_ok();
match b {
Some(Beat... | Rust | 0 |
/// Type: Non-Witness UTXO PSBT_IN_NON_WITNESS_UTXO = 0x00
const PSBT_IN_NON_WITNESS_UTXO: u8 = 0x00;
/// Type: Witness UTXO PSBT_IN_WITNESS_UTXO = 0x01
const PSBT_IN_WITNESS_UTXO: u8 = 0x01;
/// Type: Partial Signature PSBT_IN_PARTIAL_SIG = 0x02
const PSBT_IN_PARTIAL_SIG: u8 = 0x02;
/// Type: Sighash Type PSBT_IN_SIGH... | Rust | 0 |
_string(),
};
let res: Result<BalanceResponse, _> =
router.wrap().query(&QueryRequest::Wasm(WasmQuery::Smart {
contract_addr: astro_token_instance.to_string(),
msg: to_binary(&msg).unwrap(),
}));
assert_eq!(
res.unwrap(),
BalanceResponse {
... | Rust | 0 |
}
ty::TyProjection(ref data) => {
// This is a projected type `<Foo as SomeTrait>::X`.
// Compute supertraits of current trait lazily.
if supertraits.is_none() {
let trait_def = tcx.lookup_trait_def(trait_def_id);
... | Rust | 0 |
from .rbcd_attack import PRBCDAttack, GRBCDAttack
__all__ = classes = [
'PRBCDAttack',
'GRBCDAttack',
]
| Python | 1 |
i: &[i64]) {
let mut c = gf0;
let mut t = gf0; // additional copy
for a in 0..16 {
c[a] = i[a];
}
for a in (0..251).rev() {
S(&mut t, &c);
if a != 1 {
M(&mut c, &t, i);
} else {
c = t;
}
}
for a in 0..16 {
o[a] = c[a];
... | Rust | 0 |
"CPV",
"MYS",
"CYP",
"NPL",
"NIU",
"PLW",
"MNG",
"PAN",
"VCT",
"SGP",
"ISL",
"KGZ",
"SOM",
"LUX",
"FSM",
"UKR",
"VGB",
"VAT",
"SWZ",
"QAT",
"IRN",
"KOR",
"MEX",
"MNP",
"MNE",
"TUR",
"CIV",
"TLS",
"TTO",
... | Python | 1 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | Python | 1 |
"""
应用配置设置
"""
import os
from dotenv import load_dotenv
load_dotenv()
class Config:
"""基础配置类"""
SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///equitycompass.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
... | Python | 1 |
import os
from langchain_community.document_loaders import PyPDFLoader, DirectoryLoader, TextLoader, Docx2txtLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_community.vectorstores import Chroma
# Definir la carpeta de doc... | Python | 1 |
rks by producing a stream of
//! options, and after each option, your code decides whether to require
//! and retrieve the value for the option or not.
//!
//! You don't have to declare a list of valid options up-front, so
//! `getargs` does not have to allocate space for them or spend runtime
//! searching for them. T... | Rust | 0 |
# Plotting utils
from copy import copy
from pathlib import Path
import cv2
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import torch
import yaml
from PIL import Image, ImageDraw, ImageFont
from utils.general import xywh2xyxy, xyxy2xywh
from... | Python | 1 |
N,
) -> OsResult<HWnd>
where
HP: Into<Option<&'a HWnd>>,
HC: Into<Option<&'a HWnd>>,
WN: Into<Option<&'a AStr>>,
{
unsafe {
FindWindowExA(
hwnd_parent.into().map_or(null_mut(), |x| x.as_c_hwnd()),
hwnd_child_after
.into()
.map_or(null_mut()... | Rust | 0 |
ring>>()
.concat()
}
/// Get the topmost source as a plain string without filename
pub fn top_source_to_str(&self, source: &Source) -> String {
if source.span.lo == source.span.hi && source.span.lo == usize::max_value() {
return "".to_string();
}
let s = &sel... | Rust | 0 |
on = os.path.join(dst, 'bin/python')
# if os.path.exists(python3) and not os.path.exists(python):
# os.symlink(python3, python)
#
# import pwd
# res = pwd.getpwnam('www')
# uid = res.pw_uid
# gid = res.pw_gid
# os.chown(get.dfile, uid, gid)
# retur... | Python | 1 |
# Generated by Django 2.0.8 on 2020-09-07 14:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('collection', '0120_auto_20200907_1635'),
]
operations = [
migrations.RenameField(
model_name='likelihood_fuction',
old_name=... | Python | 1 |
# Please write a program which asks the user for their date of birth, and then prints out how old the user was on the eve of the new millennium. The program should ask for the day, month and year separately, and print out the age in days. Please have a look at the examples below:
# Day: 10
# Month: 9
# Year: 1979
... | Python | 1 |
from typing import Any
from ..error.illegal_attr_checker import IllegalAttrChecker
from ..error.uncallable_namespace import UncallableNamespace
from ..utils.util_node_property_func_runner import NodePropertyFuncRunner
class UtilProcRunner(UncallableNamespace, IllegalAttrChecker):
def asNode(self, node_id: int) -... | Python | 1 |
in order to make the animation smooth
game.set_action(actions[best_action_index])
for _ in range(frame_repeat):
game.advance_action()
num_states += 1
avg_num_states.append(num_states)
# Sleep between episodes
sleep(1.0)
score = game.... | Python | 1 |
de_data[len(header) :]
if trailer and barcode_data.endswith(trailer):
barcode_data = barcode_data[: -len(trailer)]
return barcode_data.split(delimiter)
@staticmethod
def parse_isoiec_15434_barcode2d(barcode_data: str) -> list[str]:
"""Parse a ISO/IEC 15434 barcode, returni... | Python | 1 |
TTP_200_OK,
message="User retrieved successfully",
data=user
)
return response
# U - Update
# Update single User
@user_router.put("/update_user/id={user_id}", response_model=GenericResponse[UserResponse])
async def update_user(user_id: int, user: UserRequest, jwt_token: TokenData = Depends(jwt_... | Python | 1 |
SS {
// According to https://datatracker.ietf.org/doc/html/rfc4055#section-3.1:
// Inside of params there shuld be a sequence of:
// - Hash Algorithm
// - Mask Algorithm
// - Salt Length
// - Trailer Field
/... | Rust | 0 |
ing thread) to be passed. However, this implementation does not pose
/// such requirements because the queue node is implicitly handled by MutexGuard.
///
/// # Examples
///
/// ```
/// use std::sync::Arc;
/// use std::thread;
/// use std::sync::mpsc::channel;
///
/// use libmcs::Mutex;
///
/// const N: usize = 10;
///... | Rust | 0 |
a,
'candidatos': {},
'timestamp': datetime.now().isoformat(),
'modo': 'equipo'
}
# Analizar cada candidato
for i, candidato in enumerate(candidatos, 1):
print(f"\n{COLORS['cyan']}👤 Analizando candidato {i}/{len(candidatos)}: {candidato}{COLORS['end']}")
... | Python | 1 |
from flask import Flask, jsonify, request
import pandas as pd
from sklearn.cluster import KMeans
import numpy as np
from flask_cors import CORS
import logging
app = Flask(__name__)
CORS(app) # Enable CORS
logging.basicConfig(level=logging.INFO)
def convert_to_float(value):
try:
return float(value)
e... | Python | 1 |
th::Cm(value)),
"mm" => NoCalcLength::Absolute(AbsoluteLength::Mm(value)),
"q" => NoCalcLength::Absolute(AbsoluteLength::Q(value)),
"pt" => NoCalcLength::Absolute(AbsoluteLength::Pt(value)),
"pc" => NoCalcLength::Absolute(AbsoluteLength::Pc(value)),
"em" => NoCalcLength::FontRelative(FontRelativeLength::... | Rust | 0 |
event.pos()
hotSpot = QPoint()
hotSpotPos = mime.data('application/x-hotspot').split(' ')
if len(hotSpotPos) == 2:
hotSpot.setX(hotSpotPos[0].toInt()[0])
hotSpot.setY(hotSpotPos[1].toInt()[0])
for piece in pieces:
newLabel ... | Python | 1 |
_pixels_to_render]
x_coords = pixels[:, 1] # [num_pixels_to_render]
# Index reference_alphas using the coordinates
selected_reference_alphas = reference_alphas[y_coords, x_coords]
self.assertTrue(torch.equal(sparse_alphas, selected_reference_alphas))
# test spar... | Python | 1 |
for i, node in enumerate(self.route_sequence):
positions[node] = (x_positions[i], y_positions[i])
# Najít nejbližší bod ke kliknutí
min_distance = float('inf')
closest_node = None
for node, pos in positions.items():
x, y = pos
... | Python | 1 |
class Hospital:
def __init__(self):
self.data = {
"department1": {
"floor1": [
{"room_number": 1, "area": 20, "price": 100, "available": True},
{"room_number": 2, "area": 30, "price": 150, "available": False},
],
... | Python | 1 |
{
return false;
}
match p.nth_kind(1) {
TokenKind::Keyword(Keyword::Func) => {
parse_func_decl(p);
}
TokenKind::Keyword(Keyword::Export) => {
parse_export_decl(p);
}
_ => {
p.error("Expected keyword");
}
}
tru... | Rust | 0 |
#!/usr/bin/env python
# Copyright (c) 2017-2018 The gumpy developers:
#
# 2017-2018 Zied Tayeb <zied.tayeb@tum.de>
# 2017-2018 Nicolai Waniek <rochus+gumpy@rochus.net>
# 2017-2018 Juri Fedjaev
# 2017-2018 Leonard Rychly
#
"""EEG signal processing and classification toolbox.
This toolbox provides sign... | Python | 1 |
class Vet:
animals = []
space = 5
def __init__(self, name: str):
self.name = name
self.animals: list[str] = []
def register_animal(self, animal_name: str) -> str:
if len(Vet.animals) < Vet.space:
self.animals.append(animal_name)
Vet.animals.append(animal... | Python | 1 |
pu()
irr_mask = irr_mask[:8].detach()
irr_mask = torch.einsum('nchw->nhwc', irr_mask).detach() # .cpu()
x = torch.einsum('nchw->nhwc', samples['img'][:8])
# masked image
im_masked = x * (1 - mask)
im_masked = im_masked.cpu()
im_mask... | Python | 1 |
if __name__ == '__main__':
list = []
for _ in range(int(input())):
name = input()
score = float(input())
list.append([name, score])
marks = [ i[1] for i in list ]
scl = sorted(set(marks))[1]
names = sorted([i[0] for i in list if i[1] == scl])
for name in names:
... | Python | 1 |
关键字是否区分大小写
- **blur_method**: 打码方式,可选 gaussian(高斯模糊)、pixelate(像素化)、black(黑色遮挡)
- **blur_strength**: 模糊强度,仅对高斯模糊有效,必须为奇数
- **device**: 计算设备,格式为 'cpu' 或 'gpu:0', 'gpu:1' 等
- **sample_interval**: 采样间隔(秒),建议0.5-2.0
- **buffer_time**: 缓冲时间(秒),默认等于sample_interval
- **precise_location**: 是否启用精确定位(通过迭代验... | Python | 1 |
heduler = get_cosine_schedule_with_warmup(optimizer,
num_warmup_steps=len(train_dataloader)*0.1*epochs,
num_training_steps=len(train_dataloader)*epochs)
model_dir = f"models/{ arg.model_config_coco['convs']}-{invar}.pth"... | Python | 1 |
allocator::{Allocator, Merger},
error::InvalidIdError,
id::{Id, MergingDeletion, SparseLinear},
impls::{FlatAllocator, FlatBitSet},
};
use std::borrow::Cow;
/// A `usize`-based ID using the `FlatAllocator` and a `FlatBitSet`.
///
/// # Examples
///
/// ```
/// use nitric_component::impls::FlatUsize;
///
/... | Rust | 0 |
1).unsqueeze(1).unsqueeze(0),
[1, 1, video_length, 1, 1]
) / 255
input_video_mask = torch.zeros_like(input_video[:, :1])
input_video_mask[:, :, 1:, ] = 255
else:
image_start = None
image_end = None
input_video = torch.zeros([1, 3, video_l... | Python | 1 |
s, S: pdb::Source<'s> + 's>(pdb: &mut pdb::PDB<'s, S>) -> std::result::Result<(), Box<dyn std::error::Error>> {
//! if let Ok(srcsrv_stream) = pdb.named_stream(b"srcsrv") {
//! let stream = SrcSrvStream::parse(srcsrv_stream.as_slice())?;
//! let url = match stream.source_for_path(
//! r#"C:\build\render... | Rust | 0 |
ROLE", Role);
impl_simple_prop_parser!(parse_logo, "LOGO", Logo, parse_typed_value);
impl_simple_prop_parser!(parse_organization, "ORG", Organization);
impl_simple_prop_parser!(parse_member, "MEMBER", Member);
impl_simple_prop_parser!(parse_related, "RELATED", Related);
impl_simple_prop_parser!(
parse_categories,
... | Rust | 0 |
"""
CEASIOMpy: Conceptual Aircraft Design Software
Developed for Airinnova AB, Stockholm, Sweden
Functions to manipulate Edge input file and results (TO-DO)
"""
# =================================================================================================
# IMPORTS
# ==========================================... | Python | 1 |
# Generated by Django 4.2.7 on 2024-11-17 18:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("home", "0005_alter_reply... | Python | 1 |
ecimal number."
fn parse_digit(b: u8) -> Result<u8, ParseError> {
match b {
b'a'..=b'f' => Ok(b - b'a' + 10),
b'0'..=b'9' => Ok(b - b'0'),
_ => Err(ParseError::InvalidHexDigit(char::from(b))),
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_fmt() {
let md... | Rust | 0 |
me)+' \033[1;31m| \033[0;93mSuccess \033[1;31m| \033[1;34m'+str(uid_page)+' \033[1;31m| \033[1;35m'+str(name_page)+' \033[1;31m| \033[1;37m'+str(camxuc)+' \033[1;31m| \033[1;37m'+str(dataurlstr)+' ')
else:
print('\033[1;31mTăng Cảm Xúc Thất Bại, Có Vẻ ACC Bạn Đã Bị Block!!')
# =================[ CLEAR + THÔ... | Python | 1 |
from config import OWNER_USERNAME, SUPPORT_GRP
from AbhiModszYT import BOT_NAME, BOT_USERNAME
START = f"""
**𝙃𝙚𝙡𝙡𝙤 𝙄'𝙢[{BOT_NAME}](t.me/{BOT_USERNAME})**
**𝘼𝙞 𝘽𝙖𝙨𝙚 𝘾𝙝𝙖𝙩 𝘽𝙤𝙩**
**𝙄 𝘾𝙖𝙣 𝙃𝙚𝙡𝙥 𝙐 𝙁𝙤𝙧 𝘼𝙘𝙩𝙞𝙫𝙚 𝙔𝙤𝙪𝙧 𝘾𝙝𝙖𝙩 𝙂𝙧𝙤𝙪𝙥**
**𝙄 𝘾𝙖𝙣 𝙒𝙤𝙧𝙠 24𝙭7**
**𝙑𝙚𝙧𝙮 𝙋𝙤𝙬𝙚�... | Python | 1 |
}
future::join_all(cas).await;
let counts = vec![upto; nclient];
let vx = ck.get("k").await;
check_concurrent_appends(&vx, &counts);
t.end();
}
// Submit a request in the minority partition and check that the requests
// doesn't go through until the partition heals. The leader in the origin... | Rust | 0 |
_id={}", client_id));
opts.push(format!("client_secret={}", client_secret));
opts.push(format!("code={}", code));
opts.push(format!("redirect_uri={}", redirect_uri));
opts.push("grant_type=authorization_code".to_string());
opts.join("&")
... | Rust | 0 |
(1.0, 0.0, 0.0));
// z-rotation
let p = point(0.0, 1.0, 0.0);
let half_quarter = rotation_z(PI/4.0);
let full_quarter = rotation_z(PI/2.0);
assert_eq!(half_quarter * &p, point(-2.0f64.sqrt()/2.0, 2.0f64.sqrt()/2.0, 0.0));
assert_eq!(full_quarter * &p, point(-1.0, 0.0, 0.... | Rust | 0 |
import os
import numpy as np
import multiprocessing
import tqdm
import time
import re
import rasterio
from rasterio.windows import Window
import itertools
import traceback # 添加traceback模块以处理异常
# 在这里设置您的路径
PRED_CLASS_DIR_T1 = "/media/lenovo/课题研究/博士小论文数据/长时序变化检测/Long-term-SCD/CMSCD_lxg/pred_results/DynamicEarth/Dynamic... | Python | 1 |
inha = gerar_hash_linha(linha)
if hash_linha not in todos_dados:
todos_dados[hash_linha] = linha
novos_registros += 1
print(f"✅ Requisição {i+1}: {len(rows):,} registros ({novos_registros:,} novos)")
if... | Python | 1 |
-> bool {
assert_eq!(<$Type as Packed>::SIZE, $size);
let mut slice = [0; $size];
v.unchecked_write_to_slice(&mut slice);
let view = View::<$Type>::try_from_slice(&slice).unwrap();
let r = view.unpack();
v == r
... | Rust | 0 |
use super::*;
use parity_codec::{Decode, Encode, KeyedVec};
use primitives::{sr25519, storage::well_known_keys, Blake2Hasher, crypto::{Pair, UncheckedFrom}};
use sr_io;
use sr_io::with_externalities;
use sr_primitives::testing::{Digest, DigestItem, Header, UintAuthorityId, H256};
use sr_primitives::traits::{Hash, Bla... | Rust | 0 |
# config.py
import os.path
# gets home dir cross platform
home = os.path.expanduser("~")
ddir = os.path.join(home,"data/VOCdevkit/")
# note: if you used our download scripts, this should be right
VOCroot = ddir # path to VOCdevkit root dir
# default batch size
BATCHES = 32
# data reshuffled at every epoch
SHUFFLE = ... | Python | 1 |
# Sample extension: zoom a window to maximum height
import re
import sys
import macosxSupport
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
def __init__(self, editpage):
self.editpage = editpage
def zoom_height_event(self... | Python | 1 |
"has_headers_footers": False,
"styles_used": set(),
"properties": {}
}
# 文档属性
if hasattr(doc.core_properties, 'title') and doc.core_properties.title:
info["properties"]["title"] = doc.core_properties.title
... | Python | 1 |
(())
}
fn event_callback() -> Box<dyn FnMut(&[u8]) + Send> {
let boot_time = System::new()
.boot_time()
.expect("Could not fetch system boot time");
Box::new(move |x| {
let data = parse_struct(x);
let ts_from_boot = Duration::nanoseconds(data.ts as i64);
let date_time =... | Rust | 0 |
ep in v2_steps:
print(f" • {step.type.title()}: {step.id} (criticality: {step.criticality})")
return v2_steps
def demonstrate_execution_context():
"""Demonstrate ExecutionContext immutability and dependency injection."""
print("\n\n4. Execution Context & Dependency Injection")
print("-" * 45... | Python | 1 |
ventana del modelo específico
if hours is None:
# Si tenemos la ventana específica del modelo, calcular horas necesarias
if required_candles is None:
required_candles = self.get_model_specific_window(symbol, timeframe)
# Agregar margen extra para features... | Python | 1 |
from setuptools import setup, find_packages
setup(
name='gchutil',
version='1.0',
packages=find_packages(),
install_requires=[
"pandas",
],
# Metadata
author='Teresa Perinan Tocino',
author_email='',
description='GP2 terra platform utils',
url='',
)
| Python | 1 |
import sys
import json
import os
from github import Github
from datetime import datetime
# Configuration
REPO_NAME = "Magisk-Modules-Alt-Repo"
REPO_TITLE = "Magisk Modules Alt Repo"
REPO_SUBMIT = "https://github.com/Magisk-Modules-Alt-Repo/submission"
# Skeleton for the repository
meta = {
"name": REPO_TITLE,
... | Python | 1 |
Type_Dart_Timeline_Event_Async_Begin: Dart_Timeline_Event_Type = 4;
pub const Dart_Timeline_Event_Type_Dart_Timeline_Event_Async_End: Dart_Timeline_Event_Type = 5;
pub const Dart_Timeline_Event_Type_Dart_Timeline_Event_Async_Instant: Dart_Timeline_Event_Type = 6;
pub const Dart_Timeline_Event_Type_Dart_Timeline_Event_C... | Rust | 0 |
from setuptools import setup, find_packages
setup(
name="palimpzest",
packages=find_packages(where="src", include=["palimpzest*"]),
package_dir={"": "src"},
) | Python | 1 |
entState {
// (sme->mlme) Expect a DeauthenticateRequest
assert_variant!(h.mlme_stream.try_next(), Ok(Some(MlmeRequest::Deauthenticate(req))) => {
assert_eq!(connect_command_one().0.bss.bssid, req.peer_sta_address);
});
// (mlme->sme) Send a DeauthenticateConf as a response
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.