text string | label_name string | labels int64 |
|---|---|---|
obot_kwargs=dict(
init_qpos=R1LITE_INIT_QPOS
),
headless=False
),
max_episode_steps=300,
)
gym.register(
id='R1ToolAdjust-v0',
entry_point='galaxea_sim.envs.robotwin.tool_adjust:ToolAdjustEnv',
disable_env_checker=True,
order_enforce=False,
kwargs=dict(
... | Python | 1 |
ol.get()?;
let rows = &conn.query("SELECT * FROM get_job_v1($1)", &[&(id as i64)])
.map_err(Error::JobGet)?;
for row in rows {
let job = self.row_to_job(&row)?;
return Ok(Some(job));
}
Ok(None)
}
/// Get a list of pending jobs, up to a maximum... | Rust | 0 |
from dataclasses import dataclass
@dataclass
class train_config:
project_name: str=None
model_name: str="meta-llama/Llama-2-7b-chat-hf"
enable_fsdp: bool=False
low_cpu_fsdp: bool=False
run_validation: bool=True
batch_size_training: int=8
batching_strategy: str="padding"
context_length: ... | Python | 1 |
# https://github.com/Woolverine94/biniou
# Musicgen.py
import os
import gradio as gr
import torch
import torchaudio
from audiocraft.models import MusicGen
from audiocraft.data.audio import audio_write
import random
from ressources.common import *
device_label_musicgen, model_arch = detect_device()
device_musicgen = to... | Python | 1 |
pub fn compress(slice: &[u8], w: &mut Vec<u8>) -> io::Result<()> {
let mut encoder = ZlibEncoder::new(w, Compression::default());
encoder.write_all(slice)?;
encoder.finish().map(|_| ())
}
pub fn decompress(slice: &[u8], w: &mut Vec<u8>) -> io::Result<()> {
let mut decoder = ZlibDecoder::new(w);
dec... | Rust | 0 |
else '错误'} (4维float64[w,x,y,z])")
print(f" ✅ 数据连续性: 良好 ({len(obs_data_samples)} 个样本)")
print(f" ✅ 更新频率: ~{len(obs_data_samples) / 10:.1f} Hz")
# 检查IMU统计
stats = imu.get_statistics()
print(f" ✅ 数据质量: 解析成功率 {stats['packets_parsed']/max(1,stats['packets_received'])*100:... | Python | 1 |
#!/usr/bin/python
# Copyright 2015 Huawei Devices USA Inc. 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 r... | Python | 1 |
ysics2d::world::{DefaultGeometricalWorld, DefaultMechanicalWorld};
use nphysics_testbed2d::Testbed;
/*
* NOTE: The `r` macro is only here to convert from f64 to the `N` scalar type.
* This simplifies experimentation with various scalar types (f32, fixed-point numbers, etc.)
*/
pub fn init_world<N: RealField>(testbe... | Rust | 0 |
xtract(member, dest)
def brain_has_been_reviewed(brainpath, backup_brainpath):
if not os.path.exists(backup_brainpath):
return False
brain_hash = get_hash(brainpath)
backup_hash = get_hash(backup_brainpath)
return brain_hash != backup_hash
def tumor_has_been_finalized(finalized_tumor_path):... | Python | 1 |
Logo::Url(url) => LogoInfo::Url(url),
Logo::Embedded(_) => LogoInfo::Embedded,
};
marketing_info.logo = Some(logo_info);
MARKETING_INFO.save(deps.storage, &marketing_info)?;
let res = Response::new().add_attribute("action", "upload_logo");
Ok(res)
}
#[cfg_attr(not(feature = "library... | Rust | 0 |
y_won'] == 1).mean() * 100:.1f}% win rate")
print(f"DOWN Markets ({len(inc_down)} cases): {(inc_down['party_won'] == 0).mean() * 100:.1f}% loss rate")
print("\nNew Candidate Analysis:")
non_inc_up = non_inc_df[non_inc_df['market_direction_3m'] == 'UP']
non_inc_down = non_inc_df[non_inc_df['market_direc... | Python | 1 |
8]) -> Vec<u8> {
let mut output = Vec::with_capacity(bytes.len() * 8);
for byte in bytes {
output.extend_from_slice(format!("{:08b}", byte).as_bytes());
}
output
}
#[cfg(test)]
mod test {
use super::*;
const QUINE: &'static [u8; 66] =
b"000101100100011010000000000001011011110... | Rust | 0 |
import unittest
import numpy as np
from two_stage_model.dynamic_analysis import heatmap_eval
class TestHeatmapEval(unittest.TestCase):
def test_heatmap_eval_above_threshold(self):
heatmap = np.array([
[10, 20, 30, 40],
[50, 60, 70, 80],
[90, 100, 110, 120],
[... | Python | 1 |
import json
import uuid
from django.db import models
from bugsink.transaction import immediate_atomic
from bugsink.app_settings import get_settings
class Installation(models.Model):
# "Installation" would probably be better at home in some different app, especially now that we're adding more and
# more stuf... | Python | 1 |
Self {
ICACHE_AUTOLOAD_RQST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ICACHE_AUTOLOAD_RQST_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ICACHE_AUTOLOAD_RQST` writer - The bits are ... | Rust | 0 |
from collections import deque
def bfs(initial_board, target_words):
queue = deque([(initial_board, [])])
target_words = set(target_words)
smallest_swap_sequence = None
while queue:
board, swaps = queue.popleft()
if board[2][0] in target_words:
if smallest_swap_sequence is ... | Python | 1 |
import os
import pandas as pd
from config.paths import paths
from analysis import betasort_analysis
from visualization import betasort_plots
# Main analysis
data_path = paths.preprocessed_data_model
save_path = paths.processed / "vte_analysis"
for rat in os.listdir(data_path):
if "TH405" not in rat: # Your exis... | Python | 1 |
import os
import cv2
import numpy as np
from pathlib import Path
from skimage import transform as trans
# ArcFace标准五点位置(对应112×112)
arcface_template = np.array([
[38.2946, 51.6963],
[73.5318, 51.5014],
[56.0252, 71.7366],
[41.5493, 92.3655],
[70.7299, 92.2041]
], dtype=np.float32)
def parse_line(l... | Python | 1 |
(de::Error::custom).map(Some),
Ok(_) => Err(de::Error::custom("Incorrect type")),
Err(_) => Ok(None),
}
}
pub fn from_str<'de, T, D>(deserializer: D) -> Result<T, D::Error>
where
T: FromStr,
T::Err: Display,
D: de::Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
... | Rust | 0 |
// Copyright 2020-2021, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: MIT OR Apache-2.0
#![allow(clippy::field_reassign_with_default)]
use paperclip::actix::Apiv2Schema;
use crate::models::Room;
#[derive(Validate, Debug, Serialize, Deserialize, Apiv2Schema, PartialEq)]
pub struct RoomD... | Rust | 0 |
( v0: Point,
v1: Point,
v2: Point,
nums_side_faces_btw_verts: (u8,u8,u8) )
-> ~[Vec]
{
let (sfs_v01, sfs_v12, sfs_v20) = nums_side_faces_btw_verts;
// inter-vertex vectors
let (v01, v12, v20) = (vdiff(v1,v0), vdiff(v2,v1), vdiff(v0,v2));
let ivvs = [(v01, sfs_v01),
... | Rust | 0 |
yteMeField, syn::Error> {
let data_type = path.segments.into_iter().next().unwrap().ident;
let size: usize = get_byte_size_from_integer_type(data_type.clone()).unwrap();
Ok(ByteMeField {
ident,
size,
data_type,
is_array: false,
attribute: None,
})
}
fn process_u8_array(
elem: Box<syn::Typ... | Rust | 0 |
im)
if if_affine:
shutil.copyfile(regMovTmp['fwdtransforms'][0], output_dir+folder_name+ "affine_fwdtransforms.mat")
if lbl_nib is not None:
save_nii(def_lbl_npy, output_dir+folder_name+'deformed_moving_label', tar_pixdim)
if if_resample_back:
save_nii... | Python | 1 |
hmic scaling similar to volume:
- $0: score = 0
- $5,000: score ≈ 20
- $50,000: score ≈ 40
- $500,000: score ≈ 60
- $5,000,000: score ≈ 80
- $50,000,000+: score ≈ 100
"""
if liquidity_usd <= 0:
return Decimal("0")
# Logarithmic... | Python | 1 |
Self {
Self::new()
}
}
impl Component for Player {
type Storage = DenseVecStorage<Self>;
}
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct PlayerActions {
pub walk_action: PlayerWalkAction,
pub look_action: PlayerLookAction,
pub cast_action: Option<PlayerCastAction>,
}
... | Rust | 0 |
self.opt.quiet && self.opt.inc_position.is_none() {
return Err(anyhow!(
"🛑 Needs to specify `inc_position` if you use `quiet` flag"
));
}
let mut new_tag = self.new_tag()?;
self.show_commit_info(&new_tag)?;
if !self.opt.quiet {
new_ta... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class SubmitApproveNotificationResponseBody(object):
_types = {
"has_access": bool,
}
def __init__(self, d=None):
self.has_access: Opti... | Python | 1 |
fn quantile_gk_new_from_bytes(bytes: *mut u8, len: usize) -> *mut Stream<f64> {
assert!(len > 0);
let bytes = unsafe { slice::from_raw_parts(bytes, len) };
let s = rmp_serde::from_slice(bytes).unwrap();
let s = Box::new(s);
Box::into_raw(s)
}
#[no_mangle]
pub extern "C" fn quantile_gk_merge(gk1: *... | Rust | 0 |
}
}
/** Arithmetic operators **/
impl Mul for &ExponentP256 {
type Output = ExponentP256;
fn mul(self, other: &ExponentP256) -> ExponentP256 {
ExponentP256 {
int: Int256::modmul(&self.int, &other.int, &Int256::N),
}
}
}
// A non-zero exponent on the elliptic curve.
#[derive(Cl... | Rust | 0 |
8_Uscaled = VK_FORMAT_R8_USCALED,
R8_Sscaled = VK_FORMAT_R8_SSCALED,
R8_Uint = VK_FORMAT_R8_UINT,
R8_Sint = VK_FORMAT_R8_SINT,
R8_sRGB = VK_FORMAT_R8_SRGB,
R8G8_Unorm = VK_FORMAT_R8G8_UNORM,
R8G8_Snorm = VK_FORMAT_R8G8_SNORM,
R8G8_Uscaled = VK_FORMAT_R8G8_USCALED,
R8G8_Sscaled = VK_FORM... | Rust | 0 |
6_9C00),
(r"icons\s\tx_s_slowfall.dds", 0x4143_476E, 0xECC3_85E9),
(r"icons\w\tx_spear_daedric.dds", 0x4147_221E, 0xA44E_9768),
(r"icons\w\tx_staff_daedric.dds", 0x4147_261A, 0xF48A_F768),
(r"icons\w\tx_shortbow_steel.dds", 0x4147_2806, 0x9F51_6F8E),
(r"icons\w\tx_silver_dagger.dds", 0x4147_2B0... | Rust | 0 |
bel = _('%(free_space)d MiB Free') % \
{'free_space': free_space / (1024 * 1024)}
class VolumePalette(Palette):
def __init__(self, mount):
Palette.__init__(self, label=mount.get_name())
self._mount = mount
self.props.secondary_text = mount.get_root().get_path()
self.... | Python | 1 |
,
/// Indicates that this is the only struct which contains the same pointer.
/// Rust functions which take ownership of an object provided via an argument require
/// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
impl Drop for AcceptChannel {
fn drop(&mut self) {
if self... | Rust | 0 |
psilon_insensitive': {
'l2': {True: 13}},
'squared_epsilon_insensitive': {
'l2': {False: 11, True: 12}},
'crammer_singer': 4
}
if multi_class == 'crammer_singer':
return _solver_type_dict[multi_class]
elif multi_class != 'ovr':
raise ValueError("`mult... | Python | 1 |
_storage,
(&coloring_storage).maybe(),
(&view_rect_storage).maybe(),
(&order_storage).maybe(),
(&morph_storage).maybe(),
)
.join()
.filter_map(
|(entity, display, transform, coloring, view_rect, order, morph)| {
... | Rust | 0 |
from quantdsl.semantics import Choice, Market, Wait, inline
def GasStorage(start, end, commodity_name, quantity, target, limit, step, slew):
if ((start < end) and (limit > 0)):
if quantity <= 0:
return Wait(start, Choice(
Continue(start, end, commodity_name, quantity, target, l... | Python | 1 |
Exception):
IsAttr[
IsEqual['Till the scent it gives'],
IsEqual[
'Makes faint with too much sweet those heavy-winged thieves:']]
# Assert that subscripting this factory with two arguments whose first
# argument is the empty string raises the expected exception.
... | Python | 1 |
in arg_names]
return module.__invoke(*arg_list)
# Cached suffix used by cython_inline above. None should get
# overridden with actual value upon the first cython_inline invocation
cython_inline.so_ext = None
_find_non_space = re.compile('[^ ]').search
def strip_common_indent(code):
min_indent = None
li... | Python | 1 |
"""The epsonworkforce component."""
| Python | 1 |
import numpy as np
from numpy import exp, sqrt, log, pi
def Integrate(f, x) :
dx = x[1:] - x[:-1]
integral = np.sum(f[:-1] * dx)
return integral
input_file = "analysed_spectra.csv"
y, f, d = np.loadtxt(input_file, delimiter=',', unpack=True)
# --------------------------------------
# Microdosimetric means... | Python | 1 |
_cards[1].set_value("birth", value)
@property
def death(self) -> typing.Optional[float]:
"""Get or set the Death time of this sensor.
""" # nopep8
return self._cards[1].get_value("death")
@death.setter
def death(self, value: float) -> None:
"""Set the death property."""... | Python | 1 |
list:
file = file.split()[0]
# Ignoring files with no help=h output
if help_exists(file):
files_read+=1
files_read_names.append(file)
# Check if the commands and the order they appear in match
# Using a try catch in case some files have no matchi... | Python | 1 |
from flask import Blueprint, request, jsonify
from db import get_connection
from werkzeug.security import generate_password_hash
from mysql.connector import Error
register_bp = Blueprint('register_bp', __name__)
@register_bp.route('/register', methods=['POST'])
def register_user():
data = request.get_json()
... | Python | 1 |
#!/usr/bin/env python
from vtkmodules.vtkCommonExecutionModel import vtkCompositeDataPipeline
from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter
from vtkmodules.vtkIOEnSight import vtkGenericEnSightReader
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkHierarchicalPolyDataMapper,
vtkRenderWi... | Python | 1 |
# Illustrates basic definition of a class in Python
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person('John', 36)
p2 = Person('Phoebe', 21)
print('id(p1):', id(p1))
print('id(p2):', id(p2))
print(p1)
print(p2)
| Python | 1 |
e of sequential address, it will be a lookup of the generated address against
/// every known address plus the look ahead threshold.
///
/// In the case of random address it will mainly be an attempt to decrypt the
/// given hdpayload and reconstructing the address with it.
///
fn lookup(
... | Rust | 0 |
///is rotated into the msb.
///The resulting value of the flags register is: Z 0 0 C
pub fn rr(register: u8, flags: &mut u8) -> u8 {
let lsb: u8 = register & 1;
let result: u8 = (register >> 1) | ((*flags & CARRY_FLAG_MASK) << 3);
*flags = 0;
*flags |= lsb << 4; //CY
*flags |= !(((result & 0x7F) + 0x7F) | result)... | Rust | 0 |
true;
}
fn r_mark_ndA(env: &mut SnowballEnv, context: &mut Context) -> bool {
// (, line 215
// call check_vowel_harmony, line 216
if !r_check_vowel_harmony(env, context) {
return false;
}
// among, line 217
if env.find_among_b(A_7, context) == 0 {
return false;
}
return... | Rust | 0 |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | Python | 1 |
?}", data_size, data);
Ok(CostedReturnType::new(0, NativeReturnType::ByteArray(ByteArray::new(data))))
}
//pub fn vm_db_next_i64(iterator: i32, primary: &mut u64) -> i32;
pub fn native_next_i64<T: StackAccessor>(mut accessor: T) -> Result<CostedReturnType> {
println!("+++++++++++native_next_i64");
let iter... | Rust | 0 |
ned()),
};
xfstate.add(&xvar);
assert_eq!(xfstate.has("number1"), true);
xfstate.remove("number1");
assert_eq!(xfstate.has("number1"), false);
assert_eq!(xfstate.is_empty(), true);
}
use super::simple_sync::{PeerSyncInfo, FUTURE_SLOT_TOLERANCE};
use beacon_chain::{BeaconChain, BeaconChainType... | Rust | 0 |
{
pub static ref HPUX_CP1148_11_11: Encoding = parse_ucm(&request_mapping_file("hpux-cp1148-11.11").unwrap()).unwrap();
}
lazy_static! {
pub static ref HPUX_CP1149_11_11: Encoding = parse_ucm(&request_mapping_file("hpux-cp1149-11.11").unwrap()).unwrap();
}
lazy_static! {
pub static ref HPUX_CP1250_11_11: E... | Rust | 0 |
from django.contrib.auth.models import AbstractUser
from django.db import models
from users.managers import CustomUserManager
class CustomUser(AbstractUser):
objects = CustomUserManager()
units = models.IntegerField(default = 1000, blank = True)
class Meta:
verbose_name_plural = 'user'
def... | Python | 1 |
init_poolmanager(self, *args, **kwargs):
if self.ssl_context:
kwargs['ssl_context'] = self.ssl_context
return super(X509Adapter, self).init_poolmanager(*args, **kwargs)
def proxy_manager_for(self, *args, **kwargs):
if self.ssl_context:
kwargs['ssl_context'] = self.s... | Python | 1 |
element_index, &mut self.quad_points, &mut self.quad_weights);
}
pub fn weights(&self) -> &[T] {
&self.quad_weights
}
pub fn points(&self) -> &[OPoint<T, GeometryDim>] {
&self.quad_points
}
pub fn data(&self) -> &[Data] {
&self.quad_data
}
pub fn weights_and_p... | Rust | 0 |
index::Index()
}
}
})
}
}
}
fn main() {
console_error_panic_hook::set_once();
console_log::init_with_level(log::Level::Debug).unwrap();
render(|| template! { App() });
}
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::map::M... | Rust | 0 |
rs, seconds = divmod(seconds, 3600)
minutes, seconds = divmod(seconds, 60)
if weeks:
parts.append(f"{weeks}w")
if days:
parts.append(f"{days}d")
if hours:
parts.append(f"{hours}h")
if minutes:
parts.append(f"{minutes}m")
if seconds or not parts:
parts.app... | Python | 1 |
{struct USE_INFO_4 {
ui4_ui3: USE_INFO_3,
ui4_auth_identity_length: DWORD,
ui4_auth_identity: PBYTE,
}}
pub type PUSE_INFO_4 = *mut USE_INFO_4;
pub type LPUSE_INFO_4 = *mut USE_INFO_4;
pub const USE_LOCAL_PARMNUM: DWORD = 1;
pub const USE_REMOTE_PARMNUM: DWORD = 2;
pub const USE_PASSWORD_PARMNUM: DWORD = 3;... | Rust | 0 |
.log_prob(action)).item()
action = T.squeeze(action).item()
value = T.squeeze(value).item()
return action, probs, value
def learn(self):
for _ in range(self.n_epochs):
state_arr, action_arr, old_prob_arr, vals_arr,\
reward_arr, dones_arr, batches = \
... | Python | 1 |
any(field.name == "input_dim" for field in fields(cls))
if need_input_dim:
self.decoder_color = cls(input_dim=input_dim, **args)
else:
self.decoder_color = cls(**args)
def _create_voxel_grid_scaffold(self) -> VoxelGridModule:
"""
Creates object to become sel... | Python | 1 |
Isometry3<f32>, mul, mul_assign);
test_op_vs_op_assign!(test_sim3_rot3_mul_assign, Similarity3<f32>, Rotation3<f32>, mul, mul_assign);
// Division.
test_op_vs_op_assign!(test_vec3_vec3_div_assign, Vector3<f32>, Vector3<f32>, div, div_assign);
test_op_vs_op_assign!(test_quaternion_quaternion_div_assign, Quaternion<f32>... | Rust | 0 |
delete it if it exists already
report = os.path.join(outDir, 'report.txt')
for name in computedResults:
basename = os.path.basename(name)
refDir = ''
if testName not in source_dir:
refDir = source_dir.replace('Tests', os.path.join('References', testName ))
else:
refDir = source_dir.re... | Python | 1 |
"""
Uses a trace function to switch greenlets at unexpected times.
In the trace function, we switch from the current greenlet to another
greenlet, which switches
"""
import greenlet
g1 = None
g2 = None
switch_to_g2 = False
def tracefunc(*args):
print('TRACE', *args)
global switch_to_g2
if switch_to_g2:
... | Python | 1 |
import datetime
import json
import logging
from typing import Any
from .errors import CartolaFCError, CartolaFCGameOverError, CartolaFCOverloadError
def json_default(value: Any) -> dict:
if isinstance(value, datetime.datetime):
return dict(
year=value.year,
month=value.month,
... | Python | 1 |
藏自治区山南地区");
map.insert("542221", "西藏自治区乃东县");
map.insert("542222", "西藏自治区扎囊县");
map.insert("542223", "西藏自治区贡嘎县");
map.insert("542224", "西藏自治区桑日县");
map.insert("542225", "西藏自治区琼结县");
map.insert("542226", "西藏自治区曲松县");
map.insert("542227", "西藏自治区措美县");
map.in... | Rust | 0 |
default clock source as input source or for PLL, turn it off.
match self.input_src {
InputSrc::Hsi => (),
InputSrc::Pll(pll_src) => match pll_src {
#[cfg(feature = "f3")]
PllSrc::HsiDiv2 => (),
#[cfg(feature = "f4")]
PllSrc... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2024 BIRU
#
# This file is part of Tenzu.
#
# Tenzu is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or (at your option) any later... | Python | 1 |
),
(Robot::Yellow, Position::from((3, 2))),
])
);
}
#[test]
fn a_command_is_invalid_if_the_robot_is_not_in_the_configuration() {
let configuration = Configuration::from(vec![(Robot::Yellow, Position::from((3, 2)))]);
let command = Command::from((Robot::Re... | Rust | 0 |
ce\\CMap',
'C:\\Program Files\\Adobe\\Acrobat 4.0\\Resource\\CMap',
'%(REPORTLAB_DIR)s/fonts/CMap', #special
'%(REPORTLAB_DIR)s/../fonts/CMap', #special
'%(REPORTLAB_DIR)s/../../fonts/CMap', #special
'%(CWD)s/fonts/CMap',... | Python | 1 |
oname>Eric-Arellano/rust
#![allow(dead_code)]
trait Get {
fn get(&self) -> Self;
}
fn get_min_from_max<'min, 'max, G>()
where 'max : 'min, &'max G : Get, G : 'max
{
impls_get::<&'min G>(); //~ ERROR mismatched types
}
fn get_max_from_min<'min, 'max, G>()
where 'max : 'min, &'min G : Get, G : 'min
{
... | Rust | 0 |
\xf59j\xf3\xce\xc9\
-O'\xd6u\xeb\xcf\x14_\xb3[\xee\xfd\xe3\x7f:\
\xf5\xaf\x82\xde\x08_\x0b\xe8\xdfl\x96\xdfu\xd4\xbf\xde\
\xf5\xe3'\x9a\x7f\x84\xbe\x1ai\xb6\x17qKy-\xbe\
\xd8\x97\x7f\x97\xb87\xe7\x8a\xf4\x18\xbcG\xa3ZK\xf6\
u\xba\xb5WU\x0b\xf7\x82\xed\xac\xa3\x87\xb7\xbdsz\
T\xb9!\xcbmJ\xf6\xb2\xacR\xfe\xf7\xef7\xddZ\
... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2015 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 |
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "marimo",
# ]
# ///
import marimo
__generated_with = "0.15.5"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
mo.md("# Task List").left()
return
@app.cell
def _(dataclass):
@dataclass
class Task:
name: str
d... | Python | 1 |
_some());
let gc_type = backend_ty.gc_type.as_ref().unwrap().as_short();
assert_eq!(gc_type.align(), MINIMAL_ALIGNMENT);
assert_eq!(gc_type.fix_len(), 1);
assert_eq!(gc_type.fix_ty(0), WordType::Ref);
assert_eq!(gc_type.var_len(), 0);
}
// iref<int64>
{
typed... | Rust | 0 |
NUM_SPEC>,
#[doc = "0x08 - Processor X Master Register"]
pub cpx_master: crate::Reg<cpx_master::CPXMASTER_SPEC>,
#[doc = "0x0c - Processor X Count Register"]
pub cpx_count: crate::Reg<cpx_count::CPXCOUNT_SPEC>,
#[doc = "0x10 - Processor X Configuration Register 0"]
pub cpx_cfg0: crate::Reg<cpx_c... | Rust | 0 |
from pubmed_scraper.parser import parse_pubmed_response
def test_parser_with_sample():
xml = """<PubmedArticleSet>
<PubmedArticle>
<MedlineCitation>
<PMID>123456</PMID>
<Article>
<ArticleTitle>Sample Title</ArticleTitle>
<AuthorList>
<Author>
... | Python | 1 |
import math
from collections import defaultdict
def load_triples(file_path):
"""Construct neighboring dictionaries containing isolated nodes (automatically includes all entities)"""
adj = defaultdict(set)
entities = set() # Record all occurrences of the entity
with open(file_path, 'r') as f:
... | Python | 1 |
::Timeout) => {
debug!("Flushing due to {}s timeout", flush_duration.as_secs());
(true, false)
}
Err(RecvTimeoutError::Disconnected) => {
warn!("SQLiteExporter channel disconnected, exiting worker");
(true, t... | Rust | 0 |
# coding=utf-8
# *** WARNING: this file was generated by test. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import builtins as _builtins
import errno
from setuptools import setup, find_packages
from setuptools.command.install import install
from subprocess import check_call
VE... | Python | 1 |
o_alipay_dict'):
params['reject_reason'] = self.reject_reason.to_alipay_dict()
else:
params['reject_reason'] = self.reject_reason
return params
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = ServicePromoBaseVO()
... | Python | 1 |
nts[-1]:
if column not in indents:
raise IndentationError(
"unindent does not match any outer indentation level",
("<tokenize>", lnum, pos, line))
tag = tags[len(indents)-2]
indents = indents[:-1]
... | Python | 1 |
Instant) -> Self {
Self { instant }
}
}
impl Sealed for InstantWrapperImpl {}
impl InstantWrapper for InstantWrapperImpl {
fn duration_since(&self, earlier: &dyn InstantWrapper) -> Duration {
self.instant.duration_since(earlier.to_inner())
}
fn elapsed(&self) -> Duration {
sel... | Rust | 0 |
import os
from parglare import Grammar, Parser
this_folder = os.path.dirname(__file__)
model_str = '''
modelID 42
component myComponent {
in SomeInputSlot
out SomeOutputSlot
}
'''
def test_imported_actions_connect_by_symbol_name():
g = Grammar.from_file(os.path.join(this_folder, 'by_symbol_name/model.p... | Python | 1 |
split: sizes don't match");
assert!(
usize::checked_add(Y, Z).is_some(),
"Array cannot be split: length would overflow"
);
// Make doubly sure that nothing funky is going on with the memory representations
assert!(core::mem::size_of::<Wrapper<T, Y, Z>>() == core::mem::size_of::<[T; X]>()... | Rust | 0 |
CISION_ERROR:
ephems.append(TruthEphemeris.fromECIVector(**ex_ephem))
return ephems
@pytest.fixture(name="matched_epoch_db")
def createMatchedDB(
self,
epochs: list[Epoch],
agent: AgentModel,
matched_ephems: list[TruthEphemeris],
):
"""Create a DB... | Python | 1 |
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 writing, software
// distributed under the License is distrib... | Rust | 0 |
}
#[test]
fn it_calculates_basins_to_match_fixtures() {
let map = HeightMap {
points: vec![
vec![2, 1, 9, 9, 9, 4, 3, 2, 1, 0],
vec![3, 9, 8, 7, 8, 9, 4, 9, 2, 1],
vec![9, 8, 5, 6, 7, 8, 9, 8, 9, 2],
vec![8, 7, 6, 7, 8, 9, 6, 7... | Rust | 0 |
.map(|p| NonNanFloat::new(*p.borrow())),
)
}
pub fn try_from_probabilities<P, E, I>(probabilities: I) -> Result<Self, E>
where
P: Ord + Clone + Add<Output = P>,
I: IntoIterator<Item = Result<P, E>>,
{
let mut heap = probabilities
.into_iter()
... | Rust | 0 |
g(0x0014, 0x5116)), alias: "WedgeInContactLength", vr: DS }, // DICONDE
E { tag: Single(Tag(0x0014, 0x5117)), alias: "WedgeFrontGap", vr: DS }, // DICONDE
E { tag: Single(Tag(0x0014, 0x5118)), alias: "WedgeTotalHeight", vr: DS }, // DICONDE
E { tag: Single(Tag(0x0014, 0x5119)), alias: "WedgeFrontHeight", vr... | Rust | 0 |
ptr: *const u8,
dst_ptr: *mut u8,
width: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn ARGBExtractAlphaRow_C(src_argb: *const u8, dst_a: *mut u8, width: ::std::os::raw::c_int);
}
extern "C" {
pub fn ARGBExtractAlphaRow_SSE2(
src_argb: *const u8,
dst_a: *mut u8,
widt... | Rust | 0 |
import pandas as pd
print(pd.__version__)
# 2.0.3
df = pd.read_csv('data/src/sample_pandas_normal_nan.csv')
print(df)
# name age state point other
# 0 Alice 24.0 NY NaN NaN
# 1 NaN NaN NaN NaN NaN
# 2 Charlie NaN CA NaN NaN
# 3 Dave 68.0 TX 70.0 NaN
# 4 ... | Python | 1 |
tch: &SpriteBatch, texture: &Texture, x: f32, y: f32, blend: BlendMode) {
let mut position: Vector2 = Vector2 { x: x, y: y };
set_blend_mode(blend);
batch.draw(texture, position, None, 0.0, None, None, COLORS[0], SpriteFlip::None).unwrap();
position.x += 50.0;
batch.draw(texture, position, None, 0.0... | Rust | 0 |
from database import init_db
print("Initialisiere Datenbank...")
init_db()
print("Datenbank-Initialisierung abgeschlossen!")
| Python | 1 |
xHashMap::default();
for (id, _) in function.blocks.iter() {
// if this block is the entry block, we don't want to generate a unique
// id for it - we want to use the function id provided for it
let key = match *id == function.entry_block {
true => fn_id,
false => fn_... | Rust | 0 |
[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"]
pub const NdisMediaStateDisconnected: NDIS_MEDIA_STATE = 1i32;
#[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"]
pub type NDIS_MEDIUM = i32;
#[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"]
pub const NdisMedium802_3: NDIS_MEDIUM = ... | Rust | 0 |
from rlcard.games.limitholdem.dealer import LimitHoldemDealer as Dealer
from rlcard.games.limitholdem.judger import LimitHoldemJudger as Judger
from rlcard.games.limitholdem.player import LimitHoldemPlayer as Player
from rlcard.games.limitholdem.player import PlayerStatus
from rlcard.games.limitholdem.round import Limi... | Python | 1 |
from .cocoapy import *
| Python | 1 |
CfiCacheError::Timeout => ObjectFileStatus::Timeout,
CfiCacheError::ObjectParsing(_) => ObjectFileStatus::Malformed,
_ => {
// Just in case we didn't handle an error properly,
// capture it here. If an error was captured with
// `capture_error` fu... | Rust | 0 |
oc = XMLDocument::new(ac.gc_context);
let mut xmlnode = xmldoc.as_node();
xmlnode.introduce_script_object(ac.gc_context, this);
this_node.swap(ac.gc_context, xmlnode);
this_node.replace_with_str(ac.gc_context, string)?;
}
(None, Some(ref mut this_node)) =... | Rust | 0 |
le struct's fields.
fn iter_fields(&self) -> TupleStructFieldIter;
/// Clones the struct into a [`DynamicTupleStruct`].
fn clone_dynamic(&self) -> DynamicTupleStruct;
}
/// An iterator over the field values of a tuple struct.
pub struct TupleStructFieldIter<'a> {
pub(crate) tuple_struct: &'a dyn Tuple... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.