text string | label_name string | labels int64 |
|---|---|---|
# -*- coding: utf-8 -*-
# Created on 2018-08-15
# author: 欧度智能,https://www.odooai.cn
# email: 300883@qq.com
# resource of odooai
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Odoo在线中文用户手册(长期更新)
# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# https://www.odooa... | Python | 1 |
_ticker,
&vec!["BTC_USDT".to_string()]
);
}
#[test]
fn subscribe_candlestick() {
gen_test_subscribe_candlestick!(GateSpotWSClient, &vec!["BTC_USDT".to_string()], 10);
gen_test_subscribe_candlestick!(GateSpotWSClient, &vec!["BTC_USDT".to_string()], 2592000);
}
}
#[cf... | Rust | 0 |
},
(Some(_), Some(c)) => {
if '0' <= c && c <= '9' {
match c.to_digit(10) {
Some(p) => {
let p = u8::try_from(p).map_err(|_| ParseSymbolError::BadPrecision)?;
... | Rust | 0 |
.shift(DOWN * 0.02 + RIGHT * 0.02)
final_note_shadow.set_z_index(final_note.z_index - 1)
stm32_logo = SVGMobject("C:\\Manim\\Assets\\stm32.svg").move_to(
final_note.get_corner(DR)
)
stm32_logo.set_z_index(final_note.z_index - 2)
if not IS_DEBUGGING:
self... | Python | 1 |
artmentCode",
/// `geolocDepartment`:
departmentPosition, "departmentPosition",
/// `depiction description (caption)`: This property can be used to map image captions from Infoboxes
depictionDescription, "depictionDescription",
/// `depth (μ)`: Is a measure of the distance between a reference heigh... | Rust | 0 |
h = img_thre_1[i, j]
if h == 255:
a = j
white_min.append(a)
break
a = min(white_min)
for q in range(height_2 - 1, -1, -1):
for w in range(width_2 - 1, -1, -1):
ps = img_thre_1[q, w]
if ps == 255:
... | Python | 1 |
except Exception as e:
logger.error(f"处理联系人详情批量请求时出错: {str(e)}")
import traceback
logger.error(traceback.format_exc())
return JSONResponse(
content={
'success': False,
'error': f'服务器错误: {str(e)}'
... | Python | 1 |
Scalar, ZkFFTSettings, ZPoly>();
}
#[test]
fn reduce_partials_random_() {
reduce_partials_random::<blsScalar, ZkFFTSettings, ZPoly>();
}
#[test]
fn check_test_data_() {
check_test_data::<blsScalar, ZkFFTSettings, ZPoly>();
}
#[test]
fn zero_poly_known_() {
... | Rust | 0 |
# Generated by Django 3.2.12 on 2022-12-28 12:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('trainings', '0004_outsi... | Python | 1 |
max_tokens=int(self.config.out_max_tokens),
)
except Exception as e:
print(f"[final_output] failed: {e}", file=sys.stderr)
return None
# ------------------------ Orchestration ------------------------
def run_for_text(self, *, situation: str) -> Dict[str, An... | Python | 1 |
Напишите программу, на вход которой подаётся список чисел одной строкой.
Программа должна для каждого элемента этого списка вывести сумму двух его
соседей. Для элементов списка, являющихся крайними, одним из соседей
считается элемент, находящий на противоположном конце этого списка.
Например, если на вход подаётся ... | Python | 1 |
e(change_x_scale=0.025)
if run_video:
video_frame.next_frame()
screen.fill((0, 0, 0))
video_frame.update()
if show_background:
video_frame.show()
for i in range(450):
x, y = tree.pixels[str(i)]
if not all_red:
pixel_color = video_frame.get_color(x, y, ... | Python | 1 |
u().item()
result = torch.cat((result, output.cpu()),0) # todo: check this. -> looks good to me
truth = torch.cat((truth, targets.cpu()), 0)
return total_loss / len(data_source_x),result,truth
def read_npy(type_name,epochs,choice_MLP,input_dim,time_len,map_fea_num, map_num, enh_fea_num, e... | Python | 1 |
, Param {
mvp: [[0.0; 4]; 4],
color: [color.0, color.1, color.2, color.3],
_r: PhantomData,
}).unwrap();
batch.state = batch.state.depth(gfx::state::Comparison::LessEqual, false);
batch.slice.prim_type = gfx::PrimitiveType::Line;
Field {
no... | Rust | 0 |
verified_count += 1
success = all_passed and verified_count == len(test_messages)
details = f"测试{len(test_messages)}条消息, 通过: {verified_count}"
self.log_test("签名验证测试", success, details)
return success
except Exception as ... | Python | 1 |
# Copyright (c) 2018-2024 NCC Group Plc
#
# 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 without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, ... | Python | 1 |
# generation_prompt = 'Could you provide a detailed analysis of artifacts in this photo? Please output with interleaved segmentation masks for the corresponding parts of the answer.'
generation_prompt = 'Please provide a detailed analysis of artifacts in this photo, considering physical artifacts (e.g., optical di... | Python | 1 |
default_app_config = 'adjallocation.apps.AdjAllocationConfig'
| Python | 1 |
work_time = sum(sum(times)
for times in self.network_requests.values())
table.add_row("Total Network Time", f"{total_network_time:.2f}s")
console.print(table)
def _display_simple_results(self):
"""Display simple text results"""
console.print... | Python | 1 |
t = int(input()) # Number of test cases
for i in range(t):
n = int(input()) # Number of participants
team = list(map(int, input().strip().split())) # List of team numbers
team_info = {} # Dictionary to store team information
rank = 1 # Initialize rank
result = [] # List to store results
... | Python | 1 |
# Conversor de Moedas em Python
# Taxas fixas fictícias para exemplo
def converter(valor, moeda_origem, moeda_destino):
"""
Converte um valor de uma moeda para outra usando taxas fixas.
"""
taxas = {
"USD": 1.0, # Dólar como base
"BRL": 5.0, # Real
"EUR": 0.9, # E... | Python | 1 |
a>;
fn send_special_data(&self, params: &serde_json::Value) -> Result<JsonData, JsonData>;
fn process_data(&mut self, pop: &mut Vec<Self::CellType>, data: &GenalgoData);
fn check_generation_over(&self, genalgo: &Lab<Self::CellType>) -> bool;
fn reset(&mut self);
}
pub type AlgoID = usize;
#[derive(Cl... | Rust | 0 |
: Mmio<u32>,
_0xfc: Mmio<u32>,
pub vendor_code: Mmio<u32>,
pub fab_code: Mmio<u32>,
pub lot_code_0: Mmio<u32>,
pub lot_code_1: Mmio<u32>,
pub wafer_id: Mmio<u32>,
pub x_coordinate: Mmio<u32>,
pub y_coordinate: Mmio<u32>,
_0x11c: Mmio<u32>,
_0x120: Mmio<u32>,
pub sata_calib: M... | Rust | 0 |
ift in each step, it can be a list of two integers to specify different shift sizes for the first step and others
)
cache_drop_size: int = 0 # the number of steps to drop from the cache
last_channel_cache_size: int = 0 # the size of the needed cache for last channel layers
valid_out_len: int = (
... | Python | 1 |
{
REVISION_R::new((self.bits & 0x0f) as u8)
}
}
#[doc = "Read the CPU ID Base Register to determine: the ID number of the processor core, the version number of the processor core, the implementation details of the processor core.
This register you can [`read`](crate::generic::Reg::read). See [API](https:... | Rust | 0 |
#[derive(Clone, Eq, PartialEq)]
pub struct Test;
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = 1024;
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75... | Rust | 0 |
use std::io::{self, Read};
use std::process::{Command, Stdio};
#[test]
fn test_scripts() -> anyhow::Result<()> {
fs::create_dir_all("temp")?;
for entry in fs::read_dir("test-scripts")? {
let entry = entry?;
let path = entry.path();
let extension = path.extension().and_then(|ext| ext.... | Rust | 0 |
# -*- coding: utf-8 -*-
import torch.nn as nn
import torch.nn.functional as F
from utils import convert_to_gray
class GuidedBackProp(object):
def __init__(self, model):
super(GuidedBackProp, self).__init__()
self.model = model.eval()
for module in self.model.named_modules():
... | Python | 1 |
lf.inputs
}
fn outputs_committed(&self) -> &Vec<Output> {
&self.outputs
}
fn overage(&self) -> i64 {
(REWARD as i64) - (self.total_fees() as i64)
}
}
/// Default properties for a block, everything zeroed out and empty vectors.
impl Default for Block {
fn default() -> Block {
Block {
header: Default::def... | Rust | 0 |
error_buffer
.0
.lock()
.map(|diagnostics| diagnostics.clone())
.ok()
.unwrap_or_default()
.iter()
.map(|diagnostic| {
let message = diagnostic.message();
let code = diagnostic.get_code().and_then(|m| {
if let Diagnostic... | Rust | 0 |
new(poll.registry(), waker_token).unwrap());
let queue = Arc::new(NotificationQueue::new(waker));
let channel_notifier = Arc::clone(&queue);
let channel_1_id = NotificationId::gen_next();
let (tx1, rx1) = channel::channel(channel_notifier, channel_1_id);
let channel_notifier = Arc::clone(&queue);... | Rust | 0 |
nts
}
pub fn output_events_mut(&mut self) -> &mut EventBuffer {
&mut self.output_events
}
pub fn activate(&mut self) {
// Setting up some buffers
let configuration = PluginAudioConfiguration {
sample_rate: 44_100.0,
frames_count_range: 32..=32,
}... | Rust | 0 |
read_line(&mut line).expect("EOF");
let mut last: i32 = line.trim().parse().expect("int");
let mut count: i32 = 0;
loop {
line = String::new();
io::stdin().read_line(&mut line).expect("EOF");
let cur: i32 = match line.trim().parse() {
Ok(r) => r,
Err(_) => bre... | Rust | 0 |
itself, but it works. You can use this
/// syntax when you haven't yet decided how your mesh should look like.
///
/// ```
/// #![feature(proc_macro_hygiene)]
/// use lox::{
/// mesh,
/// ds::SharedVertexMesh,
/// };
///
///
/// let empty_mesh = mesh! {
/// type: SharedVertexMesh,
/// vertices: [],
///... | Rust | 0 |
werItemError::FileNotFound)),
};
let sharing = match file.share_by(login_user, target.to_scope()) {
Ok(sharing) => sharing,
Err(err) => {
return Err(UseCaseError::UseCase(
FormAnswerItemError::from_share_error(err),
... | Rust | 0 |
(|s| s.to_string()).collect(),
}),
..Default::default()
}),
..Default::default()
}
}
fn selector_with_name(name: &str) -> BottlerocketShadowSelector {
BottlerocketShadowSelector {
node_name: name.to_string(),
node_u... | Rust | 0 |
"),
[
("test_file.txt"),
("output/test_file"),
],
)
def test_parallelized_download_file_using_http_uri_with_failed_downloads(
databricks_model_artifact_repo, remote_file_path
):
signed_uri_mock = {
"signed_uri": "https://my-amazing-signed-uri-to-rule-them-all.com/1234-numbers-yay... | Python | 1 |
raw::c_char,
);
}
extern "C" {
pub fn sigar_log_impl_set(
sigar: *mut sigar_t,
data: *mut ::std::os::raw::c_void,
impl_: sigar_log_impl_t,
);
}
extern "C" {
pub fn sigar_log_impl_file(
sigar: *mut sigar_t,
data: *mut ::std::os::raw::c_void,
level: ::std::o... | Rust | 0 |
Kind::Comma)?;
}
let tk_close = self.parser.expect(syntax::TokenKind::ParenClose)?;
Ok(expr::Expr::Call(leaf.span().join(&tk_close.span), Box::new(leaf), args))
}
fn parse_leaf(&mut self) -> Result<expr::Expr, ()>
{
if self.parser.next_is(0, syntax::TokenKind::BraceOpen)
{ self.parse_block() }
... | Rust | 0 |
def capitalize_metric(met):
return ' '.join(s.capitalize() for s in met.split('_'))
| Python | 1 |
}
minty_impl! {
mint::Vector2<f32> => glam::Vec2,
mint::Vector3<f32> => glam::Vec3,
mint::Vector4<f32> => glam::Vec4,
mint::Vector2<i32> => glam::IVec2,
mint::Vector3<i32> => glam::IVec3,
mint::Vector4<i32> => glam::IVec4,
mint::Vector2<u32> => glam::UVec2,
mint::Vector3<u32> => gla... | Rust | 0 |
f, "ECDSA crypto error: {}", err),
EcdsaCrypto => write!(
f,
"cryptographic error (signature verification or public key recovery failed)"
),
// FIXME: IoError(ref err) => write!(f, "IO error: {}", err),
IoError => write!(f, "database lookup... | Rust | 0 |
!(
kernel::process::ProcessPrinterText,
kernel::process::ProcessPrinterText::new()
)
}
}
use log::trace;
use log::debug;
use log::info;
use crate::util::get_env_as_f32;
const INITIALIZING_FINISHED:u8 = 0;
pub struct Simple {
indeces: [u32; 100],
current_pixel_avg: u8,
... | Rust | 0 |
errors::Error as JniError;
use jni::objects::{JFieldID, JObject};
use jni::signature::JavaType;
use jni::JNIEnv;
use crate::convert::{
FromJavaValue, IntoJavaValue, JValueWrapper, JavaValue, Signature, TryFromJavaValue,
TryIntoJavaValue,
};
use crate::jni::objects::JValue;
#[derive(Clone)]
pub struct Field<'e... | Rust | 0 |
tats.grid_variance, np.ndarray):
# plot sill heatmap
logger.info('- Plot variogram sill per gridcell.')
df_stats(
df_stats.grid_variance,
'grid_variance',
workdir=os.path.join(workdir, 'figures'),
drawgridlines=drawgridlines,
colorbarfm... | Python | 1 |
impl Future<Output = ProcessResult<()>> {
self._signal(Signal::Kill)
}
// Linux-specific methods
pub fn io_counters(&self) -> BoxFuture<ProcessResult<IoCounters>> {
procfs::io(self.pid).boxed()
}
pub fn net_io_counters(&self) -> BoxStream<ProcessResult<heim_net::IoCounters>> {
... | Rust | 0 |
import torch
import torchvision.models as models
import pytrt as tp
import numpy as np
import os
os.chdir("../workspace/")
device = "cuda" if torch.cuda.is_available() else "cpu"
# 基于torch的tensor输入
input = torch.full((5, 3, 224, 224), 0.3).to(device)
model = models.resnet18(True).eval().to(device)
trt_model ... | Python | 1 |
ull { .. } => 3,
goto_w { .. } => 5,
jsr_w { .. } => 5,
breakpoint => 1,
reserved => 1,
impdep1 => 1,
impdep2 => 1
}
}
}#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Encode, Decode};
use frame_support::{decl_module, decl_sto... | Rust | 0 |
from pydantic import BaseModel
from backend.data.block import Block, BlockInput
from backend.data.block_cost_config import BLOCK_COSTS
from backend.data.cost import BlockCostType
from backend.util.settings import Config
config = Config()
class UsageTransactionMetadata(BaseModel):
graph_exec_id: str | None = Non... | Python | 1 |
, see:
// http://infocenter.arm.com/help/topic/com.arm.doc.dht0008a/DHT0008A_arm_synchronization_primitives.pdf
asm!("dmb sy");
// also raise a signal to indicate the spinlock has been changed (this trigger all WFE's to continue
// processing) but do data syncronisation barrier upfront to ensure... | Rust | 0 |
start += i + 1;
}
count
}
pub fn naive1_count(b1: u8, haystack: &[u8]) -> usize {
let mut count = 0;
let mut start = 0;
while let Some(i) = naive::memchr(b1, &haystack[start..]) {
count += 1;
start += i + 1;
}
count
}
pub fn memchr2_count(b1: u8, b2: u8, haystack: &[u8]) ->... | Rust | 0 |
from rich.traceback import install
install()
# install(show_locals=True)
from .service import MobiLLMService
if __name__ == "__main__":
svc = MobiLLMService()
result = svc.invoke("""[security analysis]
Event Details:
- Source: MobieXpert
- Name: RRC Null Cipher
- Cell ID: 20000
- UE ID: 54... | Python | 1 |
import math
class GraphDiameter:
def __init__(self):
return
@staticmethod
def get_diameter(dct, root=0):
n = len(dct)
dis = [math.inf] * n
stack = [root]
dis[root] = 0
while stack:
nex = []
for i in stack:
for j in dc... | Python | 1 |
continue;
}
match segs.get(1).unwrap().parse::<i32>() {
Ok(n) => {
stages.push(n);
}
Err(_) => (),
}
}
}
stages.sort_unstable();
stages
}
fn mk_cmds_file_path(mut base_path: PathBuf) -... | Rust | 0 |
nwards()
## Compute internal forces for each combination
for ls in limitStates:
ls.analyzeLoadCombinations(combContainer= combContainer, setCalc= ec3CalcSet, bucklingMembers= ec3Members)
## Check normal stresses.
### Limit state to check.
limitState= limitStates[0]
### Build controller.
controller= limitState.get... | Python | 1 |
, payload) = match self {
codec::execution_outcome::Status::SuccessValue(value) => {
// In next iteration of NEAR protobuf format, `value.value` will a pre-decoded Vec<u8> directly.
let value = match base64::decode(&value.value)
.with_context(|| "FunctionC... | Rust | 0 |
p the IPC server and disconnect from all MCP servers"""
if not self.running:
return
logger.info("Stopping MCP daemon server...")
# Stop server
if self.server:
self.server.close()
await self.server.wait_closed()
self.se... | Python | 1 |
self.module_manager,
self.project_manager,
self.temp_manager,
self.xml_manager)
self.market_hours_database = MarketHoursDatabase(self.lean_config_manager)
self.... | Python | 1 |
(&self) -> &[u8] {
&self.mac
}
pub fn set_mac(&mut self, mac: &[u8]) {
self.mac.clone_from_slice(mac);
}
}
impl Message for SrdConfirm {
fn read_from<R: Read>(reader: &mut R) -> Result<Self>
where
Self: Sized,
{
let mut cbt = [0u8; 32];
reader.re... | Rust | 0 |
print(f"{file_to_extract} not found in the ZIP file.")
def extract_goodbyedpi(zip_name, bin_directory='bin'):
"""Extracts required files from the x86_64 directory of a ZIP file and removes the ZIP file afterward."""
# Ensure the `bin` directory exists
os.makedirs(bin_directory, exist_ok=True)
... | Python | 1 |
_map = {'吧台': {'灶台', '橱柜', '工作台', '服务台', '收银台', '蛋糕柜', '充电处', '冰箱'},
'餐桌': {'沙发', '大门', '窗户', '休闲区', '墙角', '椅子', '书架'},
'沙发': {'餐桌', '窗户', '音响', '休闲区', '墙角', '书架'},
'灶台': {'吧台', '橱柜', '工作台', '服务台', '收银台', '蛋糕柜', '冰箱'},
'大门': {'吧台', '灯开关', '空调开关', '卫生间', '墙角'},
'灯开关... | Python | 1 |
et_opts();
//! # if opts.get_tcp_port() == 3307 && opts.get_pass() == Some("password") {
//! // See docs on the `OptsBuilder`'s methods for the list of options available via URL.
//! let pool = my::Pool::new("mysql://root:password@localhost:3307/mysql").unwrap();
//! # }
//! # let pool = my::Pool::new_man... | Rust | 0 |
enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
};
... | Rust | 0 |
n: Annotated[str, typer.Option(help="Repository description")] = "",
private: Annotated[bool, typer.Option(help="Whether the repository should be private")] = False,
license_template: Annotated[
str | None, typer.Option(help="License template to use (e.g., mit, apache-2.0)")
] = "mit",
setup_pyp... | Python | 1 |
ll_domains(today=None):
today = today or datetime.date.today()
for domain in Domain.get_all_names():
num_users = CommCareUser.total_by_domain(domain)
record_date = today - relativedelta(days=1)
try:
DomainUserHistory.objects.create(
domain=domain,
... | Python | 1 |
Qmx_Exported_DataActiveEvent_Lvl_ActiveLvl:
::std::os::raw::c_ushort =
5684;
pub const DAQmx_Exported_RdyForStartEvent_OutputTerm: ::std::os::raw::c_ushort
=
5641;
pub const DAQmx_Exported_RdyForStartEvent_Lvl_ActiveLvl:
::std::os::raw::c_ushort =
5969;
pub const DAQmx_Exported... | Rust | 0 |
pu").manual_seed(0)
output = pipe(
prompt="anime prompts",
image=image,
mask_image=mask_image,
num_inference_steps=2,
generator=generator,
output_type="np",
)
image = output.images[0]
mem_bytes = torch.cuda.max_memo... | Python | 1 |
import argparse
import os
import torch
import torch.distributed as dist
"""
Send simple tensors in a ring with send/recv or isend/irecv.
"""
def isend_irecv(send: torch.Tensor, recv: torch.Tensor, rank: int, world_size: int):
ops = []
ops.append(dist.P2POp(dist.isend, send, (rank + 1) % world_size))
ops... | Python | 1 |
ir_produtos()
elif opcao == "4":
ordenar_produtos()
elif opcao == "5":
salvar_em_arquivo()
elif opcao == "6":
carregar_do_arquivo()
elif opcao == "7":
salvar = input("Deseja salvar o estoque antes de sair? (S/N): ").lower()
if s... | Python | 1 |
import re
import typer
from rich.console import Console
from rich.table import Table
from rich.align import Align
from constants import Perturbation, SEPARATOR
console = Console()
def main(
model: str = typer.Option(help="Model to use for analysis"),
perturbation: Perturbation = typer.Option(help="Perturbat... | Python | 1 |
fn rand_array_len(range: Option<(u64, u64)>) -> u64 {
let mut rng = thread_rng();
if let Some((mut min, mut max)) = range {
if min > max {
std::mem::swap(&mut min, &mut max);
}
if min == max {
max += 1;
}
rng.gen_range(min..max)
} else {
... | Rust | 0 |
key)
if value:
params.update({parent_config.request_option.field_name: value})
return params
def stream_slices(self) -> Iterable[StreamSlice]:
"""
Iterate over each parent stream's record and create a StreamSlice for each record.
For each... | Python | 1 |
ستقبال الرسالة: {msg.error()}"))
else:
try:
received_data = json.loads(msg.value().decode('utf-8'))
self.stdout.write(self.style.SUCCESS("تم استقبال رسالة!"))
self.stdout.write(f"محتوى الرسالة: {received_data}")
... | Python | 1 |
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork is free software: you can redistribute it and/or modify
# it under ... | Python | 1 |
# Standard library imports
import logging
import os
import sys
# Third-party imports
from fastapi import FastAPI
from vocode.streaming.models.telephony import TwilioConfig
from pyngrok import ngrok
from vocode.streaming.telephony.config_manager.redis_config_manager import (
RedisConfigManager,
)
from vocode.stream... | Python | 1 |
def pylong_join(count, digits_ptr='digits', join_type='unsigned long'):
"""
Generate an unrolled shift-then-or loop over the first 'count' digits.
Assumes that they fit into 'join_type'.
(((d[2] << n) | d[1]) << n) | d[0]
"""
return ('(' * (count * 2) + ' | '.join(
"(%s)%s[%d])%s)" % (... | Python | 1 |
self.w
}
}
#[doc = "LESENSE Decoder PRS Input 0 Configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum PRSSEL0_A {
#[doc = "0: PRS Channel 0 selected as input"]
PRSCH0 = 0,
#[doc = "1: PRS Channel 1 selected as input"]
PRSCH1 = 1,
#[doc = "2: PRS Chan... | Rust | 0 |
def test_Net2D3DFusionSeg():
batch_size = 2
img_width = 400
img_height = 225
num_coords = 2000
num_classes = 11
full_scale = 4096
in_channels = 1
img = torch.rand(batch_size, 3, img_height, img_width)
u = torch.randint(high=img_height, size=(batch_size, num_coords //
batch_si... | Python | 1 |
#************************************************************************
#
# Copyright (c) 2014-2025 Barbara Geller & Ansel Sermersheim
#
# DoxyPress is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
... | Python | 1 |
import pandas as pd
import numpy as np
from agg_funksjoner import agg_stats
from funksjoner import create_client, write_to_BQ
PROJECT_ID = 'heda-prod-2664'
SA_KEY_NAME = 'heda-access-key'
DATASET = 'teamkatalogen'
kilde_tabell = 'teamkat_gender_pred'
# Create BigQuery client
bq_client = create_client(PROJECT_ID, SA... | Python | 1 |
ymd_hms(1997, 9, 2, 9, 0, 0),
&[
ymd_hms(1997, 9, 2, 18, 6, 0),
ymd_hms(1997, 9, 2, 18, 18, 0),
ymd_hms(1997, 9, 9, 6, 6, 0),
],
);
}
#[test]
fn weekly_by_hour_and_second() {
let rrule = RRule {
freq: Frequency::Weekly,
count: Some(3),... | Rust | 0 |
# Copyright The OpenTelemetry Authors
#
# 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 ... | Python | 1 |
stat = insignia_stat.get("주스탯", "N/A")
value = insignia_stat.get("초기 수치",0) + insignia_stat.get("증가 수치", 0) * level
if name in percent_insignias:
value = f"{float(value) * 100:.0f}%"
else:
value = f"{value}"
desc_l... | Python | 1 |
bit MUST only be set if DNSSEC
// records have been requested via the DO bit RFC3225 and relevant SIG
// records are returned.
//
// https://tools.ietf.org/html/rfc4035#section-4.9.3
//
// A validating security-aware stub resolver SHOULD NOT examine the
// setting of the AD bit in response... | Rust | 0 |
import random
choices = ["Rock", "Paper", "Scissors"]
def RPS_game():
print("\n---Welcome to the Rock, Paper, Scissors game!---")
score = 0
while True:
try:
while True:
user_choice = input("Enter Rock, Paper, or Scissors : ").strip().capitalize()
... | Python | 1 |
class Wrapper:
"""
Wraps a given algorithm class with compatbility layer.
Allows for running and getting/printing results.
"""
def __init__(self, algorithm):
self.algorithm = algorithm
self.name = algorithm.name
def run(self, image_paths):
"""
Executes the given... | Python | 1 |
windows = int(app_id[self.number])
cmd = f"xdotool windowactivate {windows}"
CmdCtl.run_cmd(cmd, interrupt=False, out_debug_flag=False, command_log=False)
logger.debug(f"<{app_name}> 窗口置顶并聚焦")
def get_lastest_window_id(self, app_name: str) -> int:
"""
获取应用的所有窗口编号,并返回编号最大的窗口... | Python | 1 |
= torch.nn.functional.cross_entropy(logits, labels)
accuracy = (logits.detach().argmax(-1) == 0).float().mean()
loss.backward()
optimizer.step()
scheduler.step()
optimizer.zero_grad()
steps += 1
progress_bar.update(1)
progress_bar.set_postfix_str(f"Los... | Python | 1 |
# coding:utf-8
import os
if __name__ == '__main__':
path = os.getcwd()
dataAnnotated = os.listdir(path + '\\Annotations')
dataNum = len(dataAnnotated) # 数据集数量
ftest = open('ImageSets/Main/test.txt', 'w') # 测试集
ftrain = open('ImageSets/Main/train.txt', 'w') # 训练集
ftrainval = open('ImageSets/... | Python | 1 |
from django.db import IntegrityError
from django.db.models import *
from django.conf import settings
from canvas.exceptions import ServiceError
from canvas.models import BaseCanvasModel, CommentSticker, Comment
from drawquest import economy
from drawquest.apps.drawquest_auth.models import User
class Unstar(BaseCanva... | Python | 1 |
else { 1 };
let mut x = x1;
let mut y = y1;
let range = if x1 == x2 { if y1 > y2 {y2..y1+1} else {y1..y2+1} } else { if x1 > x2 {x2..x1+1} else {x1..x2+1} };
for _c in range {
*board.entry((x,y)).or_insert(0) += 1;
x += x_dir;
y += y_dir;
}
... | Rust | 0 |
}
} else {
send::mpi_send(&result, RequestProc::Process(0), TAG, MPI_COMM_WORLD);
}
barrier::mpi_barrier();
if rank == 0 {
print!("{}", (sw.elapsed_ms() as f64) / (1000 as f64));
}
finalize::mpi_finalize();
}
<filename>luma_core/src/cache.rs
//! ``cache`` module of ``... | Rust | 0 |
n_process():
logging.warning("rank %d starts merging results." % get_rank())
# combine results from all processes
result = []
for rank in range(get_world_size()):
result_file = os.path.join(result_dir, "%s_rank%d.json" % (filename, rank))
... | Python | 1 |
(torch.FloatTensor(size=(max_np, f_dim)).to("cuda"))
if local_np != max_np:
padding = torch.zeros(size=(max_np - local_np, f_dim)).to("cuda").float()
tensor = torch.cat((tensor, padding), dim=0)
assert tensor.size() == (max_np, f_dim)
dist.all_gather(tensor_list, tensor)
data_list ... | Python | 1 |
11f{P\xdbA\xbf\x8dG\
\x80?\x16\xf0\x9fp*\xba8(\xbe\xda}\xac\xb8\xaa\
\x7ff\xff\x17\xc0\xf3\xe0X%Po\xc0\x5c\x81\xdd\x13\
\xcb\x1f\xcag`\xc7\x83:\xef\x1f\xa00\xc4\x96\x03m\
\xf4\x08ul\xcc\xf9\xbft\xac_\x07~p\x93\xe5G\
\x89\xd3\x13\x1b\x0b\x819\x1e\xb8\xff\xcfP\xb9n#\x82\
\x8d{=\x7f*o\xcd\x07\xf9C\x00_\xa6ps\x81\
I\x99\xf... | Python | 1 |
"Cogniswitch Tools"
| Python | 1 |
# Copyright (C) 2022-2025 Intel Corporation
# LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import job_update_service_pb2 as job__update__service__pb2
cla... | Python | 1 |
pub methodURI: *mut xmlChar,
pub version: *mut xmlChar,
pub encoding: *mut xmlChar,
pub omitXmlDeclaration: ::std::os::raw::c_int,
pub decimalFormat: xsltDecimalFormatPtr,
pub standalone: ::std::os::raw::c_int,
pub doctypePublic: *mut xmlChar,
pub doctypeSystem: *mut xmlChar,
pub ind... | Rust | 0 |
be_array: json!([1, 2, 3]) =>
Err(JsonTypeMismatch { expected: JsonTy::Number, received: JsonTy::Array }),
cant_be_object: json!({"foo": 1, "bar": 2}) =>
Err(JsonTypeMismatch { expected: JsonTy::Number, received: JsonTy::Object }),
]
}
field_parse_tests! {
... | Rust | 0 |
# Filenames :
# Python bytecode : 3.8
# Time succses decompiled Sat Sep 26 13:13:00 2020
# Selector <module> in line 4 file
# Timestamp in code : 2020-06-27 04:07:18
#Instruction context error:
#
# L. 46 100 POP_EXCEPT
# 102 JUMP_BACK 60 'to 60'
#-> 104 P... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.