text string | label_name string | labels int64 |
|---|---|---|
nks| or |mid_line|@>;
crate::section_0354::Scan_a_control_sequence_and_set_state_skip_blanks_or_mid_line!($globals);
}
else if state_plus_cur_cmd_matches_any_case_plus!(state_plus_cur_cmd, active_char) {
// any_state_plus(active_char): @<Process an active-character control sequen... | Rust | 0 |
= int(input())
cenaakc1 = int(input())
stok = False
while cenaakc1 != 0:
if not stok:
if cenaakc < cenaakc1:
incena = cenaakc1
stok = True
if stok:
if cenaakc > cenaakc1:
outcena = cenaakc1
break
cenaakc = cenaakc1
cenaakc1 = int(input())
... | Python | 1 |
CUDNN, the batch size is cut in half and passed to `function`. `function` must take in a `batch_size` parameter as
its first argument.
function (`callable`, *optional*)
A function to wrap
starting_batch_size (`int`, *optional*)
The batch size to try and fit into memory
... | Python | 1 |
2 = lterm!(_);
smap.extend(v0.clone(), v1.clone());
smap.extend(v1.clone(), v2.clone());
let v3 = lterm!(_);
let vs = LTerm::singleton(v3.clone());
let v4 = lterm!(_);
smap.extend(v2.clone(), vs.clone());
smap.extend(v3.clone(), v4.clone());
let w = smap... | Rust | 0 |
lling_{}_gizeh_crop_no_roi.tif".format(method)
),
rtol=0.1,
atol=0.1,
)
kwargs["dsm_file"] = input_dsm_roi
kwargs["roi_polys"] = roi_poly
kwargs["roi_epsg"] = roi_epsg
# second test with an roi
_ = dsm_filling_application.run(**kwargs... | Python | 1 |
}
fn encoding_segments_slices(gids: &[u32]) -> Vec<(SegmentEncodingStrategy, Vec<u32>)> {
let ctx = Context::new(Optimization::O3);
let map = make_character_map('A', &gids);
let segments = encoding_segments_continuous(&map, map.iter(), &ctx);
segments
.map(|segment|... | Rust | 0 |
aint(value)
}
fn paint_level(&self, level: Level) -> Paint<Level> {
self.paint(&level, level)
}
}
impl Default for Colors {
fn default() -> Self {
Self {
trace: Style::new(Color::Black),
debug: Style::new(Color::Fixed(7)),
info: Style::new(Color::Uns... | Rust | 0 |
_lng
},
'destination': {
'lat': dest_lat,
'lng': dest_lng
},
'submit_time': row.submit_time.isoformat()
}
requests.append(request_data)
... | Python | 1 |
from fasthtml.common import *
from fasthtml.svg import *
from ..templates.template import page_template
from fh_frankenui.core import *
@page_template("404 - App Name")
def custom_404_handler(request):
return Section(
Div(
Div(
H1(
"404",
... | Python | 1 |
from django import forms
class AulaForm(forms.Form):
titulo = forms.CharField(label='Título da Aula', max_length=100)
descricao = forms.CharField(label='Descrição', widget=forms.Textarea)
data = forms.DateField(label='Data da Aula', widget=forms.DateInput(attrs={'type': 'date'}))
professor = forms.Char... | Python | 1 |
self.max * other.max,)
}
}
impl Div for StridedInterval_n {
type Output = StridedInterval_n;
fn div(self, other: StridedInterval_n) -> StridedInterval_n {
let t1 = other.stride / self.min.abs() as u64;
let t2 = self.stride / other.min.abs() as u64;
l... | Rust | 0 |
k, v in PanoSimDataProvider._actor_pool.items() if v})
@staticmethod
def get_traffic_manager_port():
return PanoSimDataProvider._traffic_manager_port
@staticmethod
def set_traffic_manager_port(tm_port):
PanoSimDataProvider._traffic_manager_port = tm_port
@staticmethod
def clea... | Python | 1 |
::new(location))),
None,
)),
ExpressionOperand::LiteralBoolean(inner) => LiteralAnalyzer::boolean(inner),
ExpressionOperand::LiteralInteger(inner) => LiteralAnalyzer::integer(inner),
ExpressionOperand::LiteralString(inner) => {
... | Rust | 0 |
_TortUrl
@TortUrl.setter
def TortUrl(self, TortUrl):
self._TortUrl = TortUrl
@property
def TortTitle(self):
r"""侵权标题
:rtype: str
"""
return self._TortTitle
@TortTitle.setter
def TortTitle(self, TortTitle):
self._TortTitle = TortTitle
@prope... | Python | 1 |
ffi::FMOD_DSP_TYPE_THREE_EQ => Ok(DspType::ThreeEq),
ffi::FMOD_DSP_TYPE_FFT => Ok(DspType::Fft),
ffi::FMOD_DSP_TYPE_LOUDNESS_METER => Ok(DspType::LoudnessMeter),
ffi::FMOD_DSP_TYPE_ENVELOPEFOLLOWER => Ok(DspType::Envelopefollower),
ffi::FMOD_DSP_TYPE_CONVOLUT... | Rust | 0 |
from mediawords.db import connect_to_db
from mediawords.dbi.downloads.store import fetch_content
from mediawords.util.guess_date import GUESS_METHOD_TAG_SET
from .get_story_date_tag import get_story_date_tag
from topics_base.stories import generate_story, SPIDER_FEED_NAME
def test_generate_story():
"""Test genera... | Python | 1 |
C[n+]7ccc(-c8cc[n+](Cc9cc(C[n+]%10ccc(-c%11cc[n+](CC)cc%11)cc%10)cc(C[n+]%10ccc(-c%11cc[n+](CC)cc%11)cc%10)c9)cc8)cc7)cc(-[n+]7ccc(-c8cc[n+](-c9cc(C[n+]%10ccc(-c%11cc[n+](Cc%12cc(C[n+]%13ccc(-c%14cc[n+](CC)cc%14)cc%13)cc(C[n+]%13ccc(-c%14cc[n+](CC)cc%14)cc%13)c%12)cc%11)cc%10)cc(C[n+]%10ccc(-c%11cc[n+](Cc%12cc(C[n+]%13... | Rust | 0 |
false_fn),
process_post: callback(&|_, _| Ok(false)),
process_put: callback(&|_, _| Ok(true)),
multiple_choices: callback(&false_fn),
create_path: callback(&|context, _| Ok(context.request.request_path.clone())),
expires: callback(&none_fn),
render_response: callback(&none_fn)
}
... | Rust | 0 |
#===========================================================
# 整个系统的一些Utils
#===========================================================
from dataclasses import dataclass
@dataclass
class PROMPT_TEMPLATE:
PROMPT = {
'咖啡厅对话':"假设我们在咖啡店,能否请您和我进行实际的点单对话练习,练习使用英语的点餐用语和交流方式?",
'超市购物... | Python | 1 |
# */
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the
# * "License... | Python | 1 |
Api, Q: Querier>(
deps: &mut Extern<S, A, Q>,
env: Env,
msg: HandleMsg,
) -> StdResult<HandleResponse> {
match msg {
HandleMsg::AddSquared { amount } => try_addsquared(deps, env, amount),
HandleMsg::Reset { total } => try_reset(deps, env, total),
}
}
pub fn try_addsquared<S: Storag... | Rust | 0 |
Return the number of seconds of offset from signing time permitted.
///
/// When a signature is checked, the local system time needs to be within
/// this many seconds from `time_signed` to be accepted.
pub fn fudge(&self) -> u16 {
self.fudge
}
/// Returns a reference to the bytes valu... | Rust | 0 |
// cancelling
swap.add_journal_message(JOURNAL_CANCELLED_BY_TIMEOUT.to_string());
return Ok(StateProcessRespond::new(StateId::SellerCancelled));
}
if swap.wait_for_backup1 {
return Ok(StateProcessRespond::new(StateId::SellerWaitingForBuyerLock)
.action(Action::WaitingForTradeBackup)
... | Rust | 0 |
id'] == ['bar']
def test_hidden_tag_is_invisible(self):
# Setting .hidden on a tag makes it invisible in output, but
# leaves its contents visible.
#
# This is not a documented or supported feature of Beautiful
# Soup (e.g. NavigableString doesn't support .hidden even
... | Python | 1 |
Tensor<f32> = args.fetch(reward_req).unwrap();
let next_board_tensor: Tensor<f32> = args.fetch(next_board_req).unwrap();
(reward_tensor, next_board_tensor)
}
/// Use representation network inference.
pub fn call_representation(session: &Session, graph: &Graph, board: &Tensor<f32>) -> Tensor<f32> {
let boa... | Rust | 0 |
, 'r', encoding='utf-8') as f:
metadata = json.load(f)
metadata_list.append(metadata)
except Exception as e:
print(f"读取元数据文件 {file} 时出错: {str(e)}")
return metadata_list
def format_metadata_display(metadata: Dict[str, Any]) -> str:... | Python | 1 |
21 => Some(String::from("RT")),
22 => Some(String::from("NSAP")),
23 => Some(String::from("NSAP-PTR")),
24 => Some(String::from("SIG")),
25 => Some(String::from("KEY")),
26 => Some(String::from("PX")),
27 => Some(String::from("GPOS")),
28 => Some(String::fr... | Rust | 0 |
_frame(initial_look, final_look, eps=eps)
initial_params = extrinsics_to_pivot_parameters(initial, pivot_frame, pivot_point)
final_params = extrinsics_to_pivot_parameters(final, pivot_frame, pivot_point)
# Interpolate the pivot parameters.
interpolated_params = interpolate_pivot_parameters(initial_para... | Python | 1 |
#!/usr/bin/env python3
## -*- coding: utf-8 -*-
##
## Output:
##
## $ ./simplification.py
## Expr: (bvxor (_ bv1 8) (_ bv1 8))
## Simp: (_ bv0 8)
##
## Expr: (bvor (bvand (_ bv1 8) (bvnot (_ bv2 8))) (bvand (bvnot (_ bv1 8)) (_ bv2 8)))
## Simp: (bvxor (_ bv1 8) (_ bv2 8))
##
## Expr: (bvor (bvand (bvnot (_ ... | Python | 1 |
tate.mnt_distribution_index += ratio
// supply_state.index_updated_at_block = current_block_number
let mnt_speed = MntSpeedStorage::<T>::get(pool_id);
if mnt_speed.is_zero() {
// Distribution is off
return Ok(());
}
let current_block = frame_system::Pallet::<T>::block_number();
let mut pool_state = ... | Rust | 0 |
import collections
import pytest
from pandas import Series
import pandas._testing as tm
class TestSeriesToDict:
@pytest.mark.parametrize(
"mapping", (dict, collections.defaultdict(list), collections.OrderedDict)
)
def test_to_dict(self, mapping, datetime_series):
# GH#16122
resul... | Python | 1 |
/// inject transactions into `storage`, as transactions must be verified beforehand.
storage: storage::Storage,
}
impl Mempool {
#[allow(dead_code)]
pub(crate) fn new(_network: Network) -> Self {
Mempool {
storage: Default::default(),
}
}
/// Get the storage field of t... | Rust | 0 |
///
/// That is, if (*a*, *b*) = `estimate_prime_pi(n)`, *a* ≤ π(*n*) ≤
/// *b*. The bounds used are proved in [1] and [2, Théorème 1.10],
/// and are summarised in [2, pp. 14–15].
///
/// [1]: <NAME>. "Explicit Bounds for Some Functions of Prime
/// Numbers". American Journal of Mathematics 63 (1):
/// 211–232. 1941.... | Rust | 0 |
ForBlocksMessage::new(
OperationsForBlock::new(
BlockHash::try_from(hex::decode(block_hash).unwrap()).unwrap(),
4,
),
Path::op(),
ops,
)
})
.collect()
... | Rust | 0 |
All);
options.default_to_empty = false;
let output = expand(
r#"
value1: $TEST_LIB_EXPAND_ALL_WITH_VALUES1
value2: ${TEST_LIB_EXPAND_ALL_WITH_VALUES2}
value3: ${TEST_LIB_EXPAND_ALL_WITH_VALUES3}
value4: %TEST_LIB_EXPAND_ALL_WITH_VALUES4%
value5: $TEST_LIB_EXPAND_ALL_WITH_VALUES5"#,
Some(options... | Rust | 0 |
// This is the expected branch.
} else {
panic!(
"Expected `RevisionCurrentlyCheckedOut` error, got: {:?}",
result
)
}
}
}
pub mod astable;
pub mod expression;
pub mod identifier;
pub mod literals;
mod parse_util;
pub mod tokenize;
pub mod typ... | Rust | 0 |
---------------------------------------\n')
logger_log(log_dir, 'After workload\n')
out, err = invoke_cmd('ps aux | grep cockroach-beta-20160714.linux-amd64')
to_write = ''
out = out.split('\n')
out = [i for i in out if i is not None and len(i) > 0 and ('workload_dir0' in i or 'workload_dir1' in i or 'workload_dir2' in... | Python | 1 |
#[test]
#[ignore = "cursive anchor positioning is not yet implemented"]
fn gpos4_simple_5() {
gpos_test(
"gpos4_simple_1.otf",
"latn", "UNKN", "test",
&[17, 18, 20, 19, 17],
&[ 0, 0, 0, -3100, 0],
&[ 0, 0, 0, -80, 0],
None,
None
... | Rust | 0 |
# *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | Python | 1 |
import sys
import numpy as np
import math
import random
import gym
import gym_game
def simulate():
global epsilon, epsilon_decay
for episode in range(MAX_EPISODES):
# Init environment
state = env.reset()
total_reward = 0
# AI tries up to MAX_TRY times
for t in range(M... | Python | 1 |
olumnStatement,
AlterViewStatement,
ArrayLiteral, // [1, 2]
AssertStatement,
Asterisk,
BinaryOperator, // + | - | = | ...
BeginStatement,
BetweenOperator,
BooleanLiteral, // TRUE | FALSE
BreakContinueStatement,
CallingArrayAccessingFunction, // OFFSET(1) | SAFE_ORDINAL(3)
Cal... | Rust | 0 |
batch_idx % save_every == 0:
save_dict = {k: {'mean': v['mean'], 'count': v['count']} for k, v in mean_vectors.items()}
torch.save(save_dict, save_path)
del batch_layer_outputs
torch.cuda.empty_cache()
gc.collect()
else:
print(f"Processing {args.n_samples} messages ... | Python | 1 |
_keycode: Some(glium::glutin::VirtualKeyCode::Escape),
..
},
..
} => {
return EventsHandlerOutcome::Break;
}
_ => (),
}
}
... | Rust | 0 |
from ncdia.utils import HOOKS
from .hook import Hook
@HOOKS.register
class ModelHook(Hook):
"""A hook to change model state in the pipeline,
such as setting device, changing model to eval mode, etc.
"""
priority = "HIGHEST"
def init_trainer(self, trainer) -> None:
"""Initialize model for... | Python | 1 |
aph(
c, margin_lr, cursor_y, text, content_w,
font="Helvetica", size=base_font_size, leading=leading
)
cursor_y -= 2
_draw_footer(c, page_num, width, client_name, ts_footer, margin_lr)
c.save()
return outpath, filename
def generate_pdf_latest(attack:... | Python | 1 |
#[allow(missing_docs)]
#[allow(non_upper_case_globals)] impl SVC { // These are enum-like
pub const Scalar : SVC = SVC(D3D_SVC_SCALAR);
pub const Vector : SVC = SVC(D3D_SVC_VECTOR);
pub const MatrixRows : SVC = SVC(D3D_SVC_MATRIX_ROWS);
pub const MatrixColumns : SVC = S... | Rust | 0 |
urce this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501
:return: The kind of this V1alpha1LocalModelNodeList. ... | Python | 1 |
6}' |
'\u{0D02}'..='\u{0D03}' |
'\u{0D3E}'..='\u{0D43}' |
'\u{0D46}'..='\u{0D48}' |
'\u{0D4A}'..='\u{0D4D}' |
'\u{0D57}' |
'\u{0E31}' |
'\u{0E34}'..='\u{0E3A}' |
'\u{0E47}'..='\u{0E4E}' |
'\u{0EB1}' |
'\u{0EB4}'..='\u{0EB9}' |
'\u{0... | Rust | 0 |
= Resize((test_shape, test_shape), correct_box=False)(img, None).transpose(2, 0, 1)
return torch.from_numpy(img[np.newaxis, ...]).float()
def __convert_pred(self, pred_bbox, test_input_size, org_img_shape, valid_scale):
"""
预测框进行过滤,去除尺度不合理的框
"""
pred_coor = xywh2xyxy(pred_b... | Python | 1 |
^ 1,
old_sample.y_bits(high_bit_count) ^ 1,
&mut strat_result,
);
let sample = pick_sample(
&strat_result,
bn_accel.as_ref(),
blue_noise_retry_count,
rng,
old_sample.class_bits() ^ 0x... | Rust | 0 |
loat(), -1.0);
}
#[test]
fn null_string() {
let results = query("null - 'aaa'", EXAMPLE_JSON);
let res = results.get(0).unwrap();
assert!(res.is_number());
assert!(f64::is_nan(res.as_float()));
}
#[test]
fn null_float() {
let results = query("null - 1.1", EXAMPLE_JSON);
let res = results.ge... | Rust | 0 |
x if x == val + 4 => 7,
x if x == val + 5 => 6,
_ => 4,
};
i += 3;
}
[x, y, _] if x == val + 1 && y == val + 2 || x == val + 1 && y == val + 3 => {
res *= match adap[i + 4] {
... | Rust | 0 |
> std::fmt::Result {
f.debug_tuple("OperationRef")
// .field(&self.some_field)
.finish()
}
}
extern crate gcc;
fn main() {
gcc::Config::new()
.file("src/ptrace_execute/forking.c")
.flag("-std=gnu99")
.compile("libforking.a");
}
use super::*;
const DYN_CO... | Rust | 0 |
let checkpoints_dir = root.join("checkpoints");
let layout = StateLayout::new(log, root.clone());
const HEIGHT: Height = Height::new(42);
let canister_id = canister_test_id(10);
let mut state = ReplicatedState::new_rooted_at(
subnet_test_id(1),
... | Rust | 0 |
opic-partial-gromov-wassertein2>`
Parameters
----------
C1 : ndarray, shape (ns, ns)
Metric cost matrix in the source space
C2 : ndarray, shape (nt, nt)
Metric costfr matrix in the target space
p : ndarray, shape (ns,)
Distribution in the source space
q : ndarray, shape... | Python | 1 |
#Escreva um programa que solicite ao usuário para digitar uma frase e verifique se todas as palavras estão em letras maiúsculas
frase = input('Digite uma frase')
if frase.isupper() == True: print('Todas as letras são caixa alta')
else: print('Todas as letras não são caixa alta')
| Python | 1 |
ptional
DESCRIPTION. The default is None.
Returns
-------
np.ndarray
The weighting curve in dB.
"""
out = []
if freqs is not None:
for freq in freqs:
out.append(eval('__' + kind + '(' + freq + ')'))
elif nth is not None:
if nth == 1:
... | Python | 1 |
rap();
let output = decode("66b7f69ac49fab4e5975aeb6fa9287d8eac02ac312c4de78f77f59da16cbcf87274e66801c4b862c33ea79cdc76528862bb2956c06db8b8acfac4794ebf39e35ac03cc73a4351a4ff762f681a48d6f25cad36e2814c9b5c40b9ae92509e58429106847789454d376836936bebc7a80e6c66e7aa52936d6b361378a41f849ad4e48f9ee2d3e92217a908fa8eb35736ac8ad... | Rust | 0 |
PowerPC,
S390,
ARM,
SuperH,
IA64,
X86_64,
AArch64,
RISCV,
}
impl fmt::Display for InstructionSet {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if let Some(width) = f.width() {
match self {
InstructionSet::NoSpecific => {
... | Rust | 0 |
zqa3z *= b''
assert x_rkwivh2ym
nonlocal myp3dbbox7p
@ioc72excylt['']
def b53te0wobsj(bfiyu5pb9a_: z6g_e9fsaie=b'', nym0vniogqm=0.0):
raise None
from y2b1f_w8bfm import wb3f0eoh6ba, xo35s_b0yqk as po76s_2rttq, bmoybjlzaaz, wo30r3lsad9 as i4har3zis4u, jkj2p5kc7x0 as rth09occy7x, mjlt22mjgf5, c7bdvfhkg6e,... | Python | 1 |
R16G16_SINT [(1, 1)] [Some(4)] [sint=2] {[i16; 2]},
R16G16Sfloat => FORMAT_R16G16_SFLOAT [(1, 1)] [Some(4)] [float=2] {[f16; 2]},
R16G16B16Unorm => FORMAT_R16G16B16_UNORM [(1, 1)] [Some(6)] [float=3] {[u16; 3]},
R16G16B16Snorm => FORMAT_R16G16B16_SNORM [(1, 1)] [Some(6)] [float=3] {[i16; 3]},
R16G16B16U... | Rust | 0 |
swim_form::structural::read::recognizer::LabelledFieldKey::Item(#name) => core::option::Option::Some(#n),
})
});
let fn_name = if let Some(var_ord) = variant {
suffix_ident(SELECT_INDEX_NAME, *var_ord)
} else {
syn::Ident::new(SELECT_INDEX_NAME, Spa... | Rust | 0 |
"""Test our ANSI/ECMA REGEXP compiled pattern"""
self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors.CLEAR)))
self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors.RED_NORMAL)))
self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors8Bit(0, 127))))
self.assertTrue(ANSI_ECMA_REGEXP.match(Colors.escap... | Python | 1 |
pivot: id.clock,
}
}
}
#[derive(Debug, PartialEq)]
pub enum Block {
Item(Item),
Skip(Skip),
GC(GC),
}
impl Block {
pub fn as_item(&self) -> Option<&Item> {
match self {
Block::Item(item) => Some(item),
_ => None,
}
}
pub fn as_item_mut(&m... | Rust | 0 |