text string | label_name string | labels int64 |
|---|---|---|
st.raises(TypeError, match="fill_value in the string is not"):
SparseDtype.construct_from_string(string)
@pytest.mark.parametrize(
"original, dtype, expected",
[
(SparseDtype(int, 0), float, SparseDtype(float, 0.0)),
(SparseDtype(int, 1), float, SparseDtype(float, 1.0)),
(Spars... | Python | 1 |
.send()
.await?;
let re = self.resp2string(resp).await?;
Ok(re)
} else {
Err(format_err!("{}", "KEYS not config"))
}
}
pub async fn get_sign(&self, url: String) -> anyhow::Result<String> {
if let Some((ref ak, _)) = self.key... | Rust | 0 |
kind = Kind::Single(pk);
chain_addr::Address(discrimination, kind)
}
pub fn address_account(&self, discrimination: Discrimination) -> chain_addr::Address {
let pk = self.pk();
let kind = Kind::Account(pk);
chain_addr::Address(discrimination, kind)
}
pub fn address_gr... | Rust | 0 |
self.presentation_timestamp.as_timestamp()
}
fn lock<'a>(&'a self) -> Box<videodecoder::DecodedVideoFrameLockGuard + 'a> {
let guard = self.buffer.lock_base_address(kCVPixelBufferLock_ReadOnly).unwrap();
Box::new(DecodedVideoFrameLockGuardImpl {
guard: guard,
}) as Bo... | Rust | 0 |
ce directory.")
parser.add_argument("--destination_dir", type=str, help="Path to the destination directory.")
parser.add_argument("--restart", action="store_true", help="Reprocess existing outputs.")
parser.add_argument("--parts", type=int, help="Option to divide inference in multiple processes.", default=1... | Python | 1 |
Total Trades: {len(trades)}")
print(f" Total Return: {df_trades['return_pct'].sum():.2f}%")
print(f" Average Return per Trade: {df_trades['return_pct'].mean():.2f}%")
print(f" Win Rate: {(df_trades['return_pct'] > 0).mean() * 100:.1f}%")
print(f" Ave... | Python | 1 |
mask()` which operates on 8-byte blocks.
#[inline]
#[allow(clippy::cast_lossless)]
pub(crate) fn apply_mask(buf: &mut [u8], mask_u32: u32) {
// Extend the mask to 64 bits
let mut mask_u64 = ((mask_u32 as u64) << 32) | (mask_u32 as u64);
// Split the buffer into three segments
let (head, mid, tail) = ali... | Rust | 0 |
:
ilu = spilu(A.tocsc())
M = LinearOperator(A.shape, ilu.solve)
# 使用预处理器的共轭梯度求解器
Xp, info = cg(A, B, tol=MaxG, maxiter=MaxI, M=M)
if info != 0:
print(f"Conjugate gradient did not converge: info = {info}")
raise RuntimeError("C... | Python | 1 |
]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::core::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::core::fmt::Debug for __Incomplet... | Rust | 0 |
financial_data.setdefault(year, {})[mapped_key] = value
except:
continue # 일부 카드에 차트가 없을 수도 있음
return financial_data
def get_financial_info(driver) -> dict:
"""
재무 정보 수집 함수
- 전체보기 버튼 존재 여부에 따라 두 방식 중 하나 선택
"""
try:
# "재무현황 전체보기" 버튼 존재 여부 확인
popup_bu... | Python | 1 |
_conf(
setting_type: SettingType,
settings: &[IrSetting],
) -> Result<NoiseModuleConf, String> {
Ok(match setting_type {
SettingType::MultiFractal => NoiseModuleConf::MultiFractal {
frequency: convert_setting("frequency", settings)?,
octaves: convert_setting("octaves", settin... | Rust | 0 |
# Copyright (C) 2023-2025 Credit Mutuel Arkea
#
# 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 ... | Python | 1 |
ices_AllJoyn\"`*"]
pub const ER_SOCK_CLOSING: QStatus = 37083i32;
#[doc = "*Required features: `\"Win32_Devices_AllJoyn\"`*"]
pub const ER_NO_SUCH_DEVICE: QStatus = 37084i32;
#[doc = "*Required features: `\"Win32_Devices_AllJoyn\"`*"]
pub const ER_P2P: QStatus = 37085i32;
#[doc = "*Required features: `\"Win32_Devices_A... | Rust | 0 |
ec![(3,1)],
vec![(1,1), (3, -1)]
);
}
#[test]
fn distinct_anti_simple_retraction2() {
test_anti_distinct(
vec![(1,1), (2,1)],
vec![(3,1), (4,-1)],
vec![(1,1), (3, -1), (4,1)]
);
}
#[test]
fn distinct_anti_simple_retraction3() {
test_anti_distinct(
vec![(... | Rust | 0 |
on);
}
pub struct AudioFile<H: Handler> {
handler: H,
file_id: FileId,
offset: usize,
}
impl <H: Handler> AudioFile<H> {
pub fn new(file_id: FileId, offset: usize, handler: H, session: &Session) {
let handler = AudioFile {
handler: handler,
file_id: file_id,
... | Rust | 0 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
def _get_conv_output_shape(inp_shape, conv):
"""compute output shape of one convolutional layer
... | Python | 1 |
: bool, kbytes_sec: &mut [f64]) {
let block_byte_sizes = vec![16, 64, 256, 1024, 8192, 16384];
let mut counts = vec![0, 0, 0, 0, 0, 0];
// Run tests with output
for i in 0..block_byte_sizes.len() {
let block_usize: usize = block_byte_sizes[i];
if !machine_output {
print!("... | Rust | 0 |
#!/usr/bin/env python3
import subprocess
import os
import pty
import socket
import select
import argparse
import subprocess
import time
class LaserScanRos2():
def __init__(self) -> None:
self.laser_pro = None
class SocketServer():
def __init__(self,lport=8889,uart_name="/tmp/bot_laser") -> None... | Python | 1 |
pos
}
pub fn radius(&self) -> f32 {
self.radius
}
pub fn color(&self) -> Vector4<f32> {
self.color
}
pub fn update(&self, others: &[Body]) -> Body {
let dt = PHYSICS_DELTA_TIME.as_secs_f32();
let mut accel = Vector3::zero();
for body in others {
... | Rust | 0 |
as isize + y1;
if x2 >= 0 && y2 >= 0 {
let next = (x2 as usize, y2 as usize);
to_search.push_back(next);
}
}
grid.set(coord, u32::MAX);
}
sizes.push(size);
}
let part2 = sizes.iter().sorted().rev().... | Rust | 0 |
/ let res = Rc::from(res);
let mut poll = Poll::new().expect("Failed to create Poll");
println!("thread {} accepting connections", i);
// Create our Server object and start polling for events. I am hiding away
// the details of how registering works inside of the `Serve... | Rust | 0 |
ुशियाई', 'hi-Latn': 'Prussian', 'hr': 'pruski', 'hsb': 'prušćina', 'hu': 'porosz', 'hy': 'պրուսերեն', 'ia': 'prussiano', 'id': 'Prusia', 'ig': 'Prụssịan', 'is': 'prússneska', 'it': 'prussiano', 'ja': 'プロシア語', 'jv': 'Prusia', 'ka': 'პრუსიული', 'kea': 'prusianu', 'kgp': 'prusijỹnũ', 'kk': 'пруссия тілі', 'km': 'ព្រូស៊ាន'... | Python | 1 |
pt_path}')
self.assertTrue(stat == 0, 'export model failed')
if stat != 0:
print(output)
fe = TorchFeatureExtractor(ckpt_path)
img = cv2.imread(os.path.join(TEST_IMAGES_DIR, 'indoor.jpg'))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
feature = fe.predict([img]... | Python | 1 |
member,
})) => {
assert_eq!(*object, Expression::Variable(Variable {
name: Span { file: 0, start: 0, end: 1 }
}));
assert_eq!(dot_span, Span { file: 0, start: 1, end: 2 });
assert_eq!(member, Span { file: 0, start: 2, end: 3 });
}... | Rust | 0 |
_key(&11));
//
// // Reduce free_balance of controller to 0
// let _ = Ring::slash(&10, u64::max_value() as u128);
// // Check total balance of account 10
// assert_eq!(Ring::total_balance(&10), 0);
//
// // Check the balance of the stash account has not been touched
// assert_eq!(Ring::free_balance(&11), 2... | Rust | 0 |
DefaultDecl::Class(get_view_for_class_expr(value, bump)),
swc_ast::DefaultDecl::Fn(value) => DefaultDecl::Fn(get_view_for_fn_expr(value, bump)),
swc_ast::DefaultDecl::TsInterfaceDecl(value) => DefaultDecl::TsInterfaceDecl(get_view_for_ts_interface_decl(value, bump)),
}
}
fn set_parent_for_default_decl<'a>(n... | Rust | 0 |
Item2TableData(
__index = 0x0000026F,
name = '回避3',
desc = ' AGL+3',
),
Item2TableData(
__index = 0x00000270,
name = '移动1',
desc = ' MOV+1',
),
Item2TableData(
__index = 0x00000271,
name = '移动2',
desc = ' MOV+2',... | Python | 1 |
from muller import Interpretation, parse, uniform, nesy, Prob
prob_framework = nesy(Prob, bool)
interpretation = Interpretation(
universe=list(range(7)),
functions={str(i): lambda i=i: i for i in range(1, 7)},
mfunctions={"die": lambda: uniform(list(range(1, 7)))},
preds={"equals": lambda x, y: x == y... | Python | 1 |
"""Update folder table and change DateTime to BigInteger for timestamp fields
Revision ID: 4ace53fd72c8
Revises: af906e964978
Create Date: 2024-10-23 03:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = "4ace53fd72c8"
down_revision = "af906e964978"
branch_labels = None
depends_on = None
d... | Python | 1 |
you get the right answer. If you make a mistake or encounter "
"an error in your thinking, say so out loud and attempt to correct it. If you don't know or "
"aren't sure about something, say so clearly. You will act as a professional logician, mathematician, "
"and physicist. You will also act ... | Python | 1 |
ruption = true;
}
&Timeout::None => unreachable!("Not an option given to choose()"),
}
Ok(timeout)
}
/// Compiles the `wasm` within the `engine` provided.
///
/// This notably will use `Module::{serialize,deserialize_file}` to
/// round-trip if configured in ... | Rust | 0 |
fn new(connection: ConnectionRef<'a>, stream: RowStream) -> RowIter<'a> {
RowIter {
connection,
it: Box::pin(stream),
}
}
}
impl FallibleIterator for RowIter<'_> {
type Item = Row;
type Error = Error;
fn next(&mut self) -> Result<Option<Row>, Error> {
le... | Rust | 0 |
import os
from torch.utils.data.dataset import Dataset
from torchvision import transforms
from PIL import Image
class PairedDataset(Dataset):
def __init__(self, low_light_root, normal_light_root, image_size=[200, 200]):
super().__init__()
self.low_light_dataset = [os.path.join(
low_l... | Python | 1 |
let t21 = &t20 * &t3;
t21
}
fn pow_p58(&self) -> FieldElement {
let (t19, _) = self.pow22501();
let t20 = t19.pow2k(2);
let t21 = self * &t20;
t21
}
pub fn sqrt_ratio_i(u: &FieldElement, v: &FieldElement) -> (Choice, FieldElement) {
let v3 = &v.s... | Rust | 0 |
sg_out, U8);
}
#[test]
fn tg_gimli_aead_39_207() {
let key = Key::from_public_slice(&[
0x99, 0xfc, 0x34, 0x26, 0xfb, 0xf3, 0xa8, 0xa9, 0xb, 0x3, 0xcc, 0x79, 0xcb, 0x61, 0xb,
0x4a, 0x7d, 0x52, 0x19, 0xee, 0x40, 0xba, 0xd8, 0xab, 0xc, 0xb5, 0x17, 0xa0, 0xd4, 0xaa,
0xb3, 0x29,
]);
let ... | Rust | 0 |
ause::read());
println!("sepc={:#x} stval={:#x}", sepc::read(), stval::read());
p.abondon(-1);
}
}
user_trap_ret();
}
/// Return to user space
pub unsafe fn user_trap_ret() -> ! {
// disable interrupts and prepare sret to user mode
sstatus::intr_off();
sstatus::user... | Rust | 0 |
erialize_manual_with_endianness::< byteorder::BigEndian >( b );
}
#[cfg(target_endian = "big")]
#[bench]
fn deserialize_manual_foreign_endianness( b: &mut Bencher ) {
bench_dedeserialize_manual_with_endianness::< byteorder::LittleEndian >( b );
}
#[bench]
fn serialize_serde_rmp( b: &mut Bencher ) {
use rmp_se... | Rust | 0 |
6,
}
);
s.unread();
assert_eq!(
s.scan_with_regex(),
Token {
tok: TOK_ILLEGAL,
lit: String::from("@"),
pos: 6,
}
);
assert_eq!(
s.scan_with_regex(),
Token {
tok: TOK_IDENT,
lit: String::from(... | Rust | 0 |
systemctl", "systemctl");
cmd.arg("--user");
cmd.arg("stop");
cmd.arg(&svc_name);
match cmd.run_or_stderr()? {
Ok(()) => found = true,
Err((_, e)) if systemd_is_not_found_error(&e) => {
not_found_error = Some(e);
}
Err((s, e)) => {
log::warn!(
... | Rust | 0 |
lindkvist): This should do a proper check for the capability in the namespace.
// TODO(lindkvist): `capability` should be a type, just like we do for signals.
pub fn has_capability(&self, _capability: u32) -> bool {
// TODO(qsr): For now, implements root has all capability.
self.is_superuser()
... | Rust | 0 |
from flask import Flask, request, jsonify
import requests
# Flask 애플리케이션 생성
app = Flask(__name__)
# Analyzer IP & SDVUser IP 설정
#Analyzer_IP = '10.152.183.194'
SDVUSER_IP = '10.152.183.240'
SDVUSER_PORT = 5000
# 메시지 파일 저장 경로
MESSAGE_FILE = '/app/SDV_UE_messages.txt'
# 메시지 포워딩 함수
def forward_message(message):
tr... | Python | 1 |
r_into();
Rect { x, y }
}
#[inline(always)]
pub fn inner_try_into<A>(self) -> Result<Rect<A>, S::Error>
where
S: TryInto<A>,
{
let x = self.x.inner_try_into();
let y = self.y.inner_try_into();
match (x, y) {
(Ok(x), Ok(y)) => Ok(Rect { x, y }),
... | Rust | 0 |
Python 3.12.5 (v3.12.5:ff3bc82f7c9, Aug 7 2024, 05:32:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
print("Hello World!")
Hello World!
print("Hello World!")
Hello World!
print("I just wrote my first Python Program")
I just wrote my first Pyth... | Python | 1 |
as_typed().as_int_expr()?.clone_int_expr();
Ok(UIntPickRangeExpression::new(groups, pick))
}
fn replace_with_bin_expr<E: Expression + 'static>(trees: &mut Vec<Tree>,
bin_expr: E,
op_pos: usize)
... | Rust | 0 |
nst MIN_DELTA_TIME: f64 = 25.0;
const MAXIMUM_SLIDER_RADIUS: f32 = NORMALIZED_RADIUS * 2.4;
const ASSUMED_SLIDER_RADIUS: f32 = NORMALIZED_RADIUS * 1.8;
pub(crate) struct DifficultyObject<'h> {
pub(crate) base: &'h OsuObject,
pub(crate) clock_rate: f64,
pub(crate) delta: f64,
pub(crate) strain_time: f6... | Rust | 0 |
import re
import unicodedata
__RE_HTML_STRIP = re.compile('<[^>]*>')
def normalize_string(
text: str,
keep_accents: bool = False,
) -> str:
"""
Normalize a string.
- Replacement of accented characters by their non-accented equivalent.
- Conversion of Unicode escaped characters.
Args:
... | Python | 1 |
"""
Human vs AI in pixel observation environment
Note that for multiagent mode, otherObs's image is horizontally flipped
Performance, 100,000 frames in 144.839 seconds, or 690 fps.
"""
import gym
import slimevolleygym
from time import sleep
from pyglet.window import key
from gym.envs.classic_control import renderin... | Python | 1 |
l => '\u{f2c8}',
Icon::Disc => '\u{f2cb}',
Icon::DiscFill => '\u{f2ca}',
Icon::Discord => '\u{f2cc}',
Icon::Display => '\u{f2ce}',
Icon::DisplayFill => '\u{f2cd}',
Icon::DistributeHorizontal => '\u{f2cf}',
Icon::DistributeVertical => '\u{f2d0}',
Icon::DoorClosed => '\u{f2d2}',
Icon::DoorClosedFill => ... | Rust | 0 |
fn test_get_file_path_from_file_meta_line() {
assert_eq!(
get_file_path_from_file_meta_line("--- src/delta.rs", false),
"src/delta.rs"
);
assert_eq!(
get_file_path_from_file_meta_line("+++ src/delta.rs", false),
"src/delta.rs"
);
}
... | Rust | 0 |
ermodynamic temperature
Z0, // amount of substance
Z0>; // luminous intensity
units {
@yottameter_second: prefix!(yotta); "Ym · s", "yottameter second",
"yottameter seconds";
@zettameter_second: prefix!(zetta); "Zm · s", "zettameter second",
"zettameter... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# This file is part of BES.NAURU.LIMS.
#
# BES.NAURU.LIMS is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2.
#
# This program is distributed in the hope that it will be us... | Python | 1 |
gamma,
total_pop,
}
}
}
impl Iterator for SirIterator {
type Item = SirStep;
fn next(&mut self) -> Option<SirStep> {
if self.current.day >= self.number_of_days {
return None;
}
let new = self.current.advance(self.beta, self.gamma, self.to... | Rust | 0 |
_seg_54()
+ _seg_55()
+ _seg_56()
+ _seg_57()
+ _seg_58()
+ _seg_59()
+ _seg_60()
+ _seg_61()
+ _seg_62()
+ _seg_63()
+ _seg_64()
+ _seg_65()
+ _seg_66()
+ _seg_67()
+ _seg_68()
+ _seg_69()
+ _seg_70()
+ _seg_71()
+ _seg_72()
+ _seg_73()
+ ... | Python | 1 |
Driver for DotsDisplay<'a,L> {
fn command(
&self,
command_num: usize,
r2: usize,
_r3: usize,
_process_id: ProcessId,
)
-> CommandReturn{
match command_num {
0 => CommandReturn::success(),
1 => match char::from_u32(r2 as u32){
Some(digit) => {
if digit >= '0' && digit <= '9'{
self.di... | Rust | 0 |
CU_MEMORYTYPE_UNIFIED = 4,
}
pub type CUmemorytype = CUmemorytype_enum;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum CUcomputemode_enum {
CU_COMPUTEMODE_DEFAULT = 0,
CU_COMPUTEMODE_PROHIBITED = 2,
CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3,
}
pub type CUcomputemode = CUcomputemode_enu... | Rust | 0 |
from typing import List
from scoring import Result, Checkpoint
import subprocess
import os
from common import grader
def check_workflow_files() -> bool:
"""Check if specific GitHub workflow files have been updated to use UV."""
try:
workflow_files = {
"mypy.yml": "uv run mypy --strict .",
... | Python | 1 |
the database."""
prediction.update_date = get_utc_now()
self.session.add(prediction)
# we need to flush so that added prediction are available for later queries, especially 24 hour precip
self.session.flush()
def mark_model_run_interpolated(self, model_run: PredictionModelRunTimest... | Python | 1 |
from datetime import datetime
from uuid import UUID, uuid4
from pydantic import BaseModel, computed_field
__all__ = [
'Comment',
'CommentInput',
]
class Comment(BaseModel):
id: UUID
content: str
created_at: datetime
class CommentInput(BaseModel):
content: str
@computed_field
@pro... | Python | 1 |
import numpy as np
import tqdm
import os
def p(x, sigma, N=10):
p_ = 0
for i in tqdm.trange(-N, N + 1):
p_ += np.exp(-(x + 2 * np.pi * i) ** 2 / 2 / sigma ** 2)
return p_
def grad(x, sigma, N=10):
p_ = 0
for i in tqdm.trange(-N, N + 1):
p_ += (x + 2 * np.pi * i) / sigma ** 2 * np... | Python | 1 |
iter {
($v:expr) => {
$v.into_par_iter()
};
}
#[cfg(not(feature = "parallel"))]
macro_rules! into_iter {
($v:expr) => {
$v.into_iter()
};
}
/// Nav mash identifier.
pub type NavMeshID = ID<NavMesh>;
/// Nav mesh triangle description - lists used vertices indices.
#[repr(C)]
#[derive(De... | Rust | 0 |
from .detection_wrapper import DetectionWrapper
from .classmap_wrapper import ClassMapWrapper
def wrap_detection_only_detr(detr, criterion):
# build window detr
kwargs = dict(
num_classes=detr.num_classes, num_queries=detr.num_queries,
num_feature_levels=detr.num_feature_levels,
aux_los... | Python | 1 |
rderClause()? _ l:LimitOffsetClauses()? _ v:ValuesClause() {
build_select(s, w, g, h, o, l, v, state)
}
//[9]
rule SelectClause() -> Selection = i("SELECT") _ Selection_init() o:SelectClause_option() _ v:SelectClause_variables() {
Selection {
option: o,
... | Rust | 0 |
.parse::<u16>()?;
Ok(cleaned)
}
fn convert_string(rawkeys: &HashMap<String, Vec<u8>>, label: &str) -> Result<String, VEError> {
let raw = &*rawkeys
.get(label)
.ok_or_else(|| VEError::MissingField(label.into()))?;
String::from_utf8(raw.clone())
.map_err(|e| VEError::Parse(f... | Rust | 0 |
new_ucmd!()
.args(&["-d", "[:upper:]"])
.pipe_in("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
.succeeds()
.stdout_is("");
}
#[test]
fn check_against_gnu_tr_tests_n() {
// ['n', qw(-d '[:lower:][:upper:]'), {IN=>'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'}, {OUT=>''}],
new_ucmd!... | Rust | 0 |
ure_jwt_io_example_using_p256() {
use ::p256::pkcs8::DecodePublicKey;
// See https://jwt.io
let jwt = EXPECTED_JWT_JWT_IO_256;
let public_key = include_bytes!("es256_jwt_io_public_key.p8.der");
let public_key = ::p256::PublicKey::from_public_key_der(public_key).unwrap();
let verifying_key = ::... | Rust | 0 |
import os
import pandas as pd
from PIL import Image
import torch
from torch.utils.data import (
DataLoader,
Dataset,
IterableDataset,
SubsetRandomSampler,
get_worker_info,
)
import clip.clip as clip
class CsvDataset(Dataset):
def __init__(self, input_filename, transforms, img_key, caption_key,... | Python | 1 |
yóu"),
('𦑹', "fú"),
('𦑺', "cī"),
('𦑻', "dá"),
('𦑼', "tǎ"),
('𦑾', "liú"),
('𦒁', "cī"),
('𦒃', "hōng"),
('𦒅', "hàn"),
('𦒆', "lā"),
('𦒈', "shī"),
('𦒍', "tóng"),
('𦒎', "huì"),
('𦒏', "hé"),
('𦒐', "piē"),
('𦒑', "yù"),
('𦒜', "xiān"),
('𦒝', "hǎ... | Rust | 0 |
pk.unwrap(),
};
// Decrypt the d_sk.
let d_sk_bytes = commands::decrypt(inner_decrypt_args);
let d_sk = SecretKey::from_bytes(d_sk_bytes).unwrap();
// FractureAAS generates the kfrags for the data using the secret key and nukes the key.
let grant_args = GrantArgs {
sender_sk: d_sk,
... | Rust | 0 |
# VariableLengthArgumentEx2.py
def disp(a,b,c,d,e): # Function def-1
print(a,b,c,d,e)
disp(10,20,30,40,50)
def disp(a,b,c,d): # Function def-2
print(a,b,c,d)
disp(10,20,30,40)
def disp(a,b,c): # Function def-3
print(a,b,c)
disp(10,20,30)
def disp(a,b): # Function def-4
print(a,b)
disp(10,20)
def dis... | Python | 1 |
os::raw::c_void)
}
else {
lookup = quote!( (* (self_ as *const T)) . );
quote!(*const std::os::raw::c_void)
};
FnArg::Captured(syn::ArgCaptured {
p... | Rust | 0 |
from pandas.io.sas.sasreader import read_sas
__all__ = ["read_sas"]
| Python | 1 |
/// The `⏭` key.
NextTrack,
/// The no convert key (Japanese).
NoConvert,
/// The OEM 102 key.
OEM102,
/// The `.` key.
Period,
/// The `⏯` key.
PlayPause,
/// The `+ key.
Plus,
/// The `⏻` key.
Power,
/// The `⏮` key.
PrevTrack,
/// The right `Alt` key.
... | Rust | 0 |
/// Pop an exact i8 value from the stack.
pub fn pop_costack_i8() -> Result<i8, RecoverableError> {
pop_costack_typed!(i8)
}
/// Pop an exact i16 value from the stack.
pub fn pop_costack_i16() -> Result<i16, RecoverableError> {
pop_costack_typed!(i16)
}
/// Pop an exact i32 value from the stack.
pub fn pop_co... | Rust | 0 |
_6();
fn EIC_INTREQ_7();
fn IISC_INTREQ();
fn SPI_INTREQ();
fn TC0_INTREQ_0();
fn TC0_INTREQ_1();
fn TC0_INTREQ_2();
fn TC1_INTREQ_0();
fn TC1_INTREQ_1();
fn TC1_INTREQ_2();
fn TWIM0_INTREQ();
fn TWIS0_INTREQ();
fn TWIM1_INTREQ();
fn TWIS1_INTREQ();
fn USART0_INTR... | Rust | 0 |
# max_score_label_repeated = np.array([[max_score_label]] * frame_length)
max_score_label_repeated = max_score_label
return max_score_label_repeated
@torch.no_grad()
def get_max_score_index(self, wav_file, start_frame, end_frame, model=emo_model, fps=30, target_sr=16000):
"... | Python | 1 |
limited_fourier_transform = np.abs(fourier_transform[valid_indices]) # Get the magnitudes
# Plot the Fourier analysis in the specified frequency range
plt.plot(limited_frequencies, limited_fourier_transform, label=f'{label} {wavelength} Fourier', color=color_offset)
plt.title('Fourier Analysis of ... | Python | 1 |
from weixinlib.weixin_urls import WEIXIN_URLS
from weixinlib.base_support import get_access_token
from weixinlib import http_get, http_post
from weixinlib.settings import WEIXIN_BOOK_HEADER, get_custom_menu_with_book_acts
from urlhandler.models import Activity
import json
import datetime
def get_custom_menu():
ac... | Python | 1 |
import hypothesis.strategies as st
from .base import (
BaseTest,
commands,
values,
keys,
common_commands,
counts,
ints,
)
class TestList(BaseTest):
# TODO: blocking commands
list_commands = (
commands(st.just("lindex"), keys, counts)
| commands(
st.just... | Python | 1 |
)
elif self.obj == "akl":
loss = self.cal_akl(stu_logits, tea_logits)
return loss
all_kl_curve = []
all_stu_kl_curve = []
for i in trange(simulation_times):
model = Net(data_num, cls_num, device, obj)
optim = SGD(model.parameters(), lr=lr, weight_decay=0.0)
iter... | Python | 1 |
LnnmHcaNWT4qN8KFrKP2wAYfv8CB",
sol: 5_000_000.0,
},
StakerInfo {
name: "alike cheese",
staker: "72BGEwYee5txFonmpEarTEKCZVN2UxcSUgdphdhcx3V",
sol: 3_880_295.0,
},
StakerInfo {
name: "noisy honey",
staker: "DRp1Scyn4yJZQfMAdQew2x8RtvRmsNELN37JTK5Xvzgn",
... | Rust | 0 |
{level}",
violation_message="{role} needs level {level}",
level_thresholds={
Roles.spotter: dict(label="Spotter", min_players=0, min_level=10)
},
)
)
player = mock_get_detailed_player(
name="A_NAME",
player_id="A_STEAM_ID",
le... | Python | 1 |
import logging
import os
import re
from pkg_resources import resource_filename
from typing import Dict, List
from zemberek.core.turkish import TurkishSyllableExtractor, TurkishAlphabet
from zemberek.morphology.analysis.tr.turkish_numbers import TurkishNumbers
logger = logging.getLogger(__name__)
def load_map(resou... | Python | 1 |
# -*- coding: utf-8 -*-
import setuptools
import turbo_tunnel
with open('README.md', 'rb') as fp:
README = fp.read().decode()
with open('requirements.txt') as fp:
text = fp.read()
REQUIREMENTS = text.split('\n')
with open('extra_requirements.txt') as fp:
EXTRA_REQUIREMENTS = {}
for line in fp... | Python | 1 |
import os
from dotenv import load_dotenv, dotenv_values
from langchain_community.tools.google_finance import GoogleFinanceQueryRun
from .wrapper.GoogleFinanceAPIWrapperPrice import GoogleFinanceAPIWrapperPrice
from .wrapper.GoogleFinanceAPIWrapperNews import GoogleFinanceAPIWrapperNews
config = dotenv_values(".env")
o... | Python | 1 |
import pandas as pd
import numpy as np
#endereco
endereco = r'C:\uc3_bigdata\dados'
#obter os dados
dados = pd.read_csv(endereco + r'\dados_producao_parafusos.csv')
#variável dependente
y_custo = dados['Custo de Produção (R$)'].values
#variável independente
x_qtde = dados['Quantidade Produzida (unidades)'].values
... | Python | 1 |
# Add it to corridor_msg
corridor_msg.poses.append(pose_cov)
# Put the odometry into the corridor_msg
corridor_msg.odometry = odom
# Publish corridor message
self.corridor_data_pub.publish(corridor_msg)
self.get_logger().info(f"Published CorridorData, s... | Python | 1 |
mmand::with_name("preview")
.about("Preview a given theme")
.arg(Arg::with_name("theme").help("Name of the color theme")),
)
.subcommand(SubCommand::with_name("themes").about("Prints list of available themes"));
let matches = app.get_matches();
let color_mode = m... | Rust | 0 |
: Gain factor = 6"]
VALUE3,
#[doc = "3: Gain factor = 12"]
VALUE4,
}
impl From<GAIN4_A> for u8 {
#[inline(always)]
fn from(variant: GAIN4_A) -> Self {
match variant {
GAIN4_A::VALUE1 => 0,
GAIN4_A::VALUE2 => 1,
GAIN4_A::VALUE3 => 2,
GAIN4_A::VA... | Rust | 0 |
if b >= 0.0 {
let mul = -b - sq;
result.push(mul / (2.0 * a));
result.push(2.0 * c / mul);
} else {
let mul = -b + sq;
result.push(2.0 * c / mul);
result.push(mul / (2.0 * a));
}
}
result
}
/// Solve cubic equation ... | Rust | 0 |
atus == TaskStatus::TaskBlocked {
debug!("wakeup task {}", task.borrow().id);
task.borrow_mut().status = TaskStatus::TaskReady;
self.ready_queue.lock().push(task.clone());
}
}
pub fn get_current_taskid(&self) -> TaskId {
self.current_task.borrow().id
}
/// Determines the start address of the stack
... | Rust | 0 |
f, Token::LParen) {
let call = self.parse_func_call(ident)?;
Ok(Expr::Call(call))
} else {
Ok(Expr::Ident(ident))
}
} else if is_next!(self, Token::UIntLiteral(_)|Token::CharLiteral(_)) {
let (num, span) = self.lexer.next().unwr... | Rust | 0 |
pass
class InvalidIpForNetworkClient(BadRequest):
pass
class InvalidIpForSubnetClient(BadRequest):
pass
class OverQuotaClient(Conflict):
pass
class IpAddressGenerationFailureClient(Conflict):
pass
class MacAddressInUseClient(Conflict):
pass
class HostNotCompatibleWithFixedIpsClient(Co... | Python | 1 |
i32>>(t: T, f: fn(i32) -> i32) -> u32 {
let mut v: Vec<i32> = t.cloned().collect();
let mut i: i32 = 0;
let mut cnt: u32 = 0;
while i >= 0 && i < v.len() as i32 {
let x = v[i as usize];
v[i as usize] = f(x);
i += x;
cnt += 1;
}
cnt
}
fn main() {
let stdin... | Rust | 0 |
(found_url) # Use the renamed function
if scraped_data:
print("Scraping successful:")
print(f" ID: {scraped_data.get('id')}")
print(f" Source: {scraped_data.get('source')}") # Should be r18devja
print(f" Title (JA): {scraped_data.get('title'... | Python | 1 |
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
on: {data_case["instruction"]}\n### Input: {data_case["input"]}'
if verify_str is not None:
gpt_str = f'{verify_str} {gpt_str}'
conversation = {
'id': f'conv_{data_idx}',
'conversations': [
{
'from': 'human',
'value': human_str,
... | Python | 1 |
sContext, tag.tagFormatConstructed, 6))),
namedtype.OptionalNamedType('issuerUID', UniqueIdentifier().subtype(
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 7))),
namedtype.OptionalNamedType('subjectUID', UniqueIdentifier().subtype(
implicitTag=tag.Tag(tag.tagClas... | Python | 1 |
txs4}][/green]")
bot.send_message(message.chat.id, f"⛏️ DEC Entered >> ⛏️{n}{dec} bits {length}{n}{n}🔨 HEX Returned >> 🔨{n}{HEX}{n}{n}🗝️ WIF Compressed >> 🗝️{n}{wifc}{n}{n}🔑 WIF Uncompressed >> 🔑{n}{wifu}{n}{n}")
for balance in balances:
addr_... | Python | 1 |
er_mapping.items()},
'primary_centers': sorted(center_mapping.keys())
}
def analyze_spatial_distribution(df: pd.DataFrame) -> dict:
"""Analyze spatial distribution of stations"""
# Calculate geographic bounds
lat_range = (float(df['lat_deg'].min()), float(df['lat_deg'].max()))
lon_range = ... | Python | 1 |
def seek_peaks(topographic_map, current_point):
peaks = set()
rating = 0
current_height = topographic_map[current_point[1]][current_point[0]]
if current_height == 9:
peaks.add(current_point)
rating = 1
return (rating, peaks)
if current_point[0] > 0 and topographic_map[curren... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.