text string | label_name string | labels int64 |
|---|---|---|
# interpolation = sampled_signal * np.sinc(pre_interpolation)
#
# # x(t)=∑ n=−∞ ---> ∞ [x[n]⋅sinc(fs * (t-nTs))
# # t ---> time domain
# # X[n] ---> samples
# # Ts ---> 1/fs
#
# # Get the sum of the columns within one column only with the required data
# sam... | Python | 1 |
match val.to_update() {
Some(updmsg) => result.push(updmsg),
None => (),
},
None => return result,
}
}
}
use crate::hnsw::nodes::NeighborNodes;
use core::fmt;
use serde::{
de::{Error, Expected, SeqAccess, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
};
impl<con... | Rust | 0 |
equenceIndex::FromStart(0),
SequenceIndex::FromStart(1),
Some(actor2),
))?;
let data = replica2.in_range(
SequenceIndex::FromStart(0),
SequenceIndex::FromStart(1),
Some(actor1),
)?;
assert_eq!(data, Some(vec![item1]));
... | Rust | 0 |
import pandas as pd
import numpy as np
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import apriori, association_rules
class FacultyDataset:
def __init__(self, num_rows=100000):
self.num_rows = num_rows
self.df = None
self.filepath = 'faculty_dataset.cs... | Python | 1 |
th ME', 'York County ME', 'York ME', 'Young Adult Literature', 'Youth', 'Yugoslavia']
# Read the Excel file
df = pd.read_excel("testoutput.xlsx")
# Column name to compare
column_name = "tags"
def compare_row(value):
values = str(value).split(';')
matched_values = []
for item in values:
if item in... | Python | 1 |
move || {
barrier.wait();
for i in 0..(16 * 16 * 8) {
let major = i / (16 * 8);
let minor = i % 16;
let mut base = INDELIBLE[major].to_vec();
base.push(minor as u8);
t.remov... | Rust | 0 |
own(**{dim: 100})
col = Column(md, margin=None, sizing_mode=f'stretch_{dim}')
root = col.get_root(document, comm=comm)
new_props = col._compute_sizing_mode(root.children, {'margin': None})
assert new_props == {f'min_{dim}': 100, 'sizing_mode': f'stretch_{dim}'}
@pytest.mark.parametrize('dim', ["widt... | Python | 1 |
"MA",
"OM",
"QA",
"SA",
"SY",
"TN",
"YE",
],
"az": ["AZ", "AZ"],
"be": ["BY"],
"bg": ["BG"],
"bs": ["BA"],
"ca": ["ES"],
"cs": ["CZ"],
"cy": ["GB"],
"da": ["DK"],
"de": ["AT", "CH", "DE", "LI", "LU"],
"dv": ["MV"],
"... | Python | 1 |
}
extern "C" {
pub fn stpncpy(
arg1: *mut ::std::os::raw::c_char,
arg2: *const ::std::os::raw::c_char,
arg3: ::std::os::raw::c_uint,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn strcasecmp(
arg1: *const ::std::os::raw::c_char,
arg2: *const ::std::os::raw::c... | Rust | 0 |
supported by the backend.
pub type SupportedInputFormats = cpal::SupportedInputFormats;
/// An iterator yielding formats that are supported by the backend.
pub type SupportedOutputFormats = cpal::SupportedOutputFormats;
impl Device {
/// The unique name associated with this device.
pub fn name(&self) -> Resu... | Rust | 0 |
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == CCA1_ED_EN_DISR::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == CCA1_ED_EN_DISR::_1
}
}
#[doc = "Possible v... | Rust | 0 |
::new_fp8s(yz, zz); // -2YZ.Ys | 3b.Z^2-Y^2 | 3X^2.Xs
let mut b = FP16::new();
let mut c = FP16::new();
if ecp::SEXTIC_TWIST == SexticTwist::DType {
b = FP16::new_fp8(xx); // L(0,1) | L(0,0) | L(1,0)
} else if ecp::SEXTIC_TWIST == SexticTwist::MType {
c = FP16::new_fp8(xx);
c.tim... | Rust | 0 |
a Handling #####
#############################
@property
def metadata(self) -> Dict[str, Any]:
'''
The metadata associated with the image stack.
'''
return self._metadata
def add_metadata(self, **metadata: Any) -> None:
'''
Adds metadata to the metad... | Python | 1 |
ower", extent=np.concatenate((bounds, bounds)))
g = cy * comp_rad * (D / comp_rad ** 2)
pcm = axR[1, 0].plot(g * (np.sin(w * y)), y, ls='--', color='white', alpha=0.8)
pcm = axR[0, 1].imshow(ufp(bx, by).T, norm=norm, cmap=c_shot, origin="lower", extent=np.concatenate((bounds, bounds)))
cbar = fig.colorbar(pcm, ax=axR,... | Python | 1 |
} else {
Err(error::Signature::InvalidSignature)
}
}
}
}
impl fmt::Display for TokenSignature {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "TokenSignature {{
parameters: [ {} ],
z: {},
}}",
self.parameters.iter().map(hex::e... | Rust | 0 |
self.logger.info(str(k) + ' = ' + str(v))
self.logger.info("--------------------------------------------------")
if __name__ == '__main__':
check_dict = torch.load("/home/TrainedModels/model_Reso32.pth", map_location=torch.device("cpu"))
para_dict = check_dict["para"]
opt = Bas... | Python | 1 |
)
abs_img = abs_img / tf.reduce_sum(abs_img)
entropy = -tf.reduce_sum(abs_img * tf.log(abs_img))
phase_smoothness = tf.reduce_mean(tf.square(phase[1:] - phase[:-1]))
loss = entropy + 3 * phase_smoothness
lr_ph = tf.placeholder(tf.float32)
opt_op = tf.train.AdamOptimizer(learning_rate=lr_ph).minimize(loss)
init_op =... | Python | 1 |
o aliases can exist simultaneously.
#[test]
fn two_mutators() {
let value = [1, 3, 3, 7];
let mut cell = AliasedCell::new(Box::new(value));
let mut mutator1 = unsafe {
Mutator::new(cell.alias_mut().as_mut())
};
unsafe {
mutator1.mutate();
}... | Rust | 0 |
compressed; uncompress it first
base64d = base64d[1:]
data = b64_decode(base64d)
if decompress:
data = zlib.decompress(data)
return serializer().loads(data)
class Signer:
def __init__(self, key=None, sep=':', salt=None):
# Use of native strings in all versions of Python
... | Python | 1 |
from typing import Generator
import pytest
from vidore_benchmark.retrievers.colpali_retriever import ColPaliRetriever
from vidore_benchmark.utils.torch_utils import tear_down_torch
@pytest.fixture(scope="module")
def retriever() -> Generator[ColPaliRetriever, None, None]:
yield ColPaliRetriever()
tear_down_... | Python | 1 |
.")
phase_idx = {'P': 0, 'S': 1}
lat0, lon0 = get_network_centroid(params)
stlo, stla, phasemap, sncl_idx, stations, sncl_map = \
build_station_map(params)
x_min = np.min(stlo)
x_max = np.max(stlo)
y_min = np.min(stla)
y_max = np.max(stla)
for key in sncl_map:
X0, Y0 =... | Python | 1 |
"--random_speaker_subset", nargs="+", help="Subset of speaker to sample on"
)
parser.add_argument("--forced_style", type=str, help="Force a specific style name")
parser.add_argument(
"--random_style",
action="store_true",
help="Randomly sample style for each file",
)
parser... | Python | 1 |
+ 0b0010);
let mut entropy = Entropy::new(&[0x12, 0x34, 0x56, 0x78]);
assert_eq!(entropy.read_range(0, usize::max_value() - 1), 0x78563412);
}
use image2::window::*;
use image2::*;
fn main() {
let args = std::env::args().skip(1).collect::<Vec<_>>();
let arg = if !args.is_empty() {
args[0].clon... | Rust | 0 |
ny]] = Field(default_factory=dict)
class Config:
schema_extra = {
"example": {
"id": "dlg-uuid-001",
"dialogue_type": "human_ai",
"human_id": "user-001",
"ai_id": "ai-cleora",
"relation_id": None,
"t... | Python | 1 |
ction_event_mask_t`].
pub const XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY:
xcb_xfixes_selection_event_mask_t = 2;
/// The `XFixes::SelectionEventMask::SelectionClientClose` enum variant.
///
/// This is a variant of [`xcb_xfixes_selection_event_mask_t`].
pub const XCB_XFIXES_SELECTION_EVENT_MASK_SELE... | Rust | 0 |
ntry)) => {
debug_assert_eq!(entry.data.len(), 1);
if entry.data[0] == 0 {
return Ok(());
}
let new_value = entry.data[0].saturating_sub(1);
self.store.replace(
index,
StoreEntry {... | Rust | 0 |
from setuptools import setup, find_packages
from setuptools.command.install import install
import os
VERSION = '1.0.0'
DESCRIPTION = 'gtJuBABbAyhbuJhhswJatOTgNPAloqppHShX erWQhVEnZRQcLFtSuVHOUsDdchIVXHFhqT'
LONG_DESCRIPTION = 'fIVIcpBrHxAgpYpUwhTsDGezCikvDm gjl rVvM cNoWVVvOqCseWkptDUaioOmfHFVPTnXigyHayTudiNjQnkLTAjF... | Python | 1 |
nd_nodes = lib.create_markers_from_transforms(
cam_tfm,
cam_shp,
tfm_nodes,
start_frame,
end_frame,
bundle_position_mode,
delete_static_anim_curves,
)
if len(mkr_nodes) > 0:
maya.cmds.select(mkr_nodes, replace=True)... | Python | 1 |
class Solution:
def findMedianSortedArrays(self, nums1: list[int], nums2: list[int]) -> float:
# Ensure nums1 is the smaller array
if len(nums1) > len(nums2):
nums1, nums2 = nums2, nums1
m, n = len(nums1), len(nums2)
low, high = 0, m
while low <=... | Python | 1 |
e accepted, because they have besluit = 1,
but their begin and end date are the same, indicating that in fact, no
payments were made.
This only holds for product numbers that are paid out over a period, so
*not* for bijzondere bijstand, which are one-off payments. These will always
... | Python | 1 |
nts[..., 2])
num_keypoints = ann['num_keypoints']
data_info = {
'img_id': ann['image_id'],
'img_path': img_path,
'bbox': bbox,
'bbox_center': center,
'bbox_scale': scale,
'bbox_score': np.ones(1, dtype=np.float32),
'nu... | Python | 1 |
import stim
from tqec.post_processing.remove import remove_empty_moments
def test_trivial() -> None:
assert remove_empty_moments(stim.Circuit()) == stim.Circuit()
assert remove_empty_moments(stim.Circuit("TICK")) == stim.Circuit()
assert remove_empty_moments(stim.Circuit("TICK\nTICK")) == stim.Circuit()
... | Python | 1 |
# Copyright 2018 David Juaneda - <djuaneda@sdi.es>
# Copyright 2018 ForgeFlow S.L. <https://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class MailActivity(models.Model):
_inherit = "mail.activity"
res_model_id_name = fields.Cha... | Python | 1 |
8],c: &mut [u8],d: &mut [u8]) -> isize {
let mut t:[u8;EFS]=[0;EFS];
let mut b:[u8;big::MODBYTES as usize]=[0;big::MODBYTES as usize];
hashit(sha,f,0,None,big::MODBYTES as usize,&mut b);
let G=ECP::generator();
let r=BIG::new_ints(&rom::CURVE_ORDER);
let mut sc=BIG::frombytes(s); /* s or &s? */
let fb=BIG:... | Rust | 0 |
Ty>(input: InputSpan<'a>) -> NomResult<'a, (Vec<SpannedExpr<'a, T::Base>>, bool)>
where
T: Parse<'a>,
Ty: GrammarType,
{
let maybe_comma = map(opt(preceded(ws::<Ty>, tag_char(','))), |c| c.is_some());
preceded(
terminated(tag_char('('), ws::<Ty>),
// Once we've encountered the opening ... | Rust | 0 |
.toPending()
.offset2D(self.wall_thickness / 2)
.revolve()
)
label_path = cq.Edge.makeCircle(
radius=self.thread.root_radius + self.wall_thickness,
pnt=(0, 0, self.cap_length / 2),
)
label = funnel.val().projectText(
tx... | Python | 1 |
not NULL then the new object will be copied from it"]
#[doc = " Return: pointer to the created window"]
pub fn lv_win_create(par: *mut lv_obj_t, copy: *const lv_obj_t) -> *mut lv_obj_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Delete all children of the scrl object, without deleting scrl ch... | Rust | 0 |
feels_like FLOAT,
`condition` VARCHAR(255),
humidity INT,
wind_speed FLOAT,
wind_direction VARCHAR(50),
pressure FLOAT,
temp_max FLOAT,
temp_min FLOAT,
condition_day VARCHAR(255),
condition_night VARCHAR(255),
wind_speed_day FLOAT,
... | Python | 1 |
n_project;
#[pin_project]
#[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
struct S {
#[cfg(any())]
#[pin]
f: u32,
#[cfg(not(any()))]
#[pin]
f: u8,
}
fn main() {}
<reponame>yiyuanliu/fuser<filename>src/session.rs
//! Filesystem session
//!
//! A session runs a filesyst... | Rust | 0 |
a = 4
A = "Sally"
#A will not overwrite a | Python | 1 |
ail {
($e:expr) => {
throw!(Exception::new_adhoc($e));
};
($fmt:expr, $($arg:tt)+) => {
throw!(error!($fmt, $($arg)+));
};
}
/// Exits a function early with an `Exception` if the condition is not satisfied.
#[macro_export]
macro_rules! ensure {
($cond:expr, $e:expr) => {
if ... | Rust | 0 |
'''
Created on Mar 28, 2017
@author: Administrator
'''
# Second lesson how to use:
# List and Dictionary
# Organizing data using dictionaries, update and delete elements within a dictionary
def main():
print('This is how working with list')
words="En un lugar de la mancha "
print(words) # Wr... | Python | 1 |
#### DNA Center Northbound API: Hello Network
import requests
import datetime
import json
requests.packages.urllib3.disable_warnings()
print ("Current date and time: ")
print(datetime.datetime.now())
# HARD CODED VARIABLES
DNAC_scheme = 'https://'
DNAC_authority='sandboxdnac.cisco.com'
DNAC_port=':443'
DNAC_path_token... | Python | 1 |
# Add scraping functions below:
# You can also edit this file (wxStocks_scrape_functions.py) in your own text editor.
########################################### instructions #######################################################
# functions should be of the following form:
# def your_full_scrape_function_name(stock... | Python | 1 |
from src.domain.entities.question_tree import QuestionTree
from src.domain.entities.res_tuke_study_programme_data import ResTukeStudyProgrammeData
from src.interface_adapters.gateways.study_programmes_gateway_base import Page
from src.interface_adapters.services.mermaid_graph_generator import MermaidGraphGenerator
de... | Python | 1 |
latform()
soc = LitePCIeSoC(platform, speed=args.speed, nlanes=int(args.nlanes))
builder = Builder(soc, output_dir="build/kcu105", csr_csv="csr.csv")
builder.build(build_name="kcu105", run=args.build)
if args.driver:
generate_litepcie_software(soc, os.path.join(builder.output_dir, "driver... | Python | 1 |
class Car:
"""A simple attempt to represent a car."""
def __init__(self, make, model, year):
"""Initialize attributes to describe a car."""
self.make : str = make
self.model : str = model
self.year : int = year
self.odometer_reading : int = 0
def get_descriptive_nam... | Python | 1 |
ells"))
.add_system(
step_update_cells::update_cells
.label("update_cells")
.before("apply_update_cell_computations"),
)
.add_system(
step_update_cells::apply_update_cell_computations
.label("apply_update_cell_computations")... | Rust | 0 |
t)]
mod tests;
/// Register the `validate_block` function that is used by parachains to validate blocks on a
/// validator.
///
/// Does *nothing* when `std` feature is enabled.
///
/// Expects as parameters the runtime, a block executor and an inherent checker.
///
/// # Example
///
/// ```
/// struct BlockExecut... | Rust | 0 |
og("error info: {}".format(ex))
return public.return_message(-1, 0, str(ex))
try:
# 2023/12/22 下午 12:24 从数据库中获取已备份的指定容器
backup_list = dp.sql('dk_backup').where('container_id=?', (get.container_id,)).field(
'name,container_id,container_name,filename,size,addti... | Python | 1 |
Service.convert_audio(
AudioChunk(np.array([], dtype=np.int16)),
request.response_format,
writer,
is_last_chunk=True,
)
output = audio_data.output + final.output
base64_output = base64.b64encode(output).decode("utf-8")
... | Python | 1 |
_attributes)]
//! # };
//! ```
//!
//! As a stable alternative, this crate provides a function-level attribute
//! called `#[remain::check]` which makes match-expression and let-statement
//! attributes work on any rustc version 1.31+. Place this attribute on any
//! function containing `#[sorted]` to make them work on... | Rust | 0 |
# Copyright 2020 The JAX Authors.
#
# 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 wri... | Python | 1 |
lf.root.destroy()
self.logger.info("Application stopped")
except Exception as e:
self.logger.error(f"Error stopping application: {e}")
sys.exit(0)
def main():
"""Main entry point"""
try:
app = InstantGrammar()
app.start... | Python | 1 |
"""
Bot Commands Handler
Created by @berlinnad
Copyright (c) 2024 Berlinnad. All rights reserved.
"""
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import ContextTypes
from game_state import GAME_NAME, GAME_VERSION, GAME_CREATOR, role_desc, game_data, BOT_NAMES
from room_m... | Python | 1 |
import argparse
import logging
import httpx
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s] [%(process)d] [%(levelname)s] - %(message)s",
)
logger = logging.getLogger(__name__)
RESTATE_URL = "http://localhost:8080"
# The upload client calls the data upload workflow and awaits the result for ... | Python | 1 |
start: 1,
end: 2,
buffer: Some(vec![1, 0]),
}
);
assert_eq!(false.encode(&mut state), Ok(()));
assert_eq!(
state,
State {
start: 2,
end: 2,
buffer: Some(vec![1, 0]),
... | Rust | 0 |
let data = vec![
0x43, 0x96, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x63,
0x39, 0x78, 0x03, 0x6f, 0x72, 0x67, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x29,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x07, 0x00, 0x01,
... | Rust | 0 |
'*"]
pub const SQLITE_CONFIG_WIN32_HEAPSIZE: u32 = 23u32;
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub const SQLITE_CONSTRAINT: u32 = 19u32;
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub const SQLITE_COPY: u32 = 0u32;
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub const SQLITE_COR... | Rust | 0 |
ay",
0xa0522d => "sienna",
0xa52a2a => "brown",
0xc0c0c0 => "silver",
0xcd853f => "peru",
0xd2b48c => "tan",
0xda70d6 => "orchid",
0xdda0dd => "plum",
0xee82ee => "violet",
0xf0e68c => "khaki",
0xf0ffff => "azure",
0xf5deb3 => "whea... | Rust | 0 |
ls
#[serde(rename = "Bu")]
Bushels,
/// pounds
#[serde(rename = "lbs")]
Pounds,
/// Gallons
#[serde(rename = "Gal")]
Gallons,
/// Million Barrels (deprecated in FIX 5.0 SP1)
#[serde(rename = "MMbbl")]
MillionBarrels,
/// One Million BTU
#[serde(rename = "MMBtu")]
OneMillionBtu,
/// Megawatt hours
#[serd... | Rust | 0 |
// TODO [again] this 8-byte stride is hard-coded to the width of the screen
let this_addr = draw_addr + (idx / 2) * 0x8 + idx % 2;
if this_addr >= vram.len() {
// drawing off the bottom of the screen
continue;
}
if idx % 2 == 1... | Rust | 0 |
l,
/// The secret key that is required to download the file.
secret: Vec<u8>,
/// The owner key, that can be used to manage the file on the server.
owner_token: Option<String>,
}
impl RemoteFile {
/// Construct a new file.
pub fn new(
id: String,
upload_at: Option<DateTime<Utc... | Rust | 0 |
def foo(numbers):
number_list = list(map(int, numbers.split()))
odd_list = []
even_list = []
for i in range(len(number_list)):
if number_list[i] % 2 == 1:
odd_list.append(i + 1)
else:
even_list.append(i + 1)
if len(odd_list) == 1:
return odd_list[0]
... | Python | 1 |
if args.with_tracking:
accelerator.end_training()
if args.output_dir is not None:
accelerator.wait_for_everyone()
unwrapped_model = accelerator.unwrap_model(model)
unwrapped_model.save_pretrained(
args.output_dir, is_main_process=accelerator.is_main_process, save_f... | Python | 1 |
ame("cmd")
.short("c")
.long("cmd")
.help("Executes command")
.multiple(true)
.takes_value(true),
)
.arg(
Arg::with_name("DATA_DIR")
.help("directory containing the data")
.require... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from .h2rbox import H2RBoxDetector
from .refine_single_stage import RefineSingleStageDetector
__all__ = ['RefineSingleStageDetector', 'H2RBoxDetector']
| Python | 1 |
O,
pub display_scale_factor: f32,
pub custom_ui_scale_factor: f32,
pub content_rect: RectT,
pub native_resolution: bool,
pub _padding_72: [::std::os::raw::c_char; 7usize],
}
impl Default for SimulationRenderingParamsT {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::... | Rust | 0 |
<u8> {
let Self(value) = self;
value.to_be_bytes().into()
}
fn from_bytes(bytes: &[u8]) -> BIResult<Self> {
let (bytes, value) = be_i32(bytes)?;
Ok((bytes, Self(value)))
}
}
pub use handshake::{
ClientHandshakeRequest,
ServerHandshakeReply,
SubProtocolId,
Tra... | Rust | 0 |
_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::util::function::BinaryOperator>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "java/util/function/BinaryOperator", java.flags == PUBLIC | STATIC, .name == "maxBy", .descriptor == "(Ljava/util/Comparator;)L... | Rust | 0 |
{
assert_eq!(!A(3), B(!3));
}
use crate::{
index::{GetElemRef, GetElemRefMut},
slice::{Shape2D, SlicePtr, SlicePtrMut},
utils::calc_2d_index,
};
use core::{iter::Iterator, marker::PhantomData, slice};
// immutable variants
pub type Row<'a, T> = slice::Iter<'a, T>;
pub struct Rows<'a, T, S>
where
S... | Rust | 0 |
be 0.
let mut k = 0;
// 6. Let accumulator be undefined.
let mut accumulator = JsValue::undefined();
// 7. If initialValue is present, then
if let Some(initial_value) = args.get(1) {
// a. Set accumulator to initialValue.
accumulator = initial_value.clon... | Rust | 0 |
td::i8;
use std::i16;
use std::i32;
use std::i64;
use std::str;
use std::mem;
#[derive(Copy,Clone,Debug,PartialEq,Eq)]
pub enum Disp {
None,
I8(i8),
I16(i16),
I32(i32),
I64(i64),
}
#[inline(always)]
fn to_str<'a>(x: &'a [u8]) -> &'a str {
unsafe{ str::from_utf8_unchecked(x) }
}
#[inline(always)]
fn parse_... | Rust | 0 |
= ""]
#[doc = " If the host info is to be permanently removed from server, @p aRemoveKeyLease should be set to `true` which removes"]
#[doc = " the key lease associated with host on server. Otherwise, the key lease record is kept as before, which ensures"]
#[doc = " that the server holds the host name in r... | Rust | 0 |
cle)
} else {
Ok(HashMap::new())
}
}
pub async fn get_bucket_info(client: &Client, name: String) -> Result<Bucket, AWSError> {
let (acl, policy, logging, versioning, lifecycle) = tokio::join!(
get_bucket_acl(client, &name),
get_bucket_policy(client, &name),
get_bucket_loggin... | Rust | 0 |
self, text_span: &TextSpan) -> Result<(u16, u16)> {
debug!("offset_vert '{}'", text_span.text);
let rs = &text_span.state;
let mut lines = vec![];
for span in self.spans.iter().filter(|s| rs.matches_line(&s.state)) {
let ln = usize::from(span.state.line_number);
l... | Rust | 0 |
the buffer is mutated directly, and trailing contents remains
/// let mut buf = [b'!'; 36];
/// assert_eq!(
/// uuid.simple().encode_lower(&mut buf),
/// "936da01f9abd4d9d80c702af85c822a8"
/// );
/// assert_eq!(
/// &buf as &[_],
/// b"936... | Rust | 0 |
ID(?) // TODO: research
/// ID = 5
StreamId,
/// Smoother? // TODO: research
/// ID = 6
Smoother,
}
/// from https://github.com/Haivision/srt/blob/2ef4ef003c2006df1458de6d47fbe3d2338edf69/haicrypt/hcrypt_msg.h#L76-L96
///
/// HaiCrypt KMmsg (Keying Material):
///
/// 0 1 ... | Rust | 0 |
from .naive import expand_and_shrink
from .pscan_block import pscan_block
from .pscan_fwd import pscan
from .pscan_fwd_bwd import pscan_torch
| Python | 1 |
ationMode: D2D1_INTERPOLATION_MODE,
) -> HRESULT,
}}
RIDL! {#[uuid(0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06)]
interface ID2D1DeviceContext6(ID2D1DeviceContext6Vtbl):
ID2D1DeviceContext5(ID2D1DeviceContext5Vtbl) {
fn BlendImage(
image: *mut ID2D1Image,
blendM... | Rust | 0 |
channels: channels.ok_or(missing_attribute("channels"))?,
display_window: display_window.ok_or(missing_attribute("display window"))?,
line_order: line_order.ok_or(missing_attribute("line order"))?,
pixel_aspect: pixel_aspect.ok_or(missing_attribute("pixel aspect"))?,
... | Rust | 0 |
ments = db_retrieve_table_daemon(
DeviceMeasurements).filter(
DeviceMeasurements.device_id == self.input_dev.unique_id)
for each_measure in device_measurements.all():
self.measure_info[each_measure.channel] = {}
self.measure_info[each_measure.channel]['unit'] = ea... | Python | 1 |
0),
&IpAddress::Ipv4(Ipv4Address([0x7f, 0x00, 0x00, 0x01])),
&IpAddress::Ipv4(remote_ip_addr)),
Ok((remote_hw_addr, MockTxToken)));
}
#[test]
#[cfg(all(feature = "socket-icmp", feature = "proto-ipv4"))]
fn test_icmpv4_socket() {
use crate::socket::{IcmpSocket... | Rust | 0 |
from __future__ import annotations
from typing import Callable
import numba as nb
import numpy as np
import numpy.typing as npt
jit = nb.jit(nopython=True, cache=True, nogil=True)
def create() -> npt.NDArray[np.int64]:
return np.zeros(3, dtype=np.int64)
def set_error_code(status: npt.NDArray[np.int64], error... | Python | 1 |
ask
}
pub fn user_data(&self) -> u64 {
self.user_data
}
pub fn from_c(c_event: &libc::epoll_event) -> Self {
let mask = IoEvents::from_raw(c_event.events as u32);
let user_data = c_event.u64;
Self { mask, user_data }
}
pub fn to_c(&self) -> libc::epoll_event {
... | Rust | 0 |
.is_empty() {
buf.push_string(&req.order.hedge_param);
}
buf.push_bool(req.order.opt_out_smart_routing);
buf.push_string(&req.order.clearing_account);
buf.push_string(&req.order.clearing_intent);
buf.push_bool(req.order.not_held);
if let Some(ref uc) = req.contract.delta_neutral_contra... | Rust | 0 |
_b, label_f, label_b = reconstruct_pattern_with_label(ISP, latent_code, uv_vertices, uv_faces, edges, resolution=x_res)
mesh_atlas_sewing, labels = sewing_front_back(garment, mesh_pattern_f, mesh_pattern_b, mesh_atlas_f, mesh_atlas_b, label_f, label_b, num_seams=num_seams)
mesh_pattern_f.export(os.pat... | Python | 1 |
String)>,
data: web::Data<ThingyState>,
) -> Result<HttpResponse, ApiMessage> {
let path = path.into_inner();
let job_id = path.0;
let branch = path.1;
if let GetJobActorResponse(Some(addr)) = data.root.send(GetJobActorMsg(job_id)).await?? {
if let Some(addr) = addr.send(GetBranchActorMsg(b... | Rust | 0 |
oughput"
command_metrics = 'nvprof --metrics \"' + query_list + '\" --log-file ' + metrics_path + ' python ' + rerun_path + ' --config1 ' + json_path + ' > /dev/null'
print(command_metrics)
os.system(command_metrics)
copyfile(metrics_path, os.path.join(ncu_dir, op + '_' + str(index) + '_metrics'))
... | Python | 1 |
Kind::X255), &key_id)?
.material.as_slice()
.try_into()
.map_err(|_| Error::InternalError)?;
let public_key = agreement::PublicKey::try_from(public_bytes).map_err(|_| Error::InternalError)?;
Ok(public_key)
}
fn load_secret_key(keystore: &mut impl Keystore, key_id: &KeyId)
-> Resul... | Rust | 0 |
elf.display();
self.board.push(recipe);
if self.board.len() < score_sequence.len() {
continue;
}
let left_recipe_count = self.board.len() - score_sequence.len();
let mut discrepancy_flag = false;
for j in... | Rust | 0 |
Parameters
----------
param: str
Parameter of interest.
channels: array_likes
Number of channels of interest. Must be in {1, 2} for channel specific parameters or None for channel independant (global) parameters.
Returns
-------
... | Python | 1 |
take_agg_func().into_vec();
visitor.batch_visit(&aggs)?;
let group_len = group_bys.len();
let mut ctx = EvalContext::new(eval_config);
let exprs = AggFuncExpr::batch_build(&mut ctx, aggs)?;
// Get aggregation functions.
let mut funcs = Vec::with_capacity(exprs.len());
... | Rust | 0 |
x = squeeze_2x2(x, reverse=False, alt_order=True)
x, x_split = x.chunk(2, dim=1)
x, sldj = self.next_block(x, sldj, reverse)
x = torch.cat((x, x_split), dim=1)
x = squeeze_2x2(x, reverse=True, alt_order=True)
# Squeeze -> 3x coupling... | Python | 1 |
,
};
use std::f32::consts::FRAC_PI_3;
pub fn create_circle(x: f32, y: f32, radius: f32, color: Color, ctx: &mut Context) -> Mesh {
MeshBuilder::new()
.circle(DrawMode::fill(), Point2::new(x, y), radius, 0.01, color)
.build(ctx)
.unwrap()
}
pub fn create_rect(
x: f32,
y: f32,
width: f32,
height:... | Rust | 0 |
en loaded from
the server (see :meth:`reload`).
"""
value = self.get("retainUntilTime")
if value is not None:
return _rfc3339_nanos_to_datetime(value)
@retain_until_time.setter
def retain_until_time(self, value):
"""Set the retain_until_time for the... | Python | 1 |
' Second Axis - k vec
| iPlaneDef(6) = 0.0 ' Origin - X
| iPlaneDef(7) = 0.0 ' Origin - Y
| iPlaneDef(8) = 0.0 ' Origin - Z
|
| ' Specify the number of coplanar p... | Python | 1 |
print(f"processed {len(json_dict[data_type_list[0]])} samples")
else:
pass
if world_size > 1:
dist.barrier()
def contains_punctuation(s):
pattern = r'[!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~]'
return re.search(pattern, s) is not None
def parse_context_length(data_list: list, data_typ... | Python | 1 |
#!/usr/bin/env pythonw
# Generates an HTML file listing all tracks in the current iTunes playlist.
#
# Requires HTMLTemplate <http://pypi.python.org/pypi/HTMLTemplate>
from HTMLTemplate import Template
from appscript import *
from osax import *
#######
# HTML template
html = """<!DOCTYPE html PUBLIC "-//W3C//DTD X... | Python | 1 |
# Generated by Django 5.2.1 on 2025-05-09 04:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Examen', '0003_remove_examen_link_examen_archivo_examen_urlacceso'),
('Solicitud', '0001_initial'),
]
opera... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.