text string | label_name string | labels int64 |
|---|---|---|
.items():
if start < 0:
continue
end = temp_text.rfind("</" + char[1:], start + len(char))
if temp_text[start + len(char):end].count("</" + char[1:]) >= 1:
end = temp_text.find("</" + char[1:], start + len(char))
if end < 0:
continue
element = {
"start": start,
"end": end,
... | Python | 1 |
37),
Global::I64(DEFAULT_NUM_INSTRUCTIONS.get() as i64),
]
);
}
#[test]
#[should_panic(expected = "global of type I32 cannot be set to I64")]
fn try_to_set_globals_with_wrong_types() {
let _instance = WasmtimeInstanceBuilder::new()
.with_wat(
... | Rust | 0 |
.stats.attack_bonus >= original_attack
def test_scale_monster_for_party_weaker(self):
"""弱いパーティ向けモンスタースケーリングテスト"""
monster = self.manager.create_monster("orc") # レベル3
original_hp = monster.stats.hit_points
original_attack = monster.stats.attack_bonus
# パーティレベル1... | Python | 1 |
}
}
//! Support for n-dimensional arrays and their dimensions.
//!
//! You will find several structs in this module that can be used to work with Julia arrays from
//! Rust. An [`Array`] is the Julia array itself, and provides methods to (mutably) access the
//! data and copy it to Rust. Accessing array data from ... | Rust | 0 |
tr) -> FuncResponse:
cur = self.conn.cursor()
try:
cur.execute("SELECT mNum FROM items WHERE id LIKE ?", ("%" + id + "%",))
existing_record = cur.fetchall()
if existing_record == []:
return FuncResponse(1, "查询失败:您没有监控对象")
elif existing_reco... | Python | 1 |
imax: MinimaxParameters,
#[structopt(long)]
position: Option<String>,
}
#[derive(Debug, StructOpt)]
enum Command {
Play(PlayParameters),
Analyze(AnalyzeParameters),
Selfplay(SelfplayParameters),
PP(PPParameters),
Sizes {},
Worker {},
}
fn ai_config(debug: usize, opt: &MinimaxParameter... | Rust | 0 |
W: SigmaByteWrite>(c: &Literal, w: &mut W) -> SigmaSerializeResult {
// for reference see http://github.com/ScorexFoundation/sigmastate-interpreter/blob/25251c1313b0131835f92099f02cef8a5d932b5e/sigmastate/src/main/scala/sigmastate/serialization/DataSerializer.scala#L26-L26
Ok(match c {
Liter... | Rust | 0 |
"""
Copyright 2023 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
from utils import *
# Örnek bir veri seti oluşturalım
m = 100 # Veri setindeki örnek sayısı
n = 2 # Veri setindeki özellik sayısı
exampleDataSet = np.random.randint(0, 100, size=(m, n)) # 100x2 boyutunda rastgele bir veri seti oluşturalım
def find_closest_centro... | Python | 1 |
fferTooSmallError {
/// The size of the buffer the read/write expected.
expected: usize,
/// The actual size of the buffer.
actual: usize,
},
/// The error was thrown because we called a method for a trait that
/// isn't valid in this particular struct's implementation.
... | Rust | 0 |
import asyncio
from time import time
class Timer:
def __init__(self, timeout, callback):
self._timeout = timeout
self._callback = callback
self._task = asyncio.ensure_future(self._job())
async def _job(self):
await asyncio.sleep(self._timeout)
self._callback()
def... | Python | 1 |
_map(
kwargs_mass,
kwargs_light,
kwargs_anisotropy,
r_eff=r_eff,
theta_E=theta_e,
gamma=gamma,
kappa_ext=0,
supersampling_factor=5,
voronoi_bins=None,
)
... | Python | 1 |
_val_val_binop!(impl $imp, $method);
forward_ref_val_binop!(impl $imp, $method);
forward_val_ref_binop!(impl $imp, $method);
};
}
forward_all_binop!(impl Add, add);
impl<'a, 'b, Lhs, Rhs> Add<&'b Matrix<Rhs>> for &'a Matrix<Lhs>
where
Lhs: Add<Rhs> + Clone,
Rhs: Clone,
{
type Output = ... | Rust | 0 |
import torch
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
def psnr_slice(gt, pred, maxval=None):
assert type(gt) == type(pred)
if type(pred) is torch.Tensor:
gt, pred = gt.detach().cpu().numpy(), pred.detach().cpu().numpy()
batch_size = gt.shape[0]
PSNR = 0.0
... | Python | 1 |
DTVALEX_W<'a> {
w: &'a mut W,
}
impl<'a> DTVALEX_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16);
self.w
}
}
impl R {
#[doc = "Bits... | Rust | 0 |
future::poll_future(self, Self::POLL_FNS)
}
}
<gh_stars>0
use std::env;
use std::io;
use std::path::PathBuf;
use structopt::StructOpt;
use reroute::ReRoute;
#[derive(Debug, StructOpt)]
#[structopt(
name = env!("CARGO_PKG_NAME"),
version = env!("CARGO_PKG_VERSION"),
author = env!("CARGO_PKG_AUTHORS"),
... | Rust | 0 |
def solution(arr):
for i in range (len(arr)):
if arr[i] >= 50:
if arr[i] % 2 == 0:
arr[i] = arr[i]/2
elif arr[i] < 50:
if arr[i] % 2 != 0:
arr[i] = arr[i]*2
return arr
| Python | 1 |
).map_err(|it|it.error)?;
Ok(())
}
use good_lp::{constraint, variables, Solution, SolverModel, StaticSolver};
// See: https://github.com/rust-or/good_lp/pull/5
fn generic_solve_example<S: StaticSolver>(solver: S) -> Result<(), Box<dyn std::error::Error>> {
variables! {
vars:
a <= 1;
... | Rust | 0 |
ct]:
"""格式化代币信息"""
# 计算综合评分
score = CommandHandler._calculate_token_score(token_data)
# 生成市场叙事
narrative = CommandHandler._generate_market_narrative(token_data)
# 简化格式,去除 HTML 标签
contract_address = token_data['baseToken'].get('address', 'Unknown'... | Python | 1 |
ded to
padding_mask[
(
torch.arange(padding_mask.shape[0], device=padding_mask.device),
output_lengths - 1,
)
] = 1
padding_mask = (
1 - padding_mask.flip([-1]).cumsum(-1).flip([-1])
)... | Python | 1 |
_str(s: &str) -> Result<Self, Self::Err> {
let splitted = s.splitn(3, ":").collect::<Vec<_>>();
match splitted.len() {
2 => Ok(Self {
package_id: String::from(splitted[0]),
version: String::from(splitted[1]),
framework: String::from(""),
... | Rust | 0 |
ime_range_specifying_ambiguous_11713() -> None:
result = pl.datetime_range(
pl.datetime(2023, 10, 29, 2, 0).dt.replace_time_zone(
"Europe/Madrid", ambiguous="earliest"
),
pl.datetime(2023, 10, 29, 3, 0).dt.replace_time_zone("Europe/Madrid"),
"1h",
eager=True,
... | Python | 1 |
}
/// ```
Unset(SmallVec<[Variable<'a>; 1]>),
/// A variable.
///
/// # Examples
///
/// ```
/// # extern crate tagua_parser;
/// use tagua_parser::ast::{
/// Expression,
/// Variable
/// };
/// use tagua_parser::rules::expressions::expression;
/// use t... | Rust | 0 |
}
pub fn config_read<S: Storage>(storage: &S) -> ReadonlySingleton<S, State> {
singleton_read(storage, CONFIG_KEY)
}
//! rpm-ostree client actor.
use super::Release;
use actix::prelude::*;
use failure::Fallible;
use log::trace;
/// Client actor for rpm-ostree.
#[derive(Debug, Default, Clone)]
pub struct RpmOstr... | Rust | 0 |
type: "bool"
default_value {
b: false
}
}
}
op {
name: "ResizeNearestNeighbor"
input_arg {
name: "images"
type_attr: "T"
}
input_arg {
name: "size"
type: DT_INT32
}
output_arg {
name: "resized_images"
type_attr: "T"
}
attr {
name: "T"
type: "type"
all... | Python | 1 |
class GreenPhone:
def __init__(self,model,android_ver,cameras):
self.model = model
self.android_ver = android_ver
self.cameras = cameras
self.update_count = 0
def showSpecification(self):
print(f"Phone Company: GreenPhone\nModel Name: {self.model}\nAndroid Version: {self.android_ver}\nNumber of... | Python | 1 |
for ll_traj, atom_seq in atom_dataset
]
assert len(segmented_trajs) == len(dataset.annotations)
# First, get the set of all ground truth operator names.
all_gt_ops = set(ground_nsrt.parent
for anno_list in dataset.annotations
... | Python | 1 |
from odoo import api, fields, models
class Task(models.Model):
_inherit = 'task.task'
ticket_id = fields.Many2one('helpdesk.ticket', string='Ticket', copy=False,
groups='helpdesk_mngmnt.helpdesk_group_user')
| Python | 1 |
block = if Node::is_block(node) {
ptr::null_mut()
} else {
target
.expect("must have some value for non-block nodes")
.internal_ir_node()
};
let empty: Vec<*mut bindings::ir_node> = vec![];
let new_n... | Rust | 0 |
dq_XMMdq_MEMdq = 1999,
XED_IFORM_VANDNPD_XMMdq_XMMdq_XMMdq = 2000,
XED_IFORM_VANDNPD_XMMf64_MASKmskw_XMMf64_MEMf64_AVX512 = 2001,
XED_IFORM_VANDNPD_XMMf64_MASKmskw_XMMf64_XMMf64_AVX512 = 2002,
XED_IFORM_VANDNPD_YMMf64_MASKmskw_YMMf64_MEMf64_AVX512 = 2003,
XED_IFORM_VANDNPD_YMMf64_MASKmskw_YMMf64_YMM... | Rust | 0 |
UnsafeDepGraph>> = None;
/// We wrap the dependency graph in an unsafe structure.
///
/// We need to do this, because we want to store both the
/// mmap and the dependency graph that references it in a
/// global variable.
pub struct UnsafeDepGraph {
/// The opener contains the open mmap.
_do_not_reference_ope... | Rust | 0 |
__author__ = 'zaxlct'
__date__ = '2017/4/2 下午5:40'
from .models import UserAsk, CourseComments, UserFavorite, UserMessage, UserCourse
import xadmin
class UserAskAdmin:
list_display = ['name', 'mobile', 'course_name', 'add_time']
search_fields = ['name', 'mobile', 'course_name']
list_filter = ['name', 'mo... | Python | 1 |
from random import uniform
from manim import *
from scipy.spatial import Delaunay
class TransparentScene(MovingCameraScene):
def construct(self):
images = 10
for _ in range(images):
w = self.camera.frame.width * 1.25
h = self.camera.frame.height * 1.25
n = 30... | Python | 1 |
f16" => CharSet::utf16,
"utf16le" => CharSet::utf16le,
"utf32" => CharSet::utf32,
"utf8" => CharSet::utf8,
"utf8mb4" => CharSet::utf8mb4,
_ => {
return Err(Error::Configuration(
format!("unsupported MySQL charset: {}", char... | Rust | 0 |
gir-files)
// DO NOT EDIT
#[cfg(any(feature = "v2_38", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_38")))]
use crate::Address;
use crate::Auth;
use crate::Message;
#[cfg(any(feature = "v2_42", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_42")))]
use crate::Request;
#[cf... | Rust | 0 |
1 _ _ 1 0 1 _ _ _ ]
/// // filter [ 0 0 1 1 1 1 0 1 0 1 1 ]
///
/// // incoming id [ 0 1 1 1 0 1 0 1 0 1 0 ]
/// // accepted
/// ```
///
/// Notice that for example `0x7AA` would not be accepted because its MSB bit is `1`,
/// but `filter` only accepts `0` in this bit position and ... | Rust | 0 |
d outside migrations
BRANDING_ORG = "org"
BRANDING_BOTH = "both"
BRANDING_ORG_BANNER = "org_banner"
BRANDING_TYPES = [BRANDING_ORG, BRANDING_BOTH, BRANDING_ORG_BANNER]
# API Keys
KEY_TYPE_NORMAL = "normal"
KEY_TYPE_TEAM = "team"
KEY_TYPE_TEST = "test"
# Providers
MMG_PROVIDER = "mmg"
FIRETEXT_PROVIDER = "firetext"
SE... | Python | 1 |
PartialEq, Eq, Hash, Debug)]
pub struct WriteChunkResponse {
/// The segment and location.
pub segment_and_location: SegmentAndLocation,
/// The offset within the segment,
pub offset: u32,
/// The result of the write chunk request.
pub result: WriteChunkResult,
}
/// The length of an write c... | Rust | 0 |
let filename = format!("aoc2020/inputs/{:02}.txt", i).to_string();
let input = load_file(filename);
run_problem(i, input);
info!("=========================");
}
} else {
if let Some(num) = args.number {
let filename = ifelse!(args.input_file.is_none(... | Rust | 0 |
import cv2
import numpy as np
# Define the size of the window and the square
window_size = 500
square_size = 100
# Create a black image
image = np.zeros((window_size, window_size, 3), dtype=np.uint8)
# Define the center and the angle of rotation
center = (window_size // 2, window_size // 2)
angle = 0
while True:
... | Python | 1 |
from __future__ import print_function
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from retinaface.data import cfg_mnet
from retinaface.layers.functions.prior_box import PriorBox
from retinaface.loader import load_model
from retinaface.utils.box_utils import decode, decode_landm
from retinafac... | Python | 1 |
fft(x, s_freq, detrend=None, taper='dpss', output='complex', sides='two', scaling='energy')
assert_almost_equal(sum(x ** 2), (Sxx0 ** 2).sum().real * s_freq * dur, -1)
def test_fft_multiple_chan():
x_chan = data(trial=0) # both channels
f, Sxx = _fft(x, data.s_freq, detrend=None)
f, Sxx_chan = _fft... | Python | 1 |
input;
self
}
/// <p>The log level for a log message.</p>
pub fn log_level(mut self, input: crate::model::LogLevel) -> Self {
self.log_level = Some(input);
self
}
/// <p>The log level for a log message.</p>
pub fn set_log_level(mut sel... | Rust | 0 |
u8) -> Self {
InterruptMask {
timer_interrupt: (data & 0b10000000) != 0,
external_interrupt: [(data & 0b00000100) != 0,
(data & 0b00001000) != 0,
(data & 0b00010000) != 0,
(data & 0b001000... | Rust | 0 |
9676, 9678, 9679, 9681, 9682, 9684, 9689,
9698, 9709, 9710, 9712, 9719, 9721, 9733, 9734, 9741, 9751, 9767, 9769, 9768, 9770, 9769,
9771, 9773, 9769, 9780, 9787, 9789, 9794, 9802, 9803, 9807, 9809, 9810, 9811, 9813, 9816,
9823, 9828, 9835, 9849, 9851, 9861, 9883, 9884, 9889, 9890, 9893, 9907, 9... | Rust | 0 |
orkspace_summary = {
"type": "workspace_summary",
"databases_analyzed": len(self.database_ids),
"pages_analyzed": len(self.page_ids),
"total_entries_generated": len(entries),
"analysis_timestamp": datetime.now().isoformat(),
... | Python | 1 |
ifetime();
method_inputs
.args
.iter()
.map(|input| {
let ident = &input.ident;
let mut ty = input.ty.clone();
let bound_lifetimes = rewrite_lifetimes_incrementally(&mut ty);
quote! {
pub(super) #ident: std::boxed::Box<dyn #bou... | Rust | 0 |
Vec<_> = unresolved_nodes_set.into_iter().collect();
unresolved_nodes.par_sort_unstable();
unresolved_nodes
},
|| {
rayon::join(
|| {
let unresolved_predicates_set: HashSet<_> = triples
.par_iter()
... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import uiautomator2 as u2
from logzero import logger
import time
import os
from Public.basepage import BasePage
from Public.decorator import *
from uiautomator2 import UiObjectNotFoundError
from Public.log import Log
from Public.config import maxin_path
log = Log()
# ma... | Python | 1 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xgboost as xgb
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
dataset_path = './Problem4.csv'
data_df = pd.read_csv(dataset_path)
X, y = data_d... | Python | 1 |
# Generated by Django 5.2.4 on 2025-07-23 06:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guest_frontend', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ContactPage',
fields=[
... | Python | 1 |
from setuptools import find_packages, setup
"""
Setup module for metasearch.
This module provides functionality for the metasearch project.
"""
setup(
name="metasearch-llamasearch",
version="0.1.0rc53",
package_dir={"": "src"},
packages=find_packages(where="src"),
install_requires=[
"nump... | Python | 1 |
2 - n1 * dist;
let err = ((dist - target_dist) * self.erp).max(-self.max_linear_correction);
let dp1 = p1.coords - pos1.translation.vector;
let dp2 = p2.coords - pos2.translation.vector;
let gcross1 = dp1.gcross(n1);
let gcross2 = -dp2.gcr... | Rust | 0 |
interpolated_features, interpolated_densities], dim=-1)
def scale_voxel_grid_with_required_output_size(
voxel_grid: VoxelGrid, output_size: Tuple[int, int, int], mode: str = "trilinear"
) -> VoxelGrid:
# extract relevant information from the original input voxel_grid:
og_unified_feature_tensor = torch.ca... | Python | 1 |
e failure
def thread_target():
try:
# Run the decorated function inside the thread
res = slow_task_in_thread()
if res is not None:
result_container.append(res)
except Exception as e:
# This might catch exceptions happening *outside* th... | Python | 1 |
, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCompilerControlFlagBitsAMD.html>"]
pub struct PipelineCompilerControlFlagsAMD(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineCompilerControlFlagsAMD, 0b0, Flags);
impl PipelineCompilerCont... | Rust | 0 |
nstraintF<G> = <<G as AffineCurve>::BaseField as Field>::BasePrimeField;
///
/// // An accumulation input for this scheme is formed from:
/// // 1. The R1CS input for an indexed relation: `input`
/// // 2. The NARK prover's first round message for the indexed relation: `first_msg`
/// // 3. Th... | Rust | 0 |
"int8x16_t" => "_n_s8",
"int16x4_t" | "int16x8_t" => "_n_s16",
"int32x2_t" | "int32x4_t" => "_n_s32",
"int64x1_t" | "int64x2_t" => "_n_s64",
"uint8x8_t" | "uint8x16_t" => "_n_u8",
"uint16x4_t" | "uint16x8_t" => "_n_u16",
"uint32x2_t" | "uint32x4_t" => "_n_u32",
"... | Rust | 0 |
-1_f64 / f64::sqrt(3_f64),
-1_f64 / f64::sqrt(3_f64),
1_f64 / f64::sqrt(3_f64)
));
let bias = Vector3::new(0_f64, 0_f64, 2_f64);
let reflection = Reflection3::from_normal_bias(&normal, &bias);
let vector = Vector3::new(1_f64, 1_f64, 1_f64);
l... | Rust | 0 |
8bj\
\xad\xe6\xb7/\xcd5\xc4\xab\xbb\xca>\x8aO\xa5z\x94\
\xb6:l\xbf7\xcb\xba\xbc\xf7\xc3\x97\xf7\xf6\xb6\xb2\xfd\
\xb1\xad\xe5o\xf9g\xb3\xe5\xe3\xde\xb4\xado\xefn\xa5\
_\xfd\x97\xff\x00\xaf_Y\x87\xa3\x1aQQGth\
{-\x8e\xca\xda\xc2\xce(\x99\x96(\xb77\xfb5N\
\xff\x00K\xb5\xd5?\xd6\xdb\xab-d]j\x93\xe9\x7f\
\xbd\xfe\x15\xa3K\... | Python | 1 |
-> EGLSurface {
// create surface
let egl_surface = egl::create_window_surface(
egl_display,
egl_config,
(window as *mut _) as EGLNativeDisplayType,
&[],
)
.expect("Failed to create EGL surface");
// set current context
if !egl::make_current(egl_display, egl_surface, egl_surface, egl_contex... | Rust | 0 |
: &[Instruction]) -> usize {
let mut map = HashMap::new();
let mut m: Option<(usize, usize)> = None;
instructions.iter().for_each(|ins| match ins {
Instruction::Mask(mask) => {
m = Some(mask_part1(mask));
}
Instruction::Mem { addr, value } => {
let mut v = *va... | Rust | 0 |
a complex array
let c_zeros = initializations::zeros::<Complex<f32>>(inputs.dims());
let c_inputs = af::add(inputs, &c_zeros, false);
let vx = af::matmul(&c_inputs
, &weight0
, MatProp::NONE
, MatProp::NONE);
let vx_wh = af::add(... | Rust | 0 |
elf, path, value):
do_copy = isinstance(value, RegistryKey)
if not do_copy and not isinstance(value, str) and not isinstance(value, compat.unicode):
if isinstance(value, object):
t = value.__class__.__name__
else:
t = type(value)
raise ... | Python | 1 |
unwrap().to_str().unwrap();
let filepath = test_dir.path().join("test.txt");
let _ = File::create(filepath).unwrap();
let router = Router::from(test_dir.path().to_str().unwrap());
println!("path prefix in route: {}", path_str);
println!("routes: {:?}", router.static_routes);
... | Rust | 0 |
- length);
return Err(ERR_INVALID_UTF8);
}
}
return match fs::read(file_name) {
Ok(s) => Ok(s),
Err(_e) => {
debug_print!("temp_to_vector: failed to read temporary file {}: {}", file_name, _e);
Err(ERR_READ_TEMP_FILE_FAILED)
}
}
}
pub un... | Rust | 0 |
ss:// on ws:// server
// ✔ WsMeta::connect: Verify error when connecting to a wrong scheme
// ✔ Verify the state method
// ✔ Verify closing from WsStream
// ✔ Verify url method
// ✔ Verify sending no subprotocols
// note: we currently don't have a backend server that supports protocols,
// so there is no test for t... | Rust | 0 |
Cell::new(bytes_buf);
let mut num_objects = 0;
let mut decompressed_bytes: u64 = 0;
let decompress_from_resolver = |slice: EntrySlice| -> Result<(pack::data::Entry, u64, Vec<u8>), Error> {
let mut bytes_buf = bytes_buf.borrow_mut();
bytes_buf.resize((slice.end - slice.start) as usize, 0);
... | Rust | 0 |
# Copyright 2025
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ContractInventoryLineExport(models.TransientModel):
_name = 'contract.inventory.line.export.wizard'
_description = 'Export Contract Inventory Lines'
inventory_line_ids = fields.Many... | Python | 1 |
": state["article"]})
state["article"] += f" {response['agent_output']}"
return state
async def word_count_rewriter_node(
self, state: SharedArticleState
) -> SharedArticleState:
response = await self.text_writer_agent.ainvoke({"article": state["article"]})
state["articl... | Python | 1 |
fn sum(a: &Vec<Vec<f64>>) -> f64 {
let mut s = 0.0;
for i in 0..a.len() {
for j in 0..a[0].len() {
s += a[i as usize][j as usize].abs();
}
}
return s;
}
// 配列は、スタック上に確保されるため大きな配列はスタックオーバーフローになる。
// なので、Vecを使用しているが、固定サイズで使用するため、最初の確保のみここに集約する
// 2次元の1次元目の大きさは、`a.len()`、2次元目は、... | Rust | 0 |
S: u32 = 265u32;
#[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"]
pub const DISPID_IRAWCDIMAGECREATOR_MEDIACATALOGNUMBER: u32 = 260u32;
#[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"]
pub const DISPID_IRAWCDIMAGECREATOR_NUMBEROFEXISTINGTRACKS: u32 = 263u32;
#[doc = "*Required features: `\"Win32_Stora... | Rust | 0 |
}
#[cfg(test)]
pub(crate) fn out1(&mut self) -> &Out1 {
self.out1.out_mut()
}
#[cfg(test)]
pub(crate) fn out2(&mut self) -> &Out2 {
self.out2.out_mut()
}
}
impl<In, Out1, Out2, F, E> Future for Forker<In, Out1, Out2, F, E>
where
In: Stream,
Out1: Sink<SinkItem = I... | Rust | 0 |
(bbox_to_anchor=(1.02,1), loc='upper left')
# --- plot ground-truth contact dots ---
plt.figure(figsize=(10,6))
for name in self.leg_names:
times_gt = contact_gt_binned[name]
plt.scatter(times_gt,
[y_pos[name]] * len(times_gt),
... | Python | 1 |
stream.emit_double_word((n*4).try_into().unwrap());
},
// 0000000000000013 backward:
// 13: 48 81 ee 80 00 00 00 subq $128, %rsi
&bf::Expression::MoveBack(n) => {
stream.emit_bytes(b"\x48\x81\xee");
stream.... | Rust | 0 |
soma = 0
j=0
while j != 1:
M,N = input().split(" ")
M = int(M)
N = int(N)
soma = 0
if M > N:
aux = M
M = N
N = aux
if M<=0 or N<=0:
j = 1
if j!=1:
for i in range(M,N+1):
print('%d '%(i),end="")
soma+=i
if i == N:
... | Python | 1 |
($($name:ident : $re:literal; )*) => {
$(
static $name: $crate::utils::RegexWrap = $crate::utils::RegexWrap::new($re);
)*
};
}
/// Print an error.
macro_rules! werr(
($($arg:tt)*) => ({
use std::io::{Write, stderr};
write!(&mut stderr(), $($arg)*).unwrap();
... | Rust | 0 |
eq!(
err.message,
"Type `set` is not supported. Perhaps you need to enable some crate feature?".to_string()
);
assert_eq!(err.level, codemap_diagnostic::Level::Error);
assert_eq!(
err.code,
Some(crate::values::error::NOT_SUPPORTED_ERROR_CODE.to_string())
);
}
#[test]
fn ... | Rust | 0 |
accelerometer +
//! compass)
//!
//! This driver is built using [`embedded-hal`] traits.
//!
//! # Usage
//!
//! Use embedded-hal implementation to get I2C, then create lsm handle
//!
//! ```
//! // to create sensor with default configuration:
//! let mut lsm = Lsm303c::default(i2c)?;
//! // to get all supported measur... | Rust | 0 |
s we run. More samples will allow us to observe a higher precision of our p-value, but will also increase our computation time. We tend to use 5,000 or 10,000 permutations as defaults.
# ### Two Sample Permutation Test
# When we were computed a one-sample permutation test above, we randomly multiplied each data point ... | Python | 1 |
0}")]
CreateOpensslHttpsConnector(#[source] openssl::error::ErrorStack),
}
pub(crate) struct Gcp {
provider: TokenProviderWrapper,
scopes: Vec<String>,
}
impl std::fmt::Debug for Gcp {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Gcp")
.field... | Rust | 0 |
Cow::Owned(dirty);
}
self.title = match title {
Cow::Borrowed(b) => MaybeArc::Static(b),
Cow::Owned(o) => MaybeArc::Dynamic(o.into()),
};
self
}
/// Sets whether the window is initially visible.
///
/// Defaults to `true`.
#[inline]
pub f... | Rust | 0 |
sync::atomic::{AtomicBool, Ordering::Relaxed};
#[test]
fn test(){
let droped = Arc::new(AtomicBool::new(false));
let droped_tmp = droped.clone();
let drop_item =OnDrop::new(1, move|| droped_tmp.store(true, Relaxed));
drop(drop_item);
assert_eq!(droped.load(Relaxed), true);
}aima.core.probability.pr... | Rust | 0 |
"encrypt")
.arg("--sk")
.arg(strip_prefix("bob.sec"))
.arg("--recipient_pk")
.arg(strip_prefix("alice.pub"))
.pipe_in(TESTFILE_ABCD)
.pipe_out(&temp_file("message.c4gh"))
.succeeds();
// Decrypt
CommandUnderTest::new()
.env("C4GH_PASSPHRASE", ALICE_PASSPHRASE)
.arg("decrypt")
.arg("--sk")
.arg(... | Rust | 0 |
h.mean(torch.abs(self.density_line[idx]))
return total
def TV_loss_density(self, reg):
total = 0
for idx in range(len(self.density_line)):
total = total + reg(self.density_line[idx]) * 1e-3
return total
def TV_loss_app(self, reg):
total = 0
for idx ... | Python | 1 |
),
BadOrigin
);
});
}
#[test]
fn create_same_pool_should_not_work() {
new_test_ext().execute_with(|| {
assert_ok!(LBPPallet::create_pool(
Origin::root(),
ALICE,
KUSD,
1_000_000_000,
BSX,
2_000_000_000,
80_000_000u32,
10_000_000u32,
WeightCurveType::Linear,
DEFAULT_FEE,
CHARLIE... | Rust | 0 |
se')), # (likely to be revised)
("Uy5", "PAM5-Unpaired-base-y",212, 1.0, [[4, 200, tetra4]], dict(role = 'unpaired-base')), # (likely to be revised)
# basepair axis handle (defined as PAM5 to make it more convenient to permit its bonding with Gv5)
# (see also: elements_data_other.py)
("Ah5", "PAM5-... | Python | 1 |
one) => v![(0x90, 1)],
(MM::Bcs, AM::AbsoluteOrZp, None) => v![(0xb0, 1)],
(MM::Bit, AM::AbsoluteOrZp, None) => v![(0x24, 1), (0x2c, 2)],
(MM::Bmi, AM::AbsoluteOrZp, None) => v![(0x30, 1)],
(MM::Bne, AM::AbsoluteOrZp, None) => v![(0xd0, 1)],
(MM::Beq, AM::AbsoluteOrZp, None) => v... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundInstcardOpenSignResponse(AlipayResponse):
def __init__(self):
super(AlipayFundInstcardOpenSignResponse, self).__init__()
self._account_name = None
s... | Python | 1 |
_nodes.len() >= 255 {
return Error::node_err(node_id, "Can't preview the output of more than 255 nodes");
}
self.output_nodes.push(node_id.to_string());
let output_index = (self.output_nodes.len() - 1) as u8;
Ok(output_index)
}
pub fn add_value(&mut self, output_inde... | Rust | 0 |
umj_
@0.0
@lambda iz18ghhxkcv, xfzyf0ca68j, bglldfxu5kj, xaawpc907y1: motudi_d8tz
def kwlsj8i0k0f():
import foyod0k8bf1, tsfczpxr9ht, zlg6yp6eudm as i6upl4vh9q6, cddeimzzdrx as h3dm1mefb40, yb6c4aw14g2, cq2s3x7fq7q, w43wethm45h as kz9ybebfdra, xt3_soefgmw as ktms72j6is9
from wmf9sxa90jm import ncy6rwafs1p, thdt... | Python | 1 |
"""Diagnostics support for Supervisor."""
from __future__ import annotations
from typing import Any
from attr import asdict
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from . import A... | Python | 1 |
time_since_last_request.unwrap().elapsed().as_secs() < 60 * 60 * 24
{
let collection = self.gfycats.as_ref().unwrap();
let gfycat = collection.pick_random().unwrap();
return Ok(format!("https://gfycat.com/{}", gfycat.gfyId));
}
if self.token.is_none() {
... | Rust | 0 |
class VkApiError(Exception):
pass
| Python | 1 |
from .biidefics_2 import BiIdefics2
from .colidefics_2 import ColIdefics2, ColIdefics2Processor
| Python | 1 |
# autor: Giancarlo Massaccesi
# data: 2025/06/01
# Descrição: Projeto de treinamento em Python com foco em herança e polimorfismo
class Animal:
def __init__(self, nro_patas):
self.nro_patas = nro_patas
def __str__(self):
return f'{self.__class__.__name__}: {', '.join([f'{chave}={valor}' for c... | Python | 1 |
prompt = match &kv.lit {
Lit::Str(s) => Ok(Some(s.value())),
_ => Err(syn::Error::new(kv.lit.span(), "expected a string")),
}?
}
ATTR_KEY_DEFAULT_VALUE => match... | Rust | 0 |
import logging
import uuid
import json
from typing import Dict
from confluent_kafka import Producer
from lsst.rucioevents.config import KafkaConfig
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("RucioKafkaProducer")
class RucioKafkaProducer:
def __init__(self, topic: str):
"""
... | Python | 1 |
(decoder)
}
}
pub fn decompress(huffs: &[&[u8]], sections: &[&[u8]]) -> HuffmanResult<Vec<Vec<u8>>> {
let mut decoder = HuffmanDecoder::init(huffs)?;
decoder.unpack_sections(sections)
}
#[doc = "Reader of register PMC_MCKR"]
pub type R = crate::R<u32, super::PMC_MCKR>;
#[doc = "Writer for register PMC_MCKR... | Rust | 0 |
std::os::raw::c_int;
}
extern "C" {
#[doc = " Program EEPROM with provided data"]
#[doc = ""]
#[doc = " @param port_id"]
#[doc = " The port identifier of the Ethernet device."]
#[doc = " @param info"]
#[doc = " The template includes EEPROM data for programming and"]
#[doc = " EEPROM at... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.