text string | label_name string | labels int64 |
|---|---|---|
from steps.utils import send_get_request, send_delete_request, send_post_request
def setup_context_with_global_params_test(context):
context.sites_to_be_cleaned_up = []
def create_site_entry(sites_names):
endpoint = "dcim/sites/"
for site in sites_names:
payload = {
"name": site,
... | Python | 1 |
ronment/config)
integrator.register_credentials(
APIProvider.ARXIV,
APICredentials(provider=APIProvider.ARXIV, rate_limit=30) # Be conservative
)
integrator.register_credentials(
APIProvider.CROSSREF,
APICredentials(provider=APIProvider.CROSSREF, rate_limit=50)
)
... | Python | 1 |
epub_publisher = u'Daniel Quinn'
epub_copyright = u'2014, Daniel Quinn'
# The basename for the epub file. It defaults to the project name.
#epub_basename = u'RIPE Atlas Sagan'
# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and e... | Python | 1 |
# RUN: %PYTHON %s 2>&1 | FileCheck %s
import torch
import torch._dynamo as dynamo
from torch._inductor.decomposition import decompositions as inductor_decomp
from torch._functorch.aot_autograd import aot_autograd_decompositions
from buddy.compiler.frontend import DynamoCompiler
from buddy.compiler.ops import linalg
f... | Python | 1 |
gles[hit_data[0] as usize].u1,
self.triangles[hit_data[1] as usize].u1,
self.triangles[hit_data[2] as usize].u1,
self.triangles[hit_data[3] as usize].u1,
);
let t_u2 = Vec4::new(
self.triangles[hit_data[0] as usize].u2,
self.triangles[hit_data[... | Rust | 0 |
t X_test.shape[0] == 10
# With shuffling and a fixed seed, results should be deterministic
def test_split_data_invalid_split(self):
X = np.arange(10).reshape(-1, 1)
y = np.arange(10)
# Test invalid splits
with pytest.raises(AssertionError):
split... | Python | 1 |
venenatis vitae, \
justo. Nullam dictum felis eu pede mollis pretium.";
/// Unicode placeholder text with 470 characters
pub(crate) static UNICODE: &str = "ǹɕǶǽũ ȥűǷŀȷÂǦǨÏNJ ýǡƎƭǃÁžƖţŝŬœĶ ɳƙŁŵŃŋŗ dzÆŅɜŴô ħIJǗɧÝÙĝɸÿ \
ǝƬDŽƫɌñÄç ɎƷɔȲƧ éďŅǒƿŅ üIJƪɮúǚijǓɔÏǙǟ ǃóıÄ×ȤøŌɘŬ ȃŜʈǑƱļ ȶė÷ƝȣŞýş óɭǽƎȮ ŏŀƔȾřŞȩ \
... | Rust | 0 |
p.start()
processes.append(p)
for p in processes:
p.join()
if args.partitions == 1:
return
# encode partition files in parallel
processes = []
input_key = 'sentence_split' if args.split_sentences else 'partition'
for name in in_ss_out_nam... | Python | 1 |
en = text_input_state.mode.max_char_len();
for _ in 0 .. (max_char_len - text.len()) {
text.push(b' ');
}
for c in text_input_state.mode.suffix() {
text.push(*c);
}
console_state.draw_text_at(63, 5, &text.data, Black, White);
*console_state.get_char_mut(63 + text_input_state.t... | Rust | 0 |
sting.gdlk")
.source_code("READ RX0")
.insert(&conn)
});
assert_eq!(
runner
.query(
QUERY,
hashmap! {
"id" => InputValue::scalar(user_program.id.to_string()),
}
)
.await,
... | Rust | 0 |
d, T::KittyIndex),
/// The price for a kitty has been updated. \[owner, kitty_id, price\]
KittyPriceUpdated(T::AccountId, T::KittyIndex, Option<BalanceOf<T>>),
/// A kitty is sold. \[seller, buyer, kitty_id, price\]
KittySold(T::AccountId, T::AccountId, T::KittyIndex, BalanceOf<T>),
}
// --- ERRORS ---
#[pa... | Rust | 0 |
_termos_produto(lista_termos_nomes_produtos, nome)
# Selecionar os elementos corretos e verificados
if tem_termo_banido == False and tem_todos_termos_produto :
preco = resultado.find_element(By.CLASS_NAME, 'Text_MobileHeadingS__HEz7L').text
preco = preco.replace("... | Python | 1 |
from typing import List, Any
def filter_integers(values: List[Any]) -> List[int]:
""" Filter given list of any python values only for integers
>>> filter_integers(['a', 3.14, 5])
[5]
>>> filter_integers([1, 2, 3, 'abc', {}, []])
[1, 2, 3]
"""
/0x01-python-if_else_loops_functions/10-print_tebah... | Python | 1 |
ctx,
&mac::DisassocHdr { reason_code: mac::ReasonCode::AP_INITIATED },
);
// Verify timeout was canceled.
assert_variant!(ctx.timer.triggered(&timeout), None);
// Verify MLME-ASSOCIATE.confirm message was sent.
let msg = m.fake_device.next_mlme_msg::<fidl_mlme::Ass... | Rust | 0 |
ointer to the register block"]
pub const PTR: *const port_j::RegisterBlock = 0x0320 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const port_j::RegisterBlock {
Self::PTR
}
}
impl Deref for PORT_J {
type Target = port_j::Registe... | Rust | 0 |
wrap_or_default().to_str() == Some("tlog"));
while let Some(file) = files.next() {
let filename = file.file_name();
let filename = filename.to_str().unwrap();
let filename = std::path::Path::new(test_path)
.join(filename)
.canonicalize()
... | Rust | 0 |
try:
import torch
import xentropy_cuda
from .softmax_xentropy import SoftmaxCrossEntropyLoss
del torch
del xentropy_cuda
del softmax_xentropy
except ImportError as err:
print("apex was installed without --xentropy flag, contrib.xentropy is not available")
| Python | 1 |
src_lo, types::I64));
ctx.emit(Inst::gen_move(
Writable::from_reg(regs::rcx()),
amt_src,
types::I64,
));
// N.B.: right-shift of *lower* half is *always* unsigned (its MSB is not a sign bit).
ctx.emit(Inst::shift_r(
OperandSize::Size64,
ShiftKind::ShiftRightLogic... | Rust | 0 |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Case data in internal format.
"""
from numpy import array
def t_case_int():
"""Case data in internal format used to test C{ext2int} and C{int2ext}.
"... | Python | 1 |
object.key("DomainName").string(var_2208.as_str());
}
if let Some(var_2209) = &input.resource_record {
let mut object_2210 = object.key("ResourceRecord").start_object();
crate::json_ser::serialize_structure_crate_model_aws_certificate_manager_certificate_resource_record(&mut object_2210, var_... | Rust | 0 |
(
path: web::Path<i64>,
payload: web::Json<req::BuyOrder>,
) -> Result<HttpResponse, ApiError> {
let trader_id = path.into_inner();
let payload = payload.into_inner();
let card_id = payload.card_id;
let expected_price = payload.expected_price.into();
let domain_registry = DOMAIN_REGISTRY.get().unwrap().r... | Rust | 0 |
corr in [False, True]:
for is_r, is_s, custom_nb_force in baseGC_big.custom_nonbonded_force_list:
custom_nb_force.setUseLongRangeCorrection(disp_corr)
tick = time.time()
baseGC_big.set_ghost_list([271, 272, 273], check_system=False)
print(f"## Time for up... | Python | 1 |
lon_mode_ttgr_lon_mode;
#[doc = "MAN register accessor: an alias for `Reg<MAN_SPEC>`"]
pub type MAN = crate::Reg<man::MAN_SPEC>;
#[doc = "Manchester Configuration Register"]
pub mod man;
#[doc = "LINMR register accessor: an alias for `Reg<LINMR_SPEC>`"]
pub type LINMR = crate::Reg<linmr::LINMR_SPEC>;
#[doc = "LIN Mode ... | Rust | 0 |
default=argparse.SUPPRESS,
help='architecture to build for, or "foreign" for all architectures other than the host architecture; may be given multiple times (default: foreign)',
)
args = parser.parse_args()
if not hasattr(args, "architectures"):
args.architectures = ["foreign"]
arc... | Python | 1 |
import requests
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
import configparser
import os
try:
import renpy
game_directory = renpy.config.gamedir
except:
game_directory = os.getcwd()
audio_directory = os.path.join(game_directory, "audio")
config = configparser.ConfigParser()
config... | Python | 1 |
if response.status_code == 200:
try:
res_json = response.json()
url = res_json.get("data", {}).get("url")
if url and len(url) > 0:
print(f"... | Python | 1 |
import pandas as pd
# Assuming you have a dictionary containing the required columns
data = {
'OrderID': [1, 2, 3, 4, 5],
'CustomerID': [101, 102, 103, 101, 104],
'ProductID': [201, 202, 203, 204, 205],
'Quantity': [2, 3, 1, 2, 4],
'TotalPrice': [20.50, 30.25, 15.75, 25.00, 40.50]
}
# Convert dict... | Python | 1 |
.unify(
ty,
Type::Constructor {
name: dtor.ty.clone(),
arguments: fresh_vars.iter().map(|(_, fresh)| fresh.clone()).collect(),
},
)?;
Ok(binders
.into_iter()
.zip(data_constructor.fields)
.map(|(bind... | Rust | 0 |
import torch
import torch.nn as nn
from ...models.modules.aspp import ASPP, ASPPDeformable
from ...config import Config
config = Config()
class BasicDecBlk(nn.Module):
def __init__(self, in_channels=64, out_channels=64, inter_channels=64):
super(BasicDecBlk, self).__init__()
inter_channels = in... | Python | 1 |
.await?
.json::<Vec<DeploymentRow>>()
.await?;
Ok(resp)
}
pub async fn get_node_by_id(id: &str, all: bool) -> Result<Node, reqwest::Error> {
let resp = reqwest::get(format!("{}/node/get/{}/{}", get_server_address(), id, all))
.await?
.json::<Node>()
.await?;
Ok(res... | Rust | 0 |
Call
async fn call(
&self,
_caller: Caller,
_data: CallRequest,
_rpc_caller: RpcCaller,
) -> MentatResponse<CallResponse> {
MentatError::not_implemented()
}
}
/// Trait to wrap the `CallApi`.
/// This trait helps to define default behavior for running the endpoints
... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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/LICENSE-2.0
#
# Unless requir... | Python | 1 |
ings("default", category=DeprecationWarning)
warnings.warn(
(
"create-transifexrc command and SPHINXINTL_TRANSIFEX_TOKEN "
"will be deprecated. Please use TX_TOKEN environment variable instead."
),
category=DeprecationWarning,
)
transifex.create_transifexrc(tr... | Python | 1 |
n = -Single::NAN;
let snan = Single::snan(None);
assert!(p_inf.bitwise_eq(p_inf.scalbn(0)));
assert!(m_inf.bitwise_eq(m_inf.scalbn(0)));
assert!(p_zero.bitwise_eq(p_zero.scalbn(0)));
assert!(m_zero.bitwise_eq(m_zero.scalbn(0)));
assert!(p_qnan.bitwise_eq(p_qnan.scalbn(0)));
assert!(m_qnan.b... | Rust | 0 |
uda",
strategy=FSDPStrategy(auto_wrap_policy=always_wrap_policy),
devices=2,
)
# Hack: we already called launch() on another Fabric instance above
fabric._launched = True
model = BoringModel()
optimizer = torch.optim.Adam(model.parameters())
model, optimizer = fabric.setup(mode... | Python | 1 |
ol_size: usize,
buf: wl_buffer::WlBuffer,
newsize: Option<(i32, i32)>
}
impl wayland_window::Handler for Window {
fn configure(&mut self, _: &mut EventQueueHandle, _: wl_shell_surface::Resize, width: i32, height: i32) {
self.newsize = Some((width, height))
}
}
impl Window {
fn resize(&mut ... | Rust | 0 |
# test syntax errors
def test_syntax(code):
try:
exec(code)
print("no SyntaxError")
except IndentationError:
print("IndentationError")
except SyntaxError:
print("SyntaxError")
# non-newline after line-continuation character (lexer error)
test_syntax("a \\a\n")
# dedent mis... | Python | 1 |
Return None if fields have default values.
if endpoint.port == 0 || endpoint.ip_addr.is_empty() {
return None;
}
let endpoint = ConnectionEndpoint::try_from(endpoint.clone())
.unwrap_or_else(|e| panic!("Node {} XNet endpoint [{:?}]: {}", node_id, endpoint, e));
... | Rust | 0 |
# uncompyle6 version 2.11.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41)
# [GCC 9.3.0]
# Embedded file name: Exploits\CVE_2019_6340Drupal8RESTful.py
import requests
from Exploits import printModule
r = '\x1b[31m'
g = '\x1b[32m'
y = '\x1b[33m'
b = '\x1b[34m'
m = '\x1b[... | Python | 1 |
et(self.places_client.ENDPOINTS['address'], {
'lat': self.places_client.geolocation.get_coordinates()[0],
'lon': self.places_client.geolocation.get_coordinates()[1],
'map_provider': self.places_client.map_provider.choose_provider()
})
if "error" not in data:
... | Python | 1 |
125 as char,
126 as char,
127 as char,
'\u{20ac}',
'\u{81}',
'\u{201a}',
'\u{0192}',
'\u{201e}',
'\u{2026}',
'\u{2020}',
'\u{2021}',
'\u{02c6}',
'\u{2030}',
'\u{0160}',
'\u{2039}',
'\u{0152}',
'\u{8d}',
'\u{017d}',
'\u{8f}',
'\u{90}',
... | Rust | 0 |
er_size=3, min_samples=2)
# Choose the best parameters based on silhouette score
# best_result = max(results, key=lambda x: x[2])
# best_min_cluster_size, best_min_samples, best_silhouette, best_cluster_labels = best_result
# print(f"Best min_cluster_size: {best_min_cluster_size}, Best min_samples: {... | Python | 1 |
"""
do BFS from each building, and decrement all empty place for every building visit
when grid[i][j] == -b_nums, it means that grid[i][j] are already visited from all b_nums
and use dist to record distances from b_nums
"""
def shortest_distance(grid):
if not grid or not grid[0]:
return -1
matrix = [... | Python | 1 |
uilder.into_expr(&Place::RETURN_PLACE, block, expr));
let source_info = builder.source_info(span);
builder.cfg.terminate(block, source_info, TerminatorKind::Return);
// Constants can't `return` so a return block should not be created.
assert_eq!(builder.cached_return_block, None);
// Constants ma... | Rust | 0 |
s: &rust::Files) -> Vec<Kind> {
let mut output = Vec::<Kind>::new();
for stmt in &function.statements {
if let Some(rust_loc) = stmt.rust_loc() {
if let Some(rust_line) = rust_files.line(rust_loc).map(|line| {
let path = rust_files.file_path(rust_loc).unwrap();
... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) 2022 CINN Authors. 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/LICENSE-2.0
#
# Unless r... | Python | 1 |
completion = BlockCompletion.objects.create(
user=self.user,
context_key=course.context_key,
block_type='course',
block_key=section.location,
completion=0.5,
)
completion.created = datetime.datetime.now(pytz.UTC) - datetime.timedelta(days=co... | Python | 1 |
=15)
if visu:
planeNode.addObject('OglModel', name="Visual", src="@loader", color=[1, 1, 1, 0.5], rotation=[90, 0, 0],
translation=[250, 35, -1], scale=15)
if simu:
planeNode.addObject('TriangleCollisionModel', simulated=0, moving=0, group=1)
planeNode.addObj... | Python | 1 |
s() -> Result<(), Box<dyn std::error::Error>> {
let mut engine = Context::new();
let date_time = forward_dt_local(&mut engine, "new Date(99, 06, 08, 09, 16, 15, 779)");
assert_eq!(
Some(NaiveDate::from_ymd(1999, 07, 08).and_hms_milli(09, 16, 15, 779)),
date_time
);
Ok(())
}
#[test... | Rust | 0 |
"""
Created on 2023/11/23
@author: Chen Qian
@e-mail: chenqian2020@sjtu.edu.cn
"""
"""
This script is used to train the models sequentially.
Before run this, please set <--data_dir> to the directory of the CWRU dataset in <main.py> first.
"""
import os, sys
if __name__ == '__main__':
# set the current directory
... | Python | 1 |
e1\x820k\xd7\xee\xae\xaf4k]\xd2\xca\xcc\
\xdf\xc4\xbe\xd4\xd9m\x7f\xb56\xdcE{*\xb7\xfc\xf3\
\xfe\x1f\xc2\xaaW\x94M\xa1Q\xc2=\xd1\x83\xe1/\xd9\
\xde\xc3\xc1\xb7M\x7fa\xaaj\x96\xadq\xf3\xc9\x0c\x97\
FH\xd9\xbd@l\xe2\xb6/\xf4\xbdsO\xb5k\x8b\
{\xfb{\xc5_\x99cu\xda\xdfL\x8a\xdc\x97\xc3\x91\
k\xd6\xaa\xb2\xb3\x7f\xbb\xfc-V%\... | Python | 1 |
heckpoint_url:
model_name += "-xlarge"
elif "large" in checkpoint_url:
model_name += "-large"
if "224" in checkpoint_url:
model_name += "-224"
elif "384" in checkpoint_url:
model_name += "-384"
if "22k" in checkpoint_url and "1k" not in checkpoint_url:
model_name ... | Python | 1 |
ing
refpts: Observation points. Default: start of the machine
dp: static momentum offset
offset: initial orbit. Default: closed orbit
grid_mode: defines the evaluation grid:
* :py:attr:`.GridMode.CARTESIAN`: full [:math:`\:x, y\:`] grid
... | Python | 1 |
s a SHUTDOWN or ABORT chunk is
/// received or when the SCTP association has been closed intentionally,
/// such as by closing the peer connection or applying a remote description
/// that rejects data or changes the SCTP port.
Closed,
}
impl Default for RTCSctpTransportState {
fn default() -> Self... | Rust | 0 |
CodeParseErr, CloseReason, DataCode, OpCode};
use crate::protocol::{HeaderFlags, Role};
use crate::test_fixture::{expect_err, EmptyIo, MirroredIo};
use bytes::BytesMut;
use std::error::Error as StdError;
use std::fmt::Debug;
use std::iter::FromIterator;
#[tokio::test]
async fn frame_text() {
let bytes = BytesMut::... | Rust | 0 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | Python | 1 |
inapi::um::winuser::WS_CAPTION;
static HANDLED_EVENTS: [u32; 2] = [EVENT_OBJECT_SHOW, EVENT_OBJECT_DESTROY];
static OS_WINDOWS: [&str; 25] = [
"Task Switching",
"OLEChannelWnd",
".NET-BroadcastEventWindow",
"Default IME",
"MSCTFIME UI",
"OleMainThreadWndName",
"CicMarshalWnd",
... | Rust | 0 |
# trunk-ignore-all(flake8/F821)
# trunk-ignore-all(ruff/F821)
Import("env")
# NOTE: This is not currently used, but can serve as an example on how to write extra_scripts
# print("Current CLI targets", COMMAND_LINE_TARGETS)
# print("Current Build targets", BUILD_TARGETS)
# print("CPP defs", env.get("CPPDEFINES"))
# p... | Python | 1 |
self.wtype as usize][level_idx];
let max = self.level == WeaponLevel::Level3 && self.experience == max_exp;
(self.experience, max_exp, max)
}
pub fn add_xp(&mut self, exp: u16, player: &mut Player, state: &mut SharedGameState) {
let curr_level_idx = self.level as usize - 1;
let... | Rust | 0 |
{predicted_label}', color='green')
else:
plt.title(f'预测: {predicted_label}\n实际: {true_label}', color='red')
plt.axis('off') # 隐藏坐标轴
plt.tight_layout()
# 添加时间戳避免覆盖
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
plt.savefig(f'custom_predictions_{timestamp}.png')
... | Python | 1 |
SETUP: StepFepPlusSetup,
_SBE.STEP_FEP_PLUS_EXEC: StepFepPlusExec,
_SBE.STEP_FEP_ABSOLUTE: StepSchrodingerAbsoluteFEP,
_SBE.STEP_FEP_PLUS_ANALYSIS: StepFepPlusAnalysis,
_SBE.STEP_PREPWIZARD: StepPrepwizard,
_SBE.STEP_RESIDUE_SCANNING: StepResidueScanning,
_SBE.STEP_MDPOCK... | Python | 1 |
import re
WIDTH = 101
HEIGHT = 103
robots = []
for line in open(0):
robots.append(list(map(int, re.findall(r"-?\d+", line))))
initial = list(map(list, robots))
max_cluster = 0
best_iteration = None
for second in range(WIDTH * HEIGHT):
coords = set((x, y) for x, y, _, _ in robots)
while coords:
... | Python | 1 |
t::mocked_random("^0.8.11").unwrap();
}
}
use necsim_core::{
cogs::{
GloballyCoherentLineageStore, LineageStore, LocallyCoherentLineageStore, MathsCore,
OriginSampler,
},
landscape::{IndexedLocation, Location},
lineage::{GlobalLineageReference, Lineage},
};
use crate::cogs::lineage_... | Rust | 0 |
}"#;
assert_eq_display!(format!("{}", record), expected);
}
#[test]
fn show_variant() {
let typ: ArcType<&str> = Type::variant(vec![
Field::new("A", Type::function(vec![Type::int()], Type::ident("A"))),
Field::new("B", Type::ident("A")),
]);
assert_eq_display!(format!("{}", typ), "| A ... | Rust | 0 |
he original results from guidance by factor guidance_rescale to avoid "plain looking" images
noise_cfg = guidance_rescale * noise_pred_rescaled + (1 - guidance_rescale) * noise_cfg
return noise_cfg
def sample_model(self, cond, guidance_scale, sampling_steps, device, scheduler, generate_list=False... | Python | 1 |
print("Code is working")
# python3 -m src.test.extra_column_csv_generated_data
# python3 -m src.test.generate_csv_data
# python3 -m src.test.generate_customer_table_data
# python3 -m src.test.generate_datewise_sales_data
# python3 -m src.test.less_column_csv_generated_data
# python3 -m src.test.less_column_csv_generat... | Python | 1 |
px: Vec<usize>,
nx: Vec<usize>,
py: Vec<usize>,
ny: Vec<usize>,
pz: Vec<usize>,
nz: Vec<usize>,
projections: Vec<[Vector2<f32>; 3]>,
}
fn face_vs_face(
vertex_buffer: &mut VertexBufferRefMut,
geometry_buffer_mut: &mut GeometryBufferRefMut,
face_triangles: &[usize],
other_face_tr... | Rust | 0 |
|| _ || _|| _d| _t|dd | _d| _|d u r>d|fg}d| _g | _d}| j}|D ]L\}}||kr|| j d||d f | j d||| |f ||7 }|| }qX|| jk r| j d|| jd f d S )Nr r FT)
r offsetr' positionrj r r map_indexmapr )r r r r' Z blockinfoZlastposZrealposr7 r... | Python | 1 |
DTH
+ FEE_EXPONENT_BIT_WIDTH
+ FEE_MANTISSA_BIT_WIDTH
+ NONCE_BIT_WIDTH
+ 2 * TIMESTAMP_BIT_WIDTH;
/// Size of the data that is signed for forced exit tx
pub const SIGNED_FORCED_EXIT_BIT_WIDTH: usize = TX_TYPE_BIT_WIDTH
+ TX_VERSION_FOR_SIGNATURE_BIT_WIDTH
+ ACCOUNT_ID_BIT_WIDTH
+ ADDRESS_W... | Rust | 0 |
DATE_2822 :&str = "Thu, 24 Jun 2021 21:44:14 +0800";
//! pub const COMMIT_DATE_3339 :&str = "2021-06-24T21:44:14.473058+08:00";
//! pub const COMMIT_EMAIL :&str = "<EMAIL>";
//! pub const PROJECT_NAME :&str = "shadow-rs";
//! pub const RUST_CHANNEL :&str = "stable-x86_64-apple-darwin (default)";
//! pub const BRANCH :&... | Rust | 0 |
nt for native pixfmt",
));
};
// get the codec blueprint
let blueprint = if let Some(bp) = blueprints.into_iter().find(|bp| {
bp.src_fmts()
.into_iter()
.find(|pixfmt| *pixfmt == src_fmt)
.is_some()
}) {
... | Rust | 0 |
content
}
fn append_content<P: AsRef<Path>>(path: P, content: &[u8]) {
let mut f = std::fs::OpenOptions::new().append(true).open(path).unwrap();
f.write_all(content).unwrap();
}
fn enable_logs(verbosity: usize) {
stderrlog::new()
.verbosity(verbosity)
.module("iron_carrier")
.times... | Rust | 0 |
wise `|` operator for `bitflags` is implemented through the `std::ops::BitOr` trait,
// which cannot be used in a const context. The workaround is to bitwise OR the raw bits.
const VMO_DEFAULT_RIGHTS: zx::Rights = zx::Rights::from_bits_truncate(
zx::Rights::DUPLICATE.bits()
| zx::Rights::TRA... | Rust | 0 |
64
0x6403_0682,// EVEX_Vpsllvq_zmm_k1z_zmm_zmmm512b64
0x6403_0402,// EVEX_Vrcp14ps_xmm_k1z_xmmm128b32
0x6403_0482,// EVEX_Vrcp14ps_ymm_k1z_ymmm256b32
0x6403_0502,// EVEX_Vrcp14ps_zmm_k1z_zmmm512b32
0x6403_0582,// EVEX_Vrcp14pd_xmm_k1z_xmmm128b64
0x6403_0602,// EVEX_Vrcp14pd_ymm_k1z_ymmm256b64
0x6403_0682,// EVEX... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# Copyright © 2015-2018 Chaoyi Zha <me@cydrobolt.com>
#
# 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 r... | Python | 1 |
-> Self::Out {
let xs_len = length(&xs);
let ys_len = length(&ys);
match equals(xs_len, ys_len) {
Some(eq_prf) => {
let xs_with_prf = such_that(xs, &eq_prf);
// use refl() to prove that Equals<Length<Ys>, Length<Ys>>
let ys_with_prf =... | Rust | 0 |
shape[new_axis]);
<Sub1<Self>>::pack(new_patch, new_input, channels, new_output_ind, new_ox, new_ix,
new_start, new_end, kernel_shape, input_shape, output_shape, kernel_strides, input_strides, output_strides)
}
for i in (end*k_stride)..(*ui::get_unchecked(kernel_shape, axis)*k_stride){
*ui::get_unchecke... | Rust | 0 |
ult when calibrating gates with
a target angle per gate of :math:`\pi/2`.
repetitions (List[int]): By default the repetitions take on odd numbers for
:math:`\pi/2` target angles as this ideally prepares states on the equator of
the Bloch sphere. Note that the ... | Python | 1 |
while len(speech_list) >= 3:
start_time = time.time()
selected_speech = np.random.choice(speech_list, 3, replace=False)
speech_list = [speech for speech in speech_list if speech not in selected_speech]
source1_path = selected_speech[0]
... | Python | 1 |
wnload feedback based on the provided criteria. This command allows fetching feedback for a specific task or across all tasks,
with control over the starting point and the number of items to retrieve.
"""
if file:
file_path = Path(file)
if file_path.exists():
rich.print(f"Warning... | Python | 1 |
ield"]
#[inline(always)]
pub fn variant(self, variant: CT16B0_CAP0LOC_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Function CT16B0_CAP0 is available for pin PIO0_2"]
#[inline(always)]
pub fn pio0_2(self) -> &'a mut W {
self.variant(CT16B0_CAP0LOC_A::PIO0_2)
... | Rust | 0 |
(0..20).map(|f| rsx!{
div {
title: "About W3Schools",
style: "color:blue;text-align:center",
class: "About W3Schools",
p {
title: "About W3Schools",
... | Rust | 0 |
faceInAbortedSeqErrs,
"hh3ce1InterfaceInNoBufferErrs": hh3ce1InterfaceInNoBufferErrs,
"hh3ce1InterfaceInFramingErrs": hh3ce1InterfaceInFramingErrs,
"hh3ce1InterfaceOutputErrs": hh3ce1InterfaceOutputErrs,
"hh3ce1InterfaceOutUnderRunErrs": hh3ce1InterfaceOutUnderRunErrs,
"hh3ce1Interfac... | Python | 1 |
info.end_tokens.push(ROUND_BRACKET_CLOSE);
} else if tok == SQUARE_BRACKET_OPEN {
parse_info.end_tokens.push(SQUARE_BRACKET_CLOSE);
} else if tok == CURLY_BRACKET_OPEN {
parse_info.end_tokens.push(CURLY_BRACKET_CLOSE);
} else if tok == ANGLE_BRACKET_OPEN {
par... | Rust | 0 |
let button_handler = result.unwrap();
let result = cube.register_norify(CoreCubeUuidName::SensorInfo, Box::new(sensor_information_notify));
let sensor_handler = result.unwrap();
let result = cube.register_norify(CoreCubeUuidName::IdInfo, Box::new(id_information_notify));
let id_handler = result.unwrap... | Rust | 0 |
t appear directly
# in the type object or its substructures. These methods are
# called from slot functions synthesized by Cython.
#
#------------------------------------------------------------------------------------------
MethodSlot(initproc, "", "__cinit__")
MethodSlot(destructor, "", "__dealloc__")
MethodSlot(o... | Python | 1 |
12_843,
75 => 27_693,
100 => 48_168,
_ => unreachable!(run),
}
}
// Generate a tree with 10 levels (this is with RUN=0)
// . 0
// ├── 1
// ├ ├── 2
// ├ ├ ├── 3
// ├ ├ ├── 4
// ├ ├ ├ ├── 5
// ├ ├ ├ ├── 6
// ├ ├ ├ ├ ├── 7
// ├ ├ ├ ├ ├── 8
// ├ ├ ├ ... | Rust | 0 |
) -> Result<FindAaChangesOutput, Report> {
let mut changes = translations
.iter()
.map(
|Translation {
gene_name,
seq,
insertions,
frame_shifts,
}|
-> Result<FindAaChangesOutput, Report> {
let ref_peptide = ref_peptides.get(gene_name).ok_or(make_... | Rust | 0 |
(cs.dh_impl, &mut rng).unwrap();
let alice_point = DhPublicKey::new_from_private_key(cs.dh_impl, &alice_scalar);
// Now encrypt to Alice
let ecies_ciphertext: EciesCiphertext =
ecies::encrypt(cs, &alice_point, plaintext.clone(), &mut rng)
.expect(... | Rust | 0 |
# Constants for the game
BOTTOM_GRID_PAD = 30
HORIZONTAL_PADDING = 3
SCREEN_WIDTH = 1200 #1200 #1400
SCREEN_HEIGHT = 800 #800 #920
SCREEN_TITLE = "Grid Battlefield"
GRID_ROWS = 10 # Number of rows
GRID_COLUMNS = 30 # Number of columns
CELL_SIZE = (SCREEN_WIDTH - BOTTOM_GRID_PAD * 2) / 20 # Size of the grid cell at ... | Python | 1 |
import pathlib
import runpy
is_prime = runpy.run_path(
str(pathlib.Path(__file__).resolve().parents[1] / "src" / "is_prime.py")
)["is_prime"]
def test_small():
assert is_prime(2)
assert is_prime(3)
assert not is_prime(1)
assert not is_prime(4)
def test_more():
assert is_prime(13)
assert... | Python | 1 |
)
}
}
impl Display for BasicType {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
self.display().fmt(f)
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FnSig<'a> {
pub bound_lifetimes: u64,
pub is_unsafe: bool,
pub abi: Option<Abi<'a>>,
pub argument_... | Rust | 0 |
lt_arr = pc.floor_temporal(ca, multiple, UNITS_DICT[unit])
else:
if unit == "q":
multiple *= 3
np_unit = "M"
elif unit == "mo":
np_unit = "M"
else:
np_unit = "Y"
ar... | Python | 1 |
let data = company::company_suffix(); // company_suffix: Inc
//! let data = company::buzzword(); // buzzword: systemic
//! let data = company::bs(); // bs: strategic
//! ```
//!
//! # Feature
//!
//! Requires the "company" feature.
//!
use crate::misc;
use crate::name;
use std::string::String;
pub(crate)... | Rust | 0 |
#[derive(PartialEq, Debug)]
pub struct PeerRequestPayload {
pub nonce: [u8; 12],
pub protocol: ProtocolNumber,
pub internal_port: u16,
pub external_port: u16,
pub external_address: IpAddr,
pub remote_port: u16,
pub remote_address: IpAddr,
}
impl PeerRequestPayload {
/// Size of the PCP... | Rust | 0 |
输入替换后的物品")
items2 = select_item(lines, "第二步")
if not items2:
break
# 检查数量是否匹配
if len(items1) != len(items2):
adjusted = adjust_mismatched_items(items1, items2)
if adjusted and adjusted[0] is None:
print(Fore.YELLOW + "已... | Python | 1 |
# flake8: noqa
from construct import *
from xbox.sg.utils.struct import XStruct
from xbox.nano.adapters import ReferenceTimestampAdapter
server_handshake = XStruct(
'protocol_version' / Int32ul,
'desktop_width' / Int32ul,
'desktop_height' / Int32ul,
'max_touches' / Int32ul,
'initial_frame_id' / Int... | Python | 1 |
0 kB
Writeback: 0 kB
AnonPages: 2524 kB
Mapped: 1900 kB
Slab: 6464 kB
SReclaimable: 988 kB
SUnreclaim: 5476 kB
PageTables: 296 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 255700 kB
Committed_AS: 5908 kB
V... | Rust | 0 |
Self {
Ballot {
N: counter,
X: values.to_vec(),
}
}
/// Check whether the ballot's counter is 0 and values are empty.
pub fn is_zero(&self) -> bool {
self.N == 0 && self.X.is_empty()
}
}
// Ballots are totally ordered with N more significant than X.
imp... | Rust | 0 |
加一个仍在运行的会话
last_session_start = current_date - timedelta(hours=random.randint(1, 6))
motd = random.choice(MOTD_LIST)
start_str = last_session_start.strftime("%Y-%m-%d %H:%M:%S") + "*"
# 新格式
log_line = f"[{server_address}] [上线] {start_str} ~ 无 | MO... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.