text string | label_name string | labels int64 |
|---|---|---|
}
if (number_of_columns == None):
no_columns = log.progress("No columns found")
no_columns.status("No columns found")
else:
for i in range(0, number_of_columns):
column_name = log.progress("Column %s" % i)
column_nam... | Python | 1 |
chemical id that is produced, contains amount produced and required.
produced_by: Vec<(ChemicalAmount, Vec<ChemicalAmount>)>,
fuel_id: ChemicalId,
ore_id: ChemicalId,
}
impl Reactions {
fn parse(input_string: &str) -> Reactions {
let mut id_assigner = ChemicalIdAssigner::new();
// Ind... | Rust | 0 |
::from(1 as i8)]);
//! # client.run_with_metadata("MATCH (n {test: 'doctest-v3'}) DETACH DELETE n;", None, None).await?;
//! # client.pull_all().await?;
//! #
//! # let params = Params::from_iter(vec![("name", "Rust")]);
//! # client.run_with_metadata(
//! # "CREATE (:Client {test: 'doctest-v3'}... | Rust | 0 |
def forward_vit(pretrained, x):
b, c, h, w = x.shape
glob = pretrained.model.forward_flex(x)
layer_1 = pretrained.activations['1']
layer_2 = pretrained.activations['2']
layer_3 = pretrained.activations['3']
layer_4 = pretrained.activations['4']
layer_1 = pretrained.act_postprocess1[0:2](laye... | Python | 1 |
image_data = cv2.cvtColor(image_data, cv2.COLOR_HSV2RGB)
#---------------------------------#
# 对真实框进行调整
#---------------------------------#
if len(box)>0:
np.random.shuffle(box)
box[:, [0,2,4,6,8,10,12]] = box[:, [0,2,4,6,8,10,12]]*nw/iw + dx
... | Python | 1 |
(Resource, NonZeroU32) {
(
Resource::Crystal(DatabaseId::default()),
NonZeroU32::new(10_f64.powi(self.properties[3] as i32 - 1) as u32).unwrap(),
)
}
fn longitude_resolution_req(&self) -> (Resource, NonZeroU32) {
(
Resource::Crystal(DatabaseId::defaul... | Rust | 0 |
OUTPUTN_A::PLU_OUTPUT5
}
#[doc = "Checks if the value of the field is `PLU_OUTPUT6`"]
#[inline(always)]
pub fn is_plu_output6(&self) -> bool {
**self == OUTPUTN_A::PLU_OUTPUT6
}
#[doc = "Checks if the value of the field is `PLU_OUTPUT7`"]
#[inline(always)]
pub fn is_plu_output7(... | Rust | 0 |
b']' => {
sum -= 1;
if sum < 0 { return false; }
},
_ => (),
}
}
sum == 0
}
#[inline]
fn munch_forward(
bytes: &[u8],
index: &mut usize,
inc: u8,
dec: u8
) -> i32 {
let mut sum = 0;
while let Some(&byte) = by... | Rust | 0 |
import copy
dx, dy = [0,1,0,-1],[1,0,-1,0]
def backtrack(i, result) :
global min_value
if i == K: # 백트래킹 완료 시
for j in result: # 최소값 비교
if min_value > sum(j):
min_value = sum(j)
for idx in range(K):
if visit[idx] == 0 :
... | Python | 1 |
\s\\s\\s\\u{2665}\\u{2665}\\u{2665}\\s\\d\\d\\sand\\s\\d\\sand\\sy\\u{306}y\\u{306}\\sand\\s\\u{1f4a9}\\u{1f4a9}\\.$\n"
));
}
#[test]
fn succeeds_with_escape_and_surrogate_option() {
let mut grex = init_command();
grex.args(&[
"--digits",
... | Rust | 0 |
ete,
Insert {
auto_increment_id: AutoIncrementId,
returning: Option<SelectType<'a>>,
},
Update,
Replace {
returning: Option<SelectType<'a>>,
},
Invalid,
}
pub(crate) fn type_statement<'a, 'b>(
typer: &mut Typer<'a, 'b>,
statement: &Statement<'a>,
) -> InnerStatem... | Rust | 0 |
import random
import numpy as np
import pinocchio as pin
import torch
def set_random_seed(seed):
"""Set random seed."""
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
def get_pose_from_rot_pos(rot, pos):
"""Ge... | Python | 1 |
import pytest
import time
from utils.exception_handler.decorator_error_handler import exception_handler
from pages.workflow_editor_page import WorkflowEditorPage
from utils.refresh_and_wait import refresh_and_wait
from settings.variables import USER1_LOGIN
import allure
@allure.severity(allure.severity_level.CRITICAL)... | Python | 1 |
pub context_hash: ContextHash,
pub protocol_hash: ProtocolHash,
pub next_protocol_hash: ProtocolHash,
pub block_header_proto_json: String,
pub block_header_proto_metadata_bytes: Vec<u8>,
pub operations_proto_metadata_bytes: Vec<Vec<Vec<u8>>>,
pub max_operations_ttl: i32,
pub last_allowe... | Rust | 0 |
/// c
pub enum Ccw {
CounterClockwise,
Clockwise,
OnlineBack,
OnlineFront,
OnSegment,
}
/// Returns a counter-clockwise result from given three points
pub fn ccw(a: Point2d, b: Point2d, c: Point2d) -> Ccw {
let ... | Rust | 0 |
import argparse
import os
from pydub import AudioSegment
from tqdm import tqdm # 导入 tqdm 库
def cut_audio(input_audio_path, start, duration, output_audio_path):
"""
从原始音频中切割指定时间段的音频片段
:param input_audio_path: 原始音频路径
:param start: 起始时间(秒)
:param duration: 持续时间(秒)
:param output_audio_path: 输出音频片... | Python | 1 |
40,
]
);
set_pokemon_pic_test!(
set_pokemon_pic_front_105,
105,
PokemonPicFace::FRONT,
"../secrets/data/pokemon_pic/front-105.png",
PicEncodingMethod::TWO(1),
0x32F8F,
vec![
0x66, 0xA1, 0xFD, 0x4F, 0x3F, 0x7D, 0x3C, 0x85, 0x18, 0x8A, 0x3C, 0xE5, 0x41, 0x55, 0x55,
0x4F, 0... | Rust | 0 |
pub sequence: u16,
pub length: u32,
}
impl TryParse for GrabKeyboardReply {
fn try_parse(initial_value: &[u8]) -> Result<(Self, &[u8]), ParseError> {
let remaining = initial_value;
let (response_type, remaining) = u8::try_parse(remaining)?;
let (status, remaining) = u8::try_parse(rem... | Rust | 0 |
lor(111, 0, 255);
pub const ELECTRIC_LAVENDER: RgbColor = RgbColor(244, 187, 255);
pub const ELECTRIC_LIME: RgbColor = RgbColor(204, 255, 0);
pub const ELECTRIC_PURPLE: RgbColor = RgbColor(191, 0, 255);
pub const ELECTRIC_ULTRAMARINE: RgbColor = RgbColor(63, 0, 255);
pub const ELECTRIC_VIOLET: RgbCo... | Rust | 0 |
elif response.__contains__("NoMatchingTemplate"):
print "NoMatchingTemplate"
ans = search_summary.kwquery(input_message)
if len(ans) == 0:
ans = mybot.respond('找不到答案')
print 'Eric:' + ans
... | Python | 1 |
# coding=utf-8
from numpy import *
from numpy.linalg import *
inp = open('input.txt', 'r')
out = open('output.txt', 'w')
n, m = 5, 5
A, f, E = [], [], identity(n)
eps = 10 ** (-5)
for line in inp: # читаем А и b
temp = [float(x) for x in line.split()]
f.append(temp.pop())
A.append(temp)
a, b = array(A)... | Python | 1 |
# finished_page.py
#
# Copyright 2025 sepehr-rs
#
# This program 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.
#
# This program is di... | Python | 1 |
# -*- coding: utf-8 -*-
"""
This program needs the following libraries to work :
- PyCrypto
- Click
- SCP
(You can install them with `pip install click scp pycrypto`)
"""
| Python | 1 |
# ------------------------------------------------------------------------------
# Copyright 2022 Upstream Data Inc -
# -
# Licensed under the Apache License, Version 2.0 (the "License"); ... | Python | 1 |
.with_spacer(1.0)
.with_flex_child(
flex_row(
digit_button(7),
digit_button(8),
digit_button(9),
op_button('×'),
),
1.0,
)
.with_spacer(1.0)
.with_flex_child(
flex_row(
... | Rust | 0 |
ps.append(chat)
except Exception:
continue
for i, group in enumerate(groups):
print(f'{gr}[{cy}{str(i)}{gr}]{cy} - {group.title}|{group.title}')
print('')
if (target_group == ''):
g_index = input(
f"{gr}[+] Введите номер группы для инвайта пользователей или N... | Python | 1 |
, "nreset_i"]
);
emit_rp_group_end("dff")
emit_module_footer()
if len(sys.argv) == 4 :
# suffix, basecell; e.g. dff, dff
generate_dff_nreset_en( sys.argv[1], int(sys.argv[2]), int(sys.argv[3]) );
else :
if ((len(sys.argv) == 5) and (sys.argv[4]==... | Python | 1 |
"""
pytest 配置文件,提供共享的测试配置和夹具
"""
import pytest
def pytest_addoption(parser: pytest.Parser):
"""添加命令行选项"""
parser.addoption("--target", default="127.0.0.1", help="目标主机名或 IP 地址")
parser.addoption("--timeout", type=int, default=5000, help="超时时间(毫秒)")
parser.addoption("--interval", type=int, default=1000... | Python | 1 |
_hack!(_mm256_srli_epi64, MaximumLaneCrossingShift - 51),
52 => compiler_const_generics_hack!(_mm256_srli_epi64, MaximumLaneCrossingShift - 52),
53 => compiler_const_generics_hack!(_mm256_srli_epi64, MaximumLaneCrossingShift - 53),
54 => compiler_const_generics_hack!(_mm256_srli_epi64, MaximumLaneCrossingShift - ... | Rust | 0 |
+= ( ( pix >> 8 ) & 0xff ) as u8;
rgba[ 2 ] += ( ( pix >> 0 ) & 0xff ) as u8;
rgba[ 3 ] += ( ( pix >> 24 ) & 0xff ) as u8;
rgba[ 3 ] = 0xff;
*pixel = image::Rgba(rgba);
};
match imgbuf.save(filename) {
Err(e) => {
println!("Error saving PNG: {:?}", e );
},
_ => {},
}
}
... | Rust | 0 |
efault) => write!(f, "DEFAULT {}", default),
Self::Collation(collation) => write!(f, "COLLATE {}", collation),
}
}
}
/// SQL table constraint definition.
///
/// ```txt
/// <table constraint definition> ::= [ CONSTRAINT <constraint name> ] <table constraint>
/// ```
pub type TableConstraintDef ... | Rust | 0 |
from operations import sub, sum
print(sum(1, 2))
print(sub(1, 2))
| Python | 1 |
{Client, Result};
use serde::{de::DeserializeOwned, Deserialize};
/// - https://docs.kraken.com/rest/#operation/unstake
/// - https://api.kraken.com/0/private/Unstake
#[must_use = "Does nothing until you send or execute it"]
pub struct UnstakeAssetRequest {
client: Client,
/// Asset to unstake (asset ID or alt... | Rust | 0 |
/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 't', 'w', ... | Python | 1 |
CityGML',
'vtkIOChemistry',
'vtkIOCesium3DTiles',
'vtkIOCONVERGECFD',
'vtkIOHDF',
'vtkIOCGNSReader',
'vtkIOAsynchronous',
'vtkIOAMR',
'vtkInteractionImage',
'vtkImagingStencil',
'vtkImagingStatistics',
'vtkImagingGeneral',
'vtkImagingOpenGL2',
'vtkImagingMorphological... | Python | 1 |
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
from automata.backend.grammar.transducers.scfg_parser import SCFG
def main():
"""
Shows an example of converting an SCFG to Chomsky Normal Form.
"""
# 1. Define a grammar that is not in CNF
grammar_str = """
... | Python | 1 |
el="CDF_negative")
plt.plot(a['percent'],a['ks'],label="K-S")
sx = np.linspace(0,1,10)
sy = sx
plt.plot(sx,sy,linestyle='--',color='darkgrey',linewidth=1.2)
plt.legend()
plt.grid(True)
ymin, ymax = plt.ylim()
plt.xlabel('Sample percent')
plt.ylab... | Python | 1 |
value
)))
}
},
validator_address: asc_new(heap, &Bytes(&self.validator_address), gas)?,
timestamp: asc_new_or_missing(heap, &self.timestamp, gas, "CommitSig", "timestamp")?,
signature: asc_new(heap, &Bytes(&self.signature), gas)?,
... | Rust | 0 |
ime
result = SuccessResponse(
data=SuccessData(
answer=final_synthesis,
consensus=ConsensusInfo(
models_queried=len(models),
models_succeeded=len(valid_responses),
models_failed=len(responses) - len(valid_res... | Python | 1 |
> {
check_integer(self)?;
Ok(<i32>::try_from(self.as_i64().ok_or_else(|| self.expected(JsonTy::Number))?)?)
}
fn parse_i64(&self) -> Result<i64, FieldError> {
check_integer(self)?;
self.as_i64().ok_or_else(|| self.expected(JsonTy::Number))
}
fn parse_string(&self, max: u3... | Rust | 0 |
348, fill=0
before:
qualifier_emb : [a,b,c,d,e,f,g,......] (here a,b,c ... are of 200 dim)
qual_index : [1,1,2,1,2,3,2,......] (here 1,2,3 .. are edge index of Main COO)
edge_type 190348 : [0,0,0,0,0,0,0, .....] (... | Python | 1 |
::core::option::Option<unsafe extern "C" fn(n: GLsizei, semaphores: *mut GLuint)>;
pub type PFNGLDELETESEMAPHORESEXTPROC =
::core::option::Option<unsafe extern "C" fn(n: GLsizei, semaphores: *const GLuint)>;
pub type PFNGLISSEMAPHOREEXTPROC =
::core::option::Option<unsafe extern "C" fn(semaphore: GLuint) -> GLb... | Rust | 0 |
import torch
from torchmdnet.models.model import load_model
class External:
def __init__(self, netfile, embeddings, device="cpu"):
self.model = load_model(netfile, device=device, derivative=True)
self.device = device
self.n_atoms = embeddings.size(1)
self.embeddings = embeddings.re... | Python | 1 |
root
///
/// This information is used to compute the hash
///
/// - Dependencies in `Xargo.toml` for a specific target
/// - RUSTFLAGS / build.rustflags / target.*.rustflags
/// - The target specification file, is any
/// - `[profile.release]` in `Cargo.toml`
/// - `rustc` commit hash
fn hash(
cmode: &CompilationMo... | Rust | 0 |
('aarch64', 'Linux'): 'linux-arm64',
('armv7l', 'Linux'): 'linux-arm-7',
('mips64', 'Linux'): 'linux-mips64',
('mips64le', 'Linux'): 'linux-mips64le',
('ppc64le', 'Linux'): 'linux-ppc64le',
('riscv64', 'Linux'): 'linux-riscv... | Python | 1 |
```
pub fn as_str_vector(&self) -> Option<Vec<&str>> {
if let Some(iter) = self.as_str_iter() {
Some(iter.collect())
} else {
None
}
}
/// Get a read-only reference to a scalar string type.
/// ```
/// use extendr_api::prelude::*;
/// test! {
... | Rust | 0 |
OO` is dropped last.
});
scope.spawn(|_| {
thread::sleep(ms(100));
s.send(()).unwrap();
});
}).unwrap();
}
use python_runner::*;
#[test]
fn load_lib() {
test_function();
}//! A lightweight low-level CoAP message manipulation crate.
//!
//! Its goal is to be comp... | Rust | 0 |
cls.mean.x == 2.0 && cls.mean.y == 3.0);
assert!(cls.n == 2);
}
#[derive(Debug)]
struct Classifer {
list: Vec<Class>,
ncls_dist: f32,
}
impl Classifer {
pub fn new(mdist: f32) -> Classifer {
Classifer { ncls_dist: mdist, list: Vec::new() }
}
pub fn classificate(&mut self, m: &Measure)... | Rust | 0 |
:3 root stylesheet",
);
}
}
mod scope {
#[allow(unused)]
fn runner() -> crate::TestRunner {
super::runner().with_cwd("scope")
}
#[test]
#[ignore] // missing error
fn diamond() {
let runner = runner().with_cwd("diamond");
assert_eq!(
runner.err(
... | Rust | 0 |
# Problem: High Low
# We want you to gain more experience working with control flow and Booleans in Python. To do this, we are going to have you develop a game! The game is called High-Low and the way it's played goes as follows:
# Two numbers are generated from 1 to 100 (inclusive on both ends): one for you and one f... | Python | 1 |
import sqlite3
def create_table():
conn = sqlite3.connect('Employees.db')
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS Employees (
id TEXT PRIMARY KEY,
name TEXT,
role TEXT,
gender TEXT,
status TEXT,
... | Python | 1 |
.ok_or("title requires a parameter".to_string())
.and_then(|param| {
Regex::new(param)
.map(|r| Some(Match::Title(r)))
.map_err(|e| format!("title: {}", e))
}),
"urgent" => token_split
.get(1)
.ok_or("ur... | Rust | 0 |
# Copyright (C) 2020-2025 Mitsubishi Electric Research Laboratories (MERL)
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Code purpose: Check if methods in pycvxset are consistent
from pycvxset import ConstrainedZonotope, Ellipsoid, Polytope
in_polytope_but_not_in_constrained_zonotope = [
v
for v in dir(Po... | Python | 1 |
unsafe { std::slice::from_raw_parts(offsets.raw_data() as *const i32, num_agents + 1) };
(0..num_agents).flat_map(move |j| {
let num_messages = i32_offsets[j + 1] - i32_offsets[j];
let agent_index = j as u32;
(0..num_messages).map(move |k| (group_index, agent_index... | Rust | 0 |
mod RW {}
}
/// Sequence Index for AHB Write triggered Command.
pub mod AWRSEQID {
/// Offset (8 bits)
pub const offset: u32 = 8;
/// Mask (4 bits: 0b1111 << 8)
pub const mask: u32 = 0b1111 << offset;
/// Read-only values (empty)
pub mod R {}
/// Writ... | Rust | 0 |