text string | label_name string | labels int64 |
|---|---|---|
═══════════╤══════╬══════════╪═════════╪════════════╡
│ │ <10 ║ 0.05 │ 0 │ 0.15 │
│ Order size ├──────╫──────────┼─────────┼────────────┤
│ │ >=10 ║ 0.10 │ 0 │ 0.15 │
└────────────┴──────╨──────────┴─────────┴────────────┘
"#;
/// **Crosstab** decision tab... | Rust | 0 |
let (canvas, events) = create_drawing_window_with_events("Mouse tracking");
// Render the window background on layer 0 (just a triangle)
canvas.draw(|gc| {
// Clear the canvas and set up the coordinates
gc.clear_canvas(Color::Rgba(0.3, 0.2, 0.0, 1.0));
gc.canvas_hei... | Rust | 0 |
_name, boogie_struct_name, boogie_struct_type_value, boogie_synthetic_name,
boogie_type_check_expr, boogie_type_value,
};
use crate::code_writer::CodeWriter;
use crate::env::{
FunctionEnv, GlobalType, ModuleEnv, ModuleIndex, StructEnv, TypeParameter, ERROR_TYPE,
UNKNOWN_TYPE,
};
pub struct SpecTranslator<'... | Rust | 0 |
.delete(&path, None::<&()>).await
}
pub async fn get_deployment_definition(&self, id: Uuid) -> Result<Pipeline> {
let path = format!("/v1/apps/{}/deployments/{}/definition", self.application_id()?, id);
self.get(&path, None::<&()>).await
}
pub async fn start_deployment(&self, id: Uuid)... | Rust | 0 |
cription:
kwargs['description'] = parsed_args.description
identity_client.update_group(group, **kwargs)
class ShowGroup(command.ShowOne):
_description = _("Display group details")
def get_parser(self, prog_name):
parser = super().get_parser(prog_name)
parser.add_argument(... | Python | 1 |
# apps/group/urls.py
from django.urls import path
from .views import manage_groups
urlpatterns = [
path('group_update', manage_groups, name='manage_groups'),
path('<int:group_id>/', manage_groups, name='update_group'),
]
| Python | 1 |
n self.account_status.items()
if a_id in account_ids
]
def batch_get_account_status(self, account_ids: List[str]) -> List[Dict[str, Any]]:
return [
status.to_batch_json()
for a_id, status in self.account_status.items()
if a_id in account_ids
]... | Python | 1 |
env_str
})
}
}
#[cfg(test)]
mod test {
use super::{Runtime, ENV};
use std::env;
use tomlenv::Environment;
fn validate_env(currenv: &str) {
env::set_var(ENV, ¤v);
assert_eq!(Runtime::env(), currenv);
assert!(env::var(ENV).is_ok());
env::rem... | Rust | 0 |
import torch
import torch.nn as nn
class SiameseNetwork(nn.Module):
def __init__(self):
super(SiameseNetwork, self).__init__()
self.cnn = nn.Sequential(
nn.Conv2d(3, 128, kernel_size=3, stride=1, padding=1),
nn.ReLU(), # activation function to introduce non-linearity
... | Python | 1 |
"""
Тест упрощенной обработки username без InputSanitizer
"""
import sys
import os
# Добавляем путь к проекту
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../bot'))
def test_simplified_username_processing():
"""Тест упрощенной обработки username как в функции добавления"""
# Имитируем ... | Python | 1 |
ercent(context.XIV, 0)
context.xiv_sell = False
context.xiv_buy = False
if context.portfolio.positions[context.VXX].amount > 0:
price = data.current(context.VXX, 'price')
if price <= context.VXX_SellLossPrice and len(get_open_orders()) == 0:
order_target_pe... | Python | 1 |
#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
import time
from collections.abc import Mapping, Se... | Python | 1 |
"http://census.daybreakgames.com/files/ps2/images/static/{}.png",
census_id
);
let mut resp = ureq::get(&image_url).call()?;
if resp.status() != 200 {
println!("Image Retry");
resp = ureq::get(&image_url).call()?;
}
if resp.status() == 200 {
println!("{:?}", r... | Rust | 0 |
290.0),
City::new(80, "Afghanistan", "Dahaneh-ye Ghowri", 35.9075000, 68.4938889, 758.0),
City::new(81, "Afghanistan", "Lab-Sar", 36.0261111, 66.8386078, 1043.0),
City::new(82, "Afghanistan", "Darwazkay", 35.0200000, 71.0400009, 2508.0),
City::new(83, "Afghanistan", "Munay", 34.9800000, 71.2500000, 995.0),
City::n... | Rust | 0 |
lf.args.n_gru_layers)
net_list = [torch.tanh(x[0]) for x in cnet_list]
inp_list = [torch.relu(x[1]) for x in cnet_list]
#inp_list = [list(conv(i).split(split_size=conv.out_channels//3, dim=1)) for i,conv in zip(inp_list, self.context_zqr_convs)]
inp_list = [list(conv(i).s... | Python | 1 |
import torch
import torch.nn.functional as F
# input, kernel, output are tensors on the GPU
def solve(input: torch.Tensor, kernel: torch.Tensor, output: torch.Tensor,
input_rows: int, input_cols: int, kernel_rows: int, kernel_cols: int):
# Reshape inputs from flattened arrays to 2D matrices
input_2... | Python | 1 |
LTree::Empty => None,
&mut AVLTree::Node(_, _, _, box ref mut r) => match r {
// &mut AVLTree::Empty => None,
_ => Some(r),
},
}
}
fn balance(&mut self) {
let mut rotate_case = RotateCase::Unknown;
match self {
&mut AVL... | Rust | 0 |
US_ICSR_ISRPENDING_RESET: u32 = 0;
pub const M0PLUS_ICSR_ISRPENDING_BITS: u32 = 4194304;
pub const M0PLUS_ICSR_ISRPENDING_MSB: u32 = 22;
pub const M0PLUS_ICSR_ISRPENDING_LSB: u32 = 22;
pub const M0PLUS_ICSR_ISRPENDING_ACCESS: &'static [u8; 3usize] = b"RO\0";
pub const M0PLUS_ICSR_VECTPENDING_RESET: u32 = 0;
pub const M... | Rust | 0 |
from prometheus_client import Counter
from .conf import NAMESPACE
model_inserts = Counter(
"ginger_model_inserts_total",
"Number of insert operations by model.",
["model"],
namespace=NAMESPACE,
)
model_updates = Counter(
"ginger_model_updates_total",
"Number of update operations by model.",
... | Python | 1 |
replace(tzinfo=tz)).days
# Embed
em = Embed(
title=f"📋 Thống kê thời gian làm việc của {member.display_name}",
color=Color.purple()
)
em.set_thumbnail(url=member.avatar.url if member.avatar else member.default_avatar.url)
em.a... | Python | 1 |
from columngen.master import RMP
from columngen.pricer import SPPRCLIB
import time
import sys
def printIterationInfo(master, pricers, iteration, duals, bestRC, costs, columns, start_time):
print("Iteration " + str(iteration))
print("Bound: " + str(master.getObj()))
end_time = time.time()
print("Time: "... | Python | 1 |
Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham Forest|Wandsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and Maidenhead|Wirral|Wokingham|Wolverhampton|Worcestershire|York"
)
s_a.append(
"Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Ma... | Python | 1 |
async fn test_good_batch(
web30: &Web3,
grpc_client: &mut GravityQueryClient<Channel>,
contact: &Contact,
keys: Vec<ValidatorKeys>,
gravity_address: EthAddress,
erc20_contract: EthAddress,
) {
let bridge_fee_amount = one_eth() * 10u8.into();
let (
cdai_held,
send_amount,... | Rust | 0 |
pd.to_numeric(temp_df['总市值'], errors="coerce")
temp_df['权重'] = pd.to_numeric(temp_df['权重'], errors="coerce")
return temp_df
def index_detail_hist_cni(symbol: str = '399001', date: str = "") -> pd.DataFrame:
"""
国证指数-样本详情-历史样本
http://www.cnindex.com.cn/module/index-detail.html?act_menu=1&indexCode=... | Python | 1 |
# coding=utf-8
# Copyright 2025 The Google Research 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 applicab... | Python | 1 |
_tcr_by_node_id((tcx_id,node_id));
let now = <timestamp::Module<T>>::get();
// check if listing was challenged
if listing.challenge_id == T::ChallengeId::from(0) {
// no challenge
// check if apply stage length has passed
ensure!(listing.application_expiry < now, "Apply stage... | Rust | 0 |
# -*- coding: utf-8 -*-
def xor_my_data(data: str, key: str) -> str:
"""Encrypts a string using a secret key with the XOR cipher.
This function performs an XOR operation on each byte of the input data
with the corresponding byte of the key. If the key is shorter than the
data, it wraps around and con... | Python | 1 |
"""
全局配置文件
"""
# 望远镜基本信息
TELESCOPE_CONFIG = {
'latitude': 38.614595,
'longitude': 93.897782,
'altitude': 4300,
'aperture': '1m',
'field_of_view': 'xx'
}
# 主题配置
THEMES = {
'light': {
'background': '#f0f0f0',
'text': '#333333',
'border': '#cccccc',
'button': '#e0e... | Python | 1 |
etrics = optval.get_boolean_argument(a)
elif o == "-r":
__run__.responsibilities = True
elif o == "--responsibilities":
__run__.responsibilities = optval.get_boolean_argument(a)
elif o == "--since":
interval.set_since(a)
elif o == "--version":
version.output()
sys.exit(0)
elif o == "-... | Python | 1 |
from aiogram.utils.keyboard import InlineKeyboardBuilder
async def admin_command():
ikb = InlineKeyboardBuilder()
ikb.button(text="Рассылка📩", callback_data="mailing")
ikb.button(text="Смена реферальной ссылки🔗", callback_data="change_ref")
ikb.button(text="Статистика📊", callback_data="stat")
i... | Python | 1 |
"""
This script download the Nordland dataset with the split used in Patch-NetVLAD.
The images are arranged to be compatible with our benchmarking framework, and
also with the CosPlace repository.
In Nordland usually a prediction for a given query is considered correct if it
is within 10 frames from the query (there's ... | Python | 1 |
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
m... | Rust | 0 |
"required": True,
"default": "",
"placeholder": "",
"min_length": None,
"max_length": None,
},
{
"label": "Why should we unban you?",
"style": 2,
"required": True,
"def... | Python | 1 |
TA: (
triton.cdiv(M, META["BLOCK_SIZE_M"]) * triton.cdiv(N, META["BLOCK_SIZE_N"]),
)
if result is None:
result = torch.zeros((M, N), dtype=torch.float16, device=input.device)
with torch.cuda.device(input.device):
awq_gemm_kernel_sym_nozp_perchannel[grid](
input,
... | Python | 1 |
accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"tx",
|m: &RequestCheckTx| { &m.tx },
|m: &mut RequestCheckTx| { &mut m.tx },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Ch... | Rust | 0 |
=> return Err(MtsvError::InvalidHeader(trimmed.to_string())),
};
children.entry(parentid).or_insert(Vec::new()).push(taxid);
ranks.insert(taxid, rank);
}
Ok((children, ranks))
}
}
#[allow(missing_docs)]
#[derive(Copy, Clone, RustcDecodable, RustcEncodable)]
pu... | Rust | 0 |
###################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free... | Python | 1 |
n3",
b"text/plain",
b"text/richtext",
b"text/rtf",
b"text/tab-separated-values",
b"text/uri-list",
b"text/vcard",
b"text/vtt",
b"text/x-gwt-rpc",
b"text/x-jquery-tmpl",
b"text/x-markdown",
b"text/x-org",
b"text/x-processing",
b"text/x-suse-ymp",
b"text/xml",
b"text/yaml",
b"x-shader/x-fr... | Rust | 0 |
blobs between validators
use crate::bank::Bank;
use crate::blocktree::Blocktree;
use crate::cluster_info::{
ClusterInfo, NodeInfo, DATA_PLANE_FANOUT, GROW_LAYER_CAPACITY, NEIGHBORHOOD_SIZE,
};
use crate::counter::Counter;
use crate::leader_scheduler::LeaderScheduler;
use crate::packet::SharedBlob;
use crate::resu... | Rust | 0 |
alize, TlsSize)]
pub(crate) struct MlsCiphertextContent {
pub(crate) content: MlsPlaintextContentType,
pub(crate) signature: Signature,
pub(crate) confirmation_tag: Option<ConfirmationTag>,
pub(crate) padding: TlsByteVecU16,
}
#[derive(Clone, TlsSerialize, TlsDeserialize, TlsSize)]
pub(crate) struct Ml... | Rust | 0 |
import sympy.physics.mechanics as _me
import sympy as _sm
import math as m
import numpy as _np
x1, x2 = _me.dynamicsymbols('x1 x2')
f1 = x1*x2+3*x1**2
f2 = x1*_me.dynamicsymbols._t+x2*_me.dynamicsymbols._t**2
x, y = _me.dynamicsymbols('x y')
x_d, y_d = _me.dynamicsymbols('x_ y_', 1)
y_dd = _me.dynamicsymbols('y_', 2)
... | Python | 1 |
def compute_metrics(self, feature_pred, data):
pred_jpos = (
feature_pred["pred_wbpos"].squeeze().reshape((-1, 24, 3)).clone().clone()
)
gt_jpos = data["wbpos"].squeeze().reshape((-1, 24, 3)).clone()
mpjpe_global = (
np.linalg.norm((pred_jpos - gt_jpos).detach()... | Python | 1 |
from django.apps import AppConfig
class ChannelsConfig(AppConfig):
name = "channels"
verbose_name = "Channels"
| Python | 1 |
ime]))
self.action_store[episode][time] = action
def do_store_delay(self, episode, time, delay):
while episode >= len(self.delay_store):
self.delay_store.append(np.zeros([self.n_time]))
self.delay_store[episode][time] = delay
def do_store_energy(self, episode, time, energy... | Python | 1 |
ON_TEST_BOOLEAN
}
#[inline]
pub fn ENCODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN(Boolean: D3D10_SB_INSTRUCTION_TEST_BOOLEAN) -> DWORD {
(Boolean << D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT) & D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK
}
pub const D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK: DWORD = 0x00780000;
pub const D3D11_S... | Rust | 0 |
Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct MessageUnpinnedItemItem {}
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct MessageSlackbotResponse {
#[serde(default)]
pub text: String,
pub ts: Option<Timestamp>,
pub user: Option<UserId>,
pub channel: Opti... | Rust | 0 |
iling = R;
}
}
let resolved = if leading == trailing {
// N1
leading
} else {
// N2
if level & 1 != 0 {
R
} else {
... | Rust | 0 |
.tensorsolve(a, b, axes=dims),
dtypes=floating_and_complex_types(),
sample_inputs_func=sample_inputs_tensorsolve,
supports_forward_ad=True,
supports_fwgrad_bwgrad=True,
decorators=[
skipCUDAIfNoMagmaAndNoCusolver,
skipCPUIfNoLapack,
DecorateInf... | Python | 1 |
,
OpIf,
OpElse,
OpEndIf,
OpReturn,
OpAbort,
// Crypto
OpCheckPerms,
OpCheckPermsFastFail,
OpCheckMultiPerms(u8, u8), // M of N: minimum threshold to number of accounts
OpCheckMultiPermsFastFail(u8, u8),
// Lock time
OpCheckTime(u64), // Epoch time in seconds
OpCheck... | Rust | 0 |
et)
def repr_deque(self, x, level):
return self._repr_iterable(x, level, 'deque([', '])', self.maxdeque)
def repr_dict(self, x, level):
n = len(x)
if n == 0:
return '{}'
if level <= 0:
return '{' + self.fillvalue + '}'
newlevel = level - 1
... | Python | 1 |
# Copyright 2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
def post_init_hook(env):
env["res.partner"]._install_partner_firstname()
| Python | 1 |
x + 1, position.y),
_ => continue,
};
if let Some(tile) = resources.map.get(target_x, target_y) {
if tile.solid {
continue;
}
}
position.x = target_x;
position.y = target_y;
movement.energy = 0;
if movement.pl... | Rust | 0 |
let a = [1];
let b = [1];
assert_eq!(crossover_pmx_single(&a, &b, 0, 0), [1]);
let a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
let b = [9, 3, 7, 8, 2, 6, 5, 1, 4];
assert_eq!(crossover_pmx_single(&a, &b, 3, 6), [9, 3, 2, 4, 5, 6, 7, 1, 8]);
let a = str_to_vec("abcdefghi"... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | Python | 1 |
) {
return Ok(res);
} else {
return Err(sp_runtime::DispatchError::Other("Evm error"));
}
}
}
}
fn trace_block(
extrinsics: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<
Vec<
thales_rpc_primitives_debug::block::TransactionTrace>,
sp_runtime::DispatchError
> {
us... | Rust | 0 |
from pyrs.algorithm import supervision_classification as sc
from pyrs.algorithm import rs_image
from osgeo import gdal
import numpy as np
import glob
import openpyxl
import pandas as pd
from sklearn.linear_model import LinearRegression
def saveExcel(Array, save_path):
workbook = openpyxl.Workbook()
sheet0 = w... | Python | 1 |
_batch([x.sequences_ids[0] for x in result])
response = []
for idx, r in enumerate(result):
response.append({'text': texts[idx].strip()})
if self.generate_kwargs['return_scores']:
seq_len = len(r.sequences_ids[0])
cum_logprob = r.scores[0... | Python | 1 |
int(f"Model: {summary['model_name']}")
>>> print(f"Best metric: {summary['best_metric']}")
"""
return {
"model_name": self.model.name,
"model_type": self.model.__class__.__name__,
"trained": self.model.trained,
"train_metrics": self.train_metri... | Python | 1 |
(MoveVariant::Standard)).state(), vec![
U, U, U, U, U, U, U, U, U, U, U, U, U, U, U, U,
B, B, B, B, R, R, R, R, R, R, R, R, R, R, R, R,
R, R, R, R, F, F, F, F, F, F, F, F, F, F, F, F,
D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D,
F, F, F, F, L, L, L, L, L, L, L, L, L, L, L,... | Rust | 0 |
ast::expr_unary(ast::box(ast::m_imm),
@dse(ast::expr_lit(@dsl(ast::lit_bool(true)))))),
dse(ast::expr_unary(ast::uniq(ast::m_imm),
@dse(ast::expr_lit(@dsl(ast::lit_bool(true))))))
]
}
pure fn safe_to_steal_expr(e: @ast::expr, tm: test_mode) -> bool {
safe_... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# PROJECT_NAME: easyofd img_deal
# CREATE_TIME: 2024/7/18 11:20
# E_MAIL: renoyuan@foxmail.com
# AUTHOR: renoyuan
# note: img 操作
from io import BytesIO
class DealImg(object):
def __init__(self):
pass
def resize(self):
"""resize img"""
pass
... | Python | 1 |
ig2
"IE6enDsG5kP36AmR7kKh+F47/iCfGKctx3I1bqPKfXM+gMDd+QjRvghFltkW9d3BIAilKs6Wt9g9XSzBvI46px4=".to_string(), // msig3
],
0,
100000000000000,
100,
Some("<KEY>"),
true,
util::P2SH,
)?;
// test with multisig (2 of 3) two correct, one false
do_btc_kernel_test(
"./tests/resources/gen_bin4... | Rust | 0 |
("To implement: Tests of struct literal type checking")
}
#[test]
fn type_check_attribute_access() {
panic!("To implement: Tests of attribute access type checking")
}
#[test]
fn type_check_nonexistent_attribute_access() {
let context = Context::b... | Rust | 0 |
io::Result<[u64; 2]> {
let shape = extract_indices(npz, name)?;
if shape.len() != 2 {
return Err(invalid_data(format_args!("invalid length for '{}' (got {}, expected 2)", name, shape.len())))
}
Ok([shape[0], shape[1]])
}
fn extract_usize_indices<R: io::Read + io::Seek>(npz: &mut NpzArchive<R>,... | Rust | 0 |
ReturnCode::SuccessWithValue { value: 0 }
}
3 /* set phase */ => {
match arg1 {
0 => self.spi_slave.set_phase(ClockPhase::SampleLeading),
_ => self.spi_slave.set_phase(ClockPhase::SampleTrailing),
};
... | Rust | 0 |
# dicionario_semantico.py
DICIONARIO_COMPONENTES = {
"rds": "Database",
"mysql": "Database",
"mariadb": "Database",
"elasticache": "Cache",
"redis": "Cache",
"api gateway": "API Gateway",
"gateway": "API Gateway",
"load balancer": "Load Balancer",
"auth": "Authentication",
"auth... | Python | 1 |
# Copyright (C) 2013 Torsten Landschoff <torsten@debian.org>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at yo... | Python | 1 |
else {
Ok(true)
}
}
fn do_visit<F>(
&mut self,
nodes: &'a [Node<'a>],
func: &mut F,
) -> StdResult<bool, VisitError>
where
F: FnMut(
&[BorrowedTemplateWithText],
&HeaderStack<'a>,
) -> LuaResult<bool>,
{
us... | Rust | 0 |
u32::MAX
];
static ref NUMS_U64: [u64; 22] = [
2u64.pow(0) - 1,
2u64.pow(0),
2u64.pow(7) - 1,
2u64.pow(7),
300,
2u64.pow(14) - 1,
2u64.pow(14),
2u64.pow(21) - 1,
2u64.pow(21),
2u64.po... | Rust | 0 |
timeFilter = advTimeFilter.getReqObj()
else:
timeFilter['filters'].append(advTimeFilter.getFilter())
timeFilter['request'][0]['and'].append(advTimeFilter.getRequest()[0]['and'][0])
return timeFilter
def _req_obj(self) -> dict:
_req_obj: dict = ... | Python | 1 |
t is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if pipeline_id is not None:
route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int')
query_parameters = {}
if pipeline_version is not None:
query... | Python | 1 |
# vim: fileencoding=utf-8
"""
Translation of v2
"""
# pylint: disable=line-too-long,bad-whitespace
V2_TRANSLATION = {
"en": (
"Weather report for:",
"Weather",
"Timezone",
"Now",
"Dawn",
"Sunrise",
"Zenith",
"Sunset",
"Dusk",
),
"af":... | Python | 1 |
g_media_plugins_permission_request_get_description(self.to_glib_none().0))
}
}
}
<filename>formatted_print.rs
fn main() {
println!("{0}, this is {1}. {1}, this is {0}", "Alice", "Bob"); // Alice, this is Bob. Bob, this is Alice
println!("{subject} {verb} {object}",
object="the lazy dog... | Rust | 0 |
gy.powi(2));
//println!("{}", data);
f.write_all(data.as_bytes()).expect("Unable to write data");
println!("a: {:.8} || b: {:.8} || E: {:.8} || Iter: {}", alphas[i], betas[i], energy / N as f64, i);
let energy_deriv_alpha = 2.* (wf_deriv_alpha_times_energy-wf_deriv_alph... | Rust | 0 |
e players turn, if they rolled doubles they need to take another turn
if roll_again {
//RECURSION!
take_player_turn(player, rng, board, card_decks, doubles_count);
}
}// My solution
fn duplicate_encode(word: &str) -> String {
use std::collections::HashMap;
let lower_case = word.to_... | Rust | 0 |
nd(&mut resp.prefixes.unwrap());
}
match resp.next_page_token {
Some(temp_token_str) => page_token = temp_token_str.clone(),
None => break,
}
}
Ok((objects, prefixes))
}
#[cfg(test)]
mod tests {
use super::*;
extern crate env_logger;
const LANDSAT_... | Rust | 0 |
.size([400.0, 300.0], Condition::FirstUseEver)
.opened(&mut opened)
.build(ui, || {
ui.text_wrapped(contents);
});
if !opened {
remove = idx as i32;
}
}
if remove >= 0 {
... | Rust | 0 |
\xe7\x86\xe8\xeb\xeb\xc5S\x0a\xa1\x04\
R\x0a4M2}\x7f\x86\xd9Gs\x04\x83A\xbe\xf8\
\xfcSB\xa10\x9e\xe7#5\x8dR\xe9\x1a\xbe\x12<\
^z@84\xcd\xc7\x1f\x7fB \x1081P\x1e\
\xf7\xc0\xf6\xf6\x16\xf3\xcb\xeb\x08+AO.\x8b\xe7+\
\x94\x10 _\x01W\x9e\xad\xf1`n\x95\xe9\x87\xf3\xd8\
\x8e\x83\xd4$B\x0a\x10\x02\x85d\xe8\xd2%\xcc\x8e\x1e\
\x... | Python | 1 |
/// The argument is of type `&[u8]` instead of `&str` to save callers
/// that are extracting the label from a non-UTF-8 protocol the trouble
/// of conversion to UTF-8. (If you have a `&str`, just call `.as_bytes()`
/// on it.)
#[inline]
pub fn for_label(label: &[u8]) -> Option<Charset> {
i... | Rust | 0 |
tion."""
if not dtype.is_floating:
raise TypeError('Cannot create initializer for non-floating point type.')
# Estimating fan_in and fan_out is not possible to do perfectly, but we try.
# This is the right thing for matrix multiply and convolutions.
fan_in = float(shape[-2])
fan_out = float(sh... | Python | 1 |
client format.
#[doc(hidden)] // TODO: shouldn't be pub
pub fn to_default_float_format(&self) -> gl::types::GLenum {
self.to_float_internal_format()
.map(|e| e.to_glenum())
.unwrap_or_else(|| self.to_gl_enum().0)
}
/// Returns a GLenum corresponding to the default ... | Rust | 0 |
ized)
img_init_points = cv.rectangle(img_init_points, (grasping_point_eval_resized[1] - int(grasp_area_resized[1]/2), grasping_point_eval_resized[0] - int(grasp_area_resized[0]/2)), (grasping_point_eval_resized[1] + int(grasp_area_resized[1]/2), grasping_point_eval_resized[0] + int(grasp_area_resized[0]/2)), 25... | Python | 1 |
licy::OriginWhenCrossOrigin,
"strict-origin" => Policy::StrictOrigin,
"strict-origin-when-cross-origin" => Policy::StrictOriginWhenCrossOrigin,
"unsafe-url" | "always" => Policy::UnsafeUrl,
_ => continue,
});
}
known
... | Rust | 0 |
if not cluster2idf_normal.has_key(c):
cluster2idf_normal[c] = 0
cluster2idf_normal[c] = np.log(normal_video_count / float(1 + cluster2idf_normal[c]))
return cluster2idf_normal
vid2abscore = dict()
cluster2idf_normal = get_idf()
for vid in vid2cluster_ab:
... | Python | 1 |
item that has a uniqueness violation should work.
assert_eq!(table.delete(|k, _v| k == &1i64.to_le_bytes()).len(), 1);
table
.insert(|_| 1i64.to_le_bytes().to_vec(), "v3".to_string())
.unwrap();
// Uniqueness violation in value.
table
.insert(|_| 5i64.to_le_bytes().to_vec(), "v3... | Rust | 0 |
#[test]
fn login() {
session("readonly-test@localhost");
}
#[test]
fn logout() {
let mut s = session("readonly-test@localhost");
s.logout().unwrap();
}
#[test]
fn inbox_zero() {
// https://github.com/greenmail-mail-test/greenmail/issues/265
let mut s = session("readonly-test@localhost");
s.s... | Rust | 0 |
import streamlit as st
import pandas as pd
import datetime
# 페이지 설정
st.set_page_config(page_title="기록장", page_icon="📒")
# 앱 제목
st.title("📒기록장")
# 사용자 입력 폼
with st.form(key='entry_form'):
date = st.date_input("날짜", value=datetime.date.today())
title = st.text_input("제목")
content = st.text_area("내용")
... | Python | 1 |
les, samples1, samples2);
}
}
}
ret
}
pub fn pdf(&self, wo: &Vector3f, wi: &Vector3f, flags: BxDFType) -> f32 {
if self.n_bxdfs == 0 {
return 0.0;
}
let wo = self.world_to_local(wo);
let wi = self.world_to_local(wi);
... | Rust | 0 |
'''
Author: ZhangLan
Date: 2024-03-02 12:34:48
LastEditors: ZhangLan
LastEditTime: 2024-03-02 14:43:44
Description: file content
'''
import numpy as np
import nibabel as nib
def remove_slices_without_label(img_path, img1_path, img2_path, img3_path, label_path):
# 加载图像和标签
img = nib.load(img_path)
img1 = nib... | Python | 1 |
from Py4GWCoreLib.enums import outpost_name_to_id, explorable_name_to_id
# 1) IDs
_8_pikensquare_to_ascaloncity_ids = {
"outpost_id": outpost_name_to_id["Piken Square"],
}
# 2) Outpost exit path
_8_pikensquare_to_ascaloncity_outpost_path = [
(20238, 7794),
(20235, 7654),
]
# 3) Segments
_8_pikensquare_to_a... | Python | 1 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# 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... | Python | 1 |
{
// Retrieve the stream from the iterator's result, which is (the result)
// of type enum Option<T>. As usual, .unwrap() will panic if the variant
// type is None
//
// stream will be of type TcpStream; this type represents a connection
// between the host and the client... | Rust | 0 |
, 2], host_buf);
/// ```
#[allow(needless_pass_by_value)]
pub unsafe fn from_raw_parts<'a>(data: DevicePointer<T>, len: usize) -> &'a DeviceSlice<T> {
DeviceSlice::from_slice(slice::from_raw_parts(data.as_raw(), len))
}
/// Performs the same functionality as `from_raw_parts`, except that a
... | Rust | 0 |
"]
#[inline(always)]
pub fn variant(&self) -> SDR12DRVSTVAL_A {
match self.bits {
0 => SDR12DRVSTVAL_A::TYPEB,
1 => SDR12DRVSTVAL_A::TYPEA,
2 => SDR12DRVSTVAL_A::TYPEC,
3 => SDR12DRVSTVAL_A::TYPED,
_ => unreachable!(),
}
}
#[doc... | Rust | 0 |
de, T, D>(deserializer: D) -> Result<T, D::Error>
where
T: Deserialize<'de> + FromStr<Err = core::convert::Infallible>,
D: Deserializer<'de>,
{
struct StringOrStruct<T>(PhantomData<fn() -> T>);
impl<'de, T> Visitor<'de> for StringOrStruct<T>
where
T: Deserialize<'de> + F... | Rust | 0 |
: 3
Features : fp asimd aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1";
#[test]
fn arm_cortex_a57() {
let cpuinfo = CpuInfo::from_str(ARM_CORTEX_A57).unwrap();
... | Rust | 0 |
crypto::asymmetric::KeyPair;
// State key name "mixer_eth_addr" holding eth address of Mixer contract
//static MIXER_ETH_ADDR: &str = "mixer_eth_addr";
static ENCRYPTION_KEY: &str = "encryption_key";
// For contract-exposed functions, declare such functions under the following public trait:
#[pub_interface]
pub trait... | Rust | 0 |
Incorrect root node of the chapter") }
}
*/
_ => assert! (false, format! ("Unimplemented tag type for a chapter '{}'", $tag))
}
}};
($book:expr, chapter_index = $chapter_index:expr, $chapter_tree:tt) => {{
if let Some (chapter) = $book.get_chapter ($chapter_index) {
... | Rust | 0 |
);
let multi_text = "\
example 42 number\n\
example 90 number\n\
Done.";
ctx.do_edit(EditNotification::Insert { chars: multi_text.into() });
ctx.do_edit(EditNotification::Gesture { line: 1, col: 9, ty: PointSelect });
ctx.do_edit(EditNotification::AddSelectionAbov... | Rust | 0 |
import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_storm_control_level
class TestConfigureInterfaceStormControlLevel(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
Overlord1:
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.