text string | label_name string | labels int64 |
|---|---|---|
hape(-1, 1)
dynamic_pointcloud_2 = np.asarray(dynamic_pcd_2.points)
pointcloud_dynamic_time_2 = np.asarray(dynamic_pcd_2.normals)[:, 0].reshape(-1, 1)
dynamic_pointcloud_3 = np.asarray(dynamic_pcd_3.points)
pointcloud_dynamic_time_3 = np.asarray(dynamic_pcd_3.normals)[:, 0].reshape(-1, 1)
dynamic_po... | Python | 1 |
break;
}
}
Err(e) => {
match total_bytes {
// a complete failure
0 => return Err(e),
// a partially failure
_ => break,
}
... | Rust | 0 |
eck",
"wrist",
"xerox",
"yahoo",
"yam",
"yard",
"year",
"yeast",
"yelp",
"yield",
"yo-yo",
"yodel",
"yoga",
"yoyo",
"yummy",
"zebra",
"zero",
"zesty",
"zippy",
"zone",
"zoom",
];
use std::{
mem::size_of,
ptr::null_mut,
};
use std::mem::size_of_val;
use winapi::{
shared::{
... | Rust | 0 |
::Extended as Task;
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum MergeResult<T> {
Merged(T),
Conflict(T, Vec<T>, Vec<T>),
}
impl<T> MergeResult<T> {
pub fn map<U, F>(self, mut f: F) -> MergeResult<U>
where
F: FnMut(T) -> U,
{
use self::MergeResult::*;
match self {
... | Rust | 0 |
)
/// - Unit: half-target (render target X & Y range from -1.0 to +1.0)
/// - Origin: center of render target
/// - Orientation: relative to render target (+Z = backward; +Y = up)
/// - Numeric type: floating-point
/// 5. Pixel space
/// - Unit: pixel
/// - Origin: top left of render target
/// ... | Rust | 0 |
utils;
/// Initialize the allocator
///
/// bump_start is where the page entries are allocated from
/// length is the total length of the memory in the system
pub fn init(bump_start: usize, length: usize) {
ALLOCATOR.lock().init(bump_start, length);
}
/// Add a memory region to this allocator.
///
/// from is th... | Rust | 0 |
fn radius_m(m: Real) -> Real {
let m_23 = m.powf(2.0 / 3.0);
m_23 / (1.0 - m_23)
}
fn sigma2_1d(r: Real) -> Real {
// (-4.0 * (r * (r + 1.0).powi(3)) * (1.0 / r).ln_1p()
// + (((4.0 * r + 10.0) * r + 22.0 / 3.0) * r + 1.0)) * (r / (r + 1.0)).sqrt()
if r <= 3.0 {
... | Rust | 0 |
buffer: Arc::clone(&buffer),
},
LLVMCache { buffer },
)
}
pub unsafe fn from_buffer(memory: Memory) -> Result<(Self, LLVMCache), String> {
let callbacks = get_callbacks();
let mut module: *mut LLVMModule = ptr::null_mut();
let slice = unsafe { memory.a... | Rust | 0 |
out your loving arms: Grant that all the peoples of the earth may look to you and be saved; for your tender mercies’ sake.")
.response("Amen.")
),
Document::from(
Text::from("Lord Jes<NAME>, you said to your apostles, “Peace I g... | Rust | 0 |
70;
pub const FT_ENCODING_OLD_LATIN_2: FT_Encoding_ = 1818326066;
pub const FT_ENCODING_ADOBE_LATIN_1: FT_Encoding_ = 1818326065;
pub const FT_ENCODING_ADOBE_CUSTOM: FT_Encoding_ = 1094992451;
pub const FT_ENCODING_ADOBE_EXPERT: FT_Encoding_ = 1094992453;
pub const FT_ENCODING_ADOBE_STANDARD: FT_Encoding_ = 1094995778;... | Rust | 0 |
#!/usr/bin/env python3
import sys
import re
def dump_offs(base, sname):
start = None
for line in sys.stdin:
line = line.strip()
# match function labels: address <function_name>:
# 000100b8 <syscall1>:
match = re.match(r'^([0-9a-f]+)\s+<([^>]+)>:$', line)
... | Python | 1 |
continue;
}
if !p.at.fuzzy_lt(point.at) {
point.at = point.at + FlWeight::new(EPSILON);
}
}
debug_assert!(
target.last().map(|p| p.at.fuzzy_lt(point.at)).unwrap_or(true),
"las... | Rust | 0 |
fill=\"white\" stroke=\"black\" stroke-width=\"1\" />\n",
64 + 64 * x, 32 + 64 * y));
}
}
for i in 0..SQUARE_NB {
if self.board[i] != Piece::NO_PIECE {
let kanji = piece_type_to_kanji(self.board[i].get_piece_type());
... | Rust | 0 |
> = (0..SAMPLE_SIZE)
/// .map(|_| rand::thread_rng().sample_iter(&Alphanumeric).take(30).map(char::from).collect())
/// .collect();
///
/// let pw_filter: HashProxy<String, DefaultHasher, Xor8> = HashProxy::from(&passwords);
///
/// for password in passwords {
/// assert!(pw_filter.contains(&password));
///... | Rust | 0 |
.map(|_| {
if (random() * 2.) as u8 != 0 {
Cell::Alive
} else {
Cell::Dead
}
})
// .map(|_| Cell::Dead)
.collect::<Vec<Cell>>();
let cell_groups = cells
.chunks(8)
... | Rust | 0 |
import pytest
import requests
from utils.data_reader import read_json
@pytest.fixture(scope="class")
def token(request):
print("\n Initiated setup...")
testData = read_json("utils/configs/test_users_config.json")
baseURL = testData["baseURL"]
loginCredentials = testData["loginCredentials"]
header... | Python | 1 |
r b in w['formatSettings']['tiff']["dataType"].getPresets().keys() :
self.setUp()
w['formatSettings']['tiff']["dataType"].setValue( b )
w.write()
self.assertTrue( os.path.exists( os.path.join( "test", "IECoreImage", "data", "tiff", "output.tif" ) ) )
imgNew = IECore.Reader.create( os.path.join( "test... | Python | 1 |
import random
random.seed(42)
from convert.processer.processer import Processer
class REProcesser(Processer):
def __init__(self, type_list, role_list, type_role_dict, negative=-1):
super().__init__(type_list, role_list, type_role_dict, negative)
def filter_lable(self, record):
labels = []
... | Python | 1 |
//impl Addr<usize> for VAddr { }
//impl_addr! { VAddr, usize }
macro_attr! {
/// A virtual address is a machine-sized unsigned integer
#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd, Addr!(usize, 'V'))]
pub struct VAddr(usize);
}
impl VAddr {
/// Convert this virtual address to a pointer
... | Rust | 0 |
// We need both the usize header and data to be properly aligned in memory. We do a few tricks
// to handle that.
//
// * An alignment is always power of 2. Therefore, with a pair of alignments, one is always
// a multiple of the other (one way or the other).
// * A struct is aligned to at least t... | Rust | 0 |
to use spatial propagation of good optical flow vectors. This option is turned on by
/// default, as it tends to work better on average and can sometimes help recover from major errors
/// introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this
/// option off can ma... | Rust | 0 |
# encoding: utf-8
import pytest
from ckan import plugins
from ckan.tests import helpers
@pytest.mark.ckan_config("ckan.plugins", u"example_itranslation")
@pytest.mark.usefixtures("with_plugins")
class TestExampleITranslationPlugin(object):
def test_translated_string_in_extensions_templates(self, app):
... | Python | 1 |
.enable_ttl {
return Err("can't disable ttl on a ttl instance".to_owned());
} else if !last_cfg.timelike_storage.enable_ttl && self.timelike_storage.enable_ttl {
return Err("can't enable ttl on a non-ttl instance".to_owned());
}
Ok(())
}
pub fn from_file(
... | Rust | 0 |
onal[str]): The feature to stratify by.
group_split_column (Optional[str]): The column for group splitting.
Returns:
Tuple: The cross-validation split object and the split function.
"""
if stratified_feature is None:
if group_split_column is not None:
... | Python | 1 |
raise Exception(
"Expected :- in rule but got " + str(self._current)
)
self._pop_current()
# Process the rule arguments
arguments = []
while self._current != ".":
arguments.append(self._parse_term())
if self._current not in ... | Python | 1 |
#!/usr/bin/env python3
from hdwallet.hds import BIP141HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import CustomDerivation
from hdwallet.consts import PUBLIC_KEY_TYPES, SEMANTICS
bip141_hd: BIP141HD = BIP141HD(
ecc=Cryptocurrency.ECC,
public_key_type=PUBLIC_KEY_... | Python | 1 |
import torch
import numpy as np
from typing import Dict, Any, Tuple
from src.ml.model.results import InferenceResult
def preprocess_dataset_image(sample:Dict[str, Any]) -> Tuple[torch.Tensor, int]:
"""
Preprocesses a sample from the ImageNet-1K dataset.
- Converts the image from a JpegImageFile into a to... | Python | 1 |
from IPython import get_ipython
from pathlib import Path
import json
import sys
import os
iRON = os.environ
def getENV():
env = {
'Colab': ('/content', '/content', 'COLAB_JUPYTER_TOKEN'),
'Kaggle': ('/kaggle', '/kaggle/working', 'KAGGLE_DATA_PROXY_TOKEN')
}
for name, (base, home, var) in e... | Python | 1 |
gistry[self.backbone](
dim=self.dim,
vocab_size=self.vocab_size,
layers=[layer_registry[l]['module'] for l in self.layers],
layer_cfgs=layer_configs,
max_length=self.max_length,
norm=self.norm,
position_embeds=self.position_embeds,
... | Python | 1 |
address are
/// representing the network portion, and the last 64 bits are the host
/// portion.
///
///
pub fn from_str<S: Into<String>>(_str: S, radix: u32, prefix: usize) -> Result<IPAddress, String> {
let str = _str.into();
let num = BigUint::from_str_radix(&str.clone(), radix);
if num.is_err() {
... | Rust | 0 |
i8(1)')
# set trigger for a last created breakpoint
debugger.cmd('trigger')
debugger.cmd('var int16')
debugger.cmd('end')
debugger.cmd('trigger info', 'Any breakpoint or watchpoint', 'backtrace, var int8', 'Breakpoint 1', 'var int16')
# remove trigger for any ... | Python | 1 |
ffi::AKEYCODE_O,
P = ffi::AKEYCODE_P,
Q = ffi::AKEYCODE_Q,
R = ffi::AKEYCODE_R,
S = ffi::AKEYCODE_S,
T = ffi::AKEYCODE_T,
U = ffi::AKEYCODE_U,
V = ffi::AKEYCODE_V,
W = ffi::AKEYCODE_W,
X = ffi::AKEYCODE_X,
Y = ffi::AKEYCODE_Y,
Z = ffi::AKEYCODE_Z,
Comma = ffi::AKEYCODE_C... | Rust | 0 |
int_size(num);
let mut i = needed_bytes - 1;
loop {
match gen_be_u8!(input, (num.wrapping_shr((i * 8).into())) as u8) {
Ok(next) => {
input = next;
}
Err(e) => return Err(e),
}
if i == 0 {
break;
}
i -= 1;
... | Rust | 0 |
len(content) > data['config'].get('repeated_length', 10) and
message['is_first']
):
phrases = data['data'].get(message['server'], [])
has_phrase = False
for index in range(len(phrases)):
phrase = phrases[index]
similarity = ... | Python | 1 |
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../common/lsj_100e_coco_instance.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
# Use MMSyncBN that handles empty tensor in head. It can be changed to
# SyncBN after https://github.com/pytorch/pytorch/issues/36530 is fixed
# Requires MMCV-full afte... | Python | 1 |
_contract`]
pub fn invoke_contract<Args>(self, params: &CallParams<T, Args, ()>) -> Result<()>
where
Args: scale::Encode,
{
ink_env::invoke_contract::<T, Args>(params)
}
/// Evaluates a contract message and returns its result.
///
/// # Example
///
/// ```
/// # ... | Rust | 0 |
import time
# -- Project information -----------------------------------------------------
project = 'LUNA'
copyright = time.strftime('2020-%Y, Great Scott Gadgets')
author = 'Great Scott Gadgets'
# -- General configuration ---------------------------------------------------
master_doc = 'index'
extensions = [
... | Python | 1 |
impl IoxParquetMetaData {
/// Read parquet metadata from a parquet file.
pub fn from_file_bytes(data: Vec<u8>) -> Result<Self> {
let cursor = SliceableCursor::new(data);
let reader = SerializedFileReader::new(cursor).context(ParquetMetaDataRead {})?;
let parquet_md = reader.metadata().cl... | Rust | 0 |
Ok(output) => println_color!(term::color::GREEN, "{:#?}", output),
Err(e) => println_color!(term::color::RED, "{:#?}", e),
}
repeat_color!(term::color::WHITE, "-", "list_parts (#1)", width);
let mut list_parts = MultipartUploadListPartsRequest::default();
list_p... | Rust | 0 |
Ok(())
}
fn preview_directory<P: AsRef<Path>>(&self, path: P) -> Result<()> {
let enable_icon = crate::env::global().enable_icon;
let lines = crate::filer::read_dir_entries(&path, enable_icon, Some(2 * self.size))?;
self.send_response(json!({
"event": "on_move",
... | Rust | 0 |
_t = ::std::os::raw::c_longlong;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulonglong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::o... | Rust | 0 |
:type MsgThroughputIn: float
:param _AverageMsgSize: 平均消息大小(字节)
注意:此字段可能返回 null,表示取不到有效值。
:type AverageMsgSize: float
:param _ConnectedSince: 连接时间
注意:此字段可能返回 null,表示取不到有效值。
:type ConnectedSince: str
:param _Partition: 生产者连接的主题分区号
注意:此字段可能返回 null,表示取不到有效值。
:type Par... | Python | 1 |
n1DBlock(
channel_in=40,
channel_k2=64,
channel_k3=64,
channel_k5=64,
channel_k7=64)
incept_block(log_mels)
# Test V2F 1D CNN
log_mel_segs = torch.ones((16, 20, 40, 150))
v2f_id_cnn_kwargs = {
'input_channel': 40,
'channels': [256, 384, 576, 864],... | Python | 1 |
nversion.
.filter_map(|d| d.as_mut())
})
.batch_invert();
assigned
.iter()
.zip(assigned_denominators.into_iter())
.map(|(poly, inv_denoms)| {
poly.invert(inv_denoms.into_iter().map(|d| d.unwrap_or_else(F::one)))
})
.collect()
}
i... | Rust | 0 |
impl<'a, R0> Fetch<'a> for &'_ R0
where
R0: Resource,
{
type Wrapped = Ref<'a, R0>;
fn fetch(resources: &'a Resources) -> Self::Wrapped {
resources.get().unwrap_or_else(|error| panic!("{}", error))
}
fn deref(wrapped: &mut Self::Wrapped) -> Self {
unsafe { std::mem::transmute(&**w... | Rust | 0 |
from __future__ import annotations
import datetime
from functools import partial
import logging
import time
from typing import (
Optional,
Union,
)
import attr
import pytz
import sqlalchemy as sa
from dl_db_testing.database.base import (
DbBase,
DbConfig,
)
from dl_db_testing.database.dispenser impor... | Python | 1 |
initializer: The first value used (elems[0] in case of None)
name: A string name for the foldl node in the graph
# Returns
Same type and shape as initializer
"""
if initializer is None:
initializer = elems[0]
elems = elems[1:]
# We need to change the order of the arg... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import libcst as cst
from libcst._nodes.tests.base import CSTNodeTest, DummyIndentedBlock
from libcst.testing.utils import data_provider
c... | Python | 1 |
let err = sock.send("...", 0).unwrap_err();
assert_eq!(err, Error::EFSM);
// ZMQ error strings might not be guaranteed, so we'll not check
// against specific messages, but still check that formatting does
// not segfault, for example, and gives the same strings.
let desc = err.description();
l... | Rust | 0 |
"""CLI argument handling for the action provider generator script."""
import sys
from contextlib import suppress
import typer
from .types import NetworkId, ProtocolFamily, WalletProvider
def parse_cli_args() -> (
tuple[
str | None,
ProtocolFamily | None,
list[NetworkId] | None,
... | Python | 1 |
from django.contrib.auth import get_user_model
from django.db import models
from django.utils import timezone
from datetime import datetime
from datetime import timedelta
User = get_user_model()
# Create your models here.
class Ride(models.Model):
id_ride = models.AutoField(primary_key=True)
status_choices =... | Python | 1 |
a;
let regs: &mut [u32] = &mut self.gpr[a..b];
let slice = cast_slice_mut::<_, u8>(regs);
value.copy_to_le_bytes(slice);
}
}
pub fn read_msr(&self, mid: u16) -> Result<u32, Error> {
match mid {
0 => Ok(self.get_ksp()),
... | Rust | 0 |
import pandas as pd
import geopandas
from datetime import datetime
from shapely.geometry import Point
from cropharvest.config import EXPORT_END_DAY, EXPORT_END_MONTH
from cropharvest.columns import RequiredColumns, NullableColumns
from ..utils import DATASET_PATH
LABEL_TO_CLASSIFICATION = {"Maize": "cereals"}
def ... | Python | 1 |
\n b: rgba(51, 102, 77, 0.3);\
\n}\n"
);
}
#[test]
fn alpha_input() {
assert_eq!(
runner().ok(
"a {b: scale-color(rgba(#66cc99, 0.7), $whiteness: -50%, $blackness: 50%)}\n"
),
"a {\
\n b: rgba(51, 102, 77, 0.7);\
\n}\n"
);
}
mod black... | Rust | 0 |
tem_78 in var_77 {
#[allow(unused_mut)]
let mut entry_80 = list_79.entry();
entry_80.string(item_78);
}
list_79.finish();
}
#[allow(unused_mut)]
let mut scope_81 = writer.prefix("HealthCheckType");
if let Some(var_82) = &input.health_check_type {
... | Rust | 0 |
repeat(source_images),
# repeat(source_labels),
# repeat(target_images),
# repeat(target_labels),
# ))
# create an artificial test split
... | Python | 1 |
Generate random matrices representing the super Lie algebra elements
# For simplicity, we consider numerical matrices
samples = []
for _ in range(num_samples):
a = np.random.randn()
b = np.random.randn()
c = np.random.randn()
d = np.random.randn()
matrix = np.array([... | Python | 1 |
cast will only be active if we have a cuda device.
with autocast(self.device.type, enabled=True) if self.device.type == 'cuda' else dummy_context():
output = self.network(data)
del data
l = self.loss(output, target)
# the following is needed for online evaluation. Fa... | Python | 1 |
k.plugin import HIGH_PRIORITY, Plugin, pluginmatcher
@pluginmatcher(re.compile("https?://example:1234/(?:foo|bar)/(?P<name>[^/]+)"))
@pluginmatcher(priority=HIGH_PRIORITY, pattern=re.compile(\"\"\"
https?://(?:
sitenumberone
|adifferentsite
... | Python | 1 |
<Vec<u8>>>>,
pub take: bool,
}
impl Filter for LeaseReadFilter {
fn before(&self, msgs: &mut Vec<RaftMessage>) -> Result<()> {
let mut ctx = self.ctx.wl();
for m in msgs {
let msg = m.mut_message();
if msg.get_msg_type() == MessageType::MsgHeartbeat && !msg.get_context()... | Rust | 0 |
function: activation_function.to_string(),
output_size: output_size,
}
}
/// Builds the fundamental structure of a fully-connected layer with a single output node and the sigmoid activation function
pub fn default() -> Self {
FCLayer {
activation_function: "sigmoid".... | Rust | 0 |
#!/usr/bin/env python
# 07-class-attributes-2.py
# The code below shows two important points:
# a) A class attribute can be overridden in an instance, even
# though it is bad due to breaking Encapsulation.
# b) There is a lookup path for attributes in Python. The first being
# the method defined within the class, a... | Python | 1 |
r, c = map(int, input().split())
L = []
debug = False
min_x = 1001
min_y = 1001
max_x = 0
max_y = 0
for j in range(r):
line = input().split()
for h in range(c):
if line[h] == '*':
if h < min_x:
min_x = h
if j < min_y:
min_y = j
if... | Python | 1 |
from .forecast import WeatherForecast
| Python | 1 |
#[serde(skip_serializing_if = "Option::is_none")]
pub ending_before: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_after: Option<&'a str>,
}
impl WebhookEndpoints {
pub fn create<S: ... | Rust | 0 |
e_between);
self.frame_zero_time_received = Instant::now();
self.frame_minus_one = std::mem::replace(&mut self.frame_zero, frame);
let sec = self.frame_zero.number as f32 / 10.0;
let mut seed = sec * 3.141592;
for explosion in self.frame_zero.explosions.iter() {
see... | Rust | 0 |
# Copyright 2024 Tobias Kovats, Flavien Solt, ETH Zurich.
# Licensed under the General Public License, Version 3.0, see LICENSE for details.
# SPDX-License-Identifier: GPL-3.0-only
# This script generates many Cascade ELFs.
from analyzeelfs.genmanyelfs import gen_many_elfs
from params.runparams import PATH_TO_TMP
im... | Python | 1 |
});
if was_panic.is_err() {
process::abort();
}
}
#[cfg(test)]
mod test {
/*
use std::path::PathBuf;
use std::process::{Command, Stdio};
use std::thread;
use std::time;
extern crate libc;
extern crate tempdir;
fn target_path() -> PathBuf {
if PathBuf::from(... | Rust | 0 |
}
cur_padding.truncate(old_len);
if mtype != ManifestType::ToString && mtype != ManifestType::Minify {
buf.push('\n');
buf.push_str(cur_padding);
}
} else if mtype == ManifestType::Std {
buf.push_str("\n\n");
buf.push_str(cur_padding);
} else if mtype == ManifestType::ToString ||... | Rust | 0 |
et inst = decoder.decode(&mut reader).unwrap();
assert_eq!(format!("{}", inst), expected);
let expected = "[MII] nop.m 0x0; sxt1 r14=r14; nop.i 0x0;;";
let data = [0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xe0, 0x00, 0x38, 0x28, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00];
let mut reader = U8Reader::new(&data[..]);
... | Rust | 0 |
est.len() == 0
let bytes = vec![
// Cat 048
0x30, 0x00, 0xb9, 0xe1, 0x93, 0x02, 0x19, 0x0d, 0x35, 0x64, 0x21, 0x00, 0x44, 0xd0, 0x74,
0x02, 0xda, 0x41, 0x80, 0x20, 0xf5, 0xff, 0xff, 0x02, 0x19, 0x0d, 0x35, 0x6e, 0x06, 0xa0,
0x2b, 0x4d, 0x65, 0x1e, 0x04, 0x18, 0x05, 0xa0, 0xe0, 0x56, ... | Rust | 0 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | Python | 1 |
print("Hello world, this repo is for dsa using python") | Python | 1 |
"source_paths",
"type": "array_of_strings",
"value": ["https://staticftv-a.akamaihd.net/sous-titres/france4/20180214/172524974-5a843dcd126f8-1518616910.ttml"]
},
{
"id": "destination_path",
"type": "string",
"value": "/tmp/172524974-5a843dcd126f8-1518616910.ttml"
... | Rust | 0 |
>. <<EMAIL>>")
.about("a weather station for the raspberry pi in rust")
.subcommand(
SubCommand::with_name("server")
.about("starts server")
.version("1.0")
.author("<NAME>. <<EMAIL>>"),
)
.get_matches();
match matches.subc... | Rust | 0 |
_origin = t * line_dir` where the given line
/// intersects with the given axis-aligned bounding box. Since a line and not a ray is given, negative values for t are
/// also considered an intersection.
///
/// The line is specified with the given origin and direction.
///
/// If the line does no... | Rust | 0 |
: {"promql": REDIS_LOAD_QUERY_TEMPLATE["redis_host_io"], "max": 20000, "min": 2000},
},
MachineType.TENDISPLUS: {
"cpu": {"promql": REDIS_LOAD_QUERY_TEMPLATE["redis_host_cpu"], "max": 60, "min": 20},
"mem": {"promql": REDIS_LOAD_QUERY_TEMPLATE["redis_host_mem"], "max": 85, "min": 20},
"d... | Python | 1 |
import os
import pytest
import pytest_asyncio
from sqlalchemy.orm import clear_mappers
from pyrelay.relay.bootstrap import set_up_session_maker
from pyrelay.relay.db.tables import mapper_registry
from pyrelay.relay.unit_of_work import SqlAlchemyUOW
from tests.relay.test_repos.base_test_repo import (
EventRepoTest... | Python | 1 |
/skyboxes/miramar_y_up/left.png",
"./docs/assets/textures/skyboxes/miramar_y_up/right.png",
"./docs/assets/textures/skyboxes/miramar_y_up/down.png",
"./docs/assets/textures/skyboxes/miramar_y_up/up.png",
"./docs/assets/textures/skyboxes/miramar_y_up/front.png",
... | Rust | 0 |
];
async {
let mut parser = futures::stream::iter(pieces.iter())
.map(|bytes| Ok::<&[u8], WebmetroError>(&bytes[..]))
.parse_ebml();
assert_matches!(parser.next().await?, Some(WebmElement::EbmlHead));
assert_matches!(parser.next().awa... | Rust | 0 |
# Copyright 2023 The JAX 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
")
.takes_value(true)
.default_value(".gbackup.toml"),
)
.arg(
Arg::with_name("workers")
.short("w")
.long("workers")
.value_name("N_WORKERS")
.help("Number of concurrent IMAP connections")
... | Rust | 0 |
n");
assert_eq!(400, parsed.error_code);
}
#[test]
fn test_parse_error_ripe_404() {
let parsed: Error = deserialize_and_serialize("error/error_ripe_404.json");
assert_eq!(404, parsed.error_code);
}
#[test]
fn test_parse_bootstrap_asn() {
let parsed: BootstrapRfc... | Rust | 0 |
_ => unimplemented!(),
},
KPrim::Ref => match (node.args.as_mut_slice(), node.results.as_mut_slice()) {
([arg], [result]) => {
let arg_ty = resolve_term(arg, tx);
resolve_var_def(result, Some(&arg_ty.into_ptr(KMut::Const)), tx);
}
_... | Rust | 0 |
from tkinter import *
def donothing():
print ('IT WORKED')
root=Tk()
root.title(string='LOGIN PAGE')
frame1=Frame(root)
frame1.pack(side=TOP,fill=X)
frame2=Frame(root)
frame2.pack(side=TOP, fill=X)
m=Menu(frame1)
root.config(menu=m)
submenu=Menu(m)
m.add_cascade(label='File',menu=submenu)
submenu.add_comm... | Python | 1 |
let height = height - PADDING.px() * 2.0;
let radius = RADIUS.px();
let shape = Rect((&width,&height)).corners_radius(&radius);
let shape = shape.fill(bg_color);
shape.into()
}
}
}
/// Node backdrop. Contains shadow and selection.
pub m... | Rust | 0 |
import datetime
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import pandas as pd
import seaborn as sns
palette = ["#56b4e9", "#949494"]
rc = {'figure.figsize': (8.9, 4.125), 'xtick.bottom': True, 'ytick.left': True}
sns.set_theme(context="paper", style="whitegrid", palette=pale... | Python | 1 |
Debug, StructOpt)]
#[structopt(name = "inferno-flamegraph", about)]
struct Opt {
// ************* //
// *** FLAGS *** //
// ************* //
/// Use consistent palette (palette.map)
#[structopt(long = "cp")]
cp: bool,
/// Colors are keyed by function name hash
#[structopt(long = "hash")... | Rust | 0 |
sync fn main() {
Zap::from_args().run().await;
}
// EndBASIC
// Copyright 2021 <NAME>
//
// 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/LICENS... | Rust | 0 |
key used (hex): c6b6d184ea26781f00b9034ec0ba974f2f833788ce2e24cc37e9e8f41131e1fa".to_string(),
"Stake public key used (hex): e542b6a0ced80e1ab5bda70311bf643b9011ee04411737f3e0136825ef47f2d8".to_string(),
"Rewards address used (hex): 60170bc7c5218b7dcce40e5a232bcf01799cf555871... | Rust | 0 |
"""
Copyright (C) 2018-2025 Intel Corporation
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 agreed to in w... | Python | 1 |
new_triangle(
(0.0, 0.0, 0.0).into(),
(0.0, 1.0, 0.0).into(),
(1.0, 0.0, 0.0).into(),
m.clone(),
);
let ray = Ray::new((0.1, 0.1, 1.0).into(), (0.0, 0.0, -1.0).into());
assert!(triangle.get_intersection(&ray).is_none());
let ray = Ray::new(... | Rust | 0 |
east configure one board.");
let board_path = &format!("board.{}", features[0]);
let board = settings
.get::<BoardData>(board_path)
.expect("No such board");
let mut clang_args = Vec::with_capacity(32);
match clang_version().as_str() {
v if v.contains("6.") => (),
v if ... | Rust | 0 |
Args>,
) -> CreateBuilder<E, CodeHash, GasLimit, Endowment, Set<ExecutionInput<Args>>, Salt, R>
{
CreateBuilder {
env: Default::default(),
code_hash: self.code_hash,
gas_limit: self.gas_limit,
endowment: self.endowment,
exec_input: Set(exec_inp... | Rust | 0 |
loc):
cut_location += distance
elif (cut_location >= end_xloc): # Should ideally not happen due to fmod, but safety
cut_location -= distance
# 1. Cut the original monotonic curve
cut_segments = cut_bezsegs(mono_segments, cut_location, cut_precision, 0)
did_cut = (mono_segments.shape[0] ... | Python | 1 |
# Problem: Sum of Two Integers - https://leetcode.com/problems/sum-of-two-integers/description/
class Solution:
def getSum(self, a: int, b: int) -> int:
mask = 0xFFFFFFFF
while (mask & b) > 0:
carry = a & b
a = a ^ b
b = carry << 1
return mask & a if b > ... | Python | 1 |
# unit test for `examples/offline_inference/torchrun_example.py`
import random
import torch.distributed as dist
from aphrodite import LLM, SamplingParams
from aphrodite.distributed.parallel_state import get_world_group
dist.init_process_group(backend="gloo")
# Create prompts
prompts = [
"Hello, my name is",
... | Python | 1 |
_elapsed, recursion_stats.total_iterations
))),
});
unsafe {
graph_data.add(JsonType::OBJECT {
name: format!("{}_min_q", after_num_matches),
value: Box::new(JsonType::NUMBER((2 * ipl::minimum_wins_qualification) as f64))
});
}
... | Rust | 0 |
fd::EventFd, terminal::Terminal};
use super::super::mmio::errors::{Result, ResultExt};
use super::super::mmio::{DeviceOps, DeviceResource, DeviceType, MmioDeviceOps};
const UART_IER_RDI: u8 = 0x01;
const UART_IER_THRI: u8 = 0x02;
const UART_IIR_NO_INT: u8 = 0x01;
const UART_IIR_THRI: u8 = 0x02;
const UART_IIR_RDI: u8... | Rust | 0 |
t = P_recon_here.add(-P_gt_here)
dist_value = torch.norm(dist,dim=3).squeeze(0)
min_dists, _ = dist_value.min(axis=1)
avg_dist = min_dists.mean()
matched = min_dists[min_dists < thre]
fraction = matched.shape[0] / npoint
return fraction, avg_dist
def completeness(P_recon, P_gt, thre=0.01)... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.