text string | label_name string | labels int64 |
|---|---|---|
ting_sub(1);
}
InputEvent::Key(KeyEvent {
key: KeyCode::Char('j'),
..
})
| InputEvent::Key(KeyEvent {
key: KeyCode::DownArrow,
..
}) => {
active_tab_idx = (active_tab_idx + 1).min(... | Rust | 0 |
resolutions
.offset((*(*(*p_tcd).image).comps.offset(0 as libc::c_int as isize)).resno_decoded as isize);
l_samples = ((*res_comp0_0).win_x1.wrapping_sub((*res_comp0_0).win_x0) as OPJ_SIZE_T)
.wrapping_mul((*res_comp0_0).win_y1.wrapping_sub((*res_comp0_0).win_y0) as OPJ_SIZE_T);
if (*l_tile).numcomp... | Rust | 0 |
1][2][0]) + '⎯⎯⎯' + element_repr(stones[1][2][1]) + '⎯⎯⎯' + element_repr(stones[1][2][2]) + ' |\n'
board += '| | |\n'
board += element_repr(stones[0][2][0]) + '⎯⎯⎯⎯⎯' + element_repr(stones[0][2][1]) + '⎯⎯⎯⎯⎯' + element_repr(stones[0][2][2]) + '\n'
return board
start_state: State = {
'turn': 0,... | Python | 1 |
#
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution ... | Python | 1 |
or generating triangle waves at a given frequency.
pub struct Triangle {
sample_rate: Math,
irate: Math,
inc: Math,
}
impl FreqMod for Triangle {
fn new(f: Math, sample_rate: Math) -> Self {
Triangle {
sample_rate,
irate: Math(4.0 * f.0 / sample_rate.0),
inc:... | Rust | 0 |
",
comments=
"""Boundaries, once created, can be modified, renamed, and even
deleted in the BOLD(Skeleton Boundaries) page.
Clicking on a boundary name in the list in the BOLD(Boundaries)
pane selects the boundary. Its name is highlighted in the list
and the boundary is displayed in the graph... | Python | 1 |
[`Self`].
pub fn builder() -> CachingConnectionManagerBuilder<T> {
CachingConnectionManagerBuilder::new()
}
}
#[tonic::async_trait]
impl<T> ConnectionManager<T> for CachingConnectionManager<T>
where
T: Clone + Send + 'static,
{
async fn remote_server(&self, connect: String) -> Result<T, Error> ... | Rust | 0 |
enizer),
n_trials=config.get("n_trials", 10),
show_progress_bar=True)
best_params = study.best_params
else:
best_params = {
"learning_rate": config.get("lr", 3e-5),
"batch_size": config.get("batch_size", 16),
"epochs":... | Python | 1 |
;
}
soft_demod[i] = interpolated[i];
}
// calculate the error value (Muller & Mueller)
let error = slice(last_sample) * interpolated[i] - slice(interpolated[i]) * last_sample;
last_sample = interpolated[i];
// update the actual samples per symbol
... | Rust | 0 |
tmpdir_factory, validate_cliresult):
storage_dir = str(tmpdir_factory.mktemp("lib"))
result = clirunner.invoke(
package_install_cmd,
["--global", "--storage-dir", storage_dir, "--library", "1"],
)
validate_cliresult(result)
result = clirunner.invoke(
cmd_ci,
[
... | Python | 1 |
let exe = current_exe()
.unwrap()
.into_os_string()
.into_string()
.unwrap();
let begin = format!(r#"
{{
while :
do
if [ -n "$ENVRC_PPID" -a "$ENVRC_PPID" != "$PPID" ]
then
unset ENVRC_LOAD
unset ENVRC_PPID
unset ENVRC_TMP
unset envrc_loaded
unset envrc_not_allowed
... | Rust | 0 |
}
#[test]
fn get_reward_with_update_credit_no_bonus() {
new_test_ext().execute_with(|| {
Timestamp::set_timestamp(INIT_TIMESTAMP);
assert_ok!(DeeperNode::im_online(Origin::signed(6)));
assert_eq!(Credit::user_credit(&6).unwrap().credit, 100);
run_to_block(BLOCKS_PER_ERA);
as... | Rust | 0 |
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QGraphicsView, QGraphicsScene, QGraphicsEllipseItem, QGraphicsRectItem, QVBoxLayout, QWidget
from PySide6.QtGui import QBrush, QPen, QPainter
from PySide6.QtCore import QRectF, Qt
# Step 1: Create custom graphical items with mouse event handling
class... | Python | 1 |
_entry(Entry::SignalAttribute(wrapped)).unwrap();
} else {
self.spns.insert(wrapped.signal_name.clone(),
SpnDefinition::from_entry(Entry::SignalAttribute(wrapped)).unwrap());
}
Ok(())
},
_ =>... | Rust | 0 |
sx };
let step_y = IntVec4 { x: sy, y: sy, z: sy, w: sy };
let swizzling_x = IntVec4 { x: 0, y: 1, z: 2, w: 3 };
let swizzling_y = IntVec4 { x: 0, y: 0, z: 0, w: 0 };
let dx = IntVec4 { x: origin.x, y: origin.x, z: origin.x, w: origin.x } + swizzling_x;
let dy = IntVec4 { x: origin.y, y: origin.y,... | Rust | 0 |
Err(_e) => decode_latin1(&input),
Ok(s) => Some(s),
}
}
pub fn normalize_line_endings(data: String) -> String {
data.replace("\r\n", "\n").replace("\n", "\r\n")
}
pub fn read_bytes_to_string(input: Vec<u8>, decode: bool, normalize: bool) -> Option<String> {
let output: String = if decode {... | Rust | 0 |
import pickle
from functools import partial
from itertools import tee as _tee
from typing import Hashable
from hypothesis import assume
from hypothesis import strategies as st
from hypothesis.strategies import composite
class PrettyIter:
"""An iterator that displays its contents."""
def __init__(self, value... | Python | 1 |
_value(*segment, value);
Ok(())
}
_ => Err(Error::IllegalDataAccess),
}
}
pub fn set_operand_value<D: Bus<Address>, I: Bus<Port>>(
cpu: &mut CPU<D, I>,
operand: &Operand,
value: u16,
) -> Result<()> {
assert_eq!(OperandSize::Wo... | Rust | 0 |
def calculate_rarity_rank(self, traits: list) -> int:
"""Calculate rarity rank based on trait rarities"""
total_rarity_score = 0
for trait in traits:
rarity_pct = float(trait["rarity"].replace("%", ""))
# Lower percentage = higher rarity score
total_rarit... | Python | 1 |
A_RESP_ERR_STALE_BROKER_EPOCH = 77,
RD_KAFKA_RESP_ERR_OFFSET_NOT_AVAILABLE = 78,
RD_KAFKA_RESP_ERR_MEMBER_ID_REQUIRED = 79,
RD_KAFKA_RESP_ERR_PREFERRED_LEADER_NOT_AVAILABLE = 80,
RD_KAFKA_RESP_ERR_GROUP_MAX_SIZE_REACHED = 81,
RD_KAFKA_RESP_ERR_FENCED_INSTANCE_ID = 82,
RD_KAFKA_RESP_ERR_ELIGIBLE_... | Rust | 0 |
));
}
#[simd_test(enable = "msa")]
unsafe fn test_msa_flog2_d() {
#[rustfmt::skip]
let a = f64x2::new(8.0, 16.0);
#[rustfmt::skip]
let r = f64x2::new(3.0, 4.0);
assert_eq!(r, mem::transmute(__msa_flog2_d(mem::transmute(a))));
}
#[simd_test(enable = "msa")]
... | Rust | 0 |
from odoo import fields, models, api
class PatientBillWizard(models.TransientModel):
_name = "patient.bill.model"
_description = "Patient Bill Details"
patient_name = fields.Char(string="Patient Name", readonly=True)
doctor_name = fields.Char(string="Doctor Name", readonly=True)
appointment_date ... | Python | 1 |
self.assertTrue(isinstance(kmf.with_df, GDF))
self.assertAlmostEqual(kmf.e_tot, -0.44429306, 6)
#mf_ref = kmf.to_cpu()
#mf_ref.run()
#self.assertAlmostEqual(kmf.e_tot, mf_ref.e_tot, 7)
def test_reset(self):
cell = pbcgto.Cell()
cell.unit = 'A'
cell.atom =... | Python | 1 |
def lookupPduClass(self, data: bytes) -> type[base.ModbusPDU] | None:
"""Use `function_code` to determine the class of the PDU."""
func_code = int(data[1])
if func_code & 0x80:
return base.ExceptionResponse
if func_code == 0x2B: # mei message, sub_function_code is 1 byt... | Python | 1 |
ice)
}).add_layer(|l| {
let rnd = rnd.clone();
LinearLayer::<_,_,_,_,100,1>::new(l,&device, move || n2.sample(&mut rnd.borrow_mut().deref_mut()), || 0.)
}).add_layer(|l| {
ActivationLayer::new(l,Sigmoid::new(&device),&device)
}).add_layer_train(|l| {
LinearOutputLayer:... | Rust | 0 |
field_begin(&TFieldIdentifier::new("skip_nulls", TType::Bool, 5))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?
}
if let Some(fld_var) = self.is_distinct {
o_prot.write_field_begin(&TFieldIdentifier::new("is_distinct", TType::Bool, 6))?;
o_prot.write_bool(fld_var)?;
o_pr... | Rust | 0 |
(&key[ 3..]), 2), 0x03FFFF03);
r[2] = and!(shr!(read32_le!(&key[ 6..]), 4), 0x03FFC0FF);
r[3] = and!(shr!(read32_le!(&key[ 9..]), 6), 0x03F03FFF);
r[4] = and!(shr!(read32_le!(&key[12..]), 8), 0x000FFFFF);
s[0] = read32_le!(&key[16..]);
s[1] = read32_le!(&key[20..]);
s[2] = read32_le!(&key[24..]);
s[3] = read32... | Rust | 0 |
}
/// Moves the selected component up, unless the first component is selected.
#[no_mangle]
pub extern "C" fn LayoutEditor_move_component_up(this: &mut LayoutEditor) {
this.move_component_up();
}
/// Moves the selected component down, unless the last component is
/// selected.
#[no_mangle]
pub extern "C" fn Layo... | Rust | 0 |
I2S0_TX_FS", "FB_AD10", "TPM0_CH1", x),
PTB4: (ptb4, 4, pcr4, ALT0), ("PTB4/LLWU_P6", "C2"), ("LPADC0_SE1", "PTB4/LLWU_P6/RF0_RF_OFF/RF0_DFT_RESET", "LPSPI0_SCK", "LPUART1_CTS", "I2S0_TX_BCLK", "FB_AD9", "TPM0_CH2", x),
PTB5: (ptb5, 5, pcr5, ALT0), ("PTB5", "D2"), (x, "PTB5/RF0_ACTIVE", "LPSPI0_SOUT", "LPUART1_... | Rust | 0 |
all the config files and
//! environment variables and printing help about all the configuration options the application
//! accepts.
//!
//! # Features
//!
//! By default, all features are turned on. However, it is possible to opt out of some to cut down
//! on dependencies. Specifically:
//!
//! * `toml` and `json` ... | Rust | 0 |
from trafilatura import fetch_url, extract
import json
import pandas as pd
from spacy_tokenization import spacy_nlp
######################################################################
###Simple script using Trafilatura to fetch privacy policy contents###
###given an Excel column with PP urls to retrieve & one to w... | Python | 1 |
_responder) = machina_virtio_device::config_builder_from_stream(
device_builder,
&mut con,
&[wire::CONTROLQ, wire::EVENTQ, wire::TXQ, wire::RXQ][..],
&guest_mem,
)
.await
.context("config_builder_from_stream")?;
// Make sure each queue has been initialized.
let contr... | Rust | 0 |
from random import random
from typing import List
def to_binary(n, bits=8):
return format((n + (1 << bits)) % (1 << bits), f'0{bits}b')
print(to_binary(-8, 11)) # 11111011
print(to_binary(-12, 11)) # 1111111111111011
print(to_binary(-20, 11))
print("11111101100")
nums = [2,3,1,5]
nums.sort()
# set
output =... | Python | 1 |
# Copyright (c) 2025, NVIDIA CORPORATION.
import string
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing import assert_eq
def test_nunique_all_null(dropna):
data = [None, None]
pd_ser = pd.Series(data)
cudf_ser = cudf.Series(data)
result = pd_ser.nunique(dropna=drop... | Python | 1 |
()
.with_title("A fantastic window!")
.with_menu(menu_bar_menu)
.build(&event_loop)
.unwrap();
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;
match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
window_id,
..
... | Rust | 0 |
logger.info("ComfyUI节点描述信息获取成功")
else:
if logger:
logger.warning("无法获取ComfyUI节点描述信息,服务将继续启动")
return True
except Exception as e:
if logger:
logger.error(f"初始化MCP服务环境时出错: {str(e)}")
return False
def get_tools_dir():
"""
... | Python | 1 |
lr=args.lr)
scheduler = StepLR(optimizer, step_size=10, gamma=0.9)
for i in range(args.epoes):
model.train()
for i_batch, sample_batched in enumerate(data_loader):
optimizer.zero_grad()
img_tensor = sample_batched["img"].to(device)
label_tensor = sample_batche... | Python | 1 |
import math
import torch
import torch.nn as nn
from abc import ABC
class ABC_Model(ABC):
def global_average_pooling_2d(self, x, keepdims=False):
x = torch.mean(x.view(x.size(0), x.size(1), -1), -1)
if keepdims:
x = x.view(x.size(0), x.size(1), 1, 1)
return x
def init... | Python | 1 |
ION},
};
pub(crate) struct NpmRunner {
runner: Runner,
npm_installer_package_directory: Utf8PathBuf,
rover_client_lint_directory: Utf8PathBuf,
}
impl NpmRunner {
pub(crate) fn new(verbose: bool) -> Result<Self> {
let runner = Runner::new("npm", verbose)?;
let project_root = PKG_PROJECT... | Rust | 0 |
l_output:
return popt, pcov, infodict, errmsg, ier
else:
return popt, pcov
def check_gradient(fcn, Dfcn, x0, args=(), col_deriv=0):
"""Perform a simple check on the gradient for correctness.
"""
x = atleast_1d(x0)
n = len(x)
x = x.reshape((n,))
fvec = atleast_1d(fcn(x, *a... | Python | 1 |
import os
from pathlib import Path
from go4py.code_gen.generate_wrapper import gen_fn
from go4py.types import CgoLimitationError, GoFunction, go4pyConfig
def template(config: go4pyConfig, functions_code: list, methods: str):
custom_incudes = "\n".join(config.custom_incudes)
custom_methods = "".join(["\n " ... | Python | 1 |
try:
from sys import maxsize
except ImportError:
print("SKIP")
raise SystemExit
# Test the range builtin at extreme values. (https://github.com/micropython/micropython/issues/17684)
#
# This is written using asserts instead of prints because the value of `maxsize` differs.
#
# Numbers & counts right up aga... | Python | 1 |
te(f"**Paciente**: {st.session_state.patient_name}")
st.write(f"**Edad**: {st.session_state.patient_age} años")
# Crear columnas para resultados
col1, col2, col3 = st.columns(3)
with col1:
st.subheader("🔍 Síntomas Detectados")
if result['symptom... | Python | 1 |
iaTransport (Length of Service Capability = 0)
0x01, 0x00,
// Recovery (LOSC = 3), Type (0x01), Window size (2), Number Media Packets (5)
0x03, 0x03, 0x01, 0x02, 0x05,
// Media Codec (LOSC = 2 + 2), Video (0x1), Codec type (0x20), Codec specific (0xB0DE)
0x07, 0x04, 0x10, 0x20, 0... | Rust | 0 |
}
#[tokio::test(flavor = "multi_thread")]
async fn subscribe_ticker() {
gen_test_code!(
OkxWSClient,
subscribe_ticker,
&vec!["BTC-USD-220624-50000-C".to_string()]
);
}
#[tokio::test(flavor = "multi_thread")]
async fn subscribe_bbo() {
gen... | Rust | 0 |
import cv2
from ultralytics import YOLO
# Load a model
# model = YOLO("yolov8n.pt")
# model = YOLO("yolov9t.pt")
# model = YOLO("yolov9c-seg.pt")
model = YOLO("yolov10n.pt")
# Use the model
results = model("video1.mp4", stream=True) # predict on an image
for result in results:
# original image
orig_img = res... | Python | 1 |
table
};
// Pre-sorted table of multihash code values, only codes tagged as
// "multihash" will be gathered in this table.
static ref TABLE_MULTIHASH: Vec<Codepoint> = {
let mut codes = Vec::default();
$(
... | Rust | 0 |
b: &StlType) -> Result<StlType, TypeError<StlType>> {
match (a, b) {
(a, b) if a == b => Ok(a.clone()),
(EmptyList, a @ List(_)) => Ok(a.clone()),
(a @ List(_), EmptyList) => Ok(a.clone()),
(a, b) => Err(StlTypeError::NoLub(a.clone(), b.clone()).into()),
}
}
fn lub_list(types... | Rust | 0 |
from setuptools import setup, find_packages
install_requires = open("requirements.txt", 'r').read().split('\n')
install_requires = [str(ir) for ir in install_requires]
setup(
name='pytorch_bio_transformations',
version='0.0.5',
description='PyTorch Biologically Motivated Transformations', # Fixed typo (r... | Python | 1 |
mut() {
match stdin.read(&mut buf) {
Err(err) => {println!("Error while reading char: {}", err)},
_ => {}
}
}
return buf[0];
}use super::Private;
use crate::Vec;
use ark_crypto_primitives::{crh::CRHGadget, CRH};
use ark_ff::fields::PrimeField;
use ark_r1cs_std::{fields::fp::FpVar, prelude::*};
use ark_relat... | Rust | 0 |
e)]
struct KeyCoordinate {
pub key: KeyValue,
pub x: f32,
pub y: f32,
}
impl KeyCoordinate {
pub fn dist(&self, other: &KeyCoordinate) -> f32 {
((self.x - other.x).powi(2) + (self.y - other.y).powi(2)).sqrt()
}
}
pub fn kbdgen_to_errormodel(input: &Path, output: &Path, _options: &Options) ... | 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 RecurringPaymentForUpdate(object):
_types = {
"id": str,
"each_amount": str,
"start_date": str,
"end_date": str,
"... | Python | 1 |
ent_accumulation_steps)
loss += hidden_layer_distill_loss
loss.backward()
# Log the loss
if i < gradient_accumulation_steps - 1:
training_log.update(
timesteps, loss, diffusion_loss, reg_loss, last_layer_distill_loss, hidden_layer_distill_loss,
... | Python | 1 |
, 'вежа', 'категорія', 'фольклор', 'стосунки', 'штукатурка', 'композиція',
'фігурне', 'хата', 'агентство', 'кондиціонування', 'відчуття', 'гроші', 'конверт', 'фольк',
'екосистема', 'дует', 'сервер', 'вугілля', 'криптографія', 'адвокат', 'матч', 'ландшафт',
'куратор', 'уважний', 'штани', 'мороз', 'гума', 'по... | Python | 1 |
discriminant(found_value) {
return Err(nom::Err::Error((input, ErrorKind::OneOf)));
}
}
Ok((input, OType::ArrayType(found_otype)))
}
/// Parses an object. This essentially recurses the `get_vec_parser` to find values inbetween `{}` tags.
///
/// *NOTE: This should not be used as a name of ... | Rust | 0 |
type
/// that can be converted to `isize` with the `as` keyword.
///
/// For example, `s![0..4;2, 6, 1..5, NewAxis]` is a slice of the first axis
/// for 0..4 with step size 2, a subview of the second axis at index 6, a slice
/// of the third axis for 1..5 with default step size 1, and a new axis of
/// length 1 at th... | Rust | 0 |
# 1. 처음 입력받은 2가지 숫자로 N*M 행렬을 만든다
# 2. N*M 행렬을 하나 더 만든다.
# 3. 출력: 처음 만든 행렬과 두 번째로 만든 행렬을 더한 후 출력한다.
temp = input().split()
rows, cols = int(temp[0]), int(temp[1])
# print(n, m)
# 첫 번째 배열
array1 = [input().split() for _ in range(rows)]
# 두 번째 배열
array2 = [input().split() for _ in range(rows)]
array3 = [[0] * cols for ... | Python | 1 |
rth":
if bw_image[location[0] - 1, location[1]] < color_threshold:
location[0] = location[0] - 1
heading = "north"
else:
dir = random.randint(1, 2)
... | Python | 1 |
namespace A {
struct Bob {
uint32_t a;
uint32_t b;
};
Bob get_bob();
}
uint32_t give_bob(A::Bob bob);
"};
let rs = quote! {
assert_eq!(ffi::give_bob(ffi::A::get_bob()), 2);
};
run_test(cxx, hdr, rs, &["give_bob... | Rust | 0 |
DIR, 'cookies.txt')
with open(cookies_txt, 'w', encoding='utf-8') as f:
f.write("# Netscape HTTP Cookie File\n")
f.write(f"# Generated on {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n")
for cookie in self.collected_cookies:
domain = cookie['domain']
... | Python | 1 |
from tkinter import *
root = Tk()
root.geometry("300x600")
root.title('Layouts')
label1 = Label(root, text="Welcome", bg="red", fg="white")
label1.pack()
label2 = Label(root, text="TO", bg="green", fg="black")
label2.pack()
label3 = Label(root, text="Python", bg="blue", fg="white")
label3.pack()
label4 = Label(root... | Python | 1 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange, repeat
from code_models.hopfield import Hopfield, STHMLayer
from math import ceil
class CoarseGrain(nn.Module):
def __init__(self, d_model, win_size, norm_layer=nn.LayerNorm):
super().__init__()
self.d_... | Python | 1 |
let sphere_two = Box::new(MSphere::new(
Vec3::new(0.0, 0.75, -1.0),
Vec3::new(0.0, 0.5, -1.0),
0.5,
0.0,
1.0,
mat_two,
));
let sphere_three = Box::new(MSphere::new(
Vec3::new(1.25, 1.0, -1.0),
Vec3::new(1.25, 0.5, -1.0),
0.5,
0.... | Rust | 0 |
from MNIST.model import train_model, evaluate_model, prepare_data, MNISTClassifier
from configuration.init_config import get_optimizer_config
import torch.optim as optim
import torch.nn as nn
import torch
import logging
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# Set up loging
lo... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - 监控平台 (BlueKing - Monitor) available.
Copyright (C) 2017-2025 Tencent. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain ... | Python | 1 |
ffi::wayland::wl_proxy_marshal(
proxy, ShmPoolRequest::Destroy as u32
);
}
}
/// This request will cause the server to remap the backing memory
/// for the pool from the file descriptor passed when the pool was
/// created, but using the new size. Thi... | Rust | 0 |
from django.urls import path
from . import views
urlpatterns = [
path('',views.PostListView.as_view(),name='post_list'),
path('about/',views.AboutView.as_view(),name='about'),
path('post/<int:pk>', views.PostDetailView.as_view(), name='post_detail'),
path('post/new/', views.CreatePostView.as_view(), n... | Python | 1 |
}
#[tracing::instrument(target = "r1cs", skip(circuit_pvk, x, proof))]
fn verify_with_processed_vk(
circuit_pvk: &Self::ProcessedVerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar,
) -> Result<Boolean<FSF>, SynthesisError> {
Ok(
MarlinVerifierGadget::<F,... | Rust | 0 |
if task.schedule:
execution_context["cron_expression"] = task.schedule
# 异步触发Celery任务
from app.services.application.tasks.workflow_tasks import generate_report_workflow
celery_task = generate_report_workflow.apply_async(
args=(
request.task_id,
... | Python | 1 |
[DEFAULT]
/// `Partial` -> VIPS_FOREIGN_PARTIAL = 1
/// `Bigendian` -> VIPS_FOREIGN_BIGENDIAN = 2
/// `Sequential` -> VIPS_FOREIGN_SEQUENTIAL = 4
/// `All` -> VIPS_FOREIGN_ALL = 7
pub flags: ForeignFlags,
/// memory: `bool` -> Force open via memory
/// default: false
pub memory: boo... | Rust | 0 |
def test_unidiffuser_text2img_multiple_images_with_latents(self):
device = 'cpu'
components = self.get_dummy_components()
unidiffuser_pipe = UniDiffuserPipeline(**components)
unidiffuser_pipe = unidiffuser_pipe.to(device)
unidiffuser_pipe.set_progress_bar_config(disable=None)
unidiffuser_pipe.se... | Python | 1 |
(self.lru[index].word >= entry.word || self.lru[index].count() == 0) {
if self.lru[index].word == entry.word {
if self.lru[index].block_id != entry.block_id {
self.lru[index].set_nonrandom_flag();
... | Rust | 0 |
/// #
/// let mut set = LinkedListSet::new();
/// let list_index = set.new_list();
/// let data = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
/// set.extend(list_index, data);
///
/// for item in set.iter_mut(list_index) {
/// *item = 2 * (*item);
/// }
///
/// let expected = v... | Rust | 0 |
64,
-63,
-42,
-69,
-1337,
-33,
-32,
-31,
-17,
-16,
-15,
-9,
-8,
-7,
-2,
-1,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
15,
... | Rust | 0 |
fn test_set_level_shifter_threshold() {
let mut parser = command();
let tgt = "set_level_shifter_threshold -voltage 0.1 -percent 0.1";
let ret = parser.parse(tgt).unwrap().0;
assert_eq!(
Command::SetLevelShifterThreshold(SetLevelShifterThreshold {
voltage: Some(0.1),
per... | Rust | 0 |
t_vertices, new_opt_joints, new_opt_pose, new_opt_betas, \
new_opt_cam_t, new_opt_joint_loss = _smplify(
pred_pose.detach(),
pred_betas.detach(),
pred_cam_t.detach(),
pred_jaw_pose.detach(),
pred_leye_pose.detach(),
pred_reye_pose.detach(),... | Python | 1 |
import os
import PIL.Image as Image
import struct
import numpy as np
png_folder = r"D:\10947\Download\HSHINTAI2_NG_改(不包括无对应翻译文件)\HSHINTAI2_NG"
old_bmp = r"decode"
for file in os.listdir(png_folder):
if not file.endswith(".png"):
continue
print(file)
image = Image.open(f"{png_folder}/{file}")
f... | Python | 1 |
_addr(device) + 0x28;
assign(addr, read_word(addr) & !(0x1 << 7));
}
pub fn uart_get_irq_statuses(device: Device) -> u32 {
return read_word(get_addr(device) + 0x14);
}
pub struct UartClearIrqConfig {
pub rx_overrun: bool,
pub rx_idle: bool,
pub rx_data_full: bool,
pub rx_line_break: bool,
... | Rust | 0 |
n float, the precision is lower than `~0.2 arcsec` only!!
/// - At depth 13, the precision on `(dx, dy)` is better than `(1/512, 1/512)`, i.e. 2e-3.
pub fn hash_with_dxdy(depth: u8, x: f32, y: f32, z: f32) -> (u32, f32, f32) {
assert!(depth <= 14);
assert!(-1.0 <= x && x <= 1.0);
assert!(-1.0 <= y && y <= 1.0);
... | Rust | 0 |
CH5CFGR1, DFSDM_CH5CFGR2, DFSDM_CH5DATINR, DFSDM_CH5DLYR,
DFSDM_CH5WDATR, DFSDM_CH6AWSCDR, DFSDM_CH6CFGR1, DFSDM_CH6CFGR2, DFSDM_CH6DATINR,
DFSDM_CH6DLYR, DFSDM_CH6WDATR, DFSDM_CH7AWSCDR, DFSDM_CH7CFGR1, DFSDM_CH7CFGR2,
DFSDM_CH7DATINR, DFSDM_CH7DLYR, DFSDM_CH7WDATR, DFSDM_FLT0AWCFR, DFSDM_FLT0AWHTR,
DF... | Rust | 0 |
m,
&is_flag,
&mut carrier,
&mut lastdrop,
&*entities,
).join()
.filter(|(_, _, _, carrier, _, _)| {
carrier.0.is_some() && carrier.0.unwrap() == player
})
.for_each(|(fpos, team, _, carrier, lastdrop, ent)| {
let packet = GameFlag {
ty: FlagUpdateType::Position,
flag... | Rust | 0 |
value);
if xor {
ip = ip ^ STUN_MAGIC;
}
Ok(SocketAddr::new(IpAddr::V4(ip.into()), port))
}
Family::V6 => {
if value.len() != 16 {
return Err("MAPPED_ADDRESS: Invalid address size for IPv6.".i... | Rust | 0 |
as_ref(), task, 1).await;
router
.must_mut_task_info("error_prone", |i| {
i.storage = Arc::new(ErrorStorage::with_first_time_error(i.storage.clone()))
})
.await;
check_on_events_result(&router.on_events(build_kv_event(0, 10)).await);
assert!(
... | Rust | 0 |
class Solution:
def commonChars(self, A: List[str]) -> List[str]:
ans = []
commonCount = [math.inf] * 26
for a in A:
count = [0] * 26
for c in a:
count[ord(c) - ord('a')] += 1
for i in range(26):
commonCount[i] = min(commonCount[i], count[i])
for c in string.ascii_l... | Python | 1 |
//OPENPGPKEY = 61,
//CSYNC = 62,
//ZONEMD = 63,
//SPF = 99,
//UINFO = 100,
//UID = 101,
//GID = 102,
//UNSPEC = 103,
//NID = 104,
//L32 = 105,
//L64 = 106,
//LP = 107,
//EUI48 = 108,
//EUI64 = 109,
//TKEY = 249,
//TSIG = 250,
//IXFR = 251,
//AXFR = 252,
//MAILB = 253,
//MAILA = 254,
//ALL = 255,
//URI = 256,
//CAA = 25... | Rust | 0 |
def reverso_numero(numero):
reverso = int(str(numero)[::-1])
return reverso
numero_informado = int(input("Informe um número inteiro: "))
resultado = reverso_numero(numero_informado)
print(f"O reverso do número {numero_informado} é: {resultado}")
| Python | 1 |
elf, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "The controller lifecycle stopped responding.")
}
}
impl std::error::Error for ControllerError {}
impl<Key, Value> DemandMapLaneController<Key, Value>
where
Key: Clone + Form,
Value: Form,
{
/// Syncs this lane. Called by the uplink.
... | Rust | 0 |
g.auto_to_case_author = True
cls.case.emailing.save()
@patch("tcms.core.utils.mailto.send_mail")
def test_send_mail_to_case_author(self, send_mail):
expected_subject = _("DELETED: TestCase #%(pk)d - %(summary)s") % {
"pk": self.case.pk,
"summary": self.case.summary,
... | Python | 1 |
# Estudo de caso
amostra = []
sex_ent = []
ida_ent = []
ava_ent = []
qtd_ava_s = 0
qtd_ava_n = 0
for entrevistado in range(3):
sexo = input("Qual o seu sexo (M/F)? ") # preciso de tratamento de erro para aceitar m/f minúsculo e recusar números ou outras letras...
sex_ent.append(sexo)
idade = int(input("Qu... | Python | 1 |
n be used to attach to via Target.attachToTarget or similar APIs.
:param manifest_id:
:param url: *(Optional)*
:returns: ID of the tab target created as a result.
'''
params: T_JSON_DICT = dict()
params['manifestId'] = manifest_id
if url is not None:
params['url'] = url
cmd_dict... | Python | 1 |
lPointer {
event: self.event,
history_index: self.history_index,
pointer_index: self.next_pointer_index,
_marker: std::marker::PhantomData,
};
self.next_pointer_index += 1;
Some(ptr)
} else {
None
... | Rust | 0 |
= tf.zeros([numberOfBatches, cameraReader.numberOfCameras, renderResolutionV, renderResolutionU, 3]),
extrinsics_input=[cameraReader.extrinsics, cameraReader.extrinsics, cameraReader.extrinsics],
intrinsics_input=[cameraReader.intrinsi... | Python | 1 |
rSeriesRing(GF(5))
sage: K = R.fraction_field()
sage: H = matrix(K, 4, 4, [(t^(i+j)).add_bigoh(10)
....: for i in range(4) for j in range(4)])
sage: H
[ 1 + O(t^10) t + O(t^10) t^2 + O(t^10) t^3 + O(t^10)]
... | Python | 1 |
from string import printable
import pytest
from readchar import key, readchar
@pytest.mark.parametrize("c", printable)
def test_printableCharacters(patched_stdin, c):
patched_stdin.push(c)
assert c == readchar()
@pytest.mark.parametrize(
["seq", "key"],
[
("\n", key.LF),
("\r", key... | Python | 1 |
assert_eq!(BoardCoord(4, 0).idx(), 4);
assert_eq!(BoardCoord(0, 4).idx(), 20);
assert_eq!(BoardCoord::from(11), BoardCoord(1, 2));
assert_eq!(BoardCoord(1, 2).idx(), 11);
}
#[test]
#[serial(board_size)]
fn test_3x6() {
set_board_size((6, 3));
// x 0 1 2
... | Rust | 0 |
.flush()
}
}
impl Seek for MemWriterFakeStream {
fn tell(&self) -> IoResult<u64> {
let &MemWriterFakeStream(ref s) = self;
s.tell()
}
fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> {
let &MemWriterFakeStream(ref mut s) = self;
s.seek(pos, style)
}
}
... | Rust | 0 |
ChrWalkTo(0x00FE, -79060, 0, 5500, 3000, 0x00)
ExitThread()
DispatchAsync(0x0101, 0x0001, lambda_3F19)
Sleep(600)
@scena.Lambda('lambda_3F39')
def lambda_3F39():
ChrWalkTo(0x00FE, -79060, 0, 6400, 3000, 0x00)
ExitThread()
DispatchAsync(0x0102, 0x0001, lambda_3F39)
... | Python | 1 |
#
# greater_than paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle as pdpd
import sys
def greater_than(name: str, x, y, data_type, cast_to_fp32=False):
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()):
node_x = ... | Python | 1 |
})
}
/// Returns the path to the database directory.
#[must_use]
pub fn path(&self) -> &Path {
&self.data.path
}
/// Returns the vault used to encrypt this database.
pub fn context(&self) -> &Context<File::Manager> {
&self.data.context
}
/// Returns the tr... | Rust | 0 |
name: "OUT_OF_MEMORY",
kind: Kind::Error,
message: Some("out of memory"),
};
/// too many connections
pub const TOO_MANY_CONNECTIONS: State = State {
code: "53300",
name: "TOO_MANY_CONNECTIONS",
kind: Kind::Error,
message: Some("too many connections"),
};
/// configuration limit exceeded
pu... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.