text string | label_name string | labels int64 |
|---|---|---|
n
# classes before giving up
drf_request = DRFRequest(request)
for auth_class in openrosa_drf_settings.DEFAULT_AUTHENTICATION_CLASSES:
try:
# `authenticate()` will:
# * return `None` if no applicable authentication attempt
# was f... | Python | 1 |
rectangle.get_height() - 1) {
color = outline_color;
} else {
color = fill_color;
}
put_pixel(&mut self.image, x_coord, y_coord, color);
}
}
return Ok(());
}
fn visit_diamond(&mut self, diamond... | Rust | 0 |
.insert(Relations::INPUT_VariableScopes, "INPUT_VariableScopes");
map.insert(Relations::INPUT_Variables, "INPUT_Variables");
map.insert(Relations::Literals, "Literals");
map.insert(Relations::TypedExpressions, "TypedExpressions");
map.insert(Relations::UnifiedTypes, "UnifiedTypes");
... | Rust | 0 |
import unittest
from src.lab4.task1.recommender import Recommender
from src.lab4.task1.utils import User, get_users, get_movies
class RecommenderTestCase(unittest.TestCase):
def test_recommneder(self):
# Given
watch_history_path = "watch_history.txt"
movies_path = "movies.txt"
user... | Python | 1 |
r
self.executor.shutdown(wait=True)
# Final memory snapshot
self.memory_debugger.take_snapshot("cleanup")
logger.info("QuantRS2 Debugging Tools Manager cleanup completed")
except Exception as e:
logger.error(f"Cle... | Python | 1 |
to lbl_to_pos
for (idx, lbl) in pos_to_lbl.into_iter().enumerate() {
lbl_to_pos[lbl] = idx;
}
// println!("new order: {:?}", lbl_to_pos);
}
let final_order: Vec<VarLabel> = lbl_to_pos
.into_iter()
.map(|v| VarLabel::new(v as u64... | Rust | 0 |
import sqlite3
def read_restaurants():
conn = sqlite3.connect('restaurant.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM restaurant")
rows = cursor.fetchall()
conn.close()
print("Restaurants:")
for row in rows:
print(row)
# Example usage
read_restaurants()
| Python | 1 |
/pre>
</div>
</div>
</div>
</div>
{% endblock %}
"""
# 写入模板文件
with open(os.path.join(templates_dir, "base.html"), "w", encoding="utf-8") as f:
f.write(base_template)
with open(os.path.join(templates_dir, "index.html"), "w", encoding="utf-8") as f:
f.write(in... | Python | 1 |
LENGTH),
..Default::default()
};
let param_bad_8 = AeadParam {
key: Some([0x00; ATCA_AES_KEY_SIZE]),
nonce: vec![0x00; AES_CCM_IV_MIN_LENGTH],
additional_data: Some(vec![0x00; AES_CCM_AAD_MAX_LENGTH + 1]),
..Default::default()
};
let mut expected_bad_1 = AtcaStat... | Rust | 0 |
false, |header_contents| header_contents == exp)
},
)
}
fn step_warn_unless_header_equals(
header_name: &str,
exp: &str,
contents: &PipeContents,
) -> StepResult {
assertion_to_warning(step_assert_header_equals(header_name, exp, contents))
}
fn step_assert_header_exists(header_name: &str, ... | Rust | 0 |
.pos.current_pos.1 = self.pos.starting_pos.1;
let _ = self.goto_internal_pos();
}
pub fn _is_at_last_terminal_col(&self) -> bool {
self.pos.current_pos.0 == self.bound.width - 1
}
pub fn is_at_last_terminal_row(&self) -> bool {
self.pos.current_pos.1 == self.bound.height - 1
... | Rust | 0 |
)),
TypeConstraint::Trait(i) => i == t,
TypeConstraint::None => false
}
}
pub fn get_all_contained_traits(&self) -> Vec<String> {
match self {
TypeConstraint::Union(inner) | TypeConstraint::Intersection(inner) => inner.iter().flat_map(|x| x.get_all_contained_... | Rust | 0 |
Previous versions"
" are not supported.")
# Set up script options.
for option, value in list(vimode_settings.items()):
if weechat.config_is_set_plugin(option):
vimode_settings[option] = weechat.config_get_plugin(option)
else:
weechat.config_set_plug... | Python | 1 |
"""
Copyright (c) 2019 ETH Zurich
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from typing import List, Tuple
Expr = 'silver.ast.Exp'
Stmt = 'silver.ast.Stmt'
Stmt... | Python | 1 |
= m0ptycd6cvv = ct0y7x02dbb = upk3nf7kz20 = vuc_reaaxe4 = md72z9o5u6j = ifn4w6pg62f = ''
pass
raise uvpcqlxoep2
del ly7vjm7ozgi
from jiwktoitbq5 import igogsgz3x4b, t5_h22qn_ph as l8qh_hq642t, agr1i1k2tn3, tq5lpzm6rbu as ksk3e5j2rl8, oali4bvj7vi
'# difficulties_punches_electrolyte -> trick_relief_sw... | Python | 1 |
.text(format!(
"{} / {}",
player_health_points.hp,
player_ability_values.get_max_health()
)),
)
});
ui.... | Rust | 0 |
::FrozenRiver => 11i32,
Biome::GiantSpruceTaiga => 160i32,
Biome::GiantSpruceTaigaHills => 161i32,
Biome::GiantTreeTaiga => 32i32,
Biome::GiantTreeTaigaHills => 33i32,
Biome::GravellyMountains => 131i32,
Biome::IceSpikes => 140i32,
Biom... | Rust | 0 |
n(args)):
arbor_args.append(args[i])
# Apply the operation/filter to the arbor
apply_operation_to_arbor_conditionally(*arbor_args)
# Axon
if morphology.has_axons():
for arbor in morphology.basal_dendrites:
# Construct arbor arguments list
... | Python | 1 |
f'tamdid<~>{api["uuid"]}'}], ]
# },
# }
# cls.send_api("sendMessage", data)
#
# @classmethod
# def send_almost_end_of_config_notif(cls, chat_id, api, type, *args):
# service = ConfigsInfo.objects.get(config_uuid=api["uuid"])
# if type == 0:
# text = "... | Python | 1 |
, 189, 190, 197, 198,
205, 206, 213, 214, 221, 222, 229, 230, 237, 238, 245, 246, 253, 6, 6,
7, 14, 15, 22, 23, 30, 31, 38, 39, 46, 47, 54, 55, 62, 63,
70, 71, 78, 79, 86, 87, 94, 95, 102, 103, 110, 111, 118, 119, 126,
127, 134, 135, 142, 143, 150, 151, 158, 159, 166, 167, 174, 175, 182... | Rust | 0 |
fn new(cfg: &'static Config) -> Self {
let o = Self {
config: cfg,
http_client: reqwest::Client::new(),
};
add_template(
KIND,
get_tag(&Event::NodeUp),
o.config.online_tpl.to_string(),
);
add_template(
KIND,... | Rust | 0 |
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
for r in range(9):
seen = set()
for i in range(9):
if board[r][i] == ".":
continue
if board[r][i] in seen:
return False
... | Python | 1 |
Bytes(vec![b'7']),
],
vec![
Column::new(MYSQL_TYPE_LONG),
Column::new(MYSQL_TYPE_VARCHAR),
Column::new(MYSQL_TYPE_LONG),
Column::new(MYSQL_TYPE_VARCHAR),
Column::new(MYSQL_TYPE_LONG),
Column::new(MYSQL_TYPE_VARCHAR),
... | Rust | 0 |
max_triangle_count: u64,
pub max_descriptor_set_acceleration_structures: u32,
}
impl PhysicalDeviceRayTracingPropertiesNV {
pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
}
impl Default for PhysicalDeviceRayTracingPropertiesNV {
... | Rust | 0 |
l rads
let sim_rads_deref = &*sim_rads_guard;
*sim_teor_guard = sim_clone.calcola(sim_rads_deref.clone());
// Move sim vectors in the next closure
let sim_teor_clone = sim_teor_guard.clone();
let sim_exp_clone = sim_exp_guard.clone();
// Draw spect... | Rust | 0 |
ORTLINK_API", "36f1ae74ba1aa01e5bd73bdd0bc22aa915443501")
VERIFY_EXPIRE = int(environ.get('VERIFY_EXPIRE', 86400)) # Add time in seconds
WELCOME_TEXT = environ.get("WELCOME_TEXT", script.WELCOME_TEXT)
INDEX_EXTENSIONS = [extensions.lower() for extensions in environ.get('INDEX_EXTENSIONS', 'mp4 mkv').split()]
PM_FILE_DE... | Python | 1 |
_and_port, e)
});
tcp::write_message(&mut stream, &check)?;
tcp::read_message(&mut stream, &mut result)?;
if response::deserialize_check_available(&result).is_none() {
continue;
}
... | Rust | 0 |
, and one may be switched for another more quickly
/// than entirely unrelated pipelines would be.
#[derive(Debug)]
pub enum BasePipeline<'a, P: 'a> {
/// Referencing an existing pipeline as parent.
Pipeline(&'a P),
/// A pipeline in the same create pipelines call.
///
/// The index of the parent m... | Rust | 0 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def nodesBetweenCriticalPoints(self, head: Optional[ListNode]) -> List[int]:
def is_crit(a, b, c):
return (a > b and b < c) or (a... | Python | 1 |
pub struct Cost(u32);
pub struct Costs {}
impl Costs {
pub const DEFAULT: Costs = Costs {};
}
impl Costs {
pub fn cost_of(&self, _: &Expr) -> Cost {
todo!()
}
}
<filename>crates/codec/tests/enum.rs
// Echidna - Codec - tests
//mod dump;
//use dump::*;
use codec::Codec;
#[derive(Codec)]
enum M... | Rust | 0 |
;
use edgelet_http_mgmt::ModuleClient;
use iotedge::*;
#[cfg(unix)]
const MGMT_URI: &str = "unix:///var/run/iotedge/mgmt.sock";
#[cfg(windows)]
const MGMT_URI: &str = "unix:///C:/ProgramData/iotedge/mgmt/sock";
fn main() {
if let Err(ref error) = run() {
let mut fail: &Fail = error;
eprintln!("{... | Rust | 0 |
: usize,
prg_rom: Vec<[u8; 0x4000]>,
chr_rom: Vec<[u8; 0x2000]>,
}
impl Mapper3 {
pub fn new(
prg_rom: Vec<[u8; 16 * 1024]>,
chr_rom: Vec<[u8; 8 * 1024]>,
header: INesHeader,
) -> Self {
Mapper3 {
header,
selected_chr_rom: 0,
prg_rom,
... | Rust | 0 |
TRACK_TCP_TIMEOUT_MAX_RETRANS: i32 = 16;
pub const NET_IPV4_NF_CONNTRACK_TCP_LOOSE: i32 = 17;
pub const NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL: i32 = 18;
pub const NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS: i32 = 19;
pub const NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED: i32 = 20;
pub const NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_C... | Rust | 0 |
}
ticks = 0;
if MODE.load(Ordering::Relaxed) == current_mode {
let mut color = COLOR.load(Ordering::Relaxed);
color = (color + 1) % 8;
if color == 0 {
color += 1;
}
COLOR.store(color, Ordering::Relaxed);
}
}
}
<filen... | Rust | 0 |
ocess_transaction_longer_timeout(transaction)
.await
.expect("Transaction failed");
let account = banks
.get_account(cryptid_address.pubkey())
.await
.expect("Error getting account")
.unwrap_or_else(|| panic!("Could not find account {}", cryptid_address.pubkey()));
... | Rust | 0 |
.single_content)
def __showPageDialog(self):
""" show Page dialog """
if self.default:
w = DefaultSetBox(self.window())
else:
w = DefaultSetBox(self.window(),False)
if w.exec_():
detail = w.tabpage.pivotInterface.scanInterface.getdetail()
... | Python | 1 |
properties {
($name:ident, $xml_elm:expr, $expect:expr $(,)*) => {
test_unreal_contect!(
"PlatformProperties",
Unreal4ContextPlatformProperties::from_xml,
$name,
$xml_elm,
$expect,
);
};
}
test_unreal_runtime_properties!(
crash_gui... | Rust | 0 |
.first()
dupe_attendee = session.query(Attendee).filter(Attendee.id != attendee.id,
Attendee.first_name == attendee.first_name,
Attendee.last_name == attendee.last_name,
... | Python | 1 |
ef,
indata: Option<&[u8]>,
out: Option<&mut Vec<u8>>,
flags: Pkcs7Flags,
) -> Result<(), ErrorStack> {
let out_bio = MemBio::new()?;
let indata_bio = match indata {
Some(data) => Some(MemBioSlice::new(data)?),
None => None,
};
let inda... | Rust | 0 |
nge = torch.arange(points.shape[0])
for idx in range(num_gts):
gt_lvl = gt_bboxes_lvl[idx]
# get the index of points in this level
lvl_idx = gt_lvl == points_lvl
points_index = points_range[lvl_idx]
# get the points in this level
lvl_point... | Python | 1 |
Found {
bail!("could not delete /dev/ptmx")
}
}
self.syscall
.symlink(Path::new("pts/ptmx"), &ptmx)
.context("failed to symlink ptmx")?;
Ok(())
}
// separating kcore symlink out from setup_default_symlinks for a better way to do the u... | Rust | 0 |
},
XINT0: XINT0 {
_marker: PhantomData,
},
CLKG0_OSC: CLKG0_OSC {
_marker: PhantomData,
},
PMG0_TST: PMG0_TST {
_marker: PhantomData,
},
CLKG0_CLK: CLKG0_CLK {
... | Rust | 0 |
import datetime
import os
# =================================================
# Background Information
# -------------------------------------------------
mip = "cmip5"
# exp = 'piControl'
exp = "historical"
frequency = "mo"
realm = "atm"
# =================================================
# Analysis Options
# ------... | Python | 1 |
"Vprefetche0",
"Vprefetche1",
"Vprefetche2",
"Vprefetchenta",
"Vprefetchnta",
"Vpsbbd",
"Vpsbbrd",
"Vpsubrd",
"Vpsubrsetbd",
"Vpsubsetbd",
"Vrcp23ps",
"Vrndfxpntpd",
"Vrndfxpntps",
"Vrsqrt23ps",
"Vscaleps",
"Vscatterpf0hintdpd",
"Vscatterpf0hintdps",
"Vsubrpd",
"Vsubrps",
];
impl fmt::Debug for Mnemo... | Rust | 0 |
}', (p.get_x() + p.get_width() / 2., p.get_height()),
ha='center', va='center', xytext=(0, 9), textcoords='offset points')
st.pyplot(fig)
else:
st.info("Nenhum dado para o gráfico de OTIF por Transportadora.")
with col2:
st.subheader("Top 10 Rotas por Custo Total")
... | Python | 1 |
= pose.vertices;
let mut ret = vec![];
for &v0 in &vs {
for &v1 in &vs {
let d = (v0 - v1).abs2();
ret.push(d as u32);
}
}
ret.into_boxed_slice()
}
/*
#[wasm_bindgen]
pub struct AllPairDist {
n: usize,
dist_flat: js_sys::Float64Array,
}
// impl Index<(usize, usize)> for AllPairDist {
// type Output =... | Rust | 0 |
# import libraries
import numpy, pylab
from pylab import *
# plot DOF convergence graph
axis('equal')
pylab.title("Error convergence")
pylab.xlabel("Degrees of freedom")
pylab.ylabel("Error [%]")
#data = numpy.loadtxt("conv_dof_est_hp_iso.dat")
#x = data[:, 0]
#y = data[:, 1]
#semilogy(x, y, "-s", label="hp-FEM (iso)"... | Python | 1 |
#=========================================================================
# Prob04p14_comb_bool_nl_ringer_test
#=========================================================================
# SPDX-License-Identifier: MIT
# Author : Christopher Batten, NVIDIA
# Date : May 20, 2024
from pyhdl_eval.cfg import Config, Inp... | Python | 1 |
A: Action,
{
index: usize,
ucan: &'a Ucan,
semantics: &'a Semantics,
capability_type: PhantomData<Capability<S, A>>,
}
impl<'a, Semantics, S, A> CapabilityIterator<'a, Semantics, S, A>
where
Semantics: CapabilitySemantics<S, A>,
S: Scope,
A: Action,
{
pub fn new(ucan: &'a Ucan, sem... | Rust | 0 |
input=llm_query, response_format=schema.ScoreReasonResponse
)
return _generate_reason_from_model_output(model_output=model_output)
def _evaluate_conversation_from_model_output(
model_output: str,
) -> schema.EvaluateUserFrustrationResponse:
try:
dict_content = parsing_helpers.extract_j... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
from argparse import ArgumentParser
import numpy as np
import requests
from mmcls.apis import inference_model, init_model, show_result_pyplot
def parse_args():
parser = ArgumentParser()
parser.add_argument('img', help='Image file')
parser.add_argument('con... | Python | 1 |
in_features=conSizes[i],
out_features=conSizes[i + 1],
weight_attr=paddle.framework.ParamAttr(
initializer=paddle.nn.initializer.XavierUniform()),
bias_attr=paddle.ParamAttr(
initializer=paddle.nn.initializer.Constant(value=0.0))... | Python | 1 |
._API_BASE}/videos', channel_id, query={
'channelId': channel_id,
'sort': 'new',
'limit': self._PAGE_SIZE,
'offset': page_num * self._PAGE_SIZE,
}, note=f'Downloading page {page_num+1}')
return [
self.url_result(f"{s... | Python | 1 |
if os.path.exists(path + '/partnerOrderId'): type = 2
if os.path.exists(path + '/certOrderId'): type = 3
csrpath = path + "/fullchain.pem" # 生成证书路径
keypath = path + "/privkey.pem" # 密钥文件路径
key = public.readFile(keypath)
csr = public.readFile(csrpath)
file = self... | Python | 1 |
# 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 |
r#"
[workspace]
members = ["bar"]
bulid = "foo"
"#,
)
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("bar/src/lib.rs", r"")
.build();
p.cargo("build --all")
.with_stderr(
"\
[WARNING] [..]/foo/Cargo.... | Rust | 0 |
alue'] for i, out in enumerate(d['vout']) if i != r['changepos']]
for d, r in zip(dec_tx, result)]
# List of differences in output amounts between normal and subtractFee transactions
share = [o0 - o1 for o0, o1 in zip(output[0], output[1])]
# output 1 is the same in both tran... | Python | 1 |
"""
Regression for #9736.
Checks some pathological column naming to make sure it doesn't break
table creation or queries.
"""
from django.db import models
class Article(models.Model):
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
headline = models.CharField(max_length=100)
auth... | Python | 1 |
.com/zkat/cacache-rs) as the backend.
#[cfg_attr(docsrs, doc(cfg(feature = "manager-cacache")))]
#[derive(Debug, Clone)]
pub struct CACacheManager {
/// Directory where the cache will be stored.
pub path: String,
}
impl Default for CACacheManager {
fn default() -> Self {
Self { path: "./http-cacach... | Rust | 0 |
en(dta.dtype.names)).any(1)
# get complete data as plain structured array
# maybe doesn't work with masked arrays
dta_use_b1 = dta[~droprows,:].data
print dta_use_b1.shape
print dta_use_b1.dtype
#Example b1: variables from Bruce's glm
# prepare data and dummy variables
xx_b1, names_b1 = form2design('I F:sex age', dta... | Python | 1 |
let arr_id = get_object_id(self.id, RESULT_ALLOWED_STATE_CONTROLLER_ADDRESSES.get_key_id(), TYPE_ARRAY | TYPE_BYTES);
ArrayOfImmutableBytes { obj_id: arr_id }
}
}
pub struct ArrayOfMutableBytes {
pub(crate) obj_id: i32,
}
impl ArrayOfMutableBytes {
pub fn clear(&self) {
clear(self.obj_id);... | Rust | 0 |
to_string())
.collect::<Vec::<_>>();
let (grids, other_data) = data.split_at(10);
let mut pinned_windows: Vec::<(bool, Vec::<i32>)> = Vec::new();
// at this point, other_data should contain 11 rows left if it's a valid format
// these last 11 rows each represent a se... | Rust | 0 |
from scipy.spatial import distance as dist
from imutils import face_utils
import imutils
import dlib
import cv2
import winsound
frequency = 2500
duration = 1000
def eyeAspectRatio(eye):
#Vertical
A = dist.euclidean(eye[1], eye[5])
B = dist.euclidean(eye[2], eye[4])
#Horizontal
C = dist.euclidean(ey... | Python | 1 |
value::data::BuildValue;
use crate::value::{LlvmValue, Value};
#[derive(Debug, Copy, Clone)]
pub struct FloatValue(LlvmValue, FloatType);
impl Value for FloatValue {
type Type = FloatType;
unsafe fn new_unchecked(value: LlvmValue, float_type: FloatType) -> FloatValue {
FloatValue(value, float_type)
... | Rust | 0 |
sertIsNone(i1.table)
self.assertNotIn(i1, t.indexes)
t.delete_index(i2)
self.assertIsNone(i2.table)
self.assertNotIn(i2, t.indexes)
with self.assertRaises(IndexNotFoundError):
t.delete_index(i1)
def test_get_refs(self):
t = Table('products')
with ... | Python | 1 |
) -> Any:
if isinstance(dataset, dict):
dataset = AugmentedDynamicItemDataset(dataset)
if tools is not None:
dataset.add_tools(tools)
return self.forward(dataset)
def forward(
self, dataset: AugmentedDynamicItemDataset
) -> AugmentedDynamicItemDataset... | Python | 1 |
<RegUnit> {
self.banks
.iter()
.filter_map(|b| b.parse_regunit(name))
.next()
}
/// Make a temporary object that can display a register unit.
pub fn display_regunit(&self, regunit: RegUnit) -> DisplayRegUnit {
DisplayRegUnit {
regunit,
... | Rust | 0 |
),
"aarch64-linux-android" => format!("linux_x64-android_{}_arm64", build),
"i686-linux-android" => format!("linux_x64-android_{}_x64", build),
"x86_64-linux-android" => format!("linux_x64-android_{}_x86", build),
"x86_64-apple-darwin" => format!("macosx_x64-host_{}", bui... | Rust | 0 |
import os
def clear_console():
os.system('cls')
clear_console()
car_speed = float(input('Digite a velocidade do carro: '))
if car_speed > 80:
print('Você foi multado!'.upper())
fine = (car_speed - 80) * 7
print('Valor da multa: R$ {:.2f}'.format(fine))
print('Tenha um bom dia!'.upper()) | Python | 1 |
)
ApiRequestArgs["businessid"] = businessType.value
ApiRequestArgs["timestamp"] = timestamp
ApiRequestArgs["data"] = data
ApiRequestArgs["sign"] = sign
if businessType== BusinessType.remoteCalculate:
result = self.__getReqResultHeartBeat("http://api2.ruikeyz.com/NetV... | Python | 1 |
"""
Very simple example of a serverless function that just returns the input value.
"""
import requests
import runpod
import sglang as sgl
# Port of the SGLang runtime server
SGLANG_PORT = 30000
# Initialize the SGLang runtime before handling requests
RUNTIME = sgl.Runtime(model_path="/app/models/llava", port = SGLAN... | Python | 1 |
Spanning(0x92, 2, 1, None)
]),
Ok(vec![Spanning(
Inst::AddRegOp(
Spanning(Reg::Dl, 1, 1, Some(0b111 << 3)),
Spanning(
Op::Ind {
disp: None,
base: Some(Spanning(Reg::Edx, 2, 1, Some... | Rust | 0 |
/// `InnerList`'s associated parameters. Can be empty.
pub params: Parameters,
}
impl InnerList {
/// Returns new `InnerList` with empty `Parameters`.
pub fn new(items: Vec<Item>) -> InnerList {
InnerList {
items,
params: Parameters::new(),
}
}
/// Retur... | Rust | 0 |
output='screen',
parameters=[
{'action_bt_xml_filename': action_bt_file},
{'start_action_bt_xml_filename': start_action_bt_file},
{'end_action_bt_xml_filename': end_action_bt_file},
{'bt_builder_plugin': bt_builder_plugin},
{'domain': domain},
{'probl... | Python | 1 |
postscript_windows_character_set: match fontinfo_v1.msCharSet {
Some(v) => match v {
0 => Some(PostscriptWindowsCharacterSet::Ansi),
1 => Some(PostscriptWindowsCharacterSet::Default),
2 => Some(PostscriptWindow... | Rust | 0 |
"VK_KHR_wayland_surface"];
//vulkan_win32.h
vk_ext![KHR_WIN32_SURFACE, 6, "VK_KHR_win32_surface"];
vk_ext![KHR_EXTERNAL_MEMORY_WIN32, 1, "VK_KHR_external_memory_win32"];
vk_ext![KHR_WIN32_KEYED_MUTEX, 1, "VK_KHR_win32_keyed_mutex"... | Rust | 0 |
dlines():
if not line.startswith('Read'):
maps.append(exec(f'maps.append({line.rstrip()})'))
maps = list(filter(None, maps))
# read AMRs
amrps = []
aafile = f'DATA/AMR2.0/corpora/{tag}.txt'
original_blocks = read_blocks(aafile)
afile ... | Python | 1 |
4 => Ok(SceneGlowType::Texture),
5 => Ok(SceneGlowType::TextureLight),
6 => Ok(SceneGlowType::Alpha),
_ => {
bail!("Invalid SceneGlowType: {}", value);
}
}
}
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq)]
pub enu... | Rust | 0 |
loading_extent_lod0));
let mut lod0 = map.lod_view_mut(0);
lod0.fill_extent(&loading_extent_lod0, 1);
// No longer loading at LOD0.
assert!(!map.extent_is_loading(0, loading_extent_lod0));
}
#[test]
fn delete_collapses_tree() {
let mut map = ChunkTreeBuilder3x1::n... | Rust | 0 |
,
small_planets: u32,
super_earths: u32,
earth_twins: u32,
ocean_planets: u32,
habitable: u32,
hot_jupiters: u32,
mini_neptunes: u32,
// Records
min_gravity: f64,
max_gravity: f64,
min_temp: f64,
max_temp: f64,
min_sma: f64,
max_sma: f64,
min_orb_period: f64,
... | Rust | 0 |
help='Output C++ header file',
required=True)
arg_parser.add_argument('-s', '--project-source-dir',
help='Project source directory',
default=".")
arg_parser.add_argument('-v', '--verbose',
... | Python | 1 |
current_version: [2; 4],
epoch,
};
let genesis_validators_root = Hash256::from_low_u64_be(seed);
let attestation_request_body = AttestationRequestBody {
bls_domain: "beacon_attester".to_string(),
data: attestation,
fork,
genesis_validators_root,
};
se... | Rust | 0 |
#-*- coding=utf8 -*-
import asyncio
import requests
import random
import time
API = "http://127.0.0.1:5000/"
MAX_NUMBER = 1000000
def generatURL(type,id,**args):
url = API+type+'?id={}'.format(id)
for each in args:
url+=('&'+each+'='+args[each])
return url
async def get(url):
loop = asyncio.get_event_loop()
... | Python | 1 |
sign_input: SignInput = match SignInput::decode(payload) {
// Ok(request) => request,
// Err(_) => return Err(Error::InvalidPrivateKey),
// };
// let output =
// Signer::sign(&private_key, &sign_input).map_err(|_| Error::InvalidPrivateKey)?;
// let mut buf =... | Rust | 0 |
"Conflicts", countConflicts())
failures += 1
seq = sorted(list(status.keys()), key=lambda x: self._counts[x], reverse=True)
tried = False
okay1 = False
for idx, link in enumerate(seq):
if status[link] + 1 < len(self._links[link]):... | Python | 1 |
"""
Test that variables of type char are displayed correctly.
"""
import AbstractBase
from lldbsuite.test.decorators import *
class CharTypeTestCase(AbstractBase.GenericTester):
mydir = AbstractBase.GenericTester.compute_mydir(__file__)
def test_char_type(self):
"""Test that char-type variables ar... | Python | 1 |
one)]
pub struct ClutterIntervalClass {
pub parent_class: gobject::GInitiallyUnownedClass,
pub validate:
Option<unsafe extern "C" fn(*mut ClutterInterval, *mut gobject::GParamSpec) -> gboolean>,
pub compute_value: Option<
unsafe extern "C" fn(*mut ClutterInterval, c_double, *mut gobject::GVa... | Rust | 0 |
path: s!("$"),
expected: Some("{\"a\":1,\"b\":2}".into()),
actual: Some("{\"a\":1,\"b\":2,\"c\":3}".into()), mismatch: s!("")}));
expect!(mismatch_message(&mismatch)).to(be_equal_to(s!("Expected a Map with 2 elements but received 3 elements")));
mismatches.clear();
matc... | Rust | 0 |
_info::{ClusterInfo, ClusterInfoError};
use crate::erasure::{CodingGenerator, ErasureConfig};
use crate::poh_recorder::WorkingBankEntries;
use crate::result::{Error, Result};
use crate::service::Service;
use crate::staking_utils;
use rayon::ThreadPool;
use solana_metrics::{
datapoint, inc_new_counter_debug, inc_new... | Rust | 0 |
parameters
params = prepare_api_parameters(
{
"filter": filter,
"limit": limit,
"offset": offset,
"q": q,
"sort": sort,
}
)
# Define the operation name
operation = "GetQueriesAlertsV... | Python | 1 |
, ..]);
match W_j.iter().any(|&w_ij| w_ij != F::zero()) {
true => {
let norm_W_j = W_j.dot(&W_j).sqrt();
grad_idx
.iter()
.zip(W_j)
.fold(F::zero(), |s... | Rust | 0 |
///
/// Making one of these can be expensive, and should be
/// once per process rather than once per connection.
///
/// These must be created via the [`ClientConfig::builder()`] function.
///
/// # Defaults
///
/// * [`ClientConfig::max_fragment_size`]: the default is `None`: TLS packets are not fragmented to a speci... | Rust | 0 |
cron_tick_raw(rt).unwrap());
rt.verify()
}
pub fn cron_tick_raw(rt: &mut MockRuntime) -> Result<RawBytes, ActorError> {
rt.expect_validate_caller_addr(vec![*CRON_ACTOR_ADDR]);
rt.set_caller(*CRON_ACTOR_CODE_ID, *CRON_ACTOR_ADDR);
rt.call::<MarketActor>(Method::CronTick as u64, &RawBytes::default())
}... | Rust | 0 |
import sys
import os
import datetime
import subprocess
import time
def PlayAndWait(macro, timeout_seconds = 10, var1 = '-', var2 = '-', var3 = '-', path_downloaddir = None, path_autorun_html = None, browser_path = None):
assert os.path.exists(path_downloaddir)
assert os.path.exists(path_autorun_html)
assert os.pa... | Python | 1 |
n<&'a DocComment<'a>>,
}
impl<'a, Ex: TrivialDrop, Fb: TrivialDrop, En: TrivialDrop, Hi: TrivialDrop> TrivialDrop
for Method_<'a, Ex, Fb, En, Hi>
{
}
pub type Nsenv<'a> = namespace_env::Env<'a>;
#[derive(
Clone,
Debug,
Eq,
FromOcamlRepIn,
Hash,
NoPosHash,
Ord,
PartialEq,
Partia... | Rust | 0 |
msg = "I <3 Python And Although <3 Elzero Web School"
print(msg.replace("<3", "Love", 1)) | Python | 1 |
#1. LISTS
fruits = ["apple", "orange", "banana", "coconut"]
print(fruits[0])
print(dir(fruits))
print(help(fruits))
fruits[0] = "mango"
fruits.append("mango")
fruits.remove("apple")
fruits.insert(0, "mango")
fruits.sort()
fruits.reverse()
fruits.clear()
for x in fruits:
print(x)
print(fruits.count("apple"))
print... | Python | 1 |
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(1 << 18)) | ((value as u32 & 1) << 18);
self.w
}
}
#[doc = "ADC FIFO Overrun IRQ Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO_OVERRUN_IRQ_EN_A {
#[doc = "0: Disable"]
DISA... | Rust | 0 |
import numpy as np
from matplotlib import pyplot as plt
import argparse
from PIL import Image
from models.util.nptrans import toMatw
from models.util.transform import inv_pose_np
from pathlib import Path
from typing import Tuple
from scipy.spatial.transform import Rotation
import shutil
from collections import defaultd... | Python | 1 |
edges[1]);
}
(platform.print_xy)(right, y, edges[2]);
// sides
for i in (y + 1)..bottom {
(platform.print_xy)(x, i, edges[3]);
(platform.print_xy)(right, i, edges[4]);
}
//bottom
(platform.print_xy)(x, bottom, edges[5]);
for i in (x + 1)..right {
(platform.prin... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.