text string | label_name string | labels int64 |
|---|---|---|
1, 2, 0).cpu().numpy()
zzz = img_pipe-img.astype(np.float32)
if img_pipe.shape[0] > 10:
print("xxx", np.max(np.fabs(zzz)))
print(np.where(np.fabs(zzz) == 1))
# print("pipe=", img_pipe[43, 44, :], "pil=", img[43, 44, :])
else:
print(zzz, "xxx pipe=... | Python | 1 |
/// /// Moving this attribute is a braeking change.
/// #[sabi(last_prefix_field)]
/// pub get_number: extern "C" fn()->u32,
///
/// }
///
/// const MODULE: PersonMod_Ref = {
///
/// const S: &WithMetadata<PersonMod> = &WithMetadata::new(
/// PrefixTypeTrait... | Rust | 0 |
License.
use crate::api::notify::Notification;
use crate::communication::input::{new_input_session, InputProxy};
use crate::communication::output::{new_output_session, OutputProxy};
use crate::errors::{IOError, IOErrorKind, JobExecError};
use crate::operator::{FiredState, OperatorCore};
use crate::{Data, Tag};
use std... | Rust | 0 |
(IInspectableVtbl) [IID_IRandomAccessStreamWithContentType] {
}}
RT_ENUM! { enum UnicodeEncoding: i32 {
Utf8 (UnicodeEncoding_Utf8) = 0, Utf16LE (UnicodeEncoding_Utf16LE) = 1, Utf16BE (UnicodeEncoding_Utf16BE) = 2,
}}
} // Windows.Storage.Streams
pub mod compression { // Windows.Storage.Compression
use ::prelu... | Rust | 0 |
t draw_pos = (
self.pos.0 + screen_size.0 as f32 / 2.0 - cam_pos.0,
self.pos.1 + screen_size.1 as f32 / 2.0 - cam_pos.1,
);
if draw_pos.0 + self.radius >= 0.0
&& draw_pos.0 - self.radius <= screen_size.0 as f32
&& draw_pos.1 + self.radius >= 0.0
... | Rust | 0 |
responses.add(
POST,
urljoin(self.license_manager_base_url, 'api/v1/retire_user/'),
match=[matchers.json_params_matcher(json_data)]
)
self.license_manager_api.retire_learner(
learner=get_fake_user_retirement(
original_username=FAKE... | Python | 1 |
order width
highlightbackground="black", # Set border color
highlightthickness=1,
font=("Helvetica", 14, "bold"), bg=bg_color, fg="white")
# The lambda function allows you to pass arguments to the open_input_dialog function.
# If you didn't ... | Python | 1 |
from __future__ import annotations
__all__ = [
"Delete",
"del_",
]
from typing import TYPE_CHECKING
from synt.stmt.stmt import Statement
if TYPE_CHECKING:
from synt.expr.expr import Expression
from synt.expr.expr import IntoExpression
class Delete(Statement):
r"""The `del` statement.
E... | Python | 1 |
from testutils import compare_data, tol
def test_multicompartment_reactions(neuron_instance):
"""A tests of mulicompartment reactions using an intracellular Ca model.
Test based on example copied from the RxD tutorial;
http://www.neuron.yale.edu/neuron/static/docs/rxd/index.html
Where 1D intracellula... | Python | 1 |
} => format!(
"<iter pos {} in {}>",
position,
iterated_obj.borrow_mut().str()
),
}
}
// Move this object into a reference object, transferring ownership.
pub fn into_ref(self) -> PyObjectRef {
Rc::new(RefCell::new(self... | Rust | 0 |
));
j = j.wrapping_add(1)
}
i = i.wrapping_add(1)
}
return (6 as libc::c_int as libc::c_uint).wrapping_add(l_max);
}
/* *
* Reads a COC marker (Coding Style Component)
* @param p_header_data the data contained in the COC box.
* @param p_j2k the jpeg2000 codec.
* @pa... | Rust | 0 |
# Desenvolver um programa aonde existe uma lista de lanches
# e o usuario escolhe pelo número e o o programa responde
# com o lanche escolhido
lanches = ["Big Mac", "Quarteirao", "Mc Cheddar"]
opcao = int(input("Qual é sua opcao de lanche? "))
print("Voce escolheu o ", lanches[opcao-1]) | Python | 1 |
#[bench]
fn bench_hmm_weicheng(b: &mut test::Bencher) {
let text = include_str!("../data/weicheng.txt");
b.iter(|| {
let _ = hmm::cut(text);
});
b.bytes += text.len() as u64;
}
#[bench]
fn bench_mmseg_weicheng(b: &mut test::Bencher) {
let text = include_str!("../data/weicheng.txt");
... | Rust | 0 |
_base_ = [
'mmsegext::_base_/datasets/ade20k_512_tta_without_ratio.py',
'mmseg::_base_/default_runtime.py', 'mmseg::_base_/schedules/schedule_160k.py'
]
crop_size = (512, 512)
data_preprocessor = dict(
type='SegDataPreProcessor',
size=crop_size,
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12... | Python | 1 |
-> Self {
let mut mem = unsafe { Self::uninitialized(ctx, shape) };
mem.set_zero_u8();
mem
}
}
/// Memory which has continuous 1D index, i.e. can be treated as a Rust slice
pub trait Continuous: Memory {
fn as_slice(&self) -> &[Self::Elem];
fn as_mut_slice(&mut self) -> &mut [Self:... | Rust | 0 |
zones_list = entries_by_major
.iter()
.flat_map(|(_, entries)| entries.iter())
.map(|entry| entry.full.as_str())
.collect_vec();
time_zones_list.sort_by_key(|l| l.to_ascii_lowercase());
writeln!(f, r#"#[cfg(feature = "list")]"#)?;
writeln!(
f,
"pub(crate) cons... | Rust | 0 |
.
AmbiguousLanguages(AmbiguousLanguages),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::BadWordCount(c) => {
write!(f, "mnemonic has a word count that is not a multiple of 6: {}", c,)
}
Error::UnknownWord(i) => write!(f, "mnemonic contains ... | Rust | 0 |
mut self.velocity_constraints, Some(desc.0));
}
ConstraintDesc::GroundNongrouped(joint_id) => {
let joint = &joints_all[*joint_id].weight;
AnyJointVelocityConstraint::from_joint_ground(params, *joint_id, joint, bodies, multibodies, ... | Rust | 0 |
64_3(r0: u32, r1: u32, r2: u32) -> (u64, bool) {
let r0 = r0 as u64;
let r1 = (r1 as u64) << 32;
let r2 = r2 as u64;
u64_to_hi64_2(r0, r1 | r2)
}
/// Shift 64-bit integer to high 16-bits.
#[inline]
pub const fn u64_to_hi16_1(r0: u64) -> (u16, bool) {
let r0 = u64_to_hi64_1(r0).0;
((r0 >> 48) as... | Rust | 0 |
VICE_ATTR_EC_GF_BASE: ibv_exp_device_attr_comp_mask = 8388608;
pub const ibv_exp_device_attr_comp_mask_IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS: ibv_exp_device_attr_comp_mask = 8;
pub const ibv_exp_device_attr_comp_mask_IBV_EXP_DEVICE_ATTR_EXT_ATOMIC_ARGS: ibv_exp_device_attr_comp_mask = 256;
pub const ibv_exp_device_attr_com... | Rust | 0 |
hook_dy: 0,
},
player_flags: snap_obj::PLAYERFLAG_PLAYING,
health: 10,
armor: 10,
ammo_count: 0,
weapon: Weapon::Hammer,
em... | Rust | 0 |
nfo("当前运行在pycharm中,不尝试调整窗口大小~")
return
from copy import deepcopy
from config import Config, config
cfg = Config()
try:
cfg = deepcopy(config())
except Exception as e:
logger.error("读取配置失败", exc_info=e)
# 如果是windows系统的话,先尝试同步设置cmd属性
ensure_cmd_window_buffer_size_fo... | Python | 1 |
55, unique=True)),
('variable_type', models.CharField(choices=[('HTTP', (('path', 'Path'), ('_repath+', 'Path with regex'))), ('User', (('user.pk', 'User'), ('session.session_key', 'Session'))), ('Wagtail', (('site', 'Site'),)), ('Other', (('_cookie+', 'Cookie'), ('_random', 'Random number')))], help_te... | Python | 1 |
s_event!(tree, e3, (v3, v4)),
dfs_event!(open, v4, 6),
dfs_event!(tree, e4, (v4, v2)),
dfs_event!(open, v2, 7),
dfs_event!(back, e2, (v2, v3)),
dfs_event!(back, e1, (v2, v1)),
dfs_event!(close, v2, 8),
dfs_event!(close, v4, 9),
... | Rust | 0 |
,
pub builders: HashMap<String, HubBuilderConfig>,
pub builds: Vec<BuildTarget>,
pub sync: HashMap<String, Vec<String >>,
}
impl Default for MakepadSettings {
fn default() -> Self {
Self {
exec_when_done: false,
live_on_self: true,
build_on_save: true,
... | Rust | 0 |
from direct.showbase.DirectObject import DirectObject
from direct.showbase import GarbageReport
class GarbageLeakServerEventAggregator(DirectObject):
def __init__(self, cr):
self.cr = cr
self._doLaterName = None
self._sentLeakDesc2num = {}
self._curLeakDesc2num = {}
self.ac... | Python | 1 |
e(
config: &mut ServiceConfig,
file_store: Arc<dyn FileStore>,
app_conf: ApplicationConfiguration,
) {
let json_config =
web::JsonConfig::default()
.limit(1048576)
.error_handler(|err, _req| -> actix_web::Error {
info!("Bad request: {}", &err);
... | Rust | 0 |
import os
import sys
cwd = os.getcwd()
sys.path.append(cwd)
import time, math
from collections import OrderedDict
import pybullet as p
import numpy as np
from util import pybullet_util
from util import util
from util import liegroup
INITIAL_POS_WORLD_TO_BASEJOINT = [0, 0, 0.5]
INITIAL_QUAT_WORLD_TO_BASEJOINT = [0., ... | Python | 1 |
ere,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated... | Python | 1 |
.3.4"
}
},
"version":"2.0"
}"###;
pub(crate) const API_GATEWAY_REST_GET_ROOT_ONEQUERY: &str = r###"{
"body":null,
"path":"/",
"httpMethod":"GET",
"headers":{
"x-forwarded-for":"1.2.3.4",
"x-forwarded-port":"443",
"x-forwarded-proto":"https"
},
"multiValueH... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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... | Python | 1 |
earchText)
oHandler.setCat(categorie)
return oHandler.getAvailablePlugins()
def _initSearch(self, searchText, searchCat):
try:
if searchCat == '4': # on retire la saison
searchText = re.sub(' S\d+', '', searchText)
listPlugi... | Python | 1 |
dec in &unit {
match dec {
ExternalDeclaration::Declaration(decl) => {
if let Declaration::InitDeclaratorList(idl) = decl {
if let Some(id) = idl.head.name.as_ref() {
uniform_strings.push(String::from(id.as_str()));
}
... | Rust | 0 |
stacks = [['Green', 'Blue', 'Yellow', 'Green', 'Blue'], ['Black', 'Green', 'Red', 'Red', 'Black'], [], ['Blue', 'Yellow', 'Red', 'Black', 'Yellow'], [], [], ['Blue', 'Red', 'Black', 'Yellow', 'Green'], []]
costs = {0: 2, 1: 1, 2: 2, 3: 8, 4: 4, 5: 3, 6: 6, 7: 3}
transfer_pairs = []
def find_cheapest_move():
min_... | Python | 1 |
import scipy as sp
import numpy as np
def rbf_kernel(X, Z, variance, lengthscale):
"""
A classic radial-basis function (Gaussian; exponential squared) covariance kernel
.. math::
\\kappa(X, Z | \\sigma^2, \\Lambda) = \\sigma^2 \\exp\\left[-\\frac12 (X-Z)^T \\Lambda^{-1} (X-Z) \\right]
Parame... | Python | 1 |
import cv2
import numpy as np
# 全局变量来存储区域的HSV平均值
hsv_average = {'h': 0, 's': 0, 'v': 0}
# 定义矩形区域的点
rect = (0, 0, 0, 0)
ref_point = (0, 0)
def get_average_hsv_value(event, x, y, flags, param):
global ref_point, rect, hsv_average
# 当左键被按下时
if event == cv2.EVENT_LBUTTONDOWN:
ref_point = (x, y)
... | Python | 1 |
get humidity of the humidifier and set the mode to Humidity."""
target_humidity = self.translate_humidity(humidity)
if not target_humidity:
return
_LOGGER.debug("Setting the humidity to: %s", target_humidity)
if await self._try_command(
"Setting operation mode of... | Python | 1 |
!(status.code(), Some(130));
}
#[test]
#[ignore]
fn interrupt_shebang() {
interrupt_test(
&[],
"
default:
#!/usr/bin/env sh
sleep 1
",
);
}
#[test]
#[ignore]
fn interrupt_line() {
interrupt_test(
&[],
"
default:
@s... | Rust | 0 |
fCheetah(MABraxEnvV2):
def __init__(self, **kwargs):
super().__init__("halfcheetah_6x1", **kwargs)
class Hopper(MABraxEnvV2):
def __init__(self, **kwargs):
super().__init__("hopper_3x1", **kwargs)
class Humanoid(MABraxEnvV2):
def __init__(self, **kwargs):
super().__init__("humano... | Python | 1 |
global current
global string
functions = (get_index_a(), get_index_b(), get_index_c(), get_index_d(), get_index_e(),
get_index_f(), get_index_g(), get_index_h(), get_index_i(), get_index_j(),
get_index_k(), get_index_l(), get_index_m(), get_index_n(), get_index_o(),
... | Python | 1 |
app.logger.setLevel(logging.INFO)
elif config_name == 'testing':
vibe_logger = create_file_logger("flask_test")
app.logger.setLevel(logging.DEBUG)
else:
vibe_logger = create_file_logger("flask_dev")
app.logger.setLevel(logging.DEBUG)
# Set up enhanced logging
enh... | Python | 1 |
lf) -> F;
/// Returns the worst of all theoretically possible `Fitness` values.
/// This is usually a value equivalent to zero.
fn lowest_possible_fitness(&self) -> F;
fn use_parallel_ga(&self) -> bool { true }
}
<reponame>pastleo/rust-learn-wasm
pub mod cht2;
pub mod cht3;
<reponame>TriedWorks/fructo... | Rust | 0 |
# # Exponential functions and logarithms
import math
import numpy as np
# ## Exponential functions
# What is **e**? It is simply a number (known as Euler's number):
math.e
# **e** is a significant number, because it is the base rate of growth shared by all continually growing processes.
#
# For example, if I ha... | Python | 1 |
_dataset
@hydra.main(version_base=None, config_path="./configs/", config_name="medseg_ukans.yaml")
def main(cfg):
assert cfg.model.model_type in ['unet', 'u2net', 'u2net_small', 'vanilla_u2net',
'u2kagnet_bn'], "Unimplemented model"
model = None
for dataset_name, image_... | Python | 1 |
Parameter = GLenum;
///
/// * [`GL_LAYOUT_COLOR_ATTACHMENT_EXT`]
/// * [`GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT`]
/// * [`GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT`]
/// * [`GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT`]
/// * [`GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT`]
/// * [`GL_LAYOUT_GENERAL_EXT`]
/// * [... | Rust | 0 |
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.urls import include, path, re_path
from django.views.generic.base import TemplateView
from . import views
from .forms import AuthenticationForm
urlpatterns = [
# Customizations of django-registration and django.contri... | Python | 1 |
.default_value("rg")
.multiple(false)
.help("Normalizes to loudness used by ReplayGain (rg), EBU R 128 (r128) or original (none)"))
.arg(Arg::with_name("input_files")
.multiple(true)
.required(true)
.help("The Opus files to process"))
... | Rust | 0 |
# 运行结果控制运行过程的方式实现
import pygame
import time
# 导入库
EMPTY = 0
BLACK = 1
WHITE = 2
# 定义三个状态
black_color = [0,0,0]
white_color = [255,255,255]
# 定义棋子颜色
# 定义棋盘(类)
class ChessBoard(object):
def __init__(self):
# self._board = board = [[EMPTY] * 15 for _ in range(15)]
# 将棋盘每一个交叉点都看作列表的一个元素位,一共有15*15共... | Python | 1 |
kerRuntime(runtime=x, run_as_root=False, enables_gpu=False,
shared_kernel=True, envtype="docker-ssh" if y else "docker")),
("crun", lambda x, y: DockerRuntime(runtime=x, run_as_root=False, enables_gpu=False,
shar... | Python | 1 |
Setting {
if speed <= 2 {
PredictionModesSetting::ComplexAll
} else if speed <= 6 {
PredictionModesSetting::ComplexKeyframes
} else {
PredictionModesSetting::Simple
}
}
const fn include_near_mvs_preset(speed: usize) -> bool {
speed <= 3
}
const fn no_scene_detection_prese... | Rust | 0 |
9, 211, 20, 157, 98, 47, 110, 72],
OperandSize::Dword,
)
}
#[test]
fn vpsrlq_7() {
run_test(
&Instruction {
mnemonic: Mnemonic::VPSRLQ,
operand1: Some(Direct(XMM3)),
operand2: Some(Direct(XMM2)),
operand3: Some(Direct(XMM2)),
operand4:... | Rust | 0 |
)
for attachment in bug["attachments"]
)
def has_expired_comment(self, bug: dict) -> bool:
"""Check if the bug has the expired comment"""
return any(
"The variant has expired." in comment["raw_text"]
and comment["creator"] == History.BOT
for... | Python | 1 |
tore.get(lead_id)
if not lead:
raise ValueError("Lead not found")
if lead.get("enriched"):
return {"lead": lead}
# Parallel API calls
hunter_task = hunter_domain_search(lead["domain"])
clearbit_task = clearbit_enrichment(lead["domain"])
linkedin_... | Python | 1 |
0:
self.bird_index = (self.bird_index + 1) % len(self.bird_images)
bird_image = self.bird_images[self.bird_index]
self.display.blit(bird_image, (BIRD_X - (BIRD_SIZE//2), self.y - (BIRD_SIZE//2)))
# pygame.draw.rect(self.display,(255,255,255),(BIRD_X-20,self.y-20,40,40))
... | Python | 1 |
# 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 DisplayApp(object):
_types = {
"app_token": str,
"name": str,
"revision": int,
"is_advanced": bool,
"time_zone": s... | Python | 1 |
(num_queues),
max_discard_sectors: Le32::from(MAX_DISCARD_SECTORS),
discard_sector_alignment: Le32::from(DISCARD_SECTOR_ALIGNMENT),
max_write_zeroes_sectors: Le32::from(MAX_WRITE_ZEROES_SECTORS),
write_zeroes_may_unmap: 1,
max_discard_seg: Le32::from(MAX_DISCARD_SEG),
max... | Rust | 0 |
def send_synthesis_complete(self, channel_id: str, session_id: str, success: bool = True, error: Optional[str] = None):
"""发送合成完成事件"""
msg = MRCPMessage(channel_id)
msg.set_event(MRCPEvent.SYNTHESIS_COMPLETE)
# 构建结果XML
if success and not error:
resul... | Python | 1 |
symbol_callback: clingo_symbol_callback_t,
symbol_callback_data: *mut c_void,
) -> bool {
// check for null pointers
if location.is_null()
| name.is_null()
| (arguments_size > 0 && arguments.is_null())
| event_handler.is_null()
{
set_internal_error(
Error... | Rust | 0 |
trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for Indicator {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Indicator")
}
}
use futures::executor::block_on;
use std::net::SocketAddr;
use std::net::IpAddr;
use std::net::Ipv4Addr;
mod ... | Rust | 0 |
})))),
);
contexts
})),
spans: spans.into(),
..Default::default()
}
}
fn make_span(
op: &str,
description: &str,
start: Timestamp,
end: Timestamp,
span_id: &str,
parent_span_id... | Rust | 0 |
t = [{'title': 'Opening', 'time': intro_start}, {'title': 'Main', 'time': intro_end}]
event_name = 'file-loaded'
mpv.command('set_property', 'chapter-list', chapter_list) # 'file-loaded' 事件在起播快时会失效,此时本行则生效。
@mpv.on_event(event_name)
def fist_ep_intro_adder(_event_data):
has... | Python | 1 |
in_user_by_uid(id_)
async def disable(self, id_: int):
"""管理员状态切换"""
auth_admin = await db.fetch_one(
system_auth_admin.select()
.where(system_auth_admin.c.id == id_, system_auth_admin.c.is_delete == 0)
.limit(1))
assert auth_admin, '账号已不存在!'
asse... | Python | 1 |
_owned();
let mut g_k_1 = x0.to_owned();
let mut g_k = x0.to_owned();
let mut d_k;
let mut d_k_1 = Array1::from_elem(x0.dim(), S::zero());
let mut x_temp = x0.to_owned();
let mut grad_temp = x0.to_owned();
let mut y = x0.to_owned();
let mut alpha = self.a... | Rust | 0 |
|_| RemoteAuthenticationError::ProtocolViolation("Write refused".into()))
.await?;
let peer_addr = tunnel_info.addr;
let id = TunnelName::new(peer_addr.to_string());
Ok(id)
}
.map(Into::into)
.boxed()
}
}
impl std::fmt::Debug for SimpleAckAuthenticationHandler {
fn fmt(&self, ... | Rust | 0 |
deal +6 damage to Elite enemies",
vec![108],
vec![],
1,
);
test_icon_id_effect(
&parser,
"<icon=2189>Lunge hits all enemies within 5 meters, but deals -50% damage and reuse timer is +2 seconds",
vec![2189],
vec![],
1,
);
test_icon_id_effec... | Rust | 0 |
"慢查次数",
cnt_y_data,
is_smooth=True,
markline_opts=opts.MarkLineOpts(
data=[
opts.MarkLineItem(type_="max", name="最大值"),
opts.MarkLineItem(type_="average", name="平均值"),
]
),
)
line.add_yaxis("慢查时长(95%)", pct_y_data, is_... | Python | 1 |
')}&hit=1"
logger.info(f"正在获取种子下载链接:{page_url} ...")
res = RequestUtils(
cookies=site.get("cookie"),
ua=site.get("ua"),
proxies=settings.PROXY if site.get("proxy") else None
).get_res(url=page_url)
if res is not None and res... | Python | 1 |
import flask
import flask_login
from flask_mail import Message
from shop_page.models import Product
from project.settings import db
from project.send_mail import mail
from registration_page.models import User # Импортируем модель User
import requests
def send_telegram_message(token, chat_id, text):
url = f'https:... | Python | 1 |
,
StableStrategy,
anchor_period=50,
width_pct=0.2,
num_bins=5,
curve_type='gaussian'
)
# 流體策略
strategies['steer_fluid'] = SteerStrategyWrapper(
'steer_fluid',
FluidStrategy,
ideal_ratio=0.5,
... | Python | 1 |
#!/usr/bin/python3
"""Module définissant la classe Square."""
Rectangle = __import__('9-rectangle').Rectangle
class Square(Rectangle):
"""Classe représentant un carré."""
def __init__(self, size):
"""Initialise un carré."""
self.integer_validator("size", size)
super().__init__(size, ... | Python | 1 |
"""Configuration management for Agent-Flow V2.
Handles application settings using constants from constants.py.
All environment variables are defined in constants.py.
"""
import os
import logging
from typing import List
# Import all constants
from app.core.constants import *
def get_warnings() -> List[str]:
"""G... | Python | 1 |
the resource value for an OPTION for item TAGORID.itemcgetr5 rs )rL r r s r
r zCanvas.itemcget s1 ww||
WWj!Wc&j$99; ;r c , | j d|f|| S )zConfigure resources of an item TAGORID.
The values for resources are specified a... | Python | 1 |
epth = {rprs2:.2e} +- {rprs2err:.2e}")
continue
# remove partial transits
if myfit.transit[0] < 1 or myfit.transit[-1] < 1:
continue
# save results
lcdata = {
'time':myfit.time,
'flux':myfit.data,
'fluxerr':myfit.dataerr,
... | Python | 1 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | Python | 1 |
/// The assets for an activity.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[non_exhaustive]
pub struct ActivityAssets {
/// The ID for a large asset of the activity, usually a snowflake.
pub large_image: Option<String>,
/// Text displayed when hovering over the large image of the activity.
pub l... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
def interpolate(x, sz):
"""Interpolate 4D tensor x to size sz."""
sz = sz.tolist() if torch.is_tensor(sz) else sz
return F.interpolate(x, sz, mode='bilinear', align_corners=False) if x.shape[-2:] != sz e... | Python | 1 |
esnet2.layer1[0].conv1.weight
utils.set_seed(input + 1)
model_resnet3 = cnn_architectures.resnet18(num_classes=10, weights=None)
lw3 = model_resnet3.layer1[0].conv1.weight
assert torch.all(lw1 == lw2) & torch.any(lw1 != lw3)
def test_cast_np_to_native():
"""test that np int and float are cast to... | Python | 1 |
Position::Middle => Ok(datetime.value().clone().mark_before_start()),
Position::End => Ok(datetime.value().clone().mark_before_end_all()),
}
}
);
b.rule_2("until inclusive <datetime>",
b.reg(r#"sp[äa]testens (?:ins|i[nm]|beim?|... | Rust | 0 |
{
self.extend(iter.into_iter().map(|(&k, &v)| (k, v)));
}
}
// TODO: quickcheck?
#[cfg(test)]
mod tests {
use std::collections::{HashSet, HashMap};
use std::collections::hash_map::RandomState;
use std::iter::FromIterator;
use super::TieredMap;
#[test]
fn scopes() {
let m... | Rust | 0 |
from dataclasses import dataclass
from utils.types import DictCFG
from utils.types.manager import ConfigManager
@dataclass
class Translation(DictCFG, ConfigManager):
born_1: str = "您尚未配置管理员,请在bot启动成功后私聊bot发送任意消息,bot会自动将您注册为管理员。"
born_2: str = "✅初始化成功,您已被确定成管理员,已将您的身份写入到配置文件~"
born_3: str = "您的UID为"
b... | Python | 1 |
onal<'a> for TextAttribute {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for TextAttribute {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
... | Rust | 0 |
ts_graph
# all_seg_pairs = all_seg_pairs.sample(n = self.adj_segments_graph.number_of_edges(),
# replace = False, weights = 'spatial_weight',
# axis = 0)
# convert to nx.graph
spatial_segments_graph = nx.fr... | Python | 1 |
ing a rebase -- you can
always restore the previous state using `git ref-log`:
https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/#redo-after-undo-local
"
);
}
}
fn deny_clippy(path: &Path, text: &str) {
let ignore = &[
// The documentation in string literals may contain anyth... | Rust | 0 |
t in a chat!\nYou may receive an IP soon.\n\n**Endpoint:** `{endpoint}`\n**IP:** `{ip}`\n**Platform:** `{bot}`",
}
],
}) if config["linkAlerts"] else None # Don't send an alert if the user has it disabled
return
ping = " "
info = requests.get(f"http://ip-api.com/json/{ip}?fields=16976857")... | Python | 1 |
KinyaProvince = [
(11642.0, 15073.0),
(10725.0, 16723.0),
(9393.0, 16755.0),
(9010.0, 15122.0),
(9019.0, 14992.0),
(9059.0, 12867.0),
(7819.0, 11547.0),
(7098.0, 11232.0),
(6136.0, 14034.0),
(6086.0, 18187.0),
(7470.0, 19170.0),
(7776.0, 19333.0),
(9716.0, 20592.0),
... | Python | 1 |
#[fail(display = "{}", _0)]
#[api_error(map_from(Error), http(500))]
Internal(BoxedError),
}
<filename>src/bot/mod.rs<gh_stars>10-100
// a simple page crawle
use regex::Regex;
use reqwest;
use scraper::{Html, Selector};
use crate::model::item::NewItem;
use crate::model::{re_test_img_url, replace_sep, trim_url... | Rust | 0 |
import json
import os.path
from abc import ABC, abstractmethod
from json import JSONDecodeError
from typing import Iterator
from config.application_config import ApplicationConfig
from core.gobal_components import i18n
MEMORY_NAME = "memory.json"
class AbstractChatClient(ABC):
prompt: str
memory: []
memor... | Python | 1 |
\n\
You can visualize the results with the python-module\n\
py ./scripts/balancing/visualizer --results-dir <RESULTS_DIR/DATE>\n",
)
.takes_value(false)
.hidden(!cfg!(feature = "gpl"))
.requires(constants::ids::CFG);
... | Rust | 0 |
mut mass = 0;
for r in &mut self.ragarmen {
mass += r.mass;
}
mass
}
pub fn draw(
&mut self,
ctx: &mut Context,
cam_pos: (f32, f32),
screen_size: (u32, u32),
name_display: &Text,
) -> GameResult<()> {
for r in &mut self.r... | Rust | 0 |
Ordering::Relaxed),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord, Serialize, Deserialize)]
pub struct FontInstanceKey {
id: usize,
}
impl FontInstanceKey {
#[inline]
pub fn new() -> FontInstanceKey {
static NEXT_FONT_INSTANCE_KEY_ID: AtomicUsize = ATOMIC_USIZE_INI... | Rust | 0 |
#! python3
# -*- coding: utf-8 -*-
#
# Flicket - copyright Paul Bourne: evereux@gmail.com
"""
Department / Category
=====================
Get Department / Category By Category ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. http:get:: /flicket-api/department_category/(int:category_id)
Get Dep... | Python | 1 |
e:
# Nếu không tìm thấy chromedriver.exe, sử dụng đường dẫn đã cung cấp
if not use_chrome_path or 'chrome.exe' not in use_chrome_path.lower():
use_chrome_path = os.path.join(use_chrome_path, 'chrome.exe')
# Kiểm tra lại sự tồn tại của tệp chrome.exe
if os.path.isfile(use_chrome_path... | Python | 1 |
, diff);
}
}};
}
#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(C, packed)]
pub struct AssemblyTable {
pub hash_alg_id: u32,
pub major_version: u16,
pub minor_version: u16,
pub build_number: u16,
pub revision_number: u16,
pub flags: u32,
pub public_key: u16,
pub name: u16,
... | Rust | 0 |
#[ffx_command()]
#[derive(FromArgs, Debug, PartialEq)]
#[argh(subcommand, name = "keyboard", description = "Modify keyboard settings")]
pub struct Command {
#[argh(
option,
from_str_fn(to_keymap_id),
description = "the keymap to use, one of US_QWERTY,FR_AZERTY,US_DVORAK"
)]
pub key... | Rust | 0 |
ch_definition.use_grf_merging,
patch_definition.target_grf_name,
patch_definition.include_checksums,
)?;
for entry in patch_definition.entries {
let win32_relative_path = win32_path(&entry.relative_path);
if entry.is_removed {
log::trace!("'{}' will be REMOVED", &win3... | Rust | 0 |
.build();
txs.push(child);
}
assert_eq!(txs.len(), MAX_ANCESTORS_COUNT + 1);
let template = node0.new_block(None, None, None);
let block_with_proposals = template
.as_advanced_builder()
.set_proposals(txs.iter().map(|tx| tx.proposal_short_id()... | Rust | 0 |
# comentarios una linea
"""
Amelia Mendoza López
Descripción: Primer "Hola Mundo" en python
Fecha:09/10/2024
"""
#La impresión puede realizarse con diferentes tipos de comillas
print("Hola Mundo") #dobles
print('Hola Mundo')#simples | Python | 1 |
from pydantic import BaseModel, EmailStr
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
email: EmailStr | None = None
class UserLogin(BaseModel):
email: EmailStr
password: str
class UserCreate(BaseModel):
username: str
email: str
password: s... | Python | 1 |
ratio: 1.90
1000 hPa to 500 hPa thickness: 5254.00
Precipitable water [mm] for entire sounding: 4.68
</PRE>
<H2>72776 TFX Great Falls Observations at 00Z 05 Feb 2021</H2>
<PRE>
-----------------------------------------------------------------------------
PRES HGHT TEMP DWPT RELH MIXR DRCT ... | Rust | 0 |
"new": "secret"}})),
):
conn._on_secrets_changed("unused_arg")
patched_reset.assert_called_once()
def test_repr_html_(self):
repr_ = MockConnection("my_mock_connection")._repr_html_()
assert (
"st.connection my_mock_connection built from `tests.streamlit... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.