text string | label_name string | labels int64 |
|---|---|---|
ap_or(self.players.len() / 2) * FULL_DECK.len();
if size >= deck_len {
bail!("kitty size too large")
}
if deck_len % self.players.len() != size % self.players.len() {
bail!("kitty must be a multiple of the remaining cards")
}
s... | Rust | 0 |
381752],
[2.028e-08, 0.56025552769, 117.3198682202],
[1.56e-08, 0.85608042681, 515.463871093],
[1.678e-08, 0.0, 0.0],
[1.102e-08, 5.98011943842, 3.1813937377],
[1.285e-08, 5.82563377753, 234.6397364404],
... | Rust | 0 |
comp_mon_coefs: wgrad_vmon_coefs.chunks(self.wgrad_comp_mons.len()) // comp dim sections
.map(|comp_coefs| comp_coefs.to_owned())
.collect() // Collect component coefficients for a single weak grad.
})
... | Rust | 0 |
Info {
pub fn format(&self) -> String {
let path = config::database_path();
format!(
"\
DB path : {path:?}\n\
DB size : {size}\n\
Tweets : {tweets}\n\
Pruned tweets : {pruned_tweets}\n\
Avg tweet size : {... | Rust | 0 |
74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07... | Rust | 0 |
e an indirect link (a pointer to a parent
model, which points, eventually, to the ancestor). Used when
constructing table joins for model inheritance.
Returns None if the model isn't an ancestor of this one.
"""
if ancestor in self.parents:
return self.parents[ancest... | Python | 1 |
lat::{Point, Rect};
use rtools::{address::Address, Rglica, ToRglica};
use crate::{
layout::Placer,
view::{view_data::ViewData, Alert, ViewInternal},
View, ViewBase, ViewFrame,
};
pub trait ViewSubviews {
fn superview(&self) -> Rglica<dyn View>;
fn subviews(&self) -> &[Box<dyn View>];
fn subvie... | Rust | 0 |
=> {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let val = i_prot.read_string()?;
f_3 = Some(val);
},
4 => {
let val = i_prot.read_i64()?;
f_4 = Some(val);
},
5 => {
let val = common_ty... | Rust | 0 |
map_err(decode_to_ser_err)?;
if let Some(message_name) = raw.type_url.strip_prefix("type.googleapis.com/") {
let message_desc = msg
.descriptor()
.parent_pool()
.get_message_by_name(message_name)
.ok_or_else(|| Error::custom(format!("message '{}' not found", ... | Rust | 0 |
encryption_alg_values_supported: None,
request_object_encryption_enc_values_supported: None,
token_endpoint_auth_methods_supported: None,
token_endpoint_auth_signing_alg_values_supported: None,
display_values_supported: None,
claim_types_supported: None,
... | Rust | 0 |
import pandas as pd
import pytrec_eval
from tqdm import tqdm
def prepare_pytrec_eval_input(ranked_list, scores, qrels, topic_id):
topic_id = str(topic_id)
ranked_list = [str(doc_id) for doc_id in eval(ranked_list)]
results = {topic_id: {doc: float(score) for doc, score in zip(ranked_list, eval(scores))}}... | Python | 1 |
{
type Family = ActivityFamily;
}
impl Activity for Eating {
fn update(mut self : Box<Self>) -> Box<dyn Activity> {
println!("Yum!");
self.calories_consumed += 100;
if self.calories_consumed >= 500 {
if self.hours_worked >= 8 {
println!("Time for bed!");
... | Rust | 0 |
asm!("in $0, $1" : "={al}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile");
}
value
}
#[inline(always)]
fn write(&mut self, value: u32) {
unsafe {
asm!("out $1, $0" : : "{al}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile");
... | Rust | 0 |
validators for all honest blocks.
for (root, slot) in harness.honest_roots.iter().rev() {
for i in 0..VALIDATOR_COUNT {
lmd.process_attestation(i, *root, *slot)
.expect("should accept attestations in increasing order");
}
// Head starting from 0 checkpoint (gene... | Rust | 0 |
}
self.wait_for_lte()?;
socket.state = SocketState::Connected;
self.at_connect(&mut socket.inner)?;
log::debug!("Connected LTE socket");
Ok(())
}
pub fn lte_is_connected(&mut self, socket: &mut LteSocket) -> bool {
socket.state.is_connected()
}
... | Rust | 0 |
TION_VALUES.iter(),
DEFAULT_LINEAR_MODEL_LEARNING_RATE_VALUES.iter(),
DEFAULT_LINEAR_MAX_EPOCHS_VALUES.iter(),
DEFAULT_LINEAR_N_EXAMPLES_PER_BATCH_VALUES.iter()
) {
grid.push(GridItem::LinearBinaryClassifier {
target_column_index,
feature_groups: choose_feature_groups_linear(column_stats, config),... | Rust | 0 |
self, mut seq: A) -> Result<Self::Value, A::Error>
where
A: SeqAccess<'de>,
{
let mut vec = Vec::new();
while let Some(elem) = seq.next_element::<Option<TagValue>>()? {
vec.extend(elem.map(|tag_value| tag_value.0));
... | Rust | 0 |
11u16.to_be(),
sin_addr: libc::in_addr {
s_addr: libc::INADDR_LOOPBACK.to_be(),
},
sin_zero: [0; 8],
};
let args = ConnectArguments {
fd: 8934,
addr: Some(addr),
addr_len: std::mem::size_of_val(&addr) as u32,
};
check_connect_call(&args, Some... | Rust | 0 |
acesso = '12qw'
chance = ''
cont = 0
while chance != acesso:
chance = input('Digite a chave: ')
if chance == acesso:
print('---- Seja bem-vindo!! ----')
break
else:
print('Errou, tente novamente!')
cont += 1
while cont <= 3:
print('Chances esgotadas, tente após 2min.')
break
... | Python | 1 |
Read,
T: FromStr,
{
fn split_commas(self) -> Vec<T> {
BufReader::new(self)
.split(b',')
.flatten()
.flat_map(String::from_utf8)
.flat_map(|s| s.parse())
.collect()
}
fn split_lines(self) -> Vec<T> {
BufReader::new(self)
... | Rust | 0 |
_os = "windows", target_pointer_width = "32")))]
extern "C" {
pub fn LzmaCompress(
dest: *mut ::std::os::raw::c_uchar,
destLen: *mut size_t,
src: *const ::std::os::raw::c_uchar,
srcLen: size_t,
outProps: *mut ::std::os::raw::c_uchar,
outPropsSize: *mut size_t,
level: ::std::os::raw::c_int,
dictSize: ::... | Rust | 0 |
t Exception as exc_dl:
status_placeholders[idx].error(f"下載 '{song_info_for_future['title']}' 時發生嚴重錯誤: {exc_dl}")
# Update overall progress bar
progress_bar.progress((i + 1) / total_songs_to_download)
st... | Python | 1 |
ledger_client = new_static_sandbox().await?;
let package_id = find_module_package_id(&ledger_client, PINGPONG_MODULE_NAME).await?;
let commands = make_commands(&package_id);
let command_id = commands.command_id().to_owned();
let submitted_command_id = ledger_client.command_service().submit_and_wait(com... | Rust | 0 |
ctrs = np.reshape(ctrs, [-1, 1, 2])
for i in range(np.shape(ctrs)[0]):
npoints = 0
for j in range(np.shape(ctrs)[1]):
npoints = npoints + np.shape(blob_point_ids_all[i, j])[0]
if npoints >= self.min_num_points_per_block: # TO... | Python | 1 |
a::RsaIdentity> {
self.rsa_identity
}
fn set_ed_identity(&mut self, ed: pk::ed25519::Ed25519Identity) {
self.ed_identity = Some(ed);
}
fn set_rsa_identity(&mut self, rsa: pk::rsa::RsaIdentity) {
self.rsa_identity = Some(rsa);
}
}
impl OwnedChanTarget {
/// Construct a new OwnedChanTarget from its parts.
/... | Rust | 0 |
`\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const DIK_2: u32 = 3u32;
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const DIK_3: u32 = 4u32;
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const DIK_4: u32 = 5u32;
#[doc = "*Required features: `\"Win32_Devic... | Rust | 0 |
/// which contains a cloned iterator, but a reference to the original
/// separator. This is useful in cases where the iterator needs to be
/// consumed, but there's no need to perform a full clone of the separator
/// (e.g. if it's a [`String`]).
///
/// Most functions which observe `&self` mak... | Rust | 0 |
# © Copyright IBM Corporation 2025. 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 required by applicable law or ... | Python | 1 |
import KratosMultiphysics as KM
from KratosMultiphysics.CoSimulationApplication import CoSimIO
model = KM.Model()
model_part = model.CreateModelPart("mp_test")
connection_settings = CoSimIO.Info()
connection_settings.SetString("my_name", "impExpMesh")
connection_settings.SetString("connect_to", "ExpImpMesh")
connecti... | Python | 1 |
#[test]
fn test_hexdigit_to_keycode() {
for c in "ABCDEFHIJKLMOJPQRSTUVWYXYZabcdefghijklmnopqrstuvwxyz".chars() {
let escaped = c.escape_unicode();
for out_c in escaped.skip(3).take_while(|x| *x != '}') {
println!("{}", out_c);
}
}
}
}
use ... | Rust | 0 |
Self {
client: Client::new(),
refresh_token: None,
}
}
pub async fn get(
&self,
url: &str,
params: Option<HashMap<String, String>>,
) -> Result<Response, ClientError> {
info!("Send GET request to {}", url);
let mut req = self.clie... | Rust | 0 |
el, stats in channel_stats.items():
total = stats["total"]
if total > 0:
channel_performance[channel] = {
"response_rate": (stats["positive"] + stats["negative"]) / total,
"positive_rate": stats["positive"] / total,
... | Python | 1 |
AssignExpr<'a>, &'a AssignExpr<'a>>(node) };
Node::AssignExpr(node)
}
}
impl<'a> NodeTrait<'a> for AssignExpr<'a> {
fn parent(&self) -> Option<Node<'a>> {
Some(self.parent.unwrap().clone())
}
fn children(&self) -> Vec<Node<'a>> {
let mut children = Vec::with_capacity(2);
children.push((&self.l... | Rust | 0 |
#!/usr/bin/python3
# The purpose of this file is to assist with reverse-engineering addition
# chains from imperative code. One would find an implementation with a good
# addition chain, translate the code to python (vim macros are your friends),
# and replace the middle section of this file with the addition chain. Th... | Python | 1 |
e)
summary.tables.append(table)
# State covariance terms
state_cov_mask = (
np.arange(len(self.params))[self.model._params_state_cov])
table = make_table(self, state_cov_mask, "Error covariance matrix",
strip_end=False)
... | Python | 1 |
}
dbg.finish()
}
}
}
/// Writes the contents of the `BitSlice`, in semantic bit order, into a hasher.
impl<C, T> Hash for BitSlice<C, T>
where C: Cursor, T: Bits {
/// Writes each bit of the `BitSlice`, as a full `bool`, into the hasher.
///
/// # Parameters
///
/// - `&self`
/// - `hasher`: The hashing s... | Rust | 0 |
import pytest
from ipytest._impl import find_coverage_configs
@pytest.mark.parametrize(
"files, expected",
[
pytest.param({".coveragerc": ""}, [".coveragerc"]),
pytest.param({"setup.cfg": ""}, []),
pytest.param({"setup.cfg": "[coverage:"}, ["setup.cfg"]),
pytest.param({"tox.in... | Python | 1 |
.SetDataSpacing(1,1,1)
reader.SetDataScalarTypeToUnsignedChar()
image = reader.GetOutput()
image.Update()
mapper = vtk.vtkFixedPointVolumeRayCastMapper()
mapper.SetInput(image)
if size < 20:
mapper.SetSampleDistance(float(size)/1000)
mapper.SetInteractiveSampleDistance(float... | Python | 1 |
PA_SET_ID,
authorities: test_keyring(),
votes: 2,
forks: 1,
}
}
}
/// Make a valid GRANDPA justification with sensible defaults
pub fn make_default_justification<H: HeaderT>(header: &H) -> GrandpaJustification<H> {
let params = JustificationGeneratorParams::<H> {
header: header.clone(),
..Default::def... | Rust | 0 |
n the client certificate, for example
checking the returned certificate has a commonName attribute equal to the
hostname (to avoid man in the middle attacks).
The signature is: (OK, err_msg) = validation_function(cert, hostname... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MyxiaojinFinanceAtsbudgetBbaremainamountQueryModel(object):
def __init__(self):
self._biz_budget_apply_code = None
@property
def biz_budget_apply_code(self):
return self.... | Python | 1 |
dle several
/// pointer theming from different places.
///
/// Note that it is however not `Send` nor `Sync`
pub struct ThemeManager {
theme: Arc<Mutex<CursorTheme>>,
compositor: wl_compositor::WlCompositor,
}
impl ThemeManager {
/// Load a system pointer theme
///
/// Will use the default theme of... | Rust | 0 |
== 84.0
a = candle.rand((3, 1, 4))
b = candle.rand((2, 1))
c_native = a.broadcast_mul(b)
c = a * b
assert c.shape == (3, 2, 4)
assert c.values() == c_native.values()
with pytest.raises(ValueError):
d = candle.rand((3, 4, 5))
e = candle.rand((4, 6))
f = d * e
def tes... | Python | 1 |
// uniform_vec1: unsafe extern "system" fn(GLint, GLfloat) -> (),
// uniform_vec4: unsafe extern "system" fn(GLint, GLfloat, GLfloat, GLfloat, GLfloat) -> (),
bind_texture: unsafe extern "system" fn(GLenum, GLuint) -> (),
bind_framebuffer: unsafe extern "system" fn(GLenum, GLuint) -> (),
attach_frameb... | Rust | 0 |
});
let button: gtk::Button = builder.get_object("button").unwrap();
let chunks_cloned = chunks.clone();
let builder_cloned = builder.clone();
button.connect_button_press_event(move | button, _ | {
*chunks_cloned.lock().unwrap() += 5;
show(&builder_cloned, *chunks_cloned.lock().unwrap... | Rust | 0 |
astype(dtype)
def clone(key):
"""Clone a key for reuse
Outside the context of key reuse checking (see :mod:`jax.experimental.key_reuse`)
this function operates as an identity.
Examples:
>>> import jax
>>> key = jax.random.key(0)
>>> data = jax.random.uniform(key)
>>> cloned_key = jax.random... | Python | 1 |
[Distance Matrix API developer
//! guide](https://developers.google.com/maps/documentation/distance-matrix/intro)
//! is intended for developers who wish to compute travel distance and time
//! between a number of points within maps provided by one of the Google Maps
//! APIs. It provides an introduction to using the ... | Rust | 0 |
the user divulges which report they care about.
/// There are not expected to be very many reports.
/// If there are many reports, then this should be redesigned to use an
/// oblivious lookup strategy inside of an sgx enclave.
///
/// Returns:
/// * Pairs of the form report-id, report-data
... | Rust | 0 |
heap.pop() {
visited.insert(current_state.position);
let current_node = if let Some(node) = map.get(¤t_state.position) { node } else { panic!() };
if current_state.position == finish {
return Some(current_state.distance)
}
for (node_position, distance) in [curre... | Rust | 0 |
.as_ptr() as *mut _,
b"notify::clock-type\0".as_ptr() as *const _,
Some(transmute(notify_clock_type_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}
<filename>src/timeclock/iterators.rs
use std::iter::Iterator;
use std::mem;
use timeclo... | Rust | 0 |
an iterator, possibly in parallel
fn parallel_dot_with_accumulator<Acc>(self) -> F
where
Acc: ParallelDotAccumulator<F>,
F: Zero,
{
self.drive_unindexed(Acc::zero().into_consumer()).dot()
}
}
#[cfg(feature = "parallel")]
impl<T, F> ParallelDotWithAccumulator<F> for T
where
... | Rust | 0 |
# Arquivo: cgbookstore/apps/core/recommendations/analytics/models.py
from django.db import models
from django.conf import settings
from django.utils import timezone
class RecommendationInteraction(models.Model):
INTERACTION_TYPES = [
('view', 'Visualização'),
('click', 'Clique'),
('add_she... | Python | 1 |
base_color_mult: [f32; 4],
pub maps: [u32; 3],
pub emissive: [f32; 3],
}
#[derive(Abomonation, Clone, Default)]
pub struct TriangleMesh {
pub positions: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub colors: Vec<[f32; 4]>,
pub uvs: Vec<[f32; 2]>,
pub tangents: Vec<[f32; 4]>,
pub materi... | Rust | 0 |
client state
:param page_size: Number of records to return, defaults to 50
:returns: Page of ConferenceParticipantInstance
"""
data = values.of(
{
"ParticipantSid": participant_sid,
"Label": label,
"Events": events,
... | Python | 1 |
}
#[doc = "Not selected"]
#[inline(always)]
pub fn const_0(self) -> &'a mut W {
self.variant(SELETH0TX_A::CONST_0)
}
#[doc = "Selected"]
#[inline(always)]
pub fn const_1(self) -> &'a mut W {
self.variant(SELETH0TX_A::CONST_1)
}
#[doc = r"Sets the field bit"]
... | Rust | 0 |
"""
Map Views to URLs.
"""
from django.urls import include, path
from utilities.urls import get_model_urls
from . import views # noqa F401
urlpatterns = (
# Access Lists
path(
"access-lists/",
include(get_model_urls("netbox_acls", "accesslist", detail=False)),
),
path(
"acces... | Python | 1 |
/// * `tx_block_height` - block number of backing chain
/// * `merkle_proof` - raw bytes
/// * `raw_tx` - raw bytes
#[weight = <T as Config>::WeightInfo::execute_redeem()]
#[transactional]
fn execute_redeem(origin, redeem_id: H256, tx_id: H256Le, merkle_proof: Vec<u8>, raw_tx: Ve... | Rust | 0 |
# * Ejercicio 6
# Contar cuántos registros hay en un archivo CSV.
import pandas as pd
rutaArchivo = "Artech/CSV/personas.txt"
df = pd.read_csv(rutaArchivo)
cantidad = len(df)
print(f"El archivo tiene {cantidad} registros.") | Python | 1 |
min > val {
min
}
else if max < val {
max
}
else {
val
}
}
impl<'s> System<'s> for PieceControllerSystem {
type SystemData = (
WriteStorage<'s, Piece>,
Read<'s, InputHandler<StringBindings>>,
Read<'s, Gameboard>,
Read<'s, Time>
);
... | Rust | 0 |
lass(YNodeConnections)
bpy.utils.unregister_class(YPaintChannel)
bpy.utils.unregister_class(YPaintUV)
bpy.utils.unregister_class(YPaint)
bpy.utils.unregister_class(YPaintMaterialProps)
bpy.utils.unregister_class(YPaintTimer)
bpy.utils.unregister_class(YPaintWMProps)
bpy.utils.unregister_clas... | Python | 1 |
>);
impl OUT_REMAIN_UNDER_4B_CH1_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
OUT_REMAIN_UNDER_4B_CH1_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for OUT_REMAIN_UNDER_4B_CH1_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self... | Rust | 0 |
on: 16.564033 },
Place { name: "Großhofen, Österreich", lat: 48.258744, lon: 16.620009 },
Place { name: "Pama/<NAME>, Österreich", lat: 48.047542, lon: 17.034563 },
Place { name: "Gösting, Österreich", lat: 48.553750, lon: 16.779552 },
Place { name: "Großinzersdorf, Österreich", lat: 48.524372, lon: 16.... | Rust | 0 |
ties)
.zip(sensitivity.iter().zip(epsilon.iter()))
.map(|((cands, utils), (sens, eps))|
exponential_mechanism(
*eps, *sens as f64, cands,
utils.into_iter().map(|v| v as f64).collect(),
... | Rust | 0 |
dc
| Currency::Trx
| Currency::Tst => {
return Err(ErrorKind::Generic(
"Ether/Erc20-token is not supported".to_string(),
));
}
};
let script_sig = Builder::new()
.push_slice(&sign_ser)
.push_opcode(OP_TRUE) // Choose refund path in original script
.push_slice(input_script.as_bytes())... | Rust | 0 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from setuptools import find_packages, setup
MAIN_REQUIREMENTS = [
"airbyte-cdk~=0.1",
]
TEST_REQUIREMENTS = [
"requests-mock~=1.9.3",
"pytest~=6.1",
"pytest-mock~=3.6.1",
]
setup(
entry_points={
"console_scripts": [
... | Python | 1 |
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.utils import to_categorical
from elephas.spark_model import SparkModel
from elephas.utils.rdd_utils... | Python | 1 |
j, path_str(func_ref.def_id), callee_fr.sig);
eprintln!(" (at {:?})", func_ref.span);
}
}
} else {
eprintln!(" single variant");
let vr = &results.variants[&id];
for (j, func_ref) in vr.func_refs.iter().enumerate() {
... | Rust | 0 |
annotations.iter(){
anotate_hashmap.insert(annotation.name.to_string(), annotation.text.to_string());
}
Some(anotate_hashmap)
},
None => None
};
SourceMetadata {
name: cube_name.clone(),
measures: measures.clone(),
annotations: ann... | Rust | 0 |
h.setText(_translate("MainWindow", "5.5"))
self.label_10.setText(_translate("MainWindow", "Horn Height (m)"))
self.horn_height.setText(_translate("MainWindow", "2.75"))
self.label_20.setText(_translate("MainWindow", "Effective Length E-plane (m)"))
self.eplane_effective_length.setText(_t... | Python | 1 |
0x4016 => self.input_device_one.poll(0x00), // Read one bit from the first controller TODO: Open Bus Behaviour
0x4017 => self.input_device_two.poll(0x00), // Read one bit from the second controller
0x4018..=0x401f => 0x00, // Usually disabled on the nes TODO: Decide... | Rust | 0 |
nk, url: &Url, cfg: &Config) -> Result<(), Box<BrokenLink>> {
if cfg.follow_web_links {
debug!("Fetching \"{}\"", url);
let response = reqwest::get(url.clone()).map_err(|e| {
Box::new(HttpError::new(
url.clone(),
link.chapter.path.clone(),
... | Rust | 0 |
ed by passing in a `&str` name to the `new` function, for example:
//!
//! ```rust
//! use goose::prelude::*;
//!
//! let mut loadtest_tasks = taskset!("LoadtestTasks");
//! ```
//!
//! ### Task Set Weight
//!
//! A weight can be assigned to a task set, controlling how often it is assigned to user
//! threads. ... | Rust | 0 |
assert_eq!(verdict.reason, ClassificationReason::BadTransferEncoding);
assert_eq!(
HttpRequestData::new(&request)
.headers
.get(0)
.unwrap()
.get_tier(),
HeaderSafetyTier::Bad
);
const BUFFER_LEN: usize = 4... | Rust | 0 |
import sys
import requests
def main():
if len(sys.argv) != 2:
print("Usage: python bitcoin.py <number_of_bitcoins>")
sys.exit(1)
try:
bitcoins = float(sys.argv[1])
except ValueError:
print("Error: Please provide a valid number of bitcoins.")
sys.exit(1)
try:
... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
" The code for the league training"
# modified from AlphaStar pseudo-code
from pysc2.env.sc2_env import Race
from alphastarmini.core.rl.rl_utils import get_supervised_agent
from alphastarmini.core.rl.learner import Learner
from alphastarmini.core.rl.actor import ActorLo... | Python | 1 |
&credentials.site)
.await
.context("could not retrieve checks")
.short()?
.map(&*pool)
.await
.short()?
.into_iter()
.map(Into::into)
.collect();
Ok(Json(checks))
}
#[post("/api/runner/report", data = "<payload>")]
pub async fn report(pool: &State<Pool<MySql>>, credentials: Runn... | Rust | 0 |
account_password,
),
json=[
{
# Do not delete any of these fields. They are all required.
"contractID": "cAOEJ9Vymiwr47-HZ3FnYR_YDCPILpaTfdloKpojyNPE",
"id": 39398,
"effectiveFrom": "2024-01-01T00:00:00Z",
"effec... | Python | 1 |
was_corrected
};
let center_dist_numer_const = (i64::from(p2.x) * i64::from(p1.y)) - (i64::from(p2.y) * i64::from(p1.x));
let (sdx, sdy) = (i64::from(p2.x) - i64::from(p1.x), i64::from(p2.y) - i64::from(p1.y));
let (dx_float, dy_float) = (f64::from(dx), f64::from(dy));
let center_dist_denom... | Rust | 0 |
)]
fn mv_probs() {
// for ( j = 0; j < MV_JOINTS - 1; j++ )
// mv_joint_probs[j] = update_mv_prob(mv_joint_probs[j])
// for ( i = 0; i < 2; i++ ) {
// mv_sign_prob[i] = update_mv_prob(mv_sign_prob[i])
// for ( j = 0; j < MV_CLASSES - 1; j++ )
// mv_class_probs[i][j] = update_mv_prob(mv... | Rust | 0 |
"counterMedium": 190,
"counterBitHard": 197,
"counterHard": 307,
"counterTooHard": 142,
"counterExHard": 43,
"counterBrainFuck"... | Python | 1 |
("millimeter", &*MILLIMETER),
("klb/h", &*KILOPOUNDS_PER_HOUR),
("horsepower_hour", &*HORSEPOWER_HOUR),
("kg/h", &*KILOGRAMS_PER_HOUR),
("S", &*SIEMENS),
("kilometer", &*KILOMETER),
("meters_per_hour", &*METERS_PER_HOUR),
("pint", &*PINT),
("MΩ", ... | Rust | 0 |
ct.as_mut_ptr(),
ct.len() as u64,
KCAPI_ACCESS_HEURISTIC as i32,
);
assert_eq!(ret, pt.len() as i64);
}
assert_eq!(ct_exp, ct);
}
#[test]
fn test_kcapi_skcipher_dec() {
let ct = [
0x7e, 0xe, 0x75, 0x77, 0xef, 0x9c, ... | Rust | 0 |
'''
--------------------------------------------------------------------------------------------------------
engage the threat
--------------------------------------------------------------------------------------------------------
'''
from bge import logic
import enemy_scripts.enemy_sound
SNAIL_DIST = 55
def main(co... | Python | 1 |
) {
self.dev_cfg.raw.get_mtu()
} else {
1500
}
}
/// Provides the "user-space" with a pointer to usable memory.
///
/// Therefore the driver checks if a free BufferToken is in its TxQueues struct.
/// If one is found, the function does return a pointer to the memory area, where
/// the "user-space" can... | Rust | 0 |
morse = {
# Letters
"a": ".-","b": "-...","c": "-.-.","d": "-..","e": ".","f": "..-.","g": "--.",
"h": "....","i": "..","j": ".---","k": "-.-","l": ".-..","m": "--","n": "-.",
"o": "---","p": ".--.","q": "--.-","r": ".-.","s": "...","t": "-","u": "..-",
"v": "...-","w": ".--","x": "-..-","y": "-.--"... | Python | 1 |
def topten():
n =1
while n<=10:
sq = n*n
yield sq
n+=1
value = topten()
for i in value:
print(i) | Python | 1 |
import numpy as np
from scipy.io import loadmat
m = loadmat('test.mat', squeeze_me=True, struct_as_record=True,
mat_dtype=True)
np.savez('test.npz', **m)
| Python | 1 |
gar un nuevo trabajador."""
nombre = self.nombre_entry.get()
usuario = self.usuario_entry.get()
password = self.password_entry.get()
rol = self.rol_combobox.get()
if nombre and usuario and password and rol:
create_trabajador(nombre, usuario, password, rol)
... | Python | 1 |
::new()
.set_max_pos(WIDTH as f64, HEIGHT as f64)
.build(id)
})
.collect(),
width,
height,
last_update: SystemTime::now(),
}
}
}
impl Scene for BouncingBalls {
fn render(self, c: Context,... | Rust | 0 |
s.number_field
[ 1 1 1 1 1 1]
[ 1 -1 1 -1 1 -1]
[ 1 -1 1 1 -1 1]
[ 1 1 1 -1 -1 -1]
[ 2 0 -1 -2 0 1]
[ 2 0 -1 2 0 -1]
sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
sage: all(SmallPermutationGroup(n,k).id() == [n,k]
..... | Python | 1 |
def find_parse_func():
for f in bv.functions:
finstr = list(f.hlil.instructions)
if len(finstr) > 10:
if isinstance(finstr[0], HighLevelILVarInit):
if isinstance(finstr[2], HighLevelILCall):
if isinstance(finstr[3], HighLevelILCall):
... | Python | 1 |
2, 31);
let walker = month.to_walker(&context.reference, &context);
assert_eq!(None, walker.forward.clone().next());
assert_eq!(None, walker.backward.clone().next());
}
#[test]
fn test_month_day_special_case_on_30_ending_months() {
let context = build_context(Moment(Paris.ym... | Rust | 0 |
'bombchu',
'nayrus_love',
'beans',
'bottle_1',
'bottle_2',
'bottle_3',
'bottle_4',
],
'sword' : [
'kokiri_sword',
],
'shield' : [
'... | Python | 1 |
from django.urls import path
from . import views
app_name = 'blog'
urlpatterns = [
path('', views.index, name='index'),
path('category/<slug:slug>/',
views.category_detail, name='category_posts'),
path('posts/<int:post_id>/', views.post_detail, name='post_detail'),
path('posts/create/', view... | Python | 1 |
Key9 => key_event(Key::Num9),
VirtualKeyCode::Key0 => key_event(Key::Num0),
VirtualKeyCode::A => key_event(Key::A),
VirtualKeyCode::B => key_event(Key::B),
VirtualKeyCode::D => key_event(Key::D),
VirtualKeyCode::E => key_event(Key::E),
VirtualKeyCode::F => key_event(Key::... | Rust | 0 |
((value as u32) & 0x01) << 22);
self.w
}
}
#[doc = "Xor value between Tx and Rx for the ck_sel field of register DLL_CTRL\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum PLL_CONF_TX_NRX_CK_SEL_TX_A {
#[doc = "3: `11`"]
PLL_CONF_TX_NRX_CK_SEL_TX_DEFAULT = 3,
}
imp... | Rust | 0 |
_model) = role_response {
let user_role_model = UserRole::from((user_created.id.clone(), role_model.id.clone()));
diesel::insert_into(user_role)
.values(user_role_model)
.execute(conn)
.map_err(|err| reject::custom(DatabaseError { error: err }))?;
let get_user... | Rust | 0 |
test() {
do_test("unary");
}
#[test]
fn equality_test() {
do_test("equality");
}
#[test]
fn relational_test() {
do_test("relational");
}
#[test]
fn not_test() {
do_test("not");
}
#[test]
fn variable_test() {
// 未初期化のローカル変数を使うのでコンパイルのみ行う
let (dir, source, output, _answer) = get_test_parameter... | Rust | 0 |
# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribu... | Python | 1 |
timeout_remain,
goal_sampler,
self.config.max_goal_sampler_count,
)
if result is None:
return OMPLSolverResult(None, None, -1, TerminateState.FAIL_PLANNING)
else:
n_call = planner.get_call_count()
ns_internal = planner.get_ns_inter... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.