text string | label_name string | labels int64 |
|---|---|---|
Id of node, on which this session is running.
pub self_node_id: NodeId,
/// Count of all configured key server nodes.
pub configured_nodes_count: usize,
/// Count of all connected key server nodes.
pub connected_nodes_count: usize,
}
impl ShareChangeSessionMeta {
/// Convert to consensus session meta. `all_node... | Rust | 0 |
scaler = pickle.load(open("Wisconsin-Breast-Cancer-/model/scaler.pkl", "rb"))
input_array = np.array(list(input_data.values())).reshape(1, -1)
input_array_scaled = scaler.transform(input_array)
prediction = model.predict(input_array_scaled)
st.subheader("Cell cluster prediction")
st.write("The cel... | Python | 1 |
ng
test_success = await run_integration_test()
if test_success:
# Brief pause between phases
print("\n⏸️ Sacred pause before consciousness exploration...")
await asyncio.sleep(1.0)
# Phase 2: Consciousness Demonstration
d... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
import pickle
plt.rcParams['axes.labelsize'] = 18
plt.rcParams['axes.labelweight'] = 'bold'
plt.rcParams['axes.linewidth'] = 2
# # load in data
best_rewards = [854.9090909090909 ,880.010101010101, 862.5555555555555, 953.5252525252525, 955.6969696969697
]
labels = ... | Python | 1 |
, env, event, state, meta, local, &[], last_expr)
}
}
}
}
fn patch_in_place<'run, 'event>(
opts: ExecOpts,
env: &'run Env<'run, 'event>,
event: &'run Value<'event>,
state: &'run Value<'static>,
meta: &'run Value<'event>,
local:... | Rust | 0 |
void, pub(crate) PhantomData<&'memory DirectlyAccessibleFileBackedMemory>);
impl<'memory> Drop for DirectlyAccessiblePersistOnDrop<'memory>
{
#[inline(always)]
fn drop(&mut self)
{
DirectlyAccessibleFileBackedMemory::drain_after_flush()
}
}
impl<'memory> PersistOnDrop<'memory> for DirectlyAccessiblePersistOnDro... | Rust | 0 |
from_bytes(FONT_FILE, FontSettings::default()).unwrap();
self.rasterize(font, px, flags).save(path).unwrap();
}
fn get_ascii_as_image(
&self,
c: char,
rgb: Rgb<u8>,
font: &Font,
px: u32,
flags: Vec<Flag>,
) -> RgbImage {
let show_inverted = fl... | Rust | 0 |
from dataclasses import dataclass
from app.deserializer.types import *
from .steam import *
@dataclass(init=False)
class PresideDataXbox(Struct):
"""
总结构体
"""
system_data_: 'SystemDataXbox'
slot_list_: FixedArray['GameDataXbox', Literal[100]]
@dataclass(init=False)
class SystemDataXbox(Struct):
... | Python | 1 |
STALL_I_DIS2_0 => false,
STALL_I_DIS2_A::STALL_I_DIS2_1 => true,
}
}
}
#[doc = "Reader of field `STALL_I_DIS2`"]
pub type STALL_I_DIS2_R = crate::R<bool, STALL_I_DIS2_A>;
impl STALL_I_DIS2_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> STALL_I_DIS2_A {
mat... | Rust | 0 |
AP flags and device capabilities against,
/// e.g. [`UtilsSecurityType::StaticWep`][crate::UtilsSecurityType::StaticWep]
/// ## `wifi_caps`
/// bitfield of the capabilities of the specific Wi-Fi device, e.g.
/// [`DeviceWifiCapabilities::CIPHER_WEP40`][crate::DeviceWifiCapabilities::CIPHER_WEP40]
/// ## `have_ap`
/// ... | Rust | 0 |
ntains(&mystem::Fact::Case(Nominative)),
_ => false,
}
} else {
false
}
} else {
false
}
})
.map(|w| w.replace(|z| z == '.' || z... | Rust | 0 |
-snip--
// leaf provide basic functionality for branch
// tree have either left or right branch
// leaves on the branches grow with branch label
pub fn leaf(&mut self, node: PrimaryNode, branch : Branch) -> Vec::<PrimaryNode>{
match branch{
Branch::Left => {self.l... | Rust | 0 |
import docker
import os
GOBGP_CONTAINER_NAME = "gobgp-speaker"
GOBGP_IMAGE = "osrg/gobgp"
GOBGP_CONFIG_HOST_PATH = os.path.abspath("./configs/gobgp/gobgp.conf")
GOBGP_CONFIG_CONTAINER_PATH = "/gobgp/gobgp.conf"
BGP_NETWORK_NAME = "bgp-net"
GOBGP_CONTAINER_IP = "10.0.0.2"
def create_docker_network():
client = dock... | Python | 1 |
# Other loss functions are not implemented
raise NotImplementedError('Loss not implemented yet.')
# Mark classifier as trained
self.is_trained = True
# Store training data dimensionality
self.train_data_dim = DX
def predict(self, Z):
"""
Make pred... | Python | 1 |
class Solution:
def countKSubsequencesWithMaxBeauty(self, s: str, k: int) -> int:
from collections import Counter
from math import comb
MOD = 10**9 + 7
# Count frequencies of each character
frequency = Counter(s)
freq_values = list(frequency.values())
# Imp... | Python | 1 |
# route_photo.py
import os
from pathlib import Path
from datetime import datetime
from typing import List, Optional
from dataclasses import dataclass
from src.routes.route import GeoPoint
from src.ui.map_helpers import expanded_bounds, print_step
from src.iio.media_helpers import photos_dir_abs
from src.iio.media_hel... | Python | 1 |
from fastapi import Depends, HTTPException, APIRouter
from app.dao.exceptions import DatabaseError
from app.database import async_session_maker
from app.auth.dependencies import get_curr_user, CurrentUserDep
from app.dao.users.models import User
from app.usecase.bids import bid_version_update as usecase
from app.useca... | Python | 1 |
{}
impl From<&'static str> for Error {
fn from(err: &'static str) -> Error {
Error::Other(err)
}
}
<gh_stars>0
use chrono::Utc;
use mongodb::bson::{doc, Bson};
use mongodb::error::Error;
use mongodb::options::{FindOneAndReplaceOptions, FindOneAndUpdateOptions};
use mongodb::results::{DeleteResult, InsertManyResul... | Rust | 0 |
# -*- coding:utf-8 -*-
# date:2017-7-11
# anthor:Alex
import time
import random
import datetime
import hashlib
from urllib.parse import quote
class myheaders(object):
# 获取当前时间字符串
T = datetime.datetime.strftime(datetime.datetime.now(),"%Y%m%d%H%M%S")
# 获取当前时间戳
t = str(int(time.time()))
# 获取... | Python | 1 |
Vec<_>>();
Ok(serde_json::json!({
"type": "tx2_proxy",
"state": "open",
"addr": addr?,
"proxy_count": i.digest_to_sub_con_map.len(),
"proxy_list": proxy_list,
"sub": self.sub_ep_hnd.debug(),
}))
... | Rust | 0 |
"""
Demonstrating a MPI parallel Matrix-Vector Multiplication.
This code will run *iter* iterations of
v(t+1) = M * v(t)
where v is a vector of length *size* and M a dense size*size
matrix. *size* must be an integer multiple of comm.size.
v is initialized to be zero except of v[0] = 1.0
M is a "off-by-one" diagonal m... | Python | 1 |
se:
msg2 = "{}发起攻击,造成了{}伤害\n"
play_list.append(get_msg_dict(player2, player2_init_hp, skill_msg))
play_list.append(
get_msg_dict(player2, player2_init_hp, msg2.format(player2['道号'], p... | Python | 1 |
};
($num:literal min) => {
std::thread::sleep(std::time::Duration::from_secs($num * 60));
};
($num:literal minutes) => {
std::thread::sleep(std::time::Duration::from_secs($num * 60));
};
($num:literal ms) => {
std::thread::sleep(std::time::Duration::from_millis($num));
... | Rust | 0 |
er for an arbitrary range
pub async fn get_quote_range(
&self,
ticker: &str,
interval: &str,
range: &str,
) -> Result<YResponse, YahooError> {
let url: String = format!(
YCHART_RANGE_QUERY!(),
url = self.url,
symbol = ticker,
... | Rust | 0 |
::from(startup))
.with(System::from(camera::control))
.with(shader::extension)
.run();
}
fn startup(
mut camera: Mut<Camera>,
mut world: Mut<World>,
mut assets: Mut<Assets>,
renderer: Const<Renderer>,
) {
camera.target = [0., 0., 0.].into();
camera.distance = 2.0;
ca... | Rust | 0 |
os");
let mut builder = tonic_build::configure()
.type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]");
for field in vec!["start", "end", "timestamp"] {
builder = builder.field_attribute(field, "#[serde(default, deserialize_with = \"crate::serde_helpers::deserialize_maybe_tim... | Rust | 0 |
g,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
/// Id of afk channel
pub afk_channel_id: Option<Snowflake>,
/// AFK timeout in seconds
pub afk_timeout: u32,
/// true if widget is enabled
pub widget_enabled: Option<bool>,
/// The channel id that the widget will genera... | Rust | 0 |
from typing import List, TypeVar, cast
from ..config import registry
from ..model import Model
from .chain import chain
from .noop import noop
InT = TypeVar("InT")
OutT = TypeVar("OutT")
@registry.layers("clone.v1")
def clone(orig: Model[InT, OutT], n: int) -> Model[InT, OutT]:
"""Construct `n` copies of a laye... | Python | 1 |
foo"
version = "0.0.1"
authors = []
"#)
.file("src/lib.rs", "
pub fn foo() {}
#[test] fn lib_test() {}
")
.file("src/main.rs", "
extern crate foo;
fn main() {}
#[test] fn bin_test() { foo::foo() }
... | Rust | 0 |
import os
import textwrap
import pytest
def test_foo_dry_run(command_tester_factory):
command_tester = command_tester_factory("generate")
with pytest.raises(SystemExit) as pytest_wrapped_exit:
command_tester.execute("-d -w repos/foo")
assert pytest_wrapped_exit.type == SystemExit
assert pytes... | Python | 1 |
o
qgZu @ s U d dl mZ d dlZd dlmZ d dlmZmZmZm Z m
Z
mZ d dlZd dl
Zd dlmZ d dlmZmZmZmZmZmZmZ d dlmZ d dlmZ d d lmZ d d
l m!Z! d dl"m#Z#m$Z$m%Z% d dl&m'Z'm(Z( d d
l)m*Z* d dl+m,Z,m-Z- d dl.m/ m0Z1 d dl2m3Z3m4Z4 d d... | Python | 1 |
rng.squeeze_128_bits_challenge();
let mut cur_challenge = G::ScalarField::one();
// Fresh random challenge x
fs_rng.absorb(&to_bytes![batch_proof.h_comm].unwrap());
let x_point: G::ScalarField = fs_rng.squeeze_128_bits_challenge();
// LC(C): reconstructed commitment to LC(p_1(X... | Rust | 0 |
on file (in mm)
ICP_FILE = "calib/icp_tf.npy"
# Optional workspace cropping bounds: [min_x, min_y, min_z, max_x, max_y, max_z] in meters
WORKSPACE_BOUNDS = [0.15, -0.4, 0.08, 1.0, 0.35, 0.6]
try:
# Initialize merger with implicit unit conversion
print("Initializing robot frame merger w... | Python | 1 |
r"""Diamonds, by Al Sweigart al@inventwithpython.com
Draws diamonds of various sizes.
View this code at https://nostarch.com/big-book-small-python-projects
/\ /\
/ \ //\\
/\ /\ / \ ///\\\
/ \ //\\ / \ ////\\\\
/... | Python | 1 |
lf.lineEdit_17.setText(str(d))
self.lineEdit_F.setText(str(F))
B00=str(int(B1))+' '+str(int(B2))
self.lineEdit_B.setText(str(B00))
self.lineEdit_G1.setText(str(G1))
self.lineEdit_G2.setText(str(G2))
self.lineEdit_H.setText(str(H))
self.lineEdit_P.setText(str(P))
... | Python | 1 |
#[allow(missing_docs)] // documentation missing in model
Master,
#[allow(missing_docs)] // documentation missing in model
Task,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for InstanceFleetType {
fn from(s... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__all__ = [
"BaseTrainer",
"OCPTrainer",
]
from .base_trainer import BaseTrainer
from .ocp_trainer import OCPTrainer
| Python | 1 |
.size_hint() }
}
impl<R: ChunksReader> ExactSizeIterator for ParallelBlockDecompressor<R> {}
impl<R: ChunksReader> Iterator for ParallelBlockDecompressor<R> {
type Item = Result<UncompressedBlock>;
fn next(&mut self) -> Option<Self::Item> { self.decompress_next_block() }
fn size_hint(&self) -> (usize, Opti... | Rust | 0 |
def unnorm(
x: torch.Tensor, mean: torch.Tensor, std: torch.Tensor
) -> torch.Tensor:
return x * std + mean
def pad_width(self, x):
pad_w = self.im_size[1] - x.shape[-1]
if pad_w > 0:
pad_w_left = pad_w // 2
pad_w_right = pad_w - pad_w_left
e... | Python | 1 |
__all__ = ('handle', 'ahandle')
import inspect
from collections.abc import Callable, Coroutine
from functools import wraps
from typing import Any, TypeVar
T = TypeVar('T')
E = TypeVar('E', bound=BaseException)
async def _await_maybe(result: T | Coroutine[Any, Any, T]) -> T:
if inspect.isawaitable(result):
... | Python | 1 |
# Crie um programa que converta uma medida em metros para centímetros e milímetros.
import os
os.system('cls')
print('-' * 90)
print('CONVERTER MEDIDAS')
print('=' * 90)
valor = float(input('ENTRE COM O VALOR DE MILíMETROS:'))
centimetros = valor / 10
print('-' * 90)
print('RESULTADOS')
print('=' * 90)
print(f... | Python | 1 |
import os
import shutil
# Define the source directory (Downloads folder)
source_dir = 'C:\\Users\\Ammar\\Downloads' # Double backslashes
# Update this path
# Define the target directories
target_dirs = {
'images': os.path.join(source_dir, 'Images'),
'documents': os.path.join(source_dir, 'Documents'),
'v... | Python | 1 |
field"]
pub struct PWM_0_FLTSRC1_DCMP7R {
bits: bool,
}
impl PWM_0_FLTSRC1_DCMP7R {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self)... | Rust | 0 |
KpDivide,
KpMultiply,
KpSubtract,
KpAdd,
KpEnter,
KpEqual,
LeftShift,
LeftControl,
LeftAlt,
LeftSuper,
RightShift,
RightControl,
RightAlt,
RightSuper,
Menu,
Unknown,
}
impl From<Key> for StringKey {
fn from(key: glfw::Key) -> StringKey {
matc... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
if __name__ == "__main__":
# compute ODE solution to radiation pressure tube (Krumholz et al. 2007)
a_rad = 7.5646e-15 # erg cm^-3 K^-4
c = 2.99792458e10 # cm s^-1
k_B = 1.380658e-16 # erg K^-1
... | Python | 1 |
from flask import Blueprint, request, jsonify, make_response
from utils.db import db
from models.caracteristica_mascota import Caracteristica_mascota
from schemas.caracteristica_mascota import caracteristicas_mascotas_schema, caracteristica_mascota_schema
car_mascotas_routes = Blueprint('car_mascotas_routes', __name_... | Python | 1 |
from .base import FunctionService
from pulumi import Output
from pydantic import Field
class Inference(FunctionService):
service_name: str = "inference"
image_name: str = "inference" + ":latest"
docker_file: str = "../inference/Dockerfile.inference"
context: str = "../inference/"
target_service: ... | Python | 1 |
import torch
from torch import nn
import torch.cuda as cuda
from EncoderDecoder import Encoder, Encoder2, Decoder
from Module import Attn
# Hyper Parameters
BATCH = 300
EPOCHS = 40
INPUT_SIZE = 6
LR = 0.01
d_model = 512
heads = 8
HIDDEN_SIZE = 32
h_state = None
TIME_STEP = 12
STEPS = 1
DEVICE = torch.device('cuda' if... | Python | 1 |
-> Self {
let mut set = HConSet::new();
for elem in src {
set.insert(elem);
}
set
}
}
/// A hash map of hash-consed things with trivial hashing.
#[derive(Clone, Debug, Eq)]
pub struct HConMap<T, V>
where
T: HashConsed,
T::Inner: Hash + Eq,
{
map: HashMap<HCo... | Rust | 0 |
pub fn ImFont_CalcTextSizeA(
font: *const ImFont,
out: *mut ImVec2,
size: c_float,
max_width: c_float,
wrap_width: c_float,
text_begin: *const c_char,
text_end: *const c_char,
remaining: *mut *const c_char,
);
pub fn ImFont_CalcWordWrapPositionA(
... | Rust | 0 |
from app.api import auth, comments, user_info, video # noqa
| Python | 1 |
it you rely on
is a supertrait of the trait you’re implementing.
Supertrait Example:
In the implementation of outline_print, we want to use the Display trait’s functionality.
Therefore, we need to specify that the OutlinePrint trait will work only for types
that also implement Display and provide the functionality t... | Rust | 0 |
Event(
tx_hash=tx_hash,
sequence_index=0,
timestamp=timestamp,
location=Location.ARBITRUM_ONE,
event_type=HistoryEventType.SPEND,
event_subtype=HistoryEventSubType.FEE,
asset=A_ETH,
balance=Balance(amount=FVal(gas)),
... | Python | 1 |
"""
SynthTIGER
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
import cv2
import numpy as np
from synthtiger.components.component import Component
from synthtiger.layers import Group
class Rotate(Component):
def __init__(self, angle=(-45, 45), ccw=0):
super().__init__()
self.angle = angle... | Python | 1 |
6,
7,
(IMM8 as u32 & 0b11) + 8,
((IMM8 as u32 >> 2) & 0b11) + 8,
((IMM8 as u32 >> 4) & 0b11) + 8,
((IMM8 as u32 >> 6) & 0b11) + 8,
12,
13,
14,
15,
(IMM8 as u32 & 0b11) + 16,
((IMM8 as... | Rust | 0 |
_set: byte
timer: byte
psylock: FixedArray['PsylockData', Literal[4]]
psy_no: sbyte
psy_menu_active_flag: byte
psy_unlock_not_unlock_message: byte
psy_unlock_success: byte
sw_move_flag: FixedArray[byte, Literal[60]]
roomseq: FixedArray[byte, Literal[25]]
lockdat: FixedArray[ushort, L... | Python | 1 |
get(self, "location")
@_builtins.property
@pulumi.getter
def name(self) -> pulumi.Output[_builtins.str]:
"""
The name of the connector. The `connector` segment is used when connecting directly to the connect cluster. Structured like: `projects/PROJECT_ID/locations/LOCATION/connectClusters/C... | Python | 1 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import re
from lib.core.agent import agent
from lib.core.common import arrayizeValue
from lib.core.common import Backend
from lib.core.common import filterPairValues
from lib.co... | Python | 1 |
: *const libc::c_void,
mut keylen: i32,
) -> *mut pdf_obj {
let object;
assert!(!names.is_null());
let value = ht_lookup_table(names, key, keylen) as *mut obj_data;
if !value.is_null() {
object = (*value).object;
assert!(!object.is_null());
} else {
/* A null object as du... | Rust | 0 |
bg gf bafeg dbefa fcge gcbea fcaegb dgceab fcbdga | gecf \
egdcabf bgf bfgea\r\nfgeab ca afcebg bdacfeg cfaedg gcfdb baec bfadeg \
bafgc acf | gebdcfa ecba ca fadegcb\r\ndbcfg fgd bdegcaf fgec aegbdf \
ecdfab fbedc dacgb gdcebf gf | cef... | Rust | 0 |
/ nr_clusters as f32,
nr_cores: nr_cores,
}
}
fn seq_raster(points: &Vec<Point>, precision: Float, threshold: usize, min_cluster_size: usize) -> (u128, u128, usize) {
let ((tiles, _scalar), proj_microsec) = timeit!("Projection: {} ms",
raster::map_to_tiles(points, precision, thresho... | Rust | 0 |
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from rdkit.Chem.rdMolDescriptors import CalcMORSE
from scipy.sparse import csr_array
from skfp.fingerprints import MORSEFingerprint
def test_morse_fingerprint(mols_conformers_list):
morse_fp = MORSEFingerprint(n_jobs=-1)
X_skfp = mors... | Python | 1 |
test)]
mod tests {
use super::{Ed25519Signer, Ed25519Verifier};
ed25519_tests!(Ed25519Signer, Ed25519Verifier);
}
<gh_stars>100-1000
/// [UNSTABLE](UNSTABLE.md) Describes how much funds will be debited from the target
/// contract balance as a result of the transaction.
#[derive(Serialize, Deserialize, Clone,... | Rust | 0 |
meragiTrait;
/// Requires world to read latest blocks commited
type World: WorldTrait;
/// Constructs `BlockSync`
fn from_configuration(
config: &BlockSyncConfiguration,
wsv: Arc<WorldStateView<Self::World>>,
sumeragi: AlwaysAddr<Self::Sumeragi>,
peer_id: PeerId,
... | Rust | 0 |
#!/usr/bin/env python
import numpy as np
import cv2 as cv
MHI_DURATION = 0.5
DEFAULT_THRESHOLD = 32
MAX_TIME_DELTA = 0.25
MIN_TIME_DELTA = 0.05
# (empty) trackbar callback
def nothing(dummy):
pass
def draw_motion_comp(vis, rect, angle, color):
x, y, w, h = rect
cv.rectangle(vis, (x, y), (x+w, y+h), (0, 2... | Python | 1 |
last block balance was updated (0 is never)
pub last_update_time: u64,
/// in normal cases, it should be set, but there is a delay between binding
/// the channel and making a query and in that time it is empty
pub remote_addr: Option<HumanAddr>,
pub remote_balance: Vec<Coin>,
}
/// accounts is loo... | Rust | 0 |
_difficulty_to_value() {
let levels: Vec<u8> = (1..=10).collect();
let mut last_level = 0;
for players in [1, 2].iter() {
for difficulty in [4, 1, 2, 3, 6].iter() {
let difficulty = Level::new(*players, *difficulty).unwrap();
let level = difficulty.to_... | Rust | 0 |
rosoft.com/en-us/windows/win32/api/winuser/nf-winuser-makewparam),
/// and
/// [`MAKELPARAM`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-makelparam)
/// macros.
pub fn MAKEDWORD(lo: u16, hi: u16) -> u32 {
((lo as u32 & 0xffff) | ((hi as u32 & 0xffff) << 16)) as u32
}
/// [`MAKEWORD`... | Rust | 0 |
self,
f: impl FnOnce(Self::Error) -> G,
) -> Result<Self::Value, Loc<G, Self::FileId>>;
}
impl<T, E, F> MapLocErr for Result<T, Loc<E, F>> {
type Value = T;
type Error = E;
type FileId = F;
#[inline(always)]
fn map_loc_err<G>(
self,
f: impl FnOnce(Self::Error) -> G,
) -> Result<Self::Value, Loc<G, Self:... | Rust | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 1 |
1);
}
_ => {
process::exit(-1);
}
}
}
use crate::bluez::{enable_le_scan, get_filter, open, set_filter, HciEvent, HciFilter, HciType};
use crate::bt_parsing::bt_parser;
use crate::event::{Color, Dispatcher, Event};
use crate::ibeacon_parsing::{ibeacon_parser, IBeacon};
use anyhow:... | Rust | 0 |
races_data = {tid: self.get_trace(tid) for tid in trace_ids}
else:
traces_data = {tid: self.get_trace(tid) for tid in self._traces.keys()}
# Convert spans to dictionaries
export_data = {}
for trace_id, spans in traces_data.items():
export_data[trace_id] =... | Python | 1 |
import torch
import torch.nn as nn
class PointPillarScatter(nn.Module):
def __init__(self, model_cfg):
super().__init__()
self.model_cfg = model_cfg
self.num_bev_features = self.model_cfg['num_features']
self.nx, self.ny, self.nz = model_cfg['grid_size']
assert self.nz == ... | Python | 1 |
"
[1, 2, 3]
"#);
let val2 = request!(r#"
[10, 22, 6, 1, 5, 3, 2]
"#);
let result = match_json(&val1, &val2, &MatchingContext::new(DiffConfig::AllowUnexpectedKeys, &matchingrules!{
"body" => {
"$" => [ MatchingRule::ArrayContains(vec![]) ]
}
}.rules_for_category("body").u... | Rust | 0 |
return model
def drn_d_56(pretrained=False, **kwargs):
model = DRN(Bottleneck, [1, 1, 3, 4, 6, 3, 2, 2], arch='D', **kwargs)
if pretrained:
model.load_state_dict(model_zoo.load_url(model_urls['drn-d-56']))
return model
def drn_d_105(pretrained=False, **kwargs):
model = DRN(Bottleneck, [1, ... | Python | 1 |
one(),
con,
}),
Uniq::default(),
peer_cert,
dir,
))
}
}
impl ConAdapt for QuicConAdapt {
fn uniq(&self) -> Uniq {
self.1
}
fn dir(&self) -> Tx2ConDir {
self.3
}
fn peer_addr(&self) -> KitsuneResult<TxUrl> ... | Rust | 0 |
use crate::ConnType;
use crate::models::schema::{
cpustats::dsl::*,
cputimes::dsl::*,
disks::dsl::*,
hosts::{
self,
dsl::{hosts as dsl_host, uuid, *},
},
ioblocks::dsl::*,
ionets::dsl::*,
loadavg::dsl::*,
memory::dsl::*,
swap::dsl::*,
};
use crate::models::{CpuS... | Rust | 0 |
::ffi::{CStr, CString};
use rute_ffi_base::*;
#[allow(unused_imports)]
use auto::*;
/// **Notice these docs are heavy WIP and not very relevent yet**
/// # Licence
///
/// The documentation is an adoption of the original [Qt Documentation](http://doc.qt.io/) and provided herein is licensed under the terms of the [GN... | Rust | 0 |
# Clean relative path - avoid duplicated directories
rel_parts = rel_path.split(os.sep)
clean_rel_parts = []
for part in rel_parts:
... | Python | 1 |
RF_GPIO1_SRC_DIO_10),
11 => Val(GPIO1_A::RF_GPIO1_SRC_DIO_11),
12 => Val(GPIO1_A::RF_GPIO1_SRC_DIO_12),
13 => Val(GPIO1_A::RF_GPIO1_SRC_DIO_13),
14 => Val(GPIO1_A::RF_GPIO1_SRC_DIO_14),
15 => Val(GPIO1_A::RF_GPIO1_SRC_DIO_15),
16 => Val(GPIO1_A::RF... | Rust | 0 |
# pygame - Python Game Library
# Copyright (C) 2000-2003 Pete Shinners
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your... | Python | 1 |
ub const PyCF_SOURCE_IS_UTF8 : c_int = 0x0100;
pub const PyCF_DONT_IMPLY_DEDENT : c_int = 0x0200;
pub const PyCF_ONLY_AST : c_int = 0x0400;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PyCompilerFlags {
cf_flags : c_int
}
#[allow(missing_copy_implementations)]
pub enum Struct__mod { }
#[allow(missing_copy_impleme... | Rust | 0 |