text string | label_name string | labels int64 |
|---|---|---|
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# #
# The code is ho... | Python | 1 |
)
logger.info(f"Calculated pruning percentage: {pruning_percentage:.2f}% to achieve "
f"expansion rate of {expansion_rate}%")
# Ensure pruning_percentage is within valid range
if not 0 <= pruning_percentage <= 100:
raise ValueError(f"pruning_percentage must... | Python | 1 |
import sys
import logging
from snowflake.snowpark import Session, DataFrame
from snowflake.snowpark.functions import col,lit,row_number, rank
from snowflake.snowpark import Window
# initiate logging at info level
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)s - %(levelname)s - %(messag... | Python | 1 |
3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, ],
[ 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, ],
[ 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, ],
[ 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, ],
[ 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, ],
[ 0x92, 0x59, 0x58, 0xfc, ... | Rust | 0 |
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import sounddevice as sd
import numpy as np
import wavio
import soundfile as sf
import time
import os
import threading
from scipy import signal
import tempfile
def gcc_phat(sig, refsig, fs=1, max_tau=None, interp=16):
"""
使用... | Python | 1 |
1 | 2 | 4 | 8 => Ok(AlignArg(m)),
_ => Err(d.error("Invalid alignment")),
}
}
}
fn main() {
let args: Args = Docopt::new(USAGE)
.and_then(|d| d.decode())
.unwrap_or_else(|e| e.exit());
// println!("args: {:#?}", args);
if args.cmd_sizes {
show_sizes();... | Rust | 0 |
elf):
"""Test warning for large text datasets."""
# Create large dataset
large_real = pd.Series(['test text'] * 50001)
large_fake = pd.Series(['sample text'] * 50001)
# Should not fail with large datasets (warning is logged via loguru, not warnings module)
result = text_... | Python | 1 |
r> {
match msg.cmd {
ShannonMessage::PING => {
self.handle_ping()?;
}
ShannonMessage::COUNTRY_CODE => {
self.handle_country_code(msg.payload)?;
}
ShannonMessage::AES_KEY => {
self.audio_key.lock().unwrap(... | Rust | 0 |
inue
pos = int(link.type[7:])
oldfriends[pos] = link.other_userid
# Save any rivals that were added/removed/changed
newfriends = oldfriends[:]
for child in request.children:
if child.name != "friend":
continue
code = int(child.at... | Python | 1 |
z}, xmm2, xmm3/m128/m64bcst`
///
/// `EVEX.128.66.0F38.W1 7E /r`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vpermt2q_xmm_k1z_xmm_xmmm128b64,
/// `VPERMT2Q ymm1 {k1}{z}, ymm2, ymm3/m256/m64bcst`
///
/// `EVEX.256.66.0F38.W1 7E /r`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_... | Rust | 0 |
from enum import Enum
from fuzz.resolve_bug import error
class JSType(Enum):
unknown = 0
undefined = 1
js_bool = 2
js_null = 3
js_number = 4
js_string = 5
js_regex = 6
js_array = 7
js_object = 8
js_func = 9
class Symbol:
def __init__(self, identifier, expr, ty = None):
if ('type' in identif... | Python | 1 |
unt, buy_energy_number, true, vpp.energy_type, voltage_type, pu_ammeter_id)?;
let vpp_transcation_amount = <TransactionAmount<T>>::get((ps_addr.clone(), vpp_number));
TransactionAmount::<T>::insert((&ps_addr, vpp_number), vpp_transcation_amount + buy_energy_token_amount);
CurrentRemainingBattery::<T>::insert(... | Rust | 0 |
format!("use {};", v.as_str()).as_str()).unwrap()
})
.collect()
} else {
vec![]
};
quote! {
#(#imports)*
#db
#(#models)*
}
}
ModelNode::Enum(_) => {
... | Rust | 0 |
from os import system
from math import sqrt, log, ceil
from time import time
from random import seed, randrange, randint
from elasticsearch import Elasticsearch
# ES_HOST = {
# "host" : "23ca3ca1db3fc430000.qbox.io",
# "port" : 80
# }
ES_HOST = {
"host" : "localhost",
"port" : 9200
}
def createM... | Python | 1 |
import numpy as np
import cv2
from matplotlib import pyplot as plt
# load data
# image = cv2.imread(r"D:/SDC/SDC_codes/right_copy/16830097790672958.png")
image = cv2.imread("Afbeelding4.png")
# create a simple mask image similar to the loaded image, with the shape and return type
mask = np.zeros(image.shape[:2], np.u... | Python | 1 |
space
dimension) array with the measure space coordinates of each
solution.
status_batch (array-like): 1D array of
:class:`ribs.archive.AddStatus` returned by a series of calls
to archive's :meth:`add()` method.
value_batch (array-l... | Python | 1 |
as mask_utils
for track in self.gt_data['annotations']:
h = track['height']
w = track['width']
for i, seg in enumerate(track['segmentations']):
if seg:
track['segmentations'][i] = mask_utils.frPyObjects(seg, h, w)
areas = [a f... | Python | 1 |
message = 'Albert Einstein once said, "A person who never made a mistake never tried anything new."'
print(message)
| Python | 1 |
= "x86", target_arch = "x86_64"))]
let supported_cpuid = kvm
.get_supported_cpuid(KVM_MAX_CPUID_ENTRIES)
.map_err(Error::VmFd)?;
#[cfg(target_arch = "x86_64")]
let supported_msrs =
arch::x86_64::msr::supported_guest_msrs(kvm).map_err(Error::GuestMSRs)?;
... | Rust | 0 |
out = (attn @ v).transpose(1, 3) # B * num_heads, dim_head_v, block_size ** 2, num_blocks
# fold
out = out.reshape(-1, self.block_size_ds, self.block_size_ds, num_h_blocks, num_w_blocks)
out = out.permute(0, 3, 1, 4, 2).contiguous().view(
B, self.dim_out_v, H // self.block... | Python | 1 |
ова острва', 'sr-Latn': 'Ostrvo Herd i Mekdonaldova ostrva', 'sv': 'Heardön och McDonaldöarna', 'sw': 'Kisiwa cha Heard na Visiwa vya McDonald', 'ta': 'ஹேர்ட் மற்றும் மெக்டொனால்டு தீவுகள்', 'te': 'హెర్డ్ దీవి మరియు మెక్\u200cడొనాల్డ్ దీవులు', 'tg': 'Ҷазираи Ҳерд ва Ҷазираҳои Макдоналд', 'th': 'เกาะเฮิร์ดและหมู่เกาะแมกด... | Python | 1 |
continua = 'S'
totalAlunos = 0
somaAcertos = 0
while (continua.upper() == 'S'):
acertos = 0
print 'Informe a resposta de cada questao:'
resposta = raw_input('Questao 1: ').upper()
if (resposta == 'A'):
acertos += 1
resposta = raw_input('Questao 2: ').upper()
if (resposta == 'B'):
... | Python | 1 |
from .. import IconBase
class IconSatelliteDish(IconBase):
class_name = "lucide lucide-satellite-dish"
svg_data = {
"attrs": {
"width": "24",
"height": "24",
"view_box": "0 0 24 24",
"fill": "none",
"stroke": "currentColor",
"stroke_width": "2",
"str... | Python | 1 |
class Solution:
def climbStairs(self, n: int) -> int:
a, b = 1, 1
for _ in range(n):
a, b = b, a + b # 1 , 1+1=3
return a | Python | 1 |
(parse_attribute(&mut this, ds, ctx, attr));
}
}
}
for v in &ds.variants {
for f in &v.fields {
for attr in f.attrs {
res.combine_err(parse_attribute(&mut this, ds, ParseCtx::Field(f), attr));
}
}
}
res?;
finish(this, ds)... | Rust | 0 |
(()));
test_serde(&vec![1, 2, 3, 4], &sexp!((1 2 3 4)));
}
#[test]
fn test_unit() {
test_serde(&(), &sexp!(()));
}
#[test]
fn test_tuples() {
let tuple = (1, "Hello".to_string(), true);
test_serde(&tuple, &sexp!(#(1 "Hello" #t)));
}
#[test]
fn test_deser_list_as_tuple() {
let tuple: (u32, String)... | Rust | 0 |
{
trace!("complete, returning");
Ok((input, None))
},
}
}
impl super::super::Solution for Solution
{
fn solve(&self) -> Result<String>
{
debug!("called with input: {}", self.input);
let mut scores = self.input.lines()
.map(|mut input|
{
loop
{
match chunk(input)
{
Ok((res... | Rust | 0 |
A,HZ,H8,G7,SA,SK,S7],[EO,GO,SO,EU,HU,SU,H9,G9],],
vec![],
vec![],
&[(EPI0, [GK,GA,G7,G9]),(EPI1, [GZ,SK,EU,H7]),(EPI3, [GO,EZ,HK,H8]),(EPI3, [EO,E7,GU,HZ]),(EPI3, [SU,SZ,E8,HO]),(EPI2, [SA,H9,E9,S8]),(EPI3, [SO,EK,S9,HA]),(EPI3, [HU,EA,G8,S7]),],
[-50, -50, -50, 150],
);
test_rul... | Rust | 0 |
year = input("What year is it?")
if len(year) == 4 and year.isdigit():
print("HAPPY NEW YEAR\n\t!!!"+ str(year)+"!!!")
# ve phao bong
print(" . : .")
print(" '. : .'")
print(". '.:.' .")
print(". .':'. .")
print(" .' : '.")
print(" ' : '")
else:
print("Số bạn nhập không h... | Python | 1 |
in the HOST header:", "yellow"))
ips_found = []
reference_content = get_reference_response_content(target_url)
for ip in ips_not_defined_in_dns:
print(f"\r=> Checking {ip:<16}", end="", flush=True)
ip_content = get_call_with_ip_response_content(target_url, domain, ip)
... | Python | 1 |
ffi::NID_id_smime_aa_ets_RevocationRefs);
pub const ID_SMIME_AA_ETS_CERTVALUES: Nid = Nid(ffi::NID_id_smime_aa_ets_certValues);
pub const ID_SMIME_AA_ETS_REVOCATIONVALUES: Nid = Nid(ffi::NID_id_smime_aa_ets_revocationValues);
pub const ID_SMIME_AA_ETS_ESCTIMESTAMP: Nid = Nid(ffi::NID_id_smime_aa_ets_escTimeStamp);
pub ... | Rust | 0 |
from __future__ import print_function, division
import imgaug as ia
import imgaug.augmenters as iaa
from .utils import run_and_save_augseq
def main():
chapter_augmenters_canny()
def chapter_augmenters_canny():
fn_start = "edges/canny"
aug = iaa.Canny()
run_and_save_augseq(
fn_start + ".jp... | Python | 1 |
h if similarity is above threshold
if best_match and highest_similarity > 0.2:
return best_match
# Step 4: Fall back to keyword extraction
# Extract main topic/theme from content and use generic format
keywords, _ = self.extract_keywords(conte... | Python | 1 |
glob.glob(os.path.join(test_dir, test_name+'.*'))
for oldfile in oldfiles:
os.remove(oldfile)
# Copy the new results
copy_to = build.ResultsFileName(dir=test_dir, testsuite=test_name, status=status,
runtime=end_time-start_time)
os.syste... | Python | 1 |
{
let mut neighbors = 0;
for y_off in -1..=1 {
for x_off in -1..=1 {
if y_off == 0 && x_off == 0 {
continue;
}
if y + y_off < 0 || y + y_off >= 100 {
continue;
... | Rust | 0 |
config: Configuration,
opt: Opt,
) -> Result<()> {
match &opt.command {
Command::Add { key, value } => {
config.add_to_string_array(&key.to_key()?, value)?;
}
Command::Remove { key, value } => {
config.remove_from_string_array(&key.to_key()?, value)?;
}
... | Rust | 0 |
.
// TODO: Replace output list with a struct or protobuf.
fn generate_keypair(&self) -> (Vec<u8>, Vec<u8>);
}
<gh_stars>0
//! Handle communication details
use core::fmt;
use core::marker::PhantomData;
use embedded_hal::blocking::{i2c, spi};
use embedded_hal::digital::v2::OutputPin;
///Represent a frame sended ... | Rust | 0 |
://lospec.com/palette-list/mist-gb
Florescence, // from: https://lospec.com/palette-list/florescence
Lollipop, // from: https://lospec.com/palette-list/t-lollipop
Crystal, // from: https://lospec.com/palette-list/moon-crystal
Autumn, // from: https://lospec.com/palette-list/autumn-chill
... | Rust | 0 |
import cv2
import torch
import torchvision
from torch import nn
from PIL import Image
import matplotlib.pyplot as plt
import tools.utils as d2l
batch_size, devices, net = 256, d2l.try_all_gpus(), d2l.resnet18(10, 3)
def apply(img, aug, num_rows=2, num_cols=4, scale=4.5):
Y = [aug(img) for _ in range(num_rows * nu... | Python | 1 |
ed by Alembic - please adjust! ###
op.drop_index(op.f('ix_article_tocs_parent_id'), table_name='article_tocs')
op.drop_index(op.f('ix_article_tocs_article_id'), table_name='article_tocs')
op.drop_table('article_tocs')
op.drop_index(op.f('ix_project_translations_project_id'), table_name='project_translat... | Python | 1 |
# Generated by Django 5.2.1 on 2025-07-06 06:20
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('employee', '0006_remove_projectmanagerassignment_unique_pm_developer_assignment_and_more'),
('project_management', '... | Python | 1 |
calc = ship_calc(10,30)
print(calc)
cost = cost_transfer(300,100)
print(cost) | Python | 1 |
# TODO: For backward compatibility, we are importing the public objects
# originally from this file.
from torch.distributed.fsdp import ( # noqa: F401
FSDPModule,
fully_shard,
register_fsdp_forward_method,
UnshardHandle,
)
| Python | 1 |
")
.help("Don't crop the page to fit the content")
)
.arg(
Arg::with_name("custom-colors")
.short("c")
.long("colors")
.help("Which colors to use for the layers. Format: L1-black,L1-gray,L1-white;...;L5-black,L5-gray,L5-white")
... | Rust | 0 |
plt.title("Normalized Mutual Information (NMI)")
plt.ylim(0, 1)
plt.tight_layout()
plt.savefig("dcca_clustering_metrics.png", dpi=300, bbox_inches="tight")
# 3. Modality alignment visualization
plt.figure(figsize=(12, 8))
alignment_scores = evaluation_results["al... | Python | 1 |
swer: the final answer to the original input question
Begin!
Question: {input}
Thought:{agent_scratchpad}'''
prompt = PromptTemplate.from_template(template)
""" # noqa: E501
missing_vars = {"tools", "tool_names", "agent_scratchpad"}.difference(
prompt.... | Python | 1 |
logger.info(f"Updated career graph for profile {profile_id}")
except (LinkedInProfile.DoesNotExist, CareerPath.DoesNotExist):
logger.error(f"Profile or career path not found for {profile_id}")
except Exception as e:
logger.error(f"Error updating career graph for profile {profile_id... | Python | 1 |
(uic: u32, station: String) -> content::Html<String> {
content::Html(get_time_lines_html(
transilien(station.as_str(), uic).unwrap().iter(),
))
}
#[get("/ratp/<line>/<station>", format = "text/html")]
fn rt_ratp(line: String, station: String) -> content::Html<String> {
content::Html(get_time_lines_... | Rust | 0 |
hidden::Foo {}
// Copyright 2017-2018 by <NAME>.
// Licensed under the MIT License <https://opensource.org/licenses/MIT>
use super::Result;
use serde_yaml::from_str;
use std::env::current_dir;
use std::fs::File;
use std::io::prelude::*;
/// The YAML configuration file name (`.changelog.yml`).
///
/// The library loo... | Rust | 0 |
;
/// ```
fn set_port(syscfg: &mut pac::SYSCFG);
/// Set the rising trigger enable.
///
/// # Example
///
/// Set C6 to trigger on a rising edge.
///
/// ```no_run
/// use stm32wlxx_hal::{
/// gpio::{pins::C6, Exti},
/// pac,
/// };
///
/// let mut dp... | Rust | 0 |
from abaqusConstants import *
class TensileFailure:
"""The TensileFailure object specifies the material tensile failure.
Notes
-----
This object can be accessed by:
.. code-block:: python
import material
mdb.models[name].materials[name].Plastic.tensileFailure
mdb.models[... | Python | 1 |
puts = tokenizer(
[
"Today is a beautiful day and I want to",
"In the city of",
],
return_tensors="jax",
padding=True,
)
jit_generate = jax.jit(model.generate)
output_sequences = jit_generate(inputs["input_ids"], a... | Python | 1 |
from collections import defaultdict
def optimize(debts):
# Словарь для учета чистых балансов
net_balances = defaultdict(int)
for debtor, creditor, amount in debts:
net_balances[debtor] -= amount
net_balances[creditor] += amount
# Создание списков должников и кредиторов
debtors = ... | Python | 1 |
0);
let shape1 = &shape(x1);
let gy0 = maybe_reduce(shape0, &gy, g);
let gy1 = maybe_reduce(shape1, &gy, g);
ctx.append_input_grad(Some(gy0));
ctx.append_input_grad(Some(gy1));
}
}
impl<T: Float> op::Op<T> for SubOp {
fn compute(&self, ctx: &mut crate::op::ComputeContext... | Rust | 0 |
e
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix =... | Python | 1 |
data: TypeAlias = MetadataParam
"""This is deprecated, `MetadataParam` should be used instead"""
ToolChoice: TypeAlias = ToolChoiceParam
"""This is deprecated, `ToolChoiceParam` should be used instead"""
ToolChoiceToolChoiceAuto: TypeAlias = ToolChoiceAutoParam
"""This is deprecated, `ToolChoiceAutoParam` should be u... | Python | 1 |
if axes.is_null() {
return None;
}
Some(TCFType::wrap_under_create_rule(axes))
}
}
pub fn create_path_for_glyph(&self, glyph: CGGlyph, matrix: &CGAffineTransform)
-> Result<CGPath, ()> {
unsafe {
l... | Rust | 0 |
B49, 0x9E82_2F0C),
(r"meshes\i\in_strongruin2_hall01.nif", 0x3133_0B49, 0xA4D2_6E78),
(r"meshes\i\in_strongruin2_hall04.nif", 0x3133_0B49, 0xBE0B_4321),
(r"meshes\i\in_strongruin2_hall03.nif", 0x3133_0B49, 0xD6F8_4C09),
(r"meshes\i\in_stronghold_hcorr01.nif", 0x3133_0B49, 0xD9E4_E07E),
(r"meshe... | Rust | 0 |
# ---------------------------------------------------------------------------------------------------------------------
# 1. Асинхронность. Понятия
# ---------------------------------------------------------------------------------------------------------------------
import time
import asyncio
# Асинхронное программи... | Python | 1 |
handle,
self.base_address.ok_or(InterfaceError::Unhooked)?,
vec![SCENE_PTR_ADDRESS, 0x78, offset, 0x16C],
);
let mut flags = ptr_flags.read()?;
flags &= !1; // Disable the entity
// Set some model flags
let mut state = u32::from_be(ptr_state.... | Rust | 0 |
import plotly.express as px
import pandas as pd
import json
from sqlalchemy import create_engine
from src.common.Parameters import *
import random
from src.learner.common.Hyperparameters import *
class GanttChart:
gantt_on = Parameters.gantt_on
gantt_history = pd.DataFrame([], columns=['Type', 'JOB_ID', 'Task'... | Python | 1 |
import logging
from functools import cache
from typing import cast
import numpy as np
from datasets import Dataset, concatenate_datasets, load_dataset
from huggingface_hub import HfApi
from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast
from ..arguments import DataArguments
from ..data import Datase... | Python | 1 |
= (*s).offset(1)
}
}
#[no_mangle]
pub unsafe extern "C" fn ht_init_table(mut ht: *mut ht_table, mut hval_free_fn: hval_free_func) {
assert!(!ht.is_null());
for i in 0..503 {
(*ht).table[i] = 0 as *mut ht_entry;
}
(*ht).count = 0i32;
(*ht).hval_free_fn = hval_free_fn;
}
#[no_mangle]
pub ... | Rust | 0 |
if get_way == "Form" or get_way == "Nickname" or get_way == "Number":
get_message, get_link, receipt = await (
await QiwiAPI(cache_message, user_bill_pass=True)
).bill_pay(pay_amount, get_way)
if get_way == "Tron" or get_way == "BTCB":
... | Python | 1 |
pc: {:x}", aarch64::get_pc()); }
// // shell::shell("$ ");
// // shell::shell("# ");
// // sys_sleep(1000);
// unsafe { asm!("svc 2" :::: "volatile"); }
// unsafe { asm!("svc 2" :::: "volatile"); }
// unsafe { asm!("svc 2" :::: "volatile"); }
// unsafe { asm!("svc 2" :::: "volatile"); }
// ... | Rust | 0 |
_tail<S>(
sender: web::Data<DownstreamSender<S>>,
auth: web::Data<DeviceAuthenticator>,
commands: web::Data<Commands>,
path: web::Path<(String, String)>,
web::Query(opts): web::Query<PublishOptions>,
req: web::HttpRequest,
body: web::Bytes,
certs: Option<ClientCertificateChain>,
) -> Res... | Rust | 0 |
if (used_classes is None) or names[i] in used_classes:
if relative_path:
db_path = str(database_save_path.stem + "/" + filename)
else:
db_path = str(filepath)
db_info = {
"name": names[i],
... | Python | 1 |
def test_parse_str_81dojo(self):
result = KIF.Parser.parse_str(TEST_KIF_81DOJO)
self.assertEqual(result[0], TEST_KIF_81DOJO_RESULT)
def test_parse_file(self):
try:
tempdir = tempfile.mkdtemp()
# cp932
path = os.path.join(tempdir, "test1.kif")
... | Python | 1 |
Write each coordinate with 6 decimal places
def check_vertices(n):
mesh_vertices = [len(obj.data.vertices) for obj in scene_meshes()]
if (sum(mesh_vertices))<n:
reset_scene()
print("scene reset for object with vertices:",n)
return True
def main():
#try:
osroot = 'D:... | Python | 1 |
::new(parzen_estimator(), range(lower, upper)?),
),
};
Ok(Self {
value: Default::default(),
categorical,
optim,
})
}
}
impl ParamState {
/// Get next hyperparam to try.
fn ask(&mut self, rng: &mut impl Rng) {
self.value = self.... | Rust | 0 |
bool {
loop {
println!("{}", msg);
if let Ok(n) = read_line() {
if n == 1 {
return true;
} else if n == 0 {
return false;
}
}
println!("ENTER YES--1 OR NO--0\n");
}
}
pub fn prompt_number(msg: &str) -> usize {... | Rust | 0 |
Vec::new();
let multisig_signers = signers_of(matches, MULTISIG_SIGNER_ARG.name, wallet_manager)
.unwrap_or_else(|e| {
eprintln!("error: {}", e);
exit(1);
});
if let Some(mut multisig_signers) = multisig_signers {
multisig_signers.sort_by(|(_, lp), (_, rp)| lp.cm... | Rust | 0 |
erning permissions and
// limitations under the License.
//! Quota manager.
use super::ContractCallExt;
use std::collections::HashMap;
use std::str::FromStr;
use crate::contracts::tools::{decode as decode_tools, method as method_tools};
use crate::libexecutor::executor::Executor;
use crate::types::block_number::Bloc... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################
# Author : cndaqiang #
# Update : 2024-08-18 #
# Build : 2024-08-18 #
# What : 更新登录体验服 #
##################################
from airtest_mobileauto.control import *
Tool = DQWheel()
txt=["字典.中... | Python | 1 |
out prior written
authorization from the copyright holders.
\****************************************************************************/
/* The following code used to be in a file called "hz.cpp" and there's no
* particular reason for it to be here, but it was a tiny file with a weird
* name so I wanted to get rid... | Rust | 0 |
PropertiesPanelMessage::ModifyTransform {
value: number_input.value,
transform_op: TransformOp::Height,
}
.into()
}),
..NumberInput::default()
})),
],
},
LayoutRow::Row {
name: "".into(),
widgets: vec![
WidgetHolder::new(Widget::TextLabel(TextLabel ... | Rust | 0 |
key in eval_metrics if key in log_line
}
# 4 find the best ckpt
best_epoch_results = dict()
for epoch in result_dict:
if len(best_epoch_results) == 0:
best_epoch_results = resu... | Python | 1 |
# Copyright (C) 2024-present Naver Corporation. All rights reserved.
# Licensed under CC BY-NC-SA 4.0 (non-commercial use only).
#
# --------------------------------------------------------
# post process function for all heads: extract 3D points/confidence from output
# ------------------------------------------------... | Python | 1 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import re
import time
from dyMEAN.data.pdb_utils import Protein, merge_to_one_chain
FILE_DIR = os.path.split(__file__)[0]
TMEXEC = os.path.join(FILE_DIR, 'TMscore')
CACHE_DIR = os.path.join(FILE_DIR, '__cache__')
# create cache dir
if not os.path.exists(CACHE_DIR):
... | Python | 1 |
ptr().offset(fresh0 as isize) = modifier;
return 1i32 != 0
}
let mut cap_0: size_t =
if modifier as libc::c_ulonglong !=
(0i32 as __u64) << 56i32 |
(1u64 << 56i32).wrapping_sub(1i32 as libc::c_ulonglong) &
0xffffffffffffffu64 {
... | Rust | 0 |
pub fn attributes(&self) -> Attribute {
match self {
Self::Accessor(ref accessor) => accessor.attributes(),
Self::Data(ref data) => data.attributes(),
}
}
}
/// This abstracts away the need for IsPropertyKey by transforming the PropertyKey
/// values into an enum with both v... | Rust | 0 |
{
XTAL_CTRL_XTAL_CTRL_BYPASS_W { w: self }
}
#[doc = "Bit 17 - If set to 1 selects the clk_in_dig signal for the digital block, otherwise the internal xtal"]
#[inline(always)]
pub fn xtal_ctrl_dig_clk_in_sel(&mut self) -> XTAL_CTRL_DIG_CLK_IN_SEL_W {
XTAL_CTRL_DIG_CLK_IN_SEL_W { w: self... | Rust | 0 |
"foo",
]);
eqnice!("2\n", cmd.stdout());
});
// See: https://github.com/BurntSushi/ripgrep/issues/1638
//
// Tests if UTF-8 BOM is sniffed, then the column index is correct.
rgtest!(r1638, |dir: Dir, mut cmd: TestCommand| {
dir.create_bytes("foo", b"\xef\xbb\xbfx");
eqnice!("foo:1:1:x\n", cmd.arg("--c... | Rust | 0 |
pub struct Initialize<'info> {
#[account(init)]
//check if account is empty, and enough lamports on the account for 2 years
meme_num_account: ProgramAccount<'info, MemeNumAccount>,
rent: Sysvar<'info, Rent>,
}//MemeNumAccount has to match meme_num_account with snake case
#[account]
pub struct MemeNumA... | Rust | 0 |
from typing import Any
import taskiq_fastapi
from taskiq import InMemoryBroker, ZeroMQBroker, AsyncBroker, AsyncResultBackend
from {{cookiecutter.project_name}}.settings import settings
{%- if cookiecutter.enable_redis == "True" %}
from taskiq_redis import ListQueueBroker, RedisAsyncResultBackend
{%- endif %}
{%- if... | Python | 1 |
import time
from pathlib import Path
import pytest
from ._helpers import run_cli
@pytest.mark.e2e
@pytest.mark.performance
def test_ner_large_input_completes_quickly():
# Construct a moderately large synthetic note (~50k chars) but simple content
sentence = "Patient with hypertension on metformin. "
tex... | Python | 1 |
valid_url(url).await;
}
false
}
pub async fn update_all_vahtis(
db: Database,
itemhistory: Arc<Mutex<ItemHistory>>,
http: Arc<Http>,
) -> Result<(), anyhow::Error> {
itemhistory.lock().await.purge_old();
let vahtis = db.fetch_all_vahtis_group().await?;
update_vahtis(db, itemhistory, htt... | Rust | 0 |
rEqual(
"querystring_query_dict", {"request": request}, expected="?a=2"
)
@setup({"querystring_query_dict_no_request": "{% querystring my_query_dict a=2 %}"})
def test_querystring_with_explicit_query_dict_and_no_request(self):
context = {"my_query_dict": QueryDict("a=1&b=2")}
... | Python | 1 |
ids = batch[0]
if isinstance(attribution_method, LimeBase):
inputs = token_ids
instance_attribution = attribution_method.attribute(inputs,
n_perturb_samples=100,
... | Python | 1 |
air();
let mut blockchain = create_blockchain(
vec![TestDispatcherService.into()],
vec![TestDispatcherService
.artifact_id()
.into_default_instance(TEST_SERVICE_ID, TEST_SERVICE_NAME)],
);
// Tests that a service with an unregistered artifact will not be started.
... | Rust | 0 |
&mut self,
renderMessages: flatbuffers::WIPOffset<
flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<RenderMessage<'b>>>,
>,
) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
RenderGroup::VT_RENDERMESSAGES,... | Rust | 0 |
json::from_reader(BufReader::new(File::open(NODE_CONFIG_PATH)?))?;
self.create_nodes(json_data, service_fs).await
}
/// Creates the nodes using the specified JSON object, adding them to the `nodes` HashMap.
async fn create_nodes<'a, 'b>(
&mut self,
json_data: json::Valu... | Rust | 0 |
i32,
d: PresenceUpdateD,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PresenceUpdateD {
token: String,
properties: PresenceUpdateProperties,
compress: Option<bool>,
large_threshold: Option<i32>,
shard: Option<(i32, i32)>,
presence: Option<UpdatePresence>,
}
#[derive(Debug, Serial... | Rust | 0 |
y commas
for item in path_list:
if item == ',':
# Convert the current sublist to a NumPy array and append to the arrays_list
data_floats = [list(map(float, sub_item.split())) for sub_item in temp_list]
data_array = np.array(data_floats)
... | Python | 1 |
# This file was auto-generated by Fern from our API Definition.
from .create_embed_job_request_truncate import CreateEmbedJobRequestTruncate
__all__ = ["CreateEmbedJobRequestTruncate"]
| Python | 1 |
_estimator.on_round_start(rate_sample, max_bw, true);
// The pipe has not been filled yet since we haven't been in recovery for a full round
assert!(!fp_estimator.filled_pipe());
}
}
<filename>crates/parser/src/error.rs<gh_stars>1-10
use crate::TextRange;
#[derive(Debug)]
pub struct Error {
des... | Rust | 0 |
: Any) -> None:
"""Handle state update."""
state = self._data.client.state
if state is not None and state.final_weight_kg is not None:
self._attr_native_value = state.final_weight_kg
super()._handle_state_update(args)
async def async_added_to_hass(self) -> None:
... | Python | 1 |
}
impl<FD, FS, D, T, B> ReadValueAt<D> for BlockListReshape<FD, FS, D, T, B>
where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
B: DenseAccess<FD, FS, D, T>,
{
type Txn = T;
fn read_value_at<'a>(self, txn: Self::Txn, coord: Coord) -> Read<'a> {
self.source
... | Rust | 0 |
.to_string()))
.map_or_else(
|e| {
log::error!("{}", e);
METRIC_STORAGE.get(&name).map_or_else(
|| unreachable!("unreachable"),
|m| m.add_failure(NumberType::Error),
... | Rust | 0 |
ert_eq!(tok_from_file.refresh_token.unwrap(), "...");
assert_eq!(tok_from_file.expires_in, Duration::seconds(3600));
assert_eq!(tok_from_file.expires_at.unwrap(), now);
// delete cache file in the end
fs::remove_file(&spotify.cache_path).unwrap();
}
#[test]
fn test_write_token() {
let now: DateTim... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.