text string | label_name string | labels int64 |
|---|---|---|
;
const STATUS_FRAME_ERROR: u8 = 1 << 3;
const STATUS_PARITY_ERROR: u8 = 1 << 2;
const STATUS_OVERRUN_ERROR: u8 = 1 << 1;
const STATUS_DATA_READY: u8 = 1;
pub struct SerialPort {
data: Port,
interrupt_enable: Port,
fifo_control: Port,
line_control: Port,
modem_control: Port,
line_status: Port,
modem_stat... | Rust | 0 |
ating a chunk of memory successfully"]
#[doc = " or fail to allocate memories with any of the parameters."]
#[doc = ""]
#[doc = " @param size Size, in bytes, of the amount of memory to allocate"]
#[doc = " @param num Number of variable paramters"]
#[doc = ""]
#[doc = " @return A point... | Rust | 0 |
_order);
let mkdir_action = build_mkdir_action(mkdir_route, encoded_dir, sort_method, sort_order);
let title_path = breadcrumbs
.iter()
.map(|el| el.name.clone())
.collect::<Vec<_>>()
.join("/");
html! {
(DOCTYPE)
html {
(page_header(&title_path,... | Rust | 0 |
import pygame
class PlayerBullet(pygame.sprite.Sprite):
"""A class to represent a bullet that was fired by the player"""
def __init__(self, x, y, bullet_group, player):
"""Initialize the bullet"""
super().__init__()
#set constant variables
self.VELOCITY = 30
self.RANGE ... | Python | 1 |
uuid4().hex
user_resp = {
'user': {
'id': user_id,
'email': uuid.uuid4().hex,
'name': uuid.uuid4().hex,
}
}
roles_resp = {
'roles': {
'values': [
{
'n... | Python | 1 |
:c_uint = 7;
pub static MEMCACHED_CALLBACK_DELETE_TRIGGER: ::libc::c_uint = 8;
pub static MEMCACHED_CALLBACK_MAX: ::libc::c_uint = 9;
pub static MEMCACHED_CALLBACK_NAMESPACE: ::libc::c_uint = 0;
pub type memcached_callback_t = Enum_memcached_callback_t;
pub type Enum_memcached_connection_t = ::libc::c_uint;
pub static ... | Rust | 0 |
tra.items():
if not samples:
continue
solved, total, first_fail = _evaluate_split(split, samples, fn)
if total == 0:
print(f"{split:>5}: no labels (produced {len(samples)} outputs)")
else:
fail_display = "none" if first_fail... | Python | 1 |
y = last.1 {
last.2 = Some(d.0);
} else if let Some(n) = last.2 {
last.2 = Some(n + d.0);
} else {
last.0 += d.0;
}
... | Rust | 0 |
e_scheduler.max()
if N != sample_steps:
# Original tensor has shape [N, 2], need to resize to [sample_steps, 2]
# Generate the original and new indices
orig_indices = np.arange(N)
new_indices = np.linspace(0, N-1, num=sample_steps)
... | Python | 1 |
Expr::or((*l).into(), (*r).into()),
ir::Guard::Not(e) => Expr::not((*e).into()),
ir::Guard::True => Expr::Const(true),
ir::Guard::Neq(l, r) => Expr::not(ir::Guard::Eq(l, r).into()),
ir::Guard::Leq(l, r) => Expr::not(ir::Guard::Gt(l, r).into()),
ir::Guard::Geq... | Rust | 0 |
er, Pull> PinTx<USART1> for Pa22<Alternate<PfA>, Filter, Pull> {}
pub struct Serial<SERIAL, PINS> {
_serial: SERIAL,
_pins: PINS,
}
pub struct Rx<SERIAL> {
_serial: PhantomData<SERIAL>,
}
pub struct Tx<SERIAL> {
_serial: PhantomData<SERIAL>,
}
/// Serial error
#[derive(Debug)]
pub enum Error {
/... | Rust | 0 |
get_image_size;
pub mod record_image_digest_image_name_version_repositories;
pub mod cri_server_image_remove;
pub mod get_image_status;
pub mod cri_server_image_fs_info;
// use sled::{ Config, Mode };
// use entrypoint::pull_image;
// #[tokio::main]
// pub async fn main() -> sled::Result<()> {
// let db = Config:... | Rust | 0 |
import sys
import numpy as np
import NDIlib as ndi
def main():
if not ndi.initialize():
return 0
ndi_find = ndi.find_create_v2()
if ndi_find is None:
return 0
sources = []
while not len(sources) > 0:
print('Looking for sources ...')
ndi.find_wait_for_sources(ndi... | Python | 1 |
*/
extern crate image;
extern crate num;
use std::fs::File;
use std::io::{Error, ErrorKind};
use std::str::FromStr;
use image::codecs::png::PngEncoder;
use image::{ColorType, ImageEncoder};
use num::Complex;
pub fn parse_pair<T: FromStr>(s: &str, separator: char) -> Option<(T, T)> {
match s.find(separator) {
... | Rust | 0 |
for n in 0..num_blocks {
// bix visits the blocks in reverse postorder
let bix = post_ord[(num_blocks - 1 - n) as usize];
// Hence:
bix2rpostord[bix] = n;
// and
rpostord2bix[n as usize] = bix;
}
for n in 0..num_blocks {
debug_assert!(bix2rpostord[Bloc... | Rust | 0 |
import statistics
from statistics import mean
with open('zzz_pareto_czasy.txt') as f:
content = f.read().splitlines()
# print('PL')
# print('avg time hlga ' + str(mean([eval(i) for i in content[15:23]])))
# print('avg time ffga ' + str(mean([eval(i) for i in content[25:30]])))
# print('avg time vega ' + str(mean... | Python | 1 |
.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFi... | Rust | 0 |
mm_k1z_zmmm512b32_sae
Mnemonic::Vgetexppd,// EVEX_Vgetexppd_xmm_k1z_xmmm128b64
Mnemonic::Vgetexppd,// EVEX_Vgetexppd_ymm_k1z_ymmm256b64
Mnemonic::Vgetexppd,// EVEX_Vgetexppd_zmm_k1z_zmmm512b64_sae
Mnemonic::Vgetexpss,// EVEX_Vgetexpss_xmm_k1z_xmm_xmmm32_sae
Mnemonic::Vgetexpsd,// EVEX_Vgetexpsd_xmm_k1z_xmm_xmmm64_... | Rust | 0 |
flat)
r2_list.append(r2)
return r2_list
def per_prop_roc_auc(block_pred: np.ndarray, block_target: np.ndarray) -> List[float]:
roc_auc_list = []
for i_prop, (pred, target) in enumerate(
group_by_properties(block_pred, block_target)):
mask = np.isnan(target)
pred_flat = ... | Python | 1 |
.join("\n");
if has_comments {
Some(docs)
} else {
None
}
}
}
pub struct CommentIter {
iter: SyntaxElementChildren,
}
impl Iterator for CommentIter {
type Item = ast::Comment;
fn next(&mut self) -> Option<ast::Comment> {
self.iter.b... | Rust | 0 |
import KobukiDriver as kobuki
import time
def main():
my_kobuki = kobuki.Kobuki()
# Play start up sound
# my_kobuki.play_on_sound()
while True:
key = input("Enter command: ")
if key == "w":
# Move forward
my_kobuki.move(200, 200, 0)
elif key == "s":
... | Python | 1 |
VDDRF_READY,
25 => TEST_AOUT_A::AOUT_VDDC_READY,
26 => TEST_AOUT_A::AOUT_VDDM_READY,
27 => TEST_AOUT_A::AOUT_VDDA_READY,
28 => TEST_AOUT_A::AOUT_CLK_PRESENT,
29 => TEST_AOUT_A::AOUT_XTAL_OK,
30 => TEST_AOUT_A::AOUT_XTAL_CLK,
31 => TEST_... | Rust | 0 |
import numpy as np
x = np.array([1,2,3])
#=========== CASE1: A = square, full rank
I = np.array([[1,0,0],[0,1,0],[0,0,1]])
A = np.array([[1,3,3],[4,5,6],[7,8,9]])
A_det = np.linalg.det(A)
#y
y = A@x
x_rec = np.linalg.inv(A)@y
#covariance
C = A@I@A.T
C_det = np.linalg.det(C)
C_vals,C_vecs = np.linalg.eig(C)
I_rec =... | Python | 1 |
super::apportion;
#[test]
fn test_apportion() {
let votes = vec![47_000, 16_000, 15_800, 12_000, 6_100, 3_100];
let seats = 10;
let total_seats = apportion(&votes, seats);
assert_eq!(vec![5, 2, 1, 1, 1, 0], total_seats);
}
#[test]
fn test_apportion_again() {
... | Rust | 0 |
"""
配置文件: ITEM_CF_CONFIG
使用方式:
from funrec.config.config_item_cf import CONFIG
config = CONFIG
"""
from typing import Dict, Any
# 配置来源: config_item_cf.yaml
CONFIG: Dict[str, Any] = {
"data": {
"dataset_name": "ml_latest_small_classical",
"rating_threshold": 4.0,
"batch_si... | Python | 1 |
# GENERATING EXPRESSION => They are special function that, when call, process or
# generate only one result at a time. Due to this, they reduce memory consumption
# and processing. They are used for sequential big data processing, filtering and
# transforming data, finally, lazy generation (on demand) of results.
# ... | Python | 1 |
import subprocess
# Get the window ID of the currently active window
active_window_id = subprocess.check_output(['xdotool', 'getactivewindow']).decode().strip()
# Get information about the active window
active_window_info = subprocess.check_output(['xwininfo', '-id', active_window_id]).decode().strip()
# Get a list ... | Python | 1 |
:
notification_content = f"恭喜!您对物品'{req.item.title}'的请求已被接受。"
recipient_id = req.requester_id
elif new_status == 'rejected':
notification_content = f"很抱歉,您对物品'{req.item.title}'的请求已被拒绝。"
recipient_id = req.requester_id
else: # cancelled
notific... | Python | 1 |
r,
},
#[snafu(display("Unable to get pod for '{}': {}", test_name, source))]
GetPod {
test_name: String,
source: kube::Error,
},
#[snafu(display("Unable to get logs for '{}': {}", pod, source))]
Logs { pod: String, source: kube::Error },
#[snafu(display("Unable to get next... | Rust | 0 |
import itertools
set1 = {1, 2, 3}
n = 2
res = list(itertools.combinations(set1, n))
print(res)
'''
Python program to print all subsets of given size of a set
import itertools
# def find_subsets(s, n):
# return list(itertools.combinations(s, n))
# print(find_subsets(s, n))
set1 = {1, 2, 3}
n = 2
res = list(ite... | Python | 1 |
from indicators.base.core import CoreIndicators
import numpy as np
class xDecay(CoreIndicators):
"""
Exponential smoothing for financial time series.
Exponential smoothing is a technique used for smoothing time series data by giving more
weight to recent data points and less weight to older data poi... | Python | 1 |
import numpy as np
def KmeansWithGD(data, centers, num_clusters, graphdist, rho):
"""
基于图距离的改进 K-Means 算法
data: 样本数据
centers: 初始中心(可以是索引或 'random')
num_clusters: 聚类数目
graphdist: 样本之间的图距离矩阵
rho: 样本的密度值
"""
iter = 0
qold = np.inf
threshold = 1e-8
n = data.shape[0]
if ... | Python | 1 |
t may return false positive,
/// i.e. cells which are near from the cone but do not overlap it.
/// To control the approximation, you can choose to perform the computations at a deeper depth
/// using the `delta_depth` parameter.
///
/// # Input
/// - `delta_depth` the difference between this Layer depth ... | Rust | 0 |
x298 - Channel Interrupt Mask Register (chid = 9)"]
pub cim9: crate::Reg<cim9::CIM9_SPEC>,
#[doc = "0x29c - Channel Interrupt Status Register (chid = 9)"]
pub cis9: crate::Reg<cis9::CIS9_SPEC>,
#[doc = "0x2a0 - Channel Source Address Register (chid = 9)"]
pub csa9: crate::Reg<csa9::CSA9_SPEC>,
#... | Rust | 0 |
let ys: [(usize, &i32); 5] = [(1, &0), (3, &1), (1, &2), (1, &1), (2, &3)];
it::assert_equal(ys.iter().cloned(), xs.iter().dedup_with_count());
let xs: [i32; 5] = [0, 0, 0, 0, 0];
let ys: [(usize, &i32); 1] = [(5, &0)];
it::assert_equal(ys.iter().cloned(), xs.iter().dedup_with_count());
}
#[te... | Rust | 0 |
se xfyetkzfvsb
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
b''
pass
bomh0t_nvb_ = ''
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
assert ymk6gm358ev, 0
return
b7jsgzpztk8 >>= botg8lv1fcb
def s6moqea9yux(hs4qle7j128, jbgk9ougmwl: f2z33wnjm0_):
nonlocal t... | Python | 1 |
let mut cursor_kind: DxcCursorKind = DxcCursorKind::UNEXPOSED_DECL;
unsafe { self.inner.get_kind(&mut cursor_kind) }.result_with_success(cursor_kind)
}
pub fn get_kind_flags(&self) -> Result<DxcCursorKindFlags> {
let mut cursor_kind_flags: DxcCursorKindFlags = DxcCursorKindFlags::NONE;
... | Rust | 0 |
import unittest
class TestSolution(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def test_example1(self):
# Constructing the tree: [1, null, 2, 3]
root = TreeNode(1)
root.right = TreeNode(2)
root.right.left = TreeNode(3)
self.assertEqual(self.s... | Python | 1 |
import sys
from benchmark_paths import get_result_path
from benchmark_tools import run
assert len(sys.argv) == 3, "Usage: python script.py scene_name scene_depth"
scene = sys.argv[1]
scene_depth = int(sys.argv[2])
replay_name = "copy"
base_defines = [
("SCENE", "\"{}\"".format(scene)),
("SCENE_DEPTH", "{}".... | Python | 1 |
terfly19<T> {
direction: FftDirection,
_phantom: std::marker::PhantomData<T>,
rotate: Rotate90F32,
twiddle1re: __m128,
twiddle1im: __m128,
twiddle2re: __m128,
twiddle2im: __m128,
twiddle3re: __m128,
twiddle3im: __m128,
twiddle4re: __m128,
twiddle4im: __m128,
twiddle5re: _... | Rust | 0 |
: LMDBVec<MerkleCheckPoint>,
curr_kernel_checkpoint: MerkleCheckPoint,
range_proof_mmr: MmrCache<D, MemDbVec<MmrHash>, LMDBVec<MerkleCheckPoint>>,
range_proof_checkpoints: LMDBVec<MerkleCheckPoint>,
curr_range_proof_checkpoint: MerkleCheckPoint,
}
impl<D> LMDBDatabase<D>
where D: Digest + Send + Sync
{... | Rust | 0 |
/needs_drop.rs
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Check that we get the expected results for the `needs_drop` intrinsic
use std::mem;
pub struct Foo<T> {
_foo: T,
}
impl<T> Foo<T> {
fn call_needs_drop(&self) -> bool {
return mem::needs_drop::<T>();
}
... | Rust | 0 |
from typing import LiteralString, override
import aioboto3
from types_aiobotocore_s3.type_defs import PutObjectRequestTypeDef
from app.config import S3_CACHE_EXPIRE
from app.lib.storage.base import StorageBase
from app.models.types import StorageKey
from app.services.cache_service import CacheContext, CacheService
fr... | Python | 1 |
paths::a,Ty=&'a T>+
IntoFieldMut<paths::b,Ty=U>
),
where[ T:'a,U:'a, ]
}
assert_equal_bounds! {
trait Bounds1_VSI_Dummy['a,T,U,Vari,],
(Bounds1_VSI<'a,T,U,Vari>),
(
IntoVariantFieldMut<Vari,strings::a,Ty=&'a T>+
IntoVariantFieldMut<Vari... | Rust | 0 |
_pkginfos_dict = {}
for pkginfo_dict in pkginfo_dicts_list:
name = pkginfo_dict["name"]
version = pkginfo_dict["version"]
channel = pkginfo_dict["channel"]
python_version = pkginfo_dict["python_version"]
... | Python | 1 |
into(users::table).values(..).await?;
// [user_id.eq(id): BoolOp<user_id, _, {Eq}>]
//
impl<Db: Backend> Access<Db> {
/// Create a `SELECT` query from the provided table.
pub fn from<T: IsTable>(&self) -> Select<'_, Db, T, AllColumns<T>>
where
Db: HasSqlType<Bool> + HasSqlType<SqlTypeOf<T::AllColumn... | Rust | 0 |
Self: 'm;
fn wait<'m>(&'m mut self) -> Self::TriggerFuture<'m>;
}
#[derive(Clone, Copy)]
pub enum Command {
Tick,
Send,
TickAndSend,
}
impl<B> SendTrigger for B
where
B: Button + 'static,
{
type TriggerFuture<'m>
where
B: 'm,
= impl Future + 'm;
fn wait<'m>(&'m mut... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
# Load the CSV file
csv_path = "output_labels.csv"
df = pd.read_csv(csv_path)
# If Final_Label contains lists, split them into multiple rows
df['Final_Label'] = df['Final_Label'].apply(
lambda x: x.strip('[]').replace("'", "").split(', ') if isinstance(x, str) e... | Python | 1 |
{
Status::new().and_then(|i| acheck!(snd_rawmidi_status(self.0, i.0)).map(|_| i))
}
pub fn drop(&self) -> Result<()> { acheck!(snd_rawmidi_drop(self.0)).map(|_| ()) }
pub fn drain(&self) -> Result<()> { acheck!(snd_rawmidi_drain(self.0)).map(|_| ()) }
pub fn name(&self) -> Result<String> {
... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define tesseract vertices
vertices = np.array([[-1, -1, -1, -1],
[-1, -1, -1, 1],
[-1, -1, 1, -1],
[-1, -1, 1, 1],
[-1, 1, -1, -1],
... | Python | 1 |
param("a"))
})))
}))
]
)
}
}
<reponame>luojia65/cc2640r2f
#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::STAT {
#[doc = r" Modifies the conte... | Rust | 0 |
"""
Given a 6 x 6 2D array, arr, an hourglass is a subset of values with indices falling in the following pattern
There are 16 hourglasses in a 6 x 6 array. The hourglass sum is the sum of the values in an hourglass. Calculate the hourglass sum for every hourglass in arr, then print the maximum hourglass sum.
Constra... | Python | 1 |
# Generated by Django 4.2.7 on 2024-01-08 10:52
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("accounts", "0032_alter_onetimepassword_expires_in"),
]
operations = [
migrations.AlterField(
model_name="busines... | Python | 1 |
#! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... | Python | 1 |
}
Ok(())
})?;
Ok(())
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
#[serde(rename_all = "snake_case")]
pub enum BackupStatus {
Done,
Processing,
BackupProcessFailed,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BackupInfo ... | Rust | 0 |
her.re,
))),
Ok(None) => Ok(vm.ctx.not_implemented()),
Err(err) => Err(err),
}
}
#[pymethod(name = "__neg__")]
fn neg(&self, _vm: &VirtualMachine) -> PyComplex {
PyComplex::from(-self.value)
}
#[pymethod(name = "__repr__")]
fn repr(&self, _vm... | Rust | 0 |
# esercizio numero 7.4 pagina 123
prompt = "\nPlease Tell me which type of toppings you want:"
prompt += "\nEnter quit to end the program."
while True:
topping = input(prompt)
if topping == 'quit':
break
else:
print(f"Adding {topping.title()} to your pizza!")
# esercizio numero 7.5... | Python | 1 |
ad();
MEM[p + 1].b32.s1 = MathCell::MathChar as _;
let ch = math_char(c) as UnicodeScalar;
MEM[p + 1].b16.s0 = (ch as i64 % 65536) as u16;
MEM[p + 1].b16.s1 = math_fam(c) as u16;
if math_class(c) == 7 {
if get_int_par(IntPar::cur_fam) >= 0
&& get_int_p... | Rust | 0 |
## Copyright (c) 2020-2023 The PyUnity Team
## This file is licensed under the MIT License.
## See https://docs.pyunity.x10.bz/en/latest/license.html
from pyunity import (RGB, Behaviour, GameObject, Material, Mesh, MeshRenderer,
SceneManager, Vector3, WaitForSeconds)
class Rotator(Behaviour):
... | Python | 1 |
from bsas import BSAS
from pyclustering.cluster.bsas import bsas
from pyclustering.utils.metric import distance_metric, type_metric
def get_ground_truth(data_points, clusters):
ground_truth_labels = []
for i in range(len(data_points)):
for j in range(len(clusters)):
if i in clusters[j]:
... | Python | 1 |
from flask import Flask
from flask_socketio import SocketIO, emit, join_room, leave_room
from redis_routes import SESSION_PREFIX, redis_client
from datetime import datetime
import json
socketio = SocketIO()
def init_socketio(app):
socketio.init_app(app, cors_allowed_origins="*")
@socketio.on('broadcast_mess... | Python | 1 |
.commit_configuration_change(proposal);
anchoring_testkit.create_blocks_until(Height(7));
anchoring_testkit.renew_address();
let signatures = anchoring_testkit
.create_signature_tx_for_validators(3)
.unwrap();
anchoring_testkit.create_block_with_transactions(signatures);
anchoring_t... | Rust | 0 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
See the file 'LICENSE' for copying permission
"""
import re
from lib.core.data import kb
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def dependencies():
pass
def tamper(payload, **kwargs):
"""
... | Python | 1 |
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ... | Rust | 0 |
: Vec<unified::Receiver> = match (0..receivers_len)
.map(|i| {
Ok(
match unsafe { (typecode_cb.unwrap())(ua_obj, i) }.try_into()? {
unified::Typecode::Orchard => {
// TODO: Replace with Orchard support.
let data_len ... | Rust | 0 |
from openpyxl import load_workbook
from dojo.tools.deepfence_threatmapper.compliance import DeepfenceThreatmapperCompliance
from dojo.tools.deepfence_threatmapper.malware import DeepfenceThreatmapperMalware
from dojo.tools.deepfence_threatmapper.secret import DeepfenceThreatmapperSecret
from dojo.tools.deepfence_threa... | Python | 1 |
import os
from pathlib import Path
import numpy as np
from matplotlib import pyplot as plt
from stringart.line.matrix import MatrixGenerator
from stringart.solver import Solver
from stringart.utils.image import ImageWrapper, crop_image
from stringart.utils.perf_analyzer import Benchmark
from stringart.utils.types impo... | Python | 1 |
self) -> &'a mut W {
self.variant(PAD64PULL_A::DIS)
}
#[doc = "Pullup enabled"]
#[inline(always)]
pub fn en(self) -> &'a mut W {
self.variant(PAD64PULL_A::EN)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
... | Rust | 0 |
aChaRng {
fn value_type(&self) -> String {
"Rng".to_string()
}
}
impl fmt::Display for ChaChaRng {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Rng")
}
}
// main will get the input about the target info
// it will initialize the target struct
// and then it will... | Rust | 0 |
$args.push(($formal_arg_name, None));
}
cons_formal_arg!($args, $ignore_extra, $($rest_arg)+)
}
};
(
$args:ident,
$ignore_extra:ident,
$formal_arg_name:expr ;? $formal_arg_default:expr,
$($rest_arg:tt)+
) => {
{
{
... | Rust | 0 |
e_distribution"]),
"unique_videos": len(results["video_coverage"]),
}
return results
if __name__ == "__main__":
# Test utilities
logger = setup_logging("DEBUG")
logger.info("Testing surgical phase recognition utilities")
# Test timer
with Timer("Test operation", logger):
... | Python | 1 |
;
unsafe fn assemble_mut(data: *mut Self::Data, meta: Self::Meta) -> *mut Self {
mem::transmute(Self::assemble(data, meta))
}
/// Break a reference down into its constituent parts.
fn disassemble(fatp: *const Self) -> (*const Self::Data, Self::Meta);
fn disassemble_mut(fatp: *mut Self) ->... | Rust | 0 |
ova, size, user_addr)
.map_err(|e| {
io::Error::new(
io::ErrorKind::Other,
format!(
"failed to map memory for VFIO container, \
iova 0x{:x}, gpa 0x{:x}, size 0x{:x}: {:?}",
iova, ... | Rust | 0 |
n of the `P2PRunner`.
fn run(&mut self);
}
<gh_stars>0
pub mod block;
pub mod compression_header;
mod container;
mod encoding;
pub mod record;
mod records;
pub mod slice;
pub use self::records::Records;
use std::{
io::{self, Read},
str,
};
use byteorder::{LittleEndian, ReadBytesExt};
use super::{Contain... | Rust | 0 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Python | 1 |
RoomStyle::Random
};
place_room(level, Position { x, y }, style);
// TODO: real passageway handling
if x > 3 {
level.set_tile(Position { x: x - 3, y }, Tile::Door);
}
if y > 3 {
level.set_tile(Position {... | Rust | 0 |
"""
Development script of the ChemEnv utility to get the explicit permutations for coordination environments identified
with the explicit permutations algorithms (typically with coordination numbers <= 6).
"""
from __future__ import annotations
import itertools
import json
import os
import numpy as np
from pymatgen... | Python | 1 |
l::OpaquePointer;
use crate::vm::VMBinding;
use enum_map::EnumMap;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
pub type SelectedPlan<VM> = MyGC<VM>;
// Says that for the semispace algorithm we should use the default allocation
// method i.e. to the copyspaces. This is as opposed to putting stuf... | Rust | 0 |
from django.forms import ModelForm, inlineformset_factory
from .models import Group, Student, Message
class GroupForm(ModelForm):
class Meta:
model = Group
fields = ['author', 'name', 'description']
class StudentForm(ModelForm):
class Meta:
model = Student
fields = ['group', 'f... | Python | 1 |
error!(
"Failed to transfer target back to local machine (error: {})",
e
);
exit(-6);
});
}
}
if !no_copy_lock {
info!("Transferring Cargo.lock file back to client.");
... | Rust | 0 |
he material
#[cfg(feature = "KHR_materials_specular")]
#[cfg_attr(docsrs, doc(cfg(feature = "KHR_materials_specular")))]
pub struct Specular<'a> {
/// The parent `Document` struct.
document: &'a Document,
/// The corresponding JSON struct.
json: &'a json::extensions::material::Specular,
}
#[cfg(featur... | Rust | 0 |
s={'pk': inv1.id}), admin, expect=200)
assert res.data['count'] == 1
res = get(reverse('api:inventory_ad_hoc_commands_list', kwargs={'pk': inv2.id}), admin, expect=200)
assert res.data['count'] == 1
inv1.adhoc_role.members.add(alice)
res = get(reverse('api:inventory_ad_hoc_commands_list', kwargs={'... | Python | 1 |
unsafe
{
write_bytes(self, 0, offset);
}
}
#[allow(trivial_casts)]
#[inline(always)]
fn writeValue<T>(self, value: T) -> usize
{
self.writeRef(&value)
}
#[allow(trivial_casts)]
#[inline(always)]
fn writeRef<T>(self, value: &T) -> usize
{
self.writeConst(value as *const _)
}
#[allow(trivial... | Rust | 0 |
fn calc(input) {
let a = input[0] + 1;
let b = `{input[1]} World`;
[a, b]
}
"#,
)?;
let VecTuple((a, b)) = output;
println!("({:?}, {:?})", a, b);
Ok(())
}
use std::io::{self, Read, Write}; // , Lines};
type Result<T> = ::std::result::Result<T, Box... | Rust | 0 |
one):
"""
Writes a serializable data piece to f
The order of tests is nonarbitrary,
as strings and mappings are iterable.
If f is None, it writes to a byte buffer
and returns a bytestring
"""
if f is None:
f = BytesIO()
_bencode_to_file(data, f)
return f.getvalue()
else:
_bencode_to_file(data, f)
def... | Python | 1 |
.cpl16(*right);
*right = tmp;
left = left.offset(1);
right = right.offset(-1);
}
let end = end as *mut u8;
match rem {
1 => *end = tables.cpl8(*end),
2 => {
let tmp = tables.cpl8(*end);
*end = tables.cpl... | Rust | 0 |
*jwt = serde_json::from_str(std::str::from_utf8(&response.json).unwrap()).unwrap();
Ok(())
}
}
#![allow(non_snake_case)]
#[macro_use]
extern crate criterion;
use criterion::{Criterion, Benchmark};
use zerocaf::backend::u64::{scalar, field};
use zerocaf::edwards::EdwardsPoint;
use zerocaf::traits::ops:... | Rust | 0 |
: {'0': 4, '1': 4, '2': 4, '3': 4, '4': 4, '5': 4, '6': 4, '7': 4, '8': 4, '9': 4, 'a': 4, 'b': 4, 'c': 3, 'd': 4, 'e': 4, 'f': 2, 'g': 4, 'h': 4, 'i': 2, 'j': 2, 'k': 4, 'l': 2, 'm': 6, 'n': 4, 'o': 4, 'p': 4, 'q': 4, 'r': 3, 's': 3, 't': 2, 'u': 4, 'v': 3, 'w': 5, 'x': 3, 'y': 3, 'z': 3, 'A': 4, 'B': 5, 'C': 4, 'D': ... | Python | 1 |
from nautobot.core.testing.integration import SeleniumTestCase
class ImportObjectsUITestCase(SeleniumTestCase):
"""Integration tests for the 'Import Objects' system Job's UI."""
def setUp(self):
super().setUp()
self.user.is_superuser = True
self.user.save()
self.login(self.use... | Python | 1 |
from pytest_harvest import get_session_synthesis_dct
from pytest_cases.common_pytest_marks import has_pytest_param
from pytest_cases import parametrize_with_cases, AUTO
from .example import foo
@parametrize_with_cases("a,b")
def test_foo_alternate_cases_file_and_two_marked_skip(a, b):
assert isinstance(foo(a, b... | Python | 1 |
# Copyright 2013 Red Hat, Inc.
#
# 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 |
----|-----\n {6} | {7} | {8} \n"
.format(GameMemory[0],
GameMemory[1], GameMemory[2],
GameMemory[3], GameMemory[4],
GameMemory[5], GameMemory[6],
GameMemory[7], GameMemory[8]))
if start % 2 != 0: # player1
... | Python | 1 |
S::Bucket;
type Stream = J::Stream;
async fn stream(&self) -> Result<Self::Stream> {
match self.journal.stream(DEFAULT_NAME).await {
Ok(stream) => Ok(stream),
Err(JournalError::NotFound(_)) => {
let stream = self.journal.create_stream(DEFAULT_NAME).await?;
... | Rust | 0 |
class Shop(BaseModel):
ShopCode: str
Amount: int
Name: Optional[constr(max_length=128)]
Fee: str
class ReceiptBase(BaseModel):
Email: Optional[constr(max_length=128)] = None
Phone: Optional[constr(max_length=64)] = None
Taxation: Taxation
class ReceiptFFD105(ReceiptBase):
FfdVer... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
ariant: "Float",
},
Token::F64(0.0000001),
Token::StructEnd,
],
);
}
/// Test PragmaGlobalPhase inputs and involved qubits
#[test]
fn pragma_global_phase_inputs_qubits() {
let pragma = PragmaGlobalPhase::new(CalculatorFloat::from(0.05));
// Test inputs are corre... | Rust | 0 |
type Target = crate::W<SAR_TOUCH_CTRL1_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SAR_TOUCH_CTRL1_SPEC>> for W {
#... | Rust | 0 |
ext.db().wallets_db();
let re = m_wallet.update_by_id(rb, tx_id).await?;
//todo 其它字段怎么处理?
Ok(re)
}
pub async fn m_wallet_by_name(context: &dyn ContextTrait, name: &str) -> Result<Vec<MWallet>, WalletError> {
let rb = context.db().wallets_db();
let wrapper = rb.new_wrapp... | Rust | 0 |
to change the container's size automatically."]
#[doc = " @param cont pointer to a container object"]
#[doc = " @param left left fit policy from `lv_fit_t`"]
#[doc = " @param right right fit policy from `lv_fit_t`"]
#[doc = " @param top top fit policy from `lv_fit_t`"]
#[doc = " @param bottom bottom... | Rust | 0 |
=> { let v = $this.get_value(Mode::IMMEDIATE); $this.adc(v) }
0x65 => { let v = $this.get_value(Mode::ZERO_PAGE); $this.adc(v) }
0x75 => { let v = $this.get_value(Mode::ZERO_PAGE_X); $this.adc(v) }
0x6d => { let v = $this.get_value(Mode::ABSOLUTE); $this.adc(v) }
0x7d =>... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.