text string | label_name string | labels int64 |
|---|---|---|
'''
더하기가 있으면 다 더한 뒤 식 계산
'''
from collections import deque
ls = list(input())
# num 이라는 리스트에 숫자와 연산자 나눠서 넣기
num = deque()
char = ''
for i in ls:
if i.isdigit():
char += i
else:
if char:
num.append(int(char))
char = ''
num.append(i)
if char:
num.append(int(... | Python | 1 |
pos += mov.unit;
position_part2.depth += position_part2.aim * mov.unit;
}
MoveKind::Down => position_part2.aim += mov.unit,
MoveKind::Up => position_part2.aim -= mov.unit,
}
}
println!(
"PART 2 - At the end : Horizontal position is [{}], Depth... | Rust | 0 |
izing_if = "is_default")]
pub headers_only: bool,
/// Enable flow control messages
#[serde(default, skip_serializing_if = "is_default")]
pub flow_control: bool,
/// Enable idle heartbeat messages
#[serde(default, with = "serde_nanos", skip_serializing_if = "is_default")]
pub idle_heartbeat: ... | Rust | 0 |
let req = req_builder
.body(req_body)
.map_err(create_port_mirroring::Error::BuildRequestError)?;
let rsp = http_client
.execute_request(req)
.await
.map_err(create_port_mirroring::Error::ExecuteRequestError)?;
match rsp.status() {
... | Rust | 0 |
a.data()))?) as ArrayRef)
}
And(ref left, ref right) | Or(ref left, ref right) => {
let l = arrow::compute::cast(&left.eval_to_array(batch)?, &DataType::Float64)?;
let r = arrow::compute::cast(&right.eval_to_array(batch)?, &DataType::Float64)?;
let... | Rust | 0 |
en": {
"label": "GaLore scale",
"info": "GaLore scaling coefficient.",
},
"ru": {
"label": "LoRA Alpha",
"info": "Коэффициент масштабирования GaLore.",
},
"zh": {
"label": "GaLore 缩放系数",
"info": "GaLore 缩放系数大小。",
... | Python | 1 |
sector.ceiling_height) - size[1],
pos[1],
),
Pnt3f::new(pos[0], from_wad_height(sector.ceiling_height), pos[1]),
)
} else {
(
self.floor_id(sector),
Pnt3f::new(pos[0], from_wad_height(sector.floor_height)... | Rust | 0 |
fe { *addrlen_out = addrlen_in };
let ret = unsafe { libc::accept4(sockfd, addr, addrlen_out, flags) };
if ret < 0 {
errno = Error::last_os_error().raw_os_error().unwrap_or(0);
}
if !error.is_null() {
unsafe {
*error = errno;
}
}
ret
}
#[no_mangle]
pub extern... | Rust | 0 |
-5d50aa60ff49").unwrap();
let test_uuid3 = uuid::Uuid::parse_str("451f82e5-c17a-4843-a9c7-5ff3f7ae20fd").unwrap();
let mut data = Vec::new();
{
let mut bld = FrameBuilder::new(&mut data);
bld.add_uuid(1, &test_uuid1);
bld.add_uuid(2, &test_uuid2); // will be ... | Rust | 0 |
import torch
import torch.nn as nn
from torch.autograd import Variable
class ContrastiveLoss(nn.Module):
"""
Compute contrastive loss (max-margin based)
"""
def __init__(self, opt, margin=0, max_violation=False):
super(ContrastiveLoss, self).__init__()
self.opt = opt
self.marg... | Python | 1 |
: io::Write>(
results: QueryResultWriter<W>,
rows: postgres::Result<postgres::rows::Rows>,
) -> Result<(), postgres::Error> {
match rows {
Ok(rows) => {
let cols: Vec<_> = rows
.columns()
.into_iter()
.map(|c| {
let t = ... | Rust | 0 |
pub total: Thread,
pub threads: Vec<Thread>,
pub time: Time,
pub cache: Cache,
pub modules: Modules,
pub cache_count: CacheCounter,
pub http: Http,
pub flags: Flags,
pub query_opcodes: HashMap<Opcode, u64>,
pub query_types: HashMap<Rtype, u64>,
// All other `Rtype` entries high... | Rust | 0 |
type_check::{TypeVariablePrinter, VisibleNames},
type_resolve::TypeVariableId,
};
use super::{
constraints::{Constraint, ConstraintEqualityReason, Constraints},
substitute,
};
/// Deduces the type of an expression.
/// Any error messages are added to the diagnostic result.
///
/// This mostly implemen... | Rust | 0 |
# Copyright 2023 The Magenta 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 1 |
)).poll_next(cx) }
}
}
use super::*;
use crate::rsz_struct;
use serde::*;
rsz_struct! {
#[rsz("snow.enemy.EnemyBossInitSetData.LotInfo")]
#[derive(Debug, Serialize)]
pub struct LotInfo {
pub lot: i32,
pub block: i32,
pub id: i32,
}
}
rsz_struct! {
#[rsz("snow.enemy.Enem... | Rust | 0 |
rted_images = sorted(filter_images,key=lambda x: int(x.split(".")[1]))
# concat_images(sorted_images, 6, f"data/analyse_fig/{input_name}/{quant_name}_cat/{ss}")
metric_logger = utils.MetricLogger(delimiter=" ")
header = 'Test:'
for images, target in metric_logger.log_every(data_loader_val, 10,... | Python | 1 |
m(_mm_shuffle_ps(self.0, self.0, 0b00_00_01_10))) }
}
#[inline]
fn zz(self) -> Vec2 {
unsafe { Vec2(XY::from(_mm_shuffle_ps(self.0, self.0, 0b00_00_10_10))) }
}
}
<gh_stars>1-10
pub fn usize_validator(input: &str) -> Result<(), String> {
let res = input.parse::<usize>().map_err(|err| err.to_... | Rust | 0 |
let ack = Packet::MAX_ACKS + 1;
let mut packet = Packet::new(3.into(), ack.into(), 40);
let original = packet.clone();
packet.ack(0.into());
assert_eq!(original, packet);
}
}
describe!(ackd_packets => {
#[test]
fn ack_id_returns(){
... | Rust | 0 |
{
Leaf { _type: PhantomData }
}
}
};
}
keyable_leaf!(bool);
keyable_leaf!(char);
keyable_leaf!(u8);
keyable_leaf!(u16);
keyable_leaf!(u32);
keyable_leaf!(u64);
keyable_leaf!(u128);
keyable_leaf!(usize);
keyable_leaf!(i8);
keyable_leaf!(i16);
keyable_leaf!(i32);
keyable_leaf!(... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
import os
import sys
import datetime
# Add the project root to the path so sphinx can find the modules
sys.path.insert(0, os.path.abspath('..'))
# Project information
project = 'Email Deliverability Library'
copyright = f'{datetime.datetime.now().year}, Inner... | Python | 1 |
# N =int(input())
# n_lst = [[] for _ in range(8)]
# n_lst_for_sort = []
# result = 0
# alpha_dict = {}
# num = 9
# # n_lst에 자리에 맞는 알파벳 넣어놓고 숫자 배정
# # 숫자는 딕셔너리에. 없으면 알파벳:숫자 저장. 숫자는 어차피 순서대로라 key로 안해도 될듯.
# # 딕셔너리에 호출,저장하면서 result에 저장
# # 같은 자리에서도 뒤에 어디서 나오냐에 따라 우선순위 필요
# for _ in range(N):
# tem = input()
# #... | Python | 1 |
multiaddr::Error::InvalidMultiaddr => Self {
code: 802,
message: format!("{:?}", err),
},
multiaddr::Error::DataLessThanLen => Self {
code: 803,
message: format!("{:?}", err),
},
multiaddr::Error::In... | Rust | 0 |
)
pos += tupleSize
dataPos += dataSize
return result
def decompileTupleVariation_(
pointCount, sharedTuples, sharedPoints, tableTag, axisTags, data, tupleData
):
assert tableTag in ("cvar", "gvar"), tableTag
flags = struct.unpack(">H", data[2:4])[0]
pos = 4
if (flags & EMBE... | Python | 1 |
"""The status of a big plan."""
from functools import total_ordering
from jupiter.core.framework.value import EnumValue, enum_value
@enum_value
@total_ordering
class BigPlanStatus(EnumValue):
"""The status of a big plan."""
# Not Started
NOT_STARTED = "not-started"
# Working
IN_PROGRESS = "in-p... | Python | 1 |
.bytes
}
}
impl FragmentSequenceTrait for DisassociateFrame<'_> {}
impl ManagementFrameTrait for DisassociateFrame<'_> {}
impl DisassociateFixedParametersTrait for DisassociateFrame<'_> {}
<gh_stars>0
$NetBSD: patch-mozilla-release_third__party_rust_authenticator_src_netbsd_mod.rs,v 1.1 2020/07/24 07:29:32 fox Exp ... | Rust | 0 |
, S, quad_inout, get_step_quad_inout, QuadInOut, |x: T| {
if x < T::from(0.5).unwrap() {
T::from(2.).unwrap() * x.powi(2)
} else {
(T::from(-2.).unwrap() * x.powi(2)) + x.mul_add(T::from(4.).unwrap(), -T::one())
}
});
easer!(T, S, cubic_in, get_step_cubic_in, CubicIn, |x: T| {
x.powi(3)
... | Rust | 0 |
# encoding:utf-8
# Python2 兼容
from __future__ import print_function, division
from scipy.io import loadmat as load
import matplotlib.pyplot as plt
import numpy as np
def reformat(samples, labels):
# 改变原始数据的形状
# 0 1 2 3 3 0 1 2
# (图片高,图片宽,通道数,图片数) -> (图片数,图片高,图片宽,通道数)
new... | Python | 1 |
, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Bytecode {
/// Debugging information at function level
#[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")]
pub function_debug_data: BTreeMap<String, FunctionDebugData>,
/// The bytecode ... | Rust | 0 |
?;
let approved = web3
.check_erc20_approved(erc20, sender_address, peggy_contract)
.await?;
if !approved {
let txid = web3
.approve_erc20_transfers(erc20, sender_secret, peggy_contract, None, options.clone())
.await?;
info!(
"We are not approv... | Rust | 0 |
" in str(e_info)
assert "climate.my_thermostat" in str(e_info)
assert PRESET_ECO in str(e_info)
async def test_thermostat_available(
hass: HomeAssistant, setup_platform: PlatformSetup, create_device: CreateDevice
) -> None:
"""Test a thermostat that is available."""
create_device.create(
{... | Python | 1 |
s=meta_events,
)
return StreamingResponse(events, media_type="application/json")
except AgentNotFoundException as exc:
logger.error("Agent not found: %s", exc, exc_info=True)
return JSONResponse(content={"error": str(exc)}, status_code=404)
except AgentExecutionException as exc:
... | Python | 1 |
re for row in final_scores_result]
print(f" Total matches: {len(scores)}")
print(f" Score range: {min(scores)} to {max(scores)}")
print(f" Average final score: {sum(scores)/len(scores):.1f}")
print(f" Sample scores: {scores[:10]}")
# Check if there are any data quality i... | Python | 1 |
unt);
mint_coins(&mut pfn_0_client, 4, 100, XUS, true);
mint_coins(&mut pfn_0_client, 5, 50, XUS, true);
// bring down another V
// Transition to unfortunate case where 2(>f) validators are down
// and submit some transactions
env.validator_swarm.kill_node(1);
// submit some non-blocking tx... | Rust | 0 |
# Copyright 2020, Brigham Young University-Idaho. All rights reserved.
"""
Write a Python program named fuel_usage.py that asks the user
for three numbers:
1. A starting odometer value in miles
2. An ending odometer value in miles
3. A amount of fuel in gallons
Your program must calculate and print fuel efficiency in... | Python | 1 |
(&self) -> SYSCTL_RESC_WDT0R {
let bits = ((self.bits >> 3) & 1) != 0;
SYSCTL_RESC_WDT0R { bits }
}
#[doc = "Bit 4 - Software Reset"]
#[inline(always)]
pub fn sysctl_resc_sw(&self) -> SYSCTL_RESC_SWR {
let bits = ((self.bits >> 4) & 1) != 0;
SYSCTL_RESC_SWR { bits }
}... | Rust | 0 |
=> {
let tags = req.tags().to_owned();
Command::OutgoingRequest(tags)
}
PublishableMessage::Response(resp) => {
let tags = resp.tags().to_owned();
Command::OutgoingResponse(tags)
}
};
self.send_command(c... | Rust | 0 |
# SPDX-License-Identifier: MIT
from dataclasses import dataclass
from xml.etree import ElementTree
from .compumethods.limit import Limit
from .description import Description
from .exceptions import odxraise, odxrequire
from .odxdoccontext import OdxDocContext
from .odxtypes import DataType
from .validtype import Valid... | Python | 1 |
ub(crate) val_codec: String,
pub(crate) ts_codec: String,
pub(crate) diff_codec: String,
pub(crate) writers: HashMap<WriterId, Vec<[u8; 8]>>,
pub(crate) since: Vec<[u8; 8]>,
pub(crate) readers: HashMap<ReaderId, Vec<[u8; 8]>>,
pub(crate) upper: Vec<[u8; 8]>,
pub(crate) contents: Vec<(Vec<u... | Rust | 0 |
a
`Lf8 @ s d dl Z d dlZd dlZd dlmZ d dlZd dlZd dlmZmZ d dl m
Z
ejedddddej
d dd
ddd
d Zedkre dS ) N)datetime)directories filenames)dlTt )Zallow_extra_argsZignore_unknown_optionsZmax_content_width)Zcontext_settingsz--d... | Python | 1 |
,
pub ext_settings: MergedSettings,
pub workdir: PathBuf,
pub config_dir: PathBuf,
pub build_mode: BuildMode,
pub prerequisites: bool,
pub isolate_network: bool,
pub containers_only: bool,
}
fn check_export(cmd: &String) -> Option<String> {
if cmd == "/proc/self/exe" || cmd == "vagga" {... | Rust | 0 |
G_XMM30 = 216,
XED_REG_XMM31 = 217,
XED_REG_YMM0 = 218,
XED_REG_YMM1 = 219,
XED_REG_YMM2 = 220,
XED_REG_YMM3 = 221,
XED_REG_YMM4 = 222,
XED_REG_YMM5 = 223,
XED_REG_YMM6 = 224,
XED_REG_YMM7 = 225,
XED_REG_YMM8 = 226,
XED_REG_YMM9 = 227,
XED_REG_YMM10 = 228,
XED_REG_YMM... | Rust | 0 |
SULT: &str = "Result";
/// The return type information of a function.
pub struct PinBoxFutRet {
is_pin_box_fut: bool,
is_fut_ret_result: bool,
ret_ty: TokenStream,
}
impl Default for PinBoxFutRet {
fn default() -> Self {
PinBoxFutRet {
is_pin_box_fut: false,
is_fut_ret_... | Rust | 0 |
s]
ys_in.append(torch.cat(y_in))
ys_in_lens.append(y_in_len)
ys_out.append(torch.cat(y_out))
ys_in_pad = pad_list(ys_in, self.eos)
ys_in_lens = torch.tensor(ys_in_lens).to(ys_pad_lens)
ys_out_pad = pad_list(ys_out, self.ignore_id)
# 1. Forward decod... | Python | 1 |
D_POD_NAMESPACE",
namespace.clone(),
);
}
if let Some(namespace) = &args.agent_namespace {
std::env::set_var("MIRRORD_AGENT_NAMESPACE", namespace.clone());
}
if let Some(log_level) = &args.agent_log_level {
std::env::set_var("MIRRORD_AGENT_RUST_LOG", log_level.clone()... | Rust | 0 |
u64 }
pub type RpcAdversarialSwitchToHeightResponse = ();
pub type RpcAdversarialSwitchToHeightError = ();
}
impl RpcMethod for RpcAdversarialSwitchToHeightRequest {
type Result = RpcAdversarialSwitchToHeightResponse;
type Error = RpcAdversarialSwitchTo... | Rust | 0 |
[to-1] as char;
let first_correct = first_char.to_string() == rule;
let second_correct = second_char.to_string() == rule;
if first_correct != second_correct {
result += 1;
}
}
println!("Part2: {}", result);
}
fn main() -> std::io::Result<()> {
let mu... | Rust | 0 |
# CENG 487 Assignment4 by
# Bugrahan Imal
# StudentId: 280201012
# May 2025
from scene import Scene
class BaseMode:
scene:Scene
orbit_sensitivity:float
pan_sensitivity:float
dolly_sensitivity:float
object_sensitivity:float
mouse_state:dict[str, bool]
last_mouse_position:dict[str, int]
... | Python | 1 |
self.layer4 = self._make_layer(block, 512, layers[3], stride=2)
self.init_weights(pretrain=pretrain)
def _make_layer(self, block, planes, blocks, stride=1):
downsample = None
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
... | Python | 1 |
elif (int(_mem.rx_freq) == int(_mem.tx_freq)):
mem.duplex = ''
else:
mem.duplex = 'split'
mem.offset = int(_mem.tx_freq)
# We'll consider any blank (i.e. 0 MHz frequency) to be empty
if (mem.freq < 1000000) or (mem.freq > 29999999):
mem.e... | Python | 1 |
let expected = hex::decode(line.next().unwrap()).unwrap();
let mut encryption = HeaderCrypto {
session_key: *session_key.as_le(),
encrypt_index: 0,
encrypt_previous_value: 0,
decrypt_index: 0,
decrypt_previous_valu... | Rust | 0 |
"""
Author: Daniela Zamorano-Martinez
Date: 11/25/24
Assignment: Module 05 Programming Assignment
Descrip: Create a sales tax report: county, state, and total based on the users total sale.
"""
def calculatesales_tax():
try:
#Ask the user to enter the total sales
total_sales = float(input("Enter the total... | Python | 1 |
# Copyright 2023-present Daniel Han-Chen & the Unsloth team. 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... | Python | 1 |
*mut libc::c_void);
}
free(fnt_name as *mut libc::c_void);
free(sfd_name as *mut libc::c_void);
}
let mut mrec =
ht_lookup_table(fontmap, kp as *const libc::c_void, strlen(kp) as i32) as *mut fontmap_rec;
if mrec.is_null() {
mrec = new((1_u64).wrapping_mul(::std::mem... | Rust | 0 |
#!/usr/bin/python3
from asterisk.agi import *
import os
from websocket import create_connection
import json
import traceback
AUDIO_FD = 3
CONTENT_TYPE = 'audio/l16; rate=8000; channels=1'
ACCEPT = 'audio/pcm'
def process_chunk(agi, ws, buf):
agi.verbose("Processing chunk")
ws.send_binary(buf)
res = json.... | Python | 1 |
"""
Part of dotnetfile
Original author: Bob Jung - Palo Alto Networks (2016)
Modified/Expanded by: Yaron Samuel - Palo Alto Networks (2021-2022),
Dominik Reichel - Palo Alto Networks (2021-2025)
"""
from __future__ import annotations
import binascii
import struct
from typing import ... | Python | 1 |
ry is 3
let mut jdb = new_db();
let h = jdb.insert(EMPTY_PREFIX, b"foo");
commit_batch(&mut jdb, 0, &keccak(b"0"), None).unwrap();
assert!(jdb.can_reconstruct_refs());
assert!(jdb.contains(&h, EMPTY_PREFIX));
jdb.remove(&h, EMPTY_PREFIX);
commit_batch(&mut jdb, 1, &keccak(b"1"), None).unwrap();
assert!(... | Rust | 0 |
3.75_f32, 50.25_f32,
];
let b_array = [
-1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
-1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
];
let a1: __m512 = transmute(a_array);
let b1: __m512 ... | Rust | 0 |
_agent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::user-agent\0".as_ptr() as *const _,
Some(transmute(notify_user_agent_trampoline::<Self, F> as usize)), Box_::into... | Rust | 0 |
import sys
sys.path.append("/home/chuqiao/Code/Poject_2023/new_mdm/motion-diffusion-model/")
print (sys.path)
import argparse
import os
from visualize import vis_utils
import shutil
from tqdm import tqdm
from visualize.convert import process_labels
if __name__ == '__main__':
parser = argparse.ArgumentParser()
... | Python | 1 |
import pytest
import torch
from colossalai.device.device_mesh import DeviceMesh
from colossalai.initialize import launch
from colossalai.logging import disable_existing_loggers
from colossalai.tensor.shape_consistency import ShapeConsistencyManager
from colossalai.tensor.sharding_spec import ShardingSpec
from colossal... | Python | 1 |
# -*- coding: utf-8 -*-
# @Time : 2024/11/9 2:04
# @Author : GZA
# @File : routes.py
from pathlib import Path
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
from server_app.services import GameResourceGetter, ItemSetManager, UserConfig,... | Python | 1 |
return ss_train_x, train_y.values, ss_test_x, genename, celltypes, samplename
elif scaler == 'mms':
print("Using minmax scaler...")
mms = MinMaxScaler()
mms_train_x = mms.fit_transform(train_x.T).T
mms_test_x = mms.fit_transform(test_x.T).T
fig = plt.figure()
sns.... | Python | 1 |
a[s.LOWER_BOUNDS]
blower = np.array(
np.concatenate((
var_lower_bounds,
data[s.B],
-np.inf*np.ones(data[s.G].shape))),
dtype=c_double)
sense = np.array(
np.concatenate((
# variable bounds, maybe unused... | Python | 1 |
from ...smp import *
from .multiple_choice import extract_answer_from_item
import numpy as np
import re
FAIL_MSG = 'Failed to obtain answer via API.'
TASK_CATEGORIES = [
'SR','IMC','TCI','TA','MHR','PAR','CTI',
]
def get_dimension_rating(data_path, score_col='score', type_col='question_type'):
data = load(d... | Python | 1 |
chord_press_half_release() {
const CHORDS: [ChordDef; 1] = [((0, 2), &[(0, 0), (0, 1)])];
let mut chording = Chording::new(&CHORDS);
// Verify a chord is converted to the correct key
let mut double_press = Vec::<Event, 8>::new();
double_press.push(Press(0, 0)).ok();
dou... | Rust | 0 |
op(
Box::new(Ident::local("a").into()),
Binop::Ne,
Box::new(Ident::local("a").into()),
)),
Statement::Assign(Ident::global("x"), AssignOp::Add.into(),
Expr::Number(1.into()) + 2.into()
),
Statement::Assign(Id... | Rust | 0 |
import pygame
pygame.init()
#화면크기 설정
screen_width = 480
screen_height = 640
screen = pygame.display.set_mode((screen_width, screen_height))
# 화면 타이틀 설정
pygame.display.set_caption("First Game")
# 배경 이미지 불러오기
background = pygame.image.load("C:\\Users\\jiyou\\OneDrive\\Desktop\\MyCoding\\AHFAH\\파이썬 게임\\pygame_basic\\b... | Python | 1 |
, Ix>
where
Ty: EdgeType,
Ix: IndexType {
let sccs = kosaraju_scc(&g);
let mut condensed = Graph::with_capacity(sccs.len(), g.edge_count());
let mut node_map = vec![NodeIndex::end(); g.node_count()];
for comp in sccs {
let new_nix = condensed.add_node(Vec::new());
for nix in com... | Rust | 0 |
.to_str() {
Some(a)=>a.into(),
_=>Value::NULL
}
},
_=>Value::NULL
}
}
}
#[inline]
fn inspect_fields(_:Executor,args:Vec<Value>)->Result<Value> {
Ok(match args.len() {
... | Rust | 0 |
env::args()
.nth(1)
.expect("please specify container name as command line parameter");
let mut core = Core::new()?;
let client = Client::new(&account, &master_key)?;
let future = client
.list_blobs()
.with_container_name(&container_name)
.with_include_copy()
... | Rust | 0 |
"""
Copyright (c) 2024 Dolby Laboratories
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
2. R... | Python | 1 |
keys.push(key.clone());
*value = *value * *value;
}
let expected_map = MyStruct::default()
.with("abc", 123 * 123)
.with("def", 456 * 456)
.with("ghi", 789 * 789);
let expected_keys = vec!["abc".to_owned(), "def".to_owned(), "ghi".to_owned()];
assert_eq!(actual_map, exp... | Rust | 0 |
println!("Result:{:?}",result);
}<gh_stars>0
import syntax::ast::*;
import syntax::visit;
import driver::session::session;
type ctx = {in_loop: bool, can_ret: bool};
fn check_crate(tcx: ty::ctxt, crate: @crate) {
visit::visit_crate(*crate, {in_loop: false,can_ret: true}, visit::mk_vt(@{
visit_item: |... | Rust | 0 |
# coding=utf-8
# Copyright 2018 The TF-Agents 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 1 |
///
/// ```
/// use bevy_ecs::prelude::*;
///
/// struct Component1;
/// struct Component2;
///
/// fn example_system(mut commands: Commands) {
/// // Create a new entity with a `Component1` and `Component2`.
/// commands.spawn((Component1,)).with(Component2);
///
///... | Rust | 0 |
Moc<u64, u64> {
coverage_left.difference(coverage_right)
}
pub fn to_ascii_str(depth_max_t: u8, depth_max_s: u8, coverage: &TimeSpaceMoc<u64, u64>) -> String {
let mut ascii = Vec::new();
coverage.time_space_iter(depth_max_t, depth_max_s)
.into_cellcellrange_moc2_iter()
.to_ascii_ivoa(Some(80)... | Rust | 0 |
_eq!(" error: simple_wrap\n cause: oh no!", format!("{:#}", wrap_simple().unwrap_err()));
assert_eq!("foo: simple_wrap", wrap_formatted().unwrap_err().to_string());
assert_eq!(" error: foo: simple_wrap\n cause: oh no!", format!("{:#}", wrap_formatted().unwrap_err()));
}
#[test]
fn test_sing... | Rust | 0 |
Format: FFT
"""
n = len(t[0]) * fft_ratio
z = [0, 0]
if (n > 1):
l10, T0, T1 = T
z[1] = merge_fft(ffnp_fft(split_fft(t[1]), T1))
t0b = add_fft(t[0], mul_fft(sub_fft(t[1], z[1]), l10))
z[0] = merge_fft(ffnp_fft(split_fft(t0b), T0))
return z
elif (n == 1):
... | Python | 1 |
first empty cell'} | {'type': 'bottom left corner value', 'value': Any},
'column_end_condition': {'type': 'first empty cell'} | {'type': 'num columns', 'value': int}
}[]
}
}
NEW:
{
"step_version": 6,
"step_type": "excel_range_import",
"params": ... | Python | 1 |
ngCS};
use crate::core::VirtualMachine;
pub use crate::errors::{MalformedBytecode, Result, RuntimeError, TypeSizeError};
use crate::gadgets::utils::bigint_to_fr;
use algebra::{prelude::PairingEngine, Field};
use failure::Fail;
use groth16::{Parameters, Proof, VerifyingKey};
// use bellman::pairing::bn256::Bn256;
use nu... | Rust | 0 |
>();
// let min_number = blocks.keys().next().map(|n| **n).unwrap_or(0);
// let max_number = blocks.keys().rev().next().map(|n| **n).unwrap_or(0);
// let mid_number = (min_number + max_number) / 2;
// let heights = blocks
// .iter()
// .filter(|(_, block)| {
// block.header.t... | Rust | 0 |
)
}
}
impl core::ops::Deref for HOST_SLC0_EXT_BIT0_INT_ST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `HOST_SLC0_EXT_BIT1_INT_ST` reader - "]
pub struct HOST_SLC0_EXT_BIT1_INT_ST_R(crate::FieldReader<bool, ... | Rust | 0 |
"""
Run setup for training iteration.
"""
# 3rd party
import yaml
from pathlib import Path
import argparse
# import numpy as np
# 3rd party
# from src_hpo.utils_hpo import load_hpo_config
def run_setup_for_train_iter(run_dir, config):
""" Setup configuration parameters for training model.
:param run_dir: s... | Python | 1 |
name.
unsafe fn symbolic_normalize_arch(arch: *const SymbolicStr) -> Result<SymbolicStr> {
let arch = (*arch).as_str().parse::<Arch>()?;
Ok(arch.to_string().into())
}
}
ffi_fn! {
/// Returns the name of the instruction pointer if known.
unsafe fn symbolic_arch_ip_reg_name(arch: *const ... | Rust | 0 |
#
# This file is part of libdebug Python library (https://github.com/libdebug/libdebug).
# Copyright (c) 2023-2024 Roberto Alessandro Bertolini, Gabriele Digregorio. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
from __future__ import annotations
from datac... | Python | 1 |
&self, locals: &mut Vec<Local>) {
match self {
Operand::Place(plc) => plc.push_used_locals(locals),
Operand::Constant(_) => (),
}
}
}
impl Display for Operand {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Operand::Place(p) ... | Rust | 0 |
gs::FRONT,
_ => {
return Err(A::Error::custom(format!("invalid face '{}'", face_str)));
}
}
}
Ok(Faces { flags })
}
}
impl<'de> Deserialize<'de> for Faces {
fn deserialize<D: Deserializer<'d... | Rust | 0 |
AG_directed_edges = {(0, 3), (1, 3), (2, 3), (2, 4), (3, 4)}
truth_CPDAG_undirected_edges = {(0, 1), (1, 2), (2, 1), (1, 0)}
truth_CPDAG = np.loadtxt("tests/TestData/test_ges_simulated_linear_gaussian_CPDAG.txt")
###### Simulation configuration: code to generate "tests/TestData/test_ges_simulat... | Python | 1 |
dows on
display ambientocclusion on
# color Display Background white
axes location Off
mol new step1_input.pdb
mol modstyle 0 0 NewCartoon 0.300000 30.000000 4.100000 0
mol modcolor 0 0 ColorID 1 # Red
mol modmaterial 0 0 AOShiny
mol new step9_final.pdb
mol modstyle 0 1 NewCartoon 0.300000 30.000000 4.100000 0
mol mo... | Python | 1 |
import cv2
from tkinter import messagebox
from .utils import calculate_distance, save_results_to_csv
def detect_from_file(model, video_path, threshold=50):
"""
Perform object detection on a video file using a trained YOLO model.
"""
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
... | Python | 1 |
ne(always)]
pub fn released(self) -> &'a mut W {
self.variant(USB0_HOSTM_RST_A::RELEASED)
}
#[doc = "Bloc is reset."]
#[inline(always)]
pub fn asserted(self) -> &'a mut W {
self.variant(USB0_HOSTM_RST_A::ASSERTED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub... | Rust | 0 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2021-2025 Tencent
#
# This source code file is made available under MIT License
# See LICENSE for details
# ==============================================================================
"""
flow: A STATIC TYPE CHECKER FOR JAVASCRIPT.
"""
import json
imp... | Python | 1 |
ount == 1
def test_execute_proposal(dao_contract):
# Arrange
admin = dao_contract.functions.admin().call()
proposal_description = "Proposal 3"
dao_contract.functions.createProposal(proposal_description).transact({'from': admin})
dao_contract.functions.vote(0).transact({'from': web3.eth.accounts[1]}... | Python | 1 |
.
pub fn initialize(options: ServiceOptions) -> io::Result<()> {
let output = match &options.output {
FileOptions::File(path) => File::create(path)?,
};
let sw = ServiceWorker {
output,
input: io::stdin(),
options,
};
SERVICE.wi... | Rust | 0 |
"""Sellar discipline 2"""
# This file is part of FAST-OAD : A framework for rapid Overall Aircraft Design
# Copyright (C) 2024 ONERA & ISAE-SUPAERO
# FAST 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, e... | Python | 1 |
fn get_attachments(&self) -> Vec<&Attachment> { Vec::new() }
fn get_nb_attachments(&self) -> usize { 0 }
}
/// TODO when use case finalize : consider replacing dhtin with kvstore spawsend + handle
pub struct AnoService<MC : MyDHTTunnelConf, SI : MyDHTConf>(<MC as MyDHTTunnelConf>::PeerRef, DHTIn<SI>);
#[derive(Cl... | Rust | 0 |
(api.ic0_call_perform());
// Render normal test function
pub fn render_test_func<I, B>(imports: I, func_body: B) -> String
where
I: core::fmt::Display,
B: core::fmt::Display,
{
format!(
r#"
(module
{IMPORTS}
(memory $mem 1)
(func $test (export "canister_u... | Rust | 0 |
, 0, 0, 0, Er|Ga, Er|Ga|W, # F?: LOCK REP HLT CMC GRP3
0, 0, 0, 0, 0, 0, Er, Er|Gsp|W ] # STI CLI
# 0f prefixed instructions: no regctrl for now
... | Python | 1 |
"""
FileAttributesETL Lambda Pydantic Models or Dataclasses
"""
from pydantic import BaseModel, ConfigDict, Field
class FileAttributesInputData(BaseModel):
"""
Input data for the ETL Function
"""
model_config = ConfigDict(populate_by_name=True)
revision_id: int = Field(alias="DatasetRevisionId"... | Python | 1 |
6, utils.GREEN, 2)
utils.colorBackgroundText(frame, f'Total Blinks: {TOTAL_BLINKS}', FONTS, 0.7, (30, 150), 2)
cv.polylines(frame, [np.array([mesh_coords[p] for p in LEFT_EYE], dtype=np.int32)], True, utils.GREEN, 1,
cv.LINE_AA)
cv.polylines(... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.