text string | label_name string | labels int64 |
|---|---|---|
ING_ENCODER 0xc00d_a412
MF_E_TRANSCODE_INVALID_PROFILE 0xc00d_a413
MF_E_ALLOCATOR_NOT_INITIALIZED 0xc00d_a7f8
MF_E_ALLOCATOR_NOT_COMMITED 0xc00d_a7f9
MF_E_ALLOCATOR_ALREADY_COMMITED 0xc00d_a7fa
MF_E_STREAM_ERROR 0xc00d_a7fb
MF_E_INVALID_STREAM_STATE 0xc00d_a7fc
MF_E_HW_STREAM_NOT_CONNECTED 0xc00d_a7fd
M... | Rust | 0 |
import customtkinter
class Calculator(customtkinter.CTk):
def __init__(self):
super().__init__()
self.title("Hesap Makinesi")
self.geometry("300x400")
self.display = customtkinter.CTkEntry(self, width=280, height=50)
self.display.grid(row=0, column=0, columnspan=4, padx=10... | Python | 1 |
#!/usr/bin/env python3
"""Tests HTTPS certificates"""
| Python | 1 |
ebattle (!win && win) { 33 } run { 34 }")
);
assert_eq!(
Ok(Expr::Int(30)),
meowth("battle (win && lose) { 32 } run { 30 }")
);
assert_eq!(
Ok(Expr::Int(52)),
meowth("battle (pokeball x = 4; x beats 3) { 52 } run { 30 }")
);
assert_eq!(
Ok(Expr::Int(22)),
m... | Rust | 0 |
import pygame
import os
from do import do_change
def draw_txt(screen, text, size, x, y, color=(100, 255, 100)):
font = pygame.font.Font(None, size)
text = font.render(text, True, color)
screen.blit(text, (x, y))
def show_adding():
pygame.init()
weight, height = 660, 660
screen = pygame.displ... | Python | 1 |
"""
Classifies: CHEBI:37143 organofluorine compound
"""
from rdkit import Chem
def is_organofluorine_compound(smiles: str):
"""
Determines if a molecule is an organofluorine compound based on its SMILES string.
An organofluorine compound contains at least one carbon-fluorine bond.
Args:
smiles... | Python | 1 |
import pygame as pg
from camera import Camera
from settings import *
class Player(Camera):
def __init__(self, app, position=PLAYER_POS, yaw=-90, pitch=0):
self.app = app
super().__init__(position, yaw, pitch)
def update(self):
self.keyboard_control()
self.mouse_control()
... | Python | 1 |
pth), dist)
rets['radii'] = radii # (1, H, W)
rets['accum'] = render_alpha # (1, H, W)
rets['rgb'] = rendered_image # (3, H, W)
rets['depth'] = render_depth_expected # (1, H, W)
# transform normal from view space to world space
rets['normal'] = (allmap[2:5].per... | Python | 1 |
IIAudioFormatDetail
{
maximum_bit_rate_in_kilobits_per_second: u16,
maximum_samples_per_frame: u16,
sampling_frequency: SamplingFrequency,
specific: Version1TypeIIAudioFormatDetailSpecific,
}
impl Version1TypeIIAudioFormatDetail
{
#[allow(missing_docs)]
#[inline(always)]
pub const fn maximum_bit_rate_in_ki... | Rust | 0 |
import pytest
from tests.utils.mocks.repo_trees import get_mock_repo_tree
METHOD_CASES = {
"readme_presence": [("FULL", True), ("MINIMAL", False)],
"license_presence": [("FULL", True), ("MINIMAL", False), ("LICENSE_ONLY", True)],
"examples_presence": [("FULL", True), ("WITH_EXAMPLES_ONLY", True), ("MINIMA... | Python | 1 |
)
right_layout.addWidget(self.task_display)
self.battle_state_display = BattleStateDisplay()
right_layout.addWidget(self.battle_state_display)
horizontal_layout.addLayout(left_layout, stretch=1)
horizontal_layout.addLayout(right_layout, stretch=1)
# 设置伸缩因子,让 QHBoxLayou... | Python | 1 |
assert!(!re_only_group.is_match(&query));
assert!(!re_group.is_match(&query));
}
}
#[test]
fn for_session() {
let query = build_query_string(&Location::Session, true);
let re_session = Regex::new(r"session == (\d*) and").unwrap();
let re_host = Regex::new(r"h... | Rust | 0 |
"""
Escribir una función que reciba una lista como parámetro y devuelva True si la lista
está ordenada en forma ascendente o False en caso contrario. Por ejemplo,
ordenada([1, 2, 3]) retorna True y ordenada(['b', 'a']) retorna False. Desarrollar
además un programa para verificar el comportamiento de la función.
"""
| Python | 1 |
)
R2_x = F * h**3 * (t * (t**2 - 1))/(math.factorial(3))
h /= 2
if abs(R2_x) < epsilon:
break
print(mass)
x_usli = [x_j_1, x_j, x_j_2]
print("Найденные узлы :", x_usli, "\n")
# ------------------ Все теперь можно считать конечные разности ----------------------------
y_usli = [math.cos(math.sin... | Python | 1 |
def findDuplicate(nums):
seen = set()
for num in nums:
if num in seen:
return num
seen.add(num)
def main():
nums = [1, 3, 4, 2, 2]
print(f"The repeated number is: {findDuplicate(nums)}")
if __name__ == "__main__":
main()
| Python | 1 |
"::",
stringify!(hasNext)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<UCharIterator>())).hasPrevious as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(UCharIterator),
"::",
stringi... | Rust | 0 |
ut <SelectableWordsSegmenter as RtType>::Abi) -> HRESULT
}}
impl ISelectableWordsSegmenterFactory {
#[inline] pub fn create_with_language(&self, language: &HStringArg) -> Result<SelectableWordsSegmenter> { unsafe {
let mut out = null_mut();
let hr = (self.get_vtbl().CreateWithLanguage)(self.get_abi... | Rust | 0 |
S OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use super::{coconodes, gateways, mixnodes, providers};
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use topology::{MixLayer, NymTopology};
... | Rust | 0 |
utils::filesystem::move_to_desired_dir();
}
// use windows registry to set the agent to run at startup
utils::registry::add_to_startup();
}
pub fn run() -> Result<(), Box<dyn Error>> {
// gathering host system's initial information
let agent_info = Info::collect();
let agent_info = ser... | Rust | 0 |
,
"last_name",
"email",
"password1",
"password2",
"is_superuser",
],
list(form.fields),
)
def test_password_not_required_with_external_auth(self):
SecretManager().set_composite_secret(
... | Python | 1 |
import random
import pickle
from hero import Hero
from monster import Monster
from merchant import Merchant
# Function to save the game state to a file
def save_game(hero):
with open('hero_save.pkl', 'wb') as file:
pickle.dump(hero, file)
print("Game saved successfully!")
# Function to save hero's hea... | Python | 1 |
'primary_key': False,
'unique': False,
'foreign_key': (other_table, other_column),
'check': False,
'index': False,
'columns': columns.split(','),
}
# Now get indexes
cursor.execute("""
SELECT
... | Python | 1 |
default, skip_serializing_if = "String::is_empty")]
pub login_provider: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub last_login: DateTime<Utc>,
#[serde(default, skip_serializing_if = "String::is_empty")]
pub last_application_accessed: String,
#[serde(default, ski... | Rust | 0 |
def run(self):
if self.type == 'destroy':
destroy_ship(self.timer, ship_types=self.destroy_ship_types)
if self.type == 'build' or self.type == 'develop':
factory: BuildManager = self.timer.port.factory
type = 'ship' if self.type == 'build' else 'equipment'
... | Python | 1 |
T {
let page_table = PageTable::from_token(token);
let va = ptr as usize;
page_table
.translate_va(VirtAddr::from(va))
.unwrap()
.get_ref()
}
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T {
let page_table = PageTable::from_token(token);
let va = p... | Rust | 0 |
= plt.figure()
plt.imshow(textured_map)
plt.plot(((trajectory[0, :]- MAP1['xmin']) / MAP1['res'] ), -((trajectory[1, :]- MAP1['ymin']) / MAP1['res'])+1000, label='Odometry Trajectory')
plt.plot(((T[0, 3, :]- MAP1['xmin']) / MAP1['res'] ), -((T[1, 3, :]- MAP1['ymin']) / MAP1['res'])+1000, label='ICP Optimised Trajector... | Python | 1 |
an Syllabics Pa", '<'),
('ᚲ', "Runic Letter Kauna", '<'),
('❬', "Medium Left-Pointing Angle Bracket Ornament", '<'),
('⟨', "Mathematical Left Angle Bracket", '<'),
('〈', "Left-Pointing Angle Bracket", '<'),
('〈', "Left Angle Bracket", '<'),
('㇛', "CJK Stroke Pd", '<'),
('く', "Hiragana Letter... | Rust | 0 |
sid": "test-open",
"tdls_prohibit_chan_switch": "1"})
wlantest_setup(hapd)
connect_2sta_open(dev, hapd)
setup_tdls(dev[0], dev[1], hapd)
def test_ap_open_tdls_external_control(dev, apdev):
"""TDLS and tdls_external_control"""
try:
_test_ap_open_tdls_exte... | Python | 1 |
("Injecting secrets from vault {} ({:?})", pth, client.mode());
let mut vault_secrets = BTreeSet::new();
let mut template_secrets = BTreeMap::new();
for e in &mut self.get_env_vars() {
for k in e.vault_secrets() {
vault_secrets.insert(k.to_string());
}
... | Rust | 0 |
fig.reward_model.strategy == 'fsdp':
from verl.workers.fsdp_workers import RewardModelWorker
elif config.reward_model.strategy == 'megatron':
from verl.workers.megatron_workers import RewardModelWorker
else:
raise NotImplementedError
role_worker_mapping[Role.R... | Python | 1 |
ght 2015 <NAME>. See the COPYRIGHT
// file at the top-level directory of this distribution.
//! General-purpose I/O routines.
use std::io;
use std::io::prelude::*;
/// Shorthand for Read + Seek
pub trait Readable: Read + Seek {}
impl<T: Read + Seek> Readable for T {}
/// Format `bytes` to `f` as a hex string.
pub f... | Rust | 0 |
Ok(())
}
}
pub fn dump_token_stream_pretty<R: ::std::io::Read>(reader: R)
{
let mut s = protocol::Reader::new(reader);
while let Some(v) = s.read_ent()
{
match v
{
Token::Symbol(s) => print!("{} ", s),
Token::Ident(s) => print!("{} ", s),
Token::Lifetime... | Rust | 0 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) typedef int GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software ... | Python | 1 |
on on slopes
let mut uvs: Vec<[f32; 2]> = Vec::new();
for i in 0..(CHUNK_SQSIZE) {
let x = i % CHUNK_SIZE;
let y = i / CHUNK_SIZE;
uvs.push([x as f32/CHUNK_SIZE as f32,y as f32/CHUNK_SIZE as f32]);
}
// create triangles
let mut indeces: Vec<u32> = Vec::new();
// for ... | Rust | 0 |
1, p2) = calc(&lines);
if !bench {
println!("Part 1: {}", p1);
println!("Part 2: {}", p2);
}
});
}
<filename>nix/wttr/src/main.rs
use std::io::{stdout, Write};
use curl::easy::Easy;
fn main() {
let mut easy = Easy::new();
easy.url("https://wttr.in/?format=4").unwrap(... | Rust | 0 |
import configparser
import csv
import json
from fast_arrow import Client, StockMarketdata, Stock
print("----- running {}".format(__file__))
#
# get auth_data (see https://github.com/westonplatter/fast_arrow_auth)
#
with open("fast_arrow_auth.json") as f:
auth_data = json.loads(f.read())
#
# initialize client ... | Python | 1 |
["initialBonus"][which] + value
elif key == 14: # 初始羁绊
ret["initialJiBan"] = cardValue.get("initialJiBan", 0) + value
elif key == 17: # hint等级
ret["hintBonus"][5] += value * 5
elif key == 18: # hint率:不处理
pass
else:
print(f"未知数值词条 {key}... | Python | 1 |
print("Initializing C build scripts...")
import urllib.request
import os
try:
urllib.request.urlretrieve(f"https://raw.githubusercontent.com/JHeflinger/Scripts/refs/heads/main/extra/build.sh", "build.sh")
urllib.request.urlretrieve(f"https://raw.githubusercontent.com/JHeflinger/Scripts/refs/heads/main/extra/... | Python | 1 |
kedFiltOffset = os.path.join(inps.outDir, 'filtAzOff.bil')
mask_filter(inps, band=[1], outName = maskedFiltOffset, plot=inps.plot)
cmd = 'isce2gis.py envi -i ' + maskedFiltOffset
os.system(cmd)
#######################
# resampling the masked and filtered dense offsets to the sam... | Python | 1 |
t_name_t,
}
impl ::std::clone::Clone for Struct_Unnamed386 {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed386 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type __Request__mach_port_get_context_t = Struct_Unnamed386;
#[repr(C)]
#[derive(Copy)]
pub struct ... | Rust | 0 |
import uuid
from datetime import datetime
from django.db import models
from django.contrib.auth.models import AbstractUser
#time_str = "2025-08-13 14:30:00"
#custom_datetime = datetime.strftime(time_str, "%Y-%m-%d %H:%M:%S")
# User models
class User(AbstractUser):
pass
class Product(models.Model):
id = m... | Python | 1 |
# -*- coding: utf-8 -*-
"""
訓練管道向後兼容介面
此模組提供與原始 training_pipeline.py 相容的介面,
確保現有代碼可以無縫遷移到新的模組化實現。
Classes:
ModelTrainer: 向後兼容的模型訓練器
"""
import logging
import warnings
from typing import Any, Dict, Optional
import pandas as pd
from src.config import LOG_LEVEL
from src.models.model_base import ModelBase
from .tr... | Python | 1 |
bit_is_set() {}
}
#[allow(unsafe_code)]
fn init_ddr_subsystem() {
use ddr_data::{
DDR_CTL_BASE_PTR, DDR_CTL_REGISTER_0_START_MASK, DDR_CTL_REGISTER_132, DDR_CTL_REGISTER_132_INT_STATUS_8,
DDR_PHYSICAL_FILTER, DDR_PHYSICAL_FILTER_PMP_0_INIT,
};
unsafe {
*DDR_CTL_BASE_PTR |= DDR_CTL_... | Rust | 0 |
xit".as_bytes().to_vec() {
s.state = Self::vec_to_bound::<u8>("e_frozen".as_bytes().to_vec())?;
}
}
Ok(())
})?;
MinerStatValue::<T>::try_mutate(|s_opt| -> DispatchResult {
let s = s_opt.as_mut().unwrap();
s.staking = s.staking.checked_sub(&punish_amount).ok_or(Error::<T>::Overflow)?;
... | Rust | 0 |
1] == wanted };
}
}
fn num_input(n: usize, checkboxes: &mut [Box<checkbox::Checkbox>]) -> bool {
let mut interactables = checkboxes.iter_mut().filter(|c| c.interactable);
let checkbox = interactables.nth(n);
match checkbox {
None => return false,
Some(x) => return x.interact()
}
... | Rust | 0 |
from django.urls import path,include
from . import views
app_name = 'tracking'
urlpatterns = [
path('home/',views.Home.as_view(),name='Home'),
path('',include('tracking.tests.urls')),
] | Python | 1 |
stream).await? {
InitReq { version, mtds }
if (version == SOCKS_VERSION) && mtds.contains(&AuthMethods::NoAuth) =>
{
info!("using no auth method");
let mut msg: BytesMut = InitReply::method(AuthMethods::NoAuth).into();
stream.write_all(&mut msg).await?
... | Rust | 0 |
_shape": "Тип фигуры",
"type_selection": "Правило выбора",
"shape_rectangle": "прямоугольник",
"shape_circle": "круг",
"shape_polygon": "полигон",
"selection_inside": "внутри",
"selection_outside": "снаружи",
"selection_intersect": "пересечение",
"databases_label": "Базы данных",
"en... | Python | 1 |
etadataSource},
rapid::types::SdpPackage,
rapid::{
rapid_store::RapidStore,
types::{Repo, Sdp},
},
};
mod metadata_file;
mod metadata_local;
mod metadata_rest;
#[derive(Error, Debug)]
pub enum MetadataQueryError {
#[error("corrupt file")]
CorruptFile(#[source] anyhow::Error),
... | Rust | 0 |
#!/usr/bin/python
import regress
import unicorn as U
class WrongEFLAGS(regress.RegressTest):
def test_eflags(self):
# xor r14,r14
CODE = 'M1\xf6'
uc = U.Uc(U.UC_ARCH_X86, U.UC_MODE_64)
uc.reg_write(U.x86_const.UC_X86_REG_RIP, 0x6000b0)
uc.reg_write(U.x86_const.UC_X86_REG_EF... | Python | 1 |
from minbpe import BPETokenizer
from model import *
from trainer import *
from datasets_novel import *
if torch.cuda.is_available():
torch.cuda.empty_cache()
BASE_DIR = Path(__file__).resolve().parent
CHECKPOINT_DIR = BASE_DIR.joinpath('data/bert_checkpoints')
timestamp = datetime.utcnow().timestamp()
LOG_DIR = B... | Python | 1 |
post not found: %s/%s", author, permlink)
return
author_id = Accounts.get_id(author)
blogger_id = Accounts.get_id(blogger)
if 'delete' in op_json and op_json['delete'] == 'delete':
DB.query("DELETE FROM hive_reblogs WHERE account = :a AND "
"post_i... | Python | 1 |
No HTTP address found");
(
instances,
format!("http://localhost:{}", http_address.port()),
)
}
#[derive(Debug)]
pub enum MatchError {
Error(usize),
ErrorEndOfFile,
Fatal(usize),
FatalEndOfFile,
}
#[derive(Debug)]
pub struct Success<T> {
pub item : T,
pub start : usiz... | Rust | 0 |
arguments={'anchors': anchors,
'num_classes': len(class_names)})([
model_body.output, boxes_input,
detectors_mask_input, matching_boxes_input
])
model = Model(
[image_input, boxes_input, detectors_mask_i... | Python | 1 |
d.set_var("TEST_remove", "val")?;
d.set_var("TEST", "${VAL} ${BAR}")?;
assert_eq!(
d.get_var("TEST")?.ok_or(DataSmartError::UnwrapNoneError)?,
"val bar"
);
});
ported_datasmart_concat_test!(remove_inactive_override, d, {
d.set_var("TEST", "${VAL} ${... | Rust | 0 |
ual encoding date is delayed to eliminate character codes to
* be mapped to .notdef and to handle multiply-encoded glyphs.
*/
encoding = new((1_u64).wrapping_mul(::std::mem::size_of::<cff_encoding>() as u64) as u32)
as *mut cff_encoding;
(*encoding).format = 1i32 as card8;
(*encoding).num... | Rust | 0 |
er = make_logger(
logpath=os.path.join(args.output_dir, f"log_{str(datetime.datetime.now()).replace(':', '-').replace(' ', '_').replace('.', '')}.txt"),
printlevel=LogLevel.INFO,
writelevel=LogLevel.INFO,
warnlevel=LogLevel.WARNING,
errorlevel=LogLevel.ERROR
)
logger.log... | Python | 1 |
t image = ImageLoader::new();
loop {
match try!(image.add_data(input)) {
LoadProgress::NeedDataProviderAndMoreData => break,
LoadProgress::NeedMoreData => {}
LoadProgress::Finished => panic!("Image ended before metadata was read!"),
}
... | Rust | 0 |
_rating(input, |z, o| {
if z.len() > o.len() {
z
} else {
o
}
})
}
fn ex1(input: &[Vec<char>]) {
let gamma = gamma_rate(input);
let epsilon = invert_binary(&gamma);
println!(
"{}",
binary_to_decimal(&gamma) * binary_to_decimal(&epsilon)
);
}
fn ex2(input: &[Vec<char>]) {
le... | Rust | 0 |
or("atoms not set")
if atoms is None:
atoms = self.atoms
if self.model_type != "MACE":
raise NotImplementedError("Only implemented for MACE models")
if num_layers == -1:
num_layers = int(self.models[0].num_interactions)
batch = self._atoms_to_batch(ato... | Python | 1 |
#!/usr/bin/env python3
import sys
import time
import msgpack
import struct
import gzip
from pprint import pformat
from .mavlink_protocol import unpack_mavlink
def main():
for f in sys.argv[1:]:
with gzip.GzipFile(f, 'rb') as fd:
while True:
hdr = fd.read(4)
if... | Python | 1 |
placement, msg['value'])
elif msg['type'] == 'image':
image_cnt += 1
question += '<image>\n'
image_path.append(msg['value'])
if image_cnt > 1:
num_patches_list = []
pixel_values_list = []
for image_i... | Python | 1 |
import os
import re
import setuptools
VERSIONFILE = "./jovian/_version.py"
FLAVORFILE = "./jovian/_flavor.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
pkg_name = os.getenv("PKG_NAME", "jovian")
if mo:
verstr = mo.group(1)
else:... | Python | 1 |
it_key_p.multiple_results = True
@split_key_p.def_abstract_eval
def _split_key_scalar_abstract_eval(seed):
key_shape = seed.dtype._impl.key_shape
if len(key_shape) != 2 or key_shape[0] != 1:
raise ValueError(f"Key shape must be (1, N), got {key_shape}")
return [jax_core.ShapedArray((), jnp.dtype("uint32"))]... | Python | 1 |
let mut list = CallList::default();
let i1 = list.insert(1);
let i2 = list.insert(2);
let i3 = list.insert(3);
let i4 = list.insert(4);
list.remove(i2);
list.remove(i1);
list.remove(i3);
let i5 = list.insert(5);
assert_eq!(i5, i1, "i5 is the lowest... | Rust | 0 |
d\x09\x00\xc0\xc3\xce\xc2\x94\
1\xfa{\xdf3\x0d\x0f,\x03\x00-\xd3\x81\x0f\x00\xdd\
0\x0f\xe1=\xfd\xf01\xca&\x96\xf0\x1e\x00\x80]\xe8\
\xc6\xa7\xaft\xe2\x03\x00G\xa1\x03\x1f\x00\x8eoV\xad\
\x0f\xca@\xc7\xe5\xc8\xfc7Q\xba\xa7\x00\x00\xe0)\xa6\
\xf5\xf5\xe4s\xa5\xa0G>E9:\x0c\x00\xa0\x15:\
\xf0\x01\xe0\xb8f!\xbc\xa7\xfbrt\x... | Python | 1 |
import pandas as pd # For working with DataFrames
# Load Titanic dataset (update the path as needed)
# Example of full path:
# df = pd.read_csv("C:/Users/YourUsername/Downloads/titanic.csv")
titanic = pd.read_csv("titanic.csv") # Assumes the file is in the same folder as the script
# Preview the first few rows of ... | Python | 1 |
observation = self.execute_code(code, thought)
# Format step XML
step_xml = f"""<step>
<thought>{thought}</thought>
<action>{action}</action>
<action_input>{code}</action_input>
<observation>{observation}</observation>
</step>"""
... | Python | 1 |
# This file is part of Bertini 2.
#
# python/bertini/multiprec/__init__.py 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, either version 3 of the License, or
# (at your option) any later version.
#
# python... | Python | 1 |
from django.db import models
from django.conf import settings
from common.models import TimeStamp
class Teacher(TimeStamp):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
def __str__(self):
return self.user.username
| Python | 1 |
('\u{1ee39}', '\u{1ee39}'),
('\u{1ee3b}', '\u{1ee3b}'),
('\u{1ee42}', '\u{1ee42}'),
('\u{1ee47}', '\u{1ee47}'),
('\u{1ee49}', '\u{1ee49}'),
('\u{1ee4b}', '\u{1ee4b}'),
('\u{1ee4d}', '\u{1ee4f}'),
('\u{1ee51}', '\u{1ee52}'),
('\u{1ee54}', '\u{1ee54}'),... | Rust | 0 |
ps://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. No part of linux-epoll, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2019 The developers of linux-epoll. See the COPYRIGHT file in the top-leve... | Rust | 0 |
quad: &DomQuad,
from: &Element,
) -> Result<DomQuad, JsValue>;
#[cfg(all(feature = "Document", feature = "DomQuad",))]
# [wasm_bindgen (catch , method , structural , js_class = "Text" , js_name = convertQuadFromNode)]
#[doc = "The `convertQuadFromNode()` method."]
#[doc = ""]
#[... | Rust | 0 |
# Copyright 2016 - Nokia
#
# 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 writing, softwar... | Python | 1 |
import os
import shutil
def lua_to_python_name(name):
"""
Rename Lua module file/directory to Python module file/directory.
For example, 'module.lua' -> 'module.py'
"""
if name.endswith('.lua'):
name = name[:-4] + '.py'
name.replace("/./", "/")
return name
def reproduce_directory_... | Python | 1 |
"最新价",
"涨跌幅",
]
big_df = big_df[
[
"序号",
"代码",
"名称",
"最新价",
"涨跌幅",
"调研机构",
"机构类型",
"调研人员",
"接待方式",
"接待人员",
"接待地点",
"调研日期",
"公告日期",
... | Python | 1 |
truction: &RefDbInstruction,
) -> Result<usize, ProgramError> {
let packed = instruction.pack(&mut output[1..])?;
let instruction_type_out = array_mut_ref![output, 0, 1];
instruction_type_out[0] = MainInstructionType::RefDbInstruction as u8;
Ok(packed + 1)
}
fn unpack_add_v... | Rust | 0 |
#!/usr/bin/env python3
import json
DB_IMPL_STRUCTURE_JSON_PATH = "./data_structures/DBImpl.json"
with open(DB_IMPL_STRUCTURE_JSON_PATH) as f:
DB_IMPL_STRUCTURE_JSON_PATH = json.load(f)
ARENA_STRUCTURE_JSON_PATH = "./data_structures/LevelDBArena.json"
with open(ARENA_STRUCTURE_JSON_PATH) as f:
ARENA_STRUCTURE_... | Python | 1 |
ions[:, start:stop]
old_mu_batch = self.mu[:, start:stop]
old_sigma_batch = self.sigma[:, start:stop]
returns_batch = self.returns[:, start:stop]
advantages_batch = self.advantages[:, start:stop]
values_batch = self.values[:, start:stop]
... | Python | 1 |
lled,
CanceledPartiallyFilled,
}
#[cfg(test)]
mod tests {
use crate::OrderStatus;
use std::str::FromStr;
#[test]
fn string_to_enum() {
matches!(
OrderStatus::from_str("fully_filled").unwrap(),
OrderStatus::FullyFilled,
);
}
#[test]
fn enum_to_st... | Rust | 0 |
::new("./example.db");
/// let db = Database::open(db_path).unwrap();
///
/// let statement = String::from(
/// "SELECT * FROM example_table WHERE ID = '15';"
/// );
///
/// let mut sql = db.prepare(statement, None::<Box<dyn FnOnce(SqlitePrimaryResult, String)>>).unwrap();
///
//... | Rust | 0 |
)]
pub fn state(&self) -> STATE_R {
STATE_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[doc = "Bits 16:20"]
#[inline(always)]
pub fn chnls_minus1(&self) -> CHNLS_MINUS1_R {
CHNLS_MINUS1_R::new(((self.bits >> 16) & 0x1f) as u8)
}
#[doc = "Bits 28:31"]
#[inline(always)]
p... | Rust | 0 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import scatter_mean, scatter_sum
from utils.nn_utils import stable_norm
from .torchmd_et import TorchMD_ET
class TorchMDEncoder(nn.Module):
def __init__(self, hidden_size, edge_size, n_... | Python | 1 |
import asyncio, os
SOCKET_PATH = "/run/parmanode/parmanode.sock"
if os.path.exists(SOCKET_PATH):
os.remove(SOCKET_PATH)
shutdown_future = None
async def handle_connection(reader, writer):
global shutdown_future
buffer = b""
while True:
chunk = await reader.read(1024)
if not chunk:
... | Python | 1 |
i) => i,
};
// richer none expr
match Some(1) {
Some(i) => i,
None => 1 + 42,
};
// multiline case
#[rustfmt::skip]
match Some(1) {
Some(i) => i,
None => {
42 + 42
+ 42 + 42 + 42
+ 42 + 42 + 42
}
};
... | Rust | 0 |
bpy.ops.object.select_all(action='DESELECT')
if start_mode == 'EDIT':
for o in start_selected_obj:
bpy.context.view_layer.objects.active = o
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.context.view_layer.objects.active = start_active_obj
for j in need_select_again_obj:
j.select_set(True)
return {... | Python | 1 |
ref = ref * mask[..., None, None, :]
# aggregate over time
ref = ref.sum(dim=-1)
else:
# no mask: average over time
ref = ref.mean(dim=-1)
# Check if the UUT matches the reference
assert torch.allclose(uut, ref... | Python | 1 |
}
//-----------------------------------------------------------------------------
// TESTS
//-----------------------------------------------------------------------------
#[cfg(test)]
mod test_incredible {
#[cfg(test)]
use super::*;
#[test]
fn test_absolute_path() {
let a = path_absolute(Pat... | Rust | 0 |
to a Python dictionary
"""
with open(path) as data_file:
return yaml.safe_load(data_file)
class ZipFileWithProgress(ZipFile):
"""
This is a helper class inheriting from ZipFile that allows to display a progress
bar while the files are being extracted.
"""
def extract_zip(self, pre... | Python | 1 |
{
std::fs::create_dir(empty_dir).unwrap(); // Git can't track empty dirs, so let's make it.
}
let mut cmd = Command::cargo_bin("aconv")?;
let cmd = cmd.arg("test_data/dir_to_dir")
.args(&["-o","output"])
.current_dir(std::path::PathBuf::from(".").canonicalize()?);
cmd.assert().s... | Rust | 0 |
lue(&src.flags);
dst.pipeline_bind_point = vk_to_raw_value(&src.pipeline_bind_point);
dst.input_attachment_count = src.input_attachments.len() as u32;
dst.input_attachments = new_ptr_vk_array(&src.input_attachments);
dst.color_attachment_count = cmp::max(src.color_attachments.len(), get_... | Rust | 0 |
)";
let mut itp = Interpreter::new();
let exprs = itp.parser.parse(src).unwrap();
itp.eval(exprs[0]).unwrap();
itp.eval(exprs[1]).unwrap();
assert_eq!(Value::I32(1), itp.eval(exprs[2]).unwrap());
assert_eq!(Value::I32(2), itp.eval(exprs[3]).unwrap());
assert_eq!(V... | Rust | 0 |
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Torch-based dataclasses for Anomalib.
This module provides PyTorch-based implementations of the generic dataclasses
used in Anomalib. These classes are designed to work with PyTorch tensors for
efficient data handling and processing in an... | Python | 1 |
]
regret_temp["n"] = n_train_true
validation_temp["n"] = n_train_true
time_temp["n"] = n_train_true
with open(output, 'a') as f:
print("True tree CDR")
print("True tree CDR", file = f)
print("total time: ", time.time() - time1, file = f)
print("seperate time", f... | Python | 1 |
{
info!(log, "Saving game");
let mut file = ctx.filesystem.create("/save.game")?;
game_state.serialize(&mut Serializer::new(&mut file)).unwrap();
}
if self.load_pressed.check() {
info!(log, "Loading game");
let mut file = ctx.filesystem.op... | Rust | 0 |
m_attribs_bytes = num_attribs.serialize();
let mut request0 = vec![
extension_information.major_opcode,
CREATE_PBUFFER_REQUEST,
0,
0,
screen_bytes[0],
screen_bytes[1],
screen_bytes[2],
screen_bytes[3],
fb... | Rust | 0 |
ockFlags {
fn from(t: usize) -> ClockFlags {
match t {
0 => ClockFlags::ZeroFlag,
1 => ClockFlags::TimerAbsTime,
_ => unreachable!(),
}
}
}
/// nanosleep
pub async fn nanosleep(dur: Duration) {
use kernel_hal::thread;
thread::sleep_until(dur).await;
}... | Rust | 0 |
i, OcallApi};
use frame_support::ensure;
use itp_ocall_api::EnclaveAttestationOCallApi;
use log::*;
use sgx_tse::rsgx_create_report;
use sgx_types::{
sgx_epid_group_id_t, sgx_measurement_t, sgx_platform_info_t, sgx_quote_nonce_t,
sgx_quote_sign_type_t, sgx_report_body_t, sgx_report_data_t, sgx_report_t, sgx_spid_t,
... | Rust | 0 |
{ println!("deallocate(ptr=0x{:010x} size={} align={})",
ptr as uint, size, align);
}
heap::deallocate(ptr, size, align);
}
unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
if PRINT {
println!("reallocate(p... | Rust | 0 |
BASE_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff);
self.w
}
}
impl R {
#[doc = "Bits 0:31 - Address base to start copying from, word ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.