text string | label_name string | labels int64 |
|---|---|---|
: None,
};
let mut env = IndexMap::new();
env.insert(
"TEST_RUN_TASK_SET_ENV".to_string(),
EnvValue::Value("VALID".to_string()),
);
let mut task = Task::new();
task.script = Some(vec!["exit 0".to_string()]);
task.env = Some(env);
let step = Step {
name: "test".... | Rust | 0 |
ur_matrix,
cmap=cmap,
square=True,
annot=True,
vmin=vmin,
vmax=vmax,
cbar_ax=cbar_ax,
cbar_kws={"ticks": np.linspace(vmin, vmax, 10)},
mask=mask,
xticklabels=[],
yticklabels=[],
ax=ax,
... | Python | 1 |
pipeline.gauge("metric", 9.1);
struct TimeTest {
num: u8,
};
let mut t = TimeTest { num: 10 };
pipeline.time("time_block", || {
t.num += 2;
});
pipeline.send(&client);
let response = server_recv(server);
assert_eq!(t.num, 12);
... | Rust | 0 |
import FWCore.ParameterSet.Config as cms
import RecoTracker.FinalTrackSelectors.selectLoose_cfi
import RecoTracker.FinalTrackSelectors.selectTight_cfi
import RecoTracker.FinalTrackSelectors.selectHighPurity_cfi
zeroStepWithLooseQuality = RecoTracker.FinalTrackSelectors.selectLoose_cfi.selectLoose.clone(
src = 'pr... | Python | 1 |
&self.0[..]
}
fn from_slice(slice: &[u8]) -> molecule::error::VerificationResult<Self> {
SUDTArgsReader::from_slice(slice).map(|reader| reader.to_entity())
}
fn from_compatible_slice(slice: &[u8]) -> molecule::error::VerificationResult<Self> {
SUDTArgsReader::from_compatible_sli... | Rust | 0 |
Training data, where `n_samples` is the number of samples
and `n_features` is the number of features.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self : object
Returns the instance itself.
"""
... | Python | 1 |
received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! A validator discovery service for the Network Bridge.
use crate::Network;
use core::marker::PhantomData;
use std::collections::HashSet;
use futures::channel::oneshot;
use sc_network::multiadd... | Rust | 0 |
test case generator.
//!
//! ## Usage
//!
//! First, use [`cargo fuzz`](https://github.com/rust-fuzz/cargo-fuzz) to define
//! a new fuzz target:
//!
//! ```shell
//! $ cargo fuzz add my_wasm_smith_fuzz_target
//! ```
//!
//! Next, add `wasm-smith` to your dependencies:
//!
//! ```toml
//! # fuzz/Cargo.toml
//!
//! [d... | Rust | 0 |
them in two sets. For example, the first line would give the
/// following two sets:
///
/// {"mxmxvkd", "kfcds", "sqjhc", "nhms"}
/// {"dairy", "fish"}
///
/// # Arguments
/// * `line` : One line from the input file.
///
/// # Returns
/// * `HashSet<String>` : The set of ingredients
/// * `HashSet<String>` : T... | Rust | 0 |
fn p2p_log_metrics(&self, metrics: Vec<MetricRecord>) -> DatabaseResult<()> {
for record in metrics {
let kind = record.kind.to_db();
let agent = record.agent.map(|a| a.0.clone());
let recorded_at = record.recorded_at_utc.as_micros();
let expires_at = record.e... | Rust | 0 |
#Identificar a maioridade
#Entrada de Dados
nome = input('Informe o seu nome: ')
idade = int(input ('informe sua idade:'))
#Verifica a idade do usuário
if idade >= 18:
print(f'{nome} é maior de idade!')
else:
print(f'{nome}é menor de idade')
| Python | 1 |
query_id`.
///
/// If the `location` has an ongoing notification and when this function is called, then an
/// error should be returned.
fn start(location: &MultiLocation, query_id: QueryId, max_weight: u64) -> XcmResult;
/// Stop notifying `location` should the XCM change. Returns an error if there is no existin... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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 |
}
tier3_rounds_store.set_at(tier3_rounds_store.len()-1,&updated_round);
//send trigger fee to triggerer
transfer_result = transfer_msg(
triggerer_address.clone(),
triggerer_fee_tier3,
None,
BLOCK_SIZE,
... | Rust | 0 |
ig
.host_key
.clone()
.unwrap_or(event::log_schema().host_key().to_string());
Ok(unix::unix(config.path, config.max_length, host_key, out))
}
}
}
fn output_type(&self) -> DataType {
DataType::Log
}
... | Rust | 0 |
w(),
}
}
pub fn container(&self) -> >k::Notebook { &self.container }
pub fn history(&self) -> &history::Map { &self.history }
pub fn shortcuts(&self) -> &shortcuts::Map { &self.shortcuts }
pub fn bookmarks(&self) -> &bookmarks::Map { &self.bookmarks }
pub fn show_section(&self, secti... | Rust | 0 |
string(&mut tdeq, "<EMAIL>");
deq_put_cstring(&mut tdeq, "2");
deq_put_cstring(&mut tdeq, "<EMAIL>");
deq_put_cstring(&mut tdeq, "1");
deq_put_cstring(&mut tdeq, "<EMAIL>");
deq_put_cstring(&mut tdeq, "1");
deq_put_cstring(&mut tdeq, "l<EMAIL>");
deq_put_cstrin... | 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 u... | Python | 1 |
ut ffi::GtkPlacesSidebar, mount_operation: *mut gio_ffi::GMountOperation, f: glib_ffi::gpointer)
where P: IsA<PlacesSidebar> {
let f: &&(Fn(&P, &gio::MountOperation) + 'static) = transmute(f);
f(&PlacesSidebar::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(mount_operation))
}
unsafe extern "C"... | Rust | 0 |
# ///////////////////////////////////////////////////////////////
#
# BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0
#
# This project can be used freely for all uses, as long as they maintain the
# respective credits only in the Python scripts, any information in the visual
# interface ... | Python | 1 |
rror = 1;
pub type GOnceStatus = c_int;
pub const G_ONCE_STATUS_NOTCALLED: GOnceStatus = 0;
pub const G_ONCE_STATUS_PROGRESS: GOnceStatus = 1;
pub const G_ONCE_STATUS_READY: GOnceStatus = 2;
pub type GOptionArg = c_int;
pub const G_OPTION_ARG_NONE: GOptionArg = 0;
pub const G_OPTION_ARG_STRING: GOptionArg = 1;
pub co... | Rust | 0 |
target = 0.25
class scales( LeggedRobotCfg.rewards.scales ):
termination = 0.0
tracking_lin_vel = 1.5 * 1. / (.005 * 6)
tracking_ang_vel = 0.5 * 1. / (.005 * 6)
lin_vel_z = 0.0
ang_vel_xy = 0.0
orientation = 0.0
torques = 0.0
... | Python | 1 |
dksCJ t |d tsLJ t |d ttfsYJ |n"|tj u rot |trkt|dksmJ n|tj
u rt |trt|dksJ t |d tr|d d d t|d d dv sJ t |d ttfsJ |n|tju rt|d usJ n|tj
tjfv rt |tsJ tdd |D sJ |n|tjtjfv rt |tsJ n|tju rt |trt|dksJ t|... | Python | 1 |
"""MDB Mapper CLI interface."""
from pathlib import Path
from typing import Optional
import typer
from rich.console import Console
app = typer.Typer(
name="mdb_mapper",
help="CLI tool for processing MDB mapper images",
add_completion=False,
)
console = Console()
@app.command()
def preprocess(
raw_d... | Python | 1 |
# https://www.acmicpc.net/problem/1735
# 두 분수가 주어졌을 때, 그 합을 기약분수의 형태로 구하는 프로그램
# 분수 합을 구하고 최대공약수로 나눠서 계산하면 되겠다
import math
a, b = map(int, input().split())
c, d = map(int, input().split())
e = (a * d) + (b * c) # 분수 합의 분자
f = b * d # 분수 합의 분모
# 최대공약수로 분자 분모 나누기
gcd = math.gcd(e, f)
e //= gcd
f //= gcd
# 분자 분... | Python | 1 |
const TEXT: &'static str = "aaaabaaaab";
let source = SourceText::new(TEXT);
let mut lexer = Lexer::new(Test::new(), source);
lexer.set_filter_fn(|tok| *tok != Aa);
assert_eq!(lexer.peek(), Some(B));
let f = lexer.take_filter();
assert_eq!(lexer.peek(), Some(Aa));
lexer.set_filter(f... | Rust | 0 |
import pytest
from fastapi import FastAPI, status
from fastapi.testclient import TestClient
from models.slugify_models import SlugifyInput, SlugifyOutput
from routers.slugify_router import router as slugify_router
# Fixture for the FastAPI app
@pytest.fixture(scope="module")
def test_app() -> FastAPI:
app = Fast... | Python | 1 |
from typing import Any, Callable, Dict, Optional
from fuzzysearch import find_near_matches
from guardrails.validator_base import (
FailResult,
PassResult,
ValidationResult,
Validator,
register_validator,
ErrorSpan
)
@register_validator(name="guardrails/ban_list", data_type="string")
class Ban... | Python | 1 |
}
impl core::convert::From<crate::R<MPUCTL1_SPEC>> for R {
fn from(reader: crate::R<MPUCTL1_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `MPUCTL1` writer"]
pub struct W(crate::W<MPUCTL1_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MPUCTL1_SPEC>;
#[inline(always)]
fn deref... | Rust | 0 |
- 9.0).abs() < 1e-10);
}
}
<gh_stars>0
use three_d::*;
fn main() {
let args: Vec<String> = std::env::args().collect();
let screenshot_path = if args.len() > 1 { Some(args[1].clone()) } else {None};
let mut window = Window::new_default("Wireframe").unwrap();
let (width, height) = window.frameb... | Rust | 0 |
let imod = prog.read_inter(&modkey.name);
let fix = match args.flag_func {
Some(func) => {
let lfunc = Lstr::from(func);
imod.interfunc.get(&lfunc)
}
None => imod.interfunc.get("main"),
};
println!("\n{:?}\n", fix);
... | Rust | 0 |
"""
#! 🧠 CLASE 14 Manejo de errores: try, except, else, finally
#? 📘 Módulo 1 (Ampliado) Clase 14 de 30
#? 🎯 Objetivo de esta clase
#todo: Aprender a manejar errores de forma controlada y elegante usando las estructuras que ofrece Python:
#!Palabra clave ¿Qué hace?
try #... | Python | 1 |
import functools
import operator
import itertools
from .errors import OptionError
from jaraco.text import yield_lines
from jaraco.functools import pass_none
from ._importlib import metadata
from ._itertools import ensure_unique
from more_itertools import consume
def ensure_valid(ep):
"""
Exercise one of the ... | Python | 1 |
w channel
publish_msg(&cli, &payload.payload, &connected.to_string(), &1)
}
}
fn publish_test(cli: &mqtt::AsyncClient, topic: &str, uuid: &Uuid){
// println!("Publish test to: {:?}", topic);
// // Publish the GPU info
// for (_p_idx, platform) in Platform::list().into_iter().enumerate() {
// // for ... | Rust | 0 |
model:
model = self.service.get_current_model()
# Convert to chat format
chat_request = {
"model": model,
"messages": [{"role": "user", "content": prompt}],
"user": request_data.get("user", "") + f"|module:{module_id}"... | Python | 1 |
s': [],
'fid_neg': [],
'unfaith': []
}
for i in range(args.repeat):
unfaithful_list = []
fid_pos_list = []
fid_neg_list = []
for data in tqdm(testloader):
data = data.to(device)
# target = explained_model(data.x, data.edge_index, data.batch)
explanation = explainer(x = data.x... | Python | 1 |
"""current_revision_id in content
Revision ID: 2bb8ccb44ce0
Revises: 511ce99e1baa
Create Date: 2020-03-24 16:42:32.943900
"""
# revision identifiers, used by Alembic.
from alembic import op
import sqlalchemy as sa
revision = "2bb8ccb44ce0"
down_revision = "4f72874ba193"
filling_current_revision_query = """
update c... | Python | 1 |
# nuScenes dev-kit.
# Code written by Holger Caesar, 2020.
import fire
import os
import json
import tarfile
from typing import List
def export_release(dataroot='/data/sets/nuimages', version: str = 'v1.0') -> None:
"""
This script tars the image and metadata files for release on https://www.nuscenes.org/down... | Python | 1 |
addr =
Self::node_record_to_target_addr(node_id, latest_version, node_record)?;
node_targets.insert(PrometheusTargetGroup {
targets: vec![socket_addr].into_iter().collect(),
subnet_id: None,
node_id,
ic_name: ic_name.into(),
... | Rust | 0 |
_configure_validators(self, config: configparser.ConfigParser,
network_config: Dict[str, Any]) -> None:
"""Configure validator settings"""
for section in config.sections():
config[section].clear()
config.set(section, "\n".join(map(str, network_config[... | Python | 1 |
from beanie import Document, Indexed
from pydantic import BaseModel
from typing import Any
import pytz
from datetime import datetime
class CompareDoc(BaseModel): # pylint: disable=R0901
document_id: str
file_name: str
schema_version: str
type: str
class Doc(BaseModel): # pylint: disable=R0901
... | Python | 1 |
nt_loop()
asyncio.set_event_loop(loop)
try:
for webpage in new_webpages:
try:
# Get embedding for content
embedding = loop.run_until_complete(get_embedding_from_vllm(truncate_text(webpage['content'])))
# Pr... | Python | 1 |
.await;
self.pending_text = new_text;
}
async fn check_cwd_change(&mut self) {
// handle if the cwd changes, if the cwd is deleted in the case of
// get_cwd_uri() erroring, then keep using it as the base
let cwd_uri = get_cwd_uri().unwrap_or_else(|_| self.cwd_uri.clone());
if self.cwd_uri ... | Rust | 0 |
)?;
continue;
}
if init_in.major < 7 || init_in.minor < MINIMUM_SUPPORTED_MINOR_VERSION {
tracing::warn!(
"polyfuse supports only ABI 7.{} or later. {}.{} is not supported",
MINIMUM_S... | Rust | 0 |
from .image_processing import *
import cv2 as cv
def get_letters(img):
"""
Extract individual letters from an image.
Parameters
----------
filename : str
The filename of the image containing the letters.
Returns
-------
list
A list of cropped images containing individ... | Python | 1 |
match message {
None => {
println!("Failed to parse AWS Event");
return Response::new(ResponseType::InternalServerError500, None)
},
Some(value) => { value },
};
// let func = Funcionario::new_from_json(request);
let func = message.get_value::<Funcionario>(... | Rust | 0 |
eate_global_mpc_variable(
persistable=True,
dtype='int64', shape=[3],
)
helper.set_variable_initializer(stat, Constant(value=0))
op_type = 'precision_recall'
helper.append_op(
type='mpc_' + op_type,
inputs={
"Predicts": input,
"L... | Python | 1 |
client_sock, H2SettingsFrame(ack=True).to_bytes())
case H2FrameType.PING:
if not frame.flags.end_stream_or_ack:
sendall(client_sock, H2PingFrame(ack=True, opaque_data=frame.payload[:8]).to_bytes())
case H2FrameType.GOAWAY:
r... | Python | 1 |
er=True
)
# North arrow
ax.annotate(
"", xy=(0.1, 0.25), xytext=(0.1, 0.1),
xycoords="axes fraction",
arrowprops=dict(arrowstyle="-|>", lw=3, color="black")
)
ax.text(
0.1, 0.27, "N",
... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 21:25:25 2024
@author: awei
Regression RMSE:
0.0204
ln_reg_real ln_reg_pred
0 -0.007125 -0.001014
1 -0.015440 -0.004879
2 -0.007288 -0.003205
3 -0.012618 -0.001099
4 0.002114 0.003121
5 -0.004233 0.003436
6 0.01054... | Python | 1 |
();
af_print! ("-------\nas2 =", as2);
let (U, Σ, Vᵗ) = arrayfire::svd (&as2);
af_print! ("U =", U);
af_print! ("Σ =", Σ);
af_print! ("Vᵗ =", Vᵗ);
let mut Vᵗʹ = [0f32; 9]; Vᵗ.host (&mut Vᵗʹ);
let mut Σʹ = [0f32; 2]; Σ.host (&mut Σʹ);
let (U, Σ, Vᵗ) = a2.svddc (UVTFlag::Full) .unwrap();
let _U = U.unwr... | Rust | 0 |
ssion {
object.key("ApiKeySelectionExpression").string(var_1181);
}
if let Some(var_1182) = &input.created_date {
object.key("CreatedDate").string(var_1182);
}
if let Some(var_1183) = &input.description {
object.key("Description").string(var_1183);
}
if let Some(var_1184)... | Rust | 0 |
99404568402;
pub const RELATIVE_ERROR_FACTOR: f64 = 100.0;
pub type uint16 = u16;
pub type uint32 = u32;
pub type uint64 = u64;
pub type uint8 = u8;
/// Draws keylines.
///
/// ## Parameters
/// * image: input image
/// * keylines: keylines to be drawn
/// * outImage: output image to draw on
/// * color: color of line... | Rust | 0 |
let _ = (line, pos, ctx);
Ok((0, vec![]))
}
}
#[derive(Debug)]
pub enum VoidError {}
impl fmt::Display for VoidError {
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {}
}
}
impl Error for VoidError {}
impl HighlightAndComplete for String {
type Error = Voi... | Rust | 0 |
mon.parse_java(input, '1.4')
assert expect == classes, (expect, classes)
pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5')
assert expect == classes, (expect, classes)
def test_genercis(self):
"""Test that generics don't interfere with detecting anonymous classes"""... | Python | 1 |
SEARCH_STEPS[i]})
search_target = SEARCH_STEPS[i].split("search: ")[-1].strip()
search_response = gold_search_recipe(search_target)
example_dialogue.append({"role": "user", "content": search_response})
if "think" in handler_names:
example_dialogue.append({"role":... | Python | 1 |
slot_and_parent: Option<(u64, u64)>,
slot_broadcast_start: Option<Instant>,
shred_version: u16,
last_datapoint_submit: Arc<AtomicU64>,
num_batches: usize,
cluster_nodes: Arc<RwLock<ClusterNodes<BroadcastStage>>>,
last_peer_update: Arc<AtomicU64>,
}
impl StandardBroadcastRun {
pub(super) fn ... | Rust | 0 |
s
N_perbin = np.zeros((sbn, 1))
# if volume condition met, then redistribute particles and components based on
# the new volume
for sbi in range(sbn): # particle size bin loop
sbi_new = sum(Vnew[sbi]>s0[1::]) # index of size bin these particles fit now
# add number concentration (# particles/cm3 (air))
... | Python | 1 |
Preview::HalfAlpha,
);
self.flags.set(
ImGuiColorEditFlags::AlphaPreview,
preview == ColorPreview::Alpha,
);
self
}
/// Sets the button size.
///
/// Use 0.0 for width and/or height to use the default size.
#[inline]
pub fn size(mut self, s... | Rust | 0 |
oard": "servo micro",
"vid": 6353,
"pid": 20506,
"flash": 134217728,
"regions": {
"RW": [65536, 65536],
"PSTATE": [61440, 4096],
"RO": [0, 61440]
}
}
Args:
brdfile: path to board description file.
"""
with open(brdfile) as data_file:
d... | Python | 1 |
tokens=words, entities=entities))
return examples
class ProcessExample2Feature:
def __init__(self, label2id, tokenizer, max_sequence_length):
super().__init__()
self.label2id = label2id
self.tokenizer = tokenizer
self.max_sequence_length = max_sequence_length
def __ca... | Python | 1 |
stringify!($expression), $expression);
)
}
fn main() {
foo();
bar();
print_result!(1u32 + 1);
// Recall that blocks are expressions too!
print_result!({
let x = 1u32;
x * x + 2 * x -1
});
}
<reponame>johnhalbert/oso<gh_stars>0
//! Benchmarks of blog post things
use oso:... | Rust | 0 |
from_cache) with a node cache
/// obtained from [`NodeCache::from_interner`].
#[inline]
pub fn from_interner(interner: I) -> Self {
let cache = NodeCache::from_interner(interner);
Self::from_cache(cache)
}
/// Get a reference to the interner used to deduplicate source text (strings)... | Rust | 0 |
) -> SubModules {
match s {
"jsonrpc" => SubModules::Jsonrpc,
"net" => SubModules::Net,
"chain" => SubModules::Chain,
"consensus" => SubModules::Consensus,
"auth" => SubModules::Auth,
"executor" => SubModules::Executor,
"synchro... | Rust | 0 |
8).and_hms(8, 49, 37), "Tuesday, 08-Nov-94 08:49:37 GMT"),
(UTC.ymd(1994, 11, 9).and_hms(8, 49, 37), "Wednesday, 09-Nov-94 08:49:37 GMT"),
(UTC.ymd(1994, 11, 10).and_hms(8, 49, 37), "Thursday, 10-Nov-94 08:49:37 GMT"),
(UTC.ymd(1994, 11, 11).and_hms(8, 49, 37), "Friday, 11-Nov-94 08:49:37 GMT... | Rust | 0 |
#Write a program to count the number of a vowel in a string.
def vowelFunc(str):
c = 0
s="aeiouAEIOU"
v = set(s)
for alpha in str:
if alpha in v:
c = c + 1
print("Count of Vowels = ", c)
str = input("Enter the string = ")
vowelFunc(str)
| Python | 1 |
etailsSettings) -> LuaResult<Self> {
let bufnr = api::create_buf(lua, false, true)?;
Ok(CompletionDetails {
bufnr,
floater: Floater::new(
lua,
bufnr,
&settings.border,
vec![
("FloatBorder", ui::DE... | Rust | 0 |
), None, Some((11, 13))] ),
( r"M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", r"<NAME>", vec![Some((0, 14)), None, Some((9, 11))] ),
( r"M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", r"<NAME>", vec![Some((0, 16)), None, Some((11, 13))] ),
( r"M[ou]'... | Rust | 0 |
"""empty message
Revision ID: 0017_add_failure_types
Revises: 0016_reply_to_email
Create Date: 2016-05-17 11:23:36.881219
"""
# revision identifiers, used by Alembic.
revision = "0017_add_failure_types"
down_revision = "0016_reply_to_email"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects imp... | Python | 1 |
#!/usr/bin/env python3
# Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
... | Python | 1 |
x_cat is not None:
x = torch.cat([x, x_cat], dim=1)
# Process the conditioning embeddings
r_embed = self.gen_r_embedding(r)
if clip is not None:
clip = self.gen_c_embeddings(clip)
# Model Blocks
x_in = x
x = self.embedding(x)
level_output... | Python | 1 |
requests = json.load(f)
for request in requests:
query = request.get("query", "")
if query:
await self.process_query(query)
# Clear the queue
queue_file.unlink()
except Exception as e:
... | Python | 1 |
from typing import Dict, Any, Union
import csle_collector.traffic_manager.traffic_manager_pb2
class TrafficManagerUtil:
"""
Class with utility functions related to the Traffic Manager
"""
@staticmethod
def traffic_dto_to_dict(traffic_dto: csle_collector.traffic_manager.traffic_manager_pb2.Traffic... | Python | 1 |
# author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2022.02.21
# [python - Can not enter course code into timetable, timetable is returning empty - Stack Overflow](https://stackoverflow.com/questions/71205676/can-not-enter-course-code-into-timetable-timetable-is-returning-empty/71206905#71206905)
from s... | Python | 1 |
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `DCOFTRIM`"]
pub enum DCOFTRIMW {
#[doc = "DCO frequency trim: 0"]
DCOFTRIM_0,
#[doc = "DCO frequency trim: 1"]
DCOFTRIM_1,
#[doc = "DCO frequency trim: 2"]
DCOFTRIM_2,
#... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Wed May 17 10:29:26 2023
@author: arianeg
"""
import numpy as np
def BP_avg(window_size, stride, Y_pred, Y_real):
''' Function to apply a moving average to arrays'''
Y1 = np.array([np.nanmean(Y_pred[i:i+window_size]) for i in range(0, len(Y_pred), stride) if i+... | Python | 1 |
from logo import logo
import os
import time
import locale
locale.setlocale(locale.LC_ALL, 'id_ID.UTF-8')
ulang = True
while ulang:
print(logo)
daftar_pelelang = {}
def hitungHasil():
if daftar_pelelang:
pemenang = max(daftar_pelelang, key=daftar_pelelang.get)
harga_terting... | Python | 1 |
};
info!("Finished device init");
Ok(dev)
} else {
error!("Device does not match chip id {}", BME680_CHIP_ID);
Err(Error::DeviceNotFound)
}
}
fn bme680_set_regs(
&mut self,
reg: &[(u8, u8)],
) -> Result<(), <I2C as Read>::Err... | Rust | 0 |
ter = {'modelname':'fastai_schirrmeister', 'modeltype':'fastai_model',
'parameters':dict()}
conf_fastai_sen = {'modelname':'fastai_sen', 'modeltype':'fastai_model',
'parameters':dict()}
conf_fastai_basic1d = {'modelname':'fastai_basic1d', 'modeltype':'fastai_model',
'parameters':dict()}
conf_fa... | Python | 1 |
nalOpe} = 0")
# print("__________________________________________")
listPArtOperation = getListPartOperation(finalOpe)
printReducedForm(listPArtOperation)
equationdegree = 0
for i in range(len(listPArtOperation) - 1, -1, -1):
if listPArtOperation[i] != 0:
... | Python | 1 |
use crate::err::{DirectoryError, ScriptError};
#[test]
fn directory_error_displays_correctly() {
let actual_error_disp = format!("{}", DirectoryError("Test".to_owned()));
let expected_error_disp = format!("Directory error: Test");
assert_eq!(actual_error_disp, expected_error_disp)... | Rust | 0 |
})
.await;
}
}
tracing::trace!(?worker, "received {} new job(s)", total_jobs);
let _ = poll_queue
.send(PollMessage::JobsArrived(total_jobs))
... | Rust | 0 |
t_2.0 > 100 {
trace!("Unknown Behavior, {:?}", point_2);
}
inf!("Point: {:?} == {:?}", point, point_2);
}
use {
anyhow::Result,
crate::{
app::Context,
core::Board,
display::Screen,
pos::ScreenPos,
},
crossterm::{
event::KeyCode,
termin... | Rust | 0 |
u64;
const DEFAULT_EXPIRATION_PERIOD: u64 = 20000u64;
const DEFAULT_PROPOSAL_DEPOSIT: u128 = 10000000000u128;
const DEFAULT_VOTER_WEIGHT: u64 = 50u64;
const DEFAULT_SNAPSHOT_PERIOD: u64 = 100u64;
fn init_msg() -> InitMsg {
InitMsg {
mirror_token: HumanAddr::from(VOTING_TOKEN),
quorum: Decimal::perc... | Rust | 0 |
!= fax_digits[7:]:
return "similar_pattern"
return "different"
def process_organization(self, org_data):
"""개별 기관 연락처 처리 (전화번호 + 팩스번호)"""
name = org_data.get("name", "")
if not name:
self.logger.warning("기관명이 없음")
pri... | Python | 1 |
!(loaded, Some(not_expected));
assert_eq!(loaded, Some(expected));
Ok(())
}
/// Checks the prover registration workflow, including
/// adding a new prover, stopping and resuming it.
#[db_test]
async fn prover_registration(mut storage: StorageProcessor<'_>) -> QueryResult<()> {
// Attempt to load the non-e... | Rust | 0 |
er\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor informat... | Rust | 0 |
import telebot
import datetime
import json
import threading
import time
import pytz
DATA_FILE_NAME = "data/database.json"
today_lessons = dict()
cur_weekday = datetime.datetime.now(pytz.timezone('Europe/Moscow')).weekday()
# initialize bot
token_file = open("data/token.txt", 'r')
token = token_file.read()
token_file... | Python | 1 |
g * len(_gao_shots),
name=name,
)
for name, cfg in _gao_stores.items()
]
]
)
))
_bansal_shots = (4, 8, 16)
registry.register(ChallengeSpec(
id='bansal',
hash='31823db1a92462cd4760526ba23c244789170968',
num_tasks=_flex_episodes_per_... | Python | 1 |
or i in range(3):
plt.subplot(2,3,i+1)
plt.tight_layout()
# x_e = test_x_e2[i+15].view(-1, X_DIM).to(device).float()/255
x_e = test_x_e1[i+10].unsqueeze(0).unsqueeze(0).to(device).float()/255
z, mu, logvar = vae.encode(x_e,1)
z_e = torch.randn(1, 10)
z_e[0,8] = z_e[0,8]+100
z[0,10:20] = ... | Python | 1 |
from mcstatus import JavaServer, BedrockServer
def minecraft_server(domain: str):
if ':' in domain:
host, port_str = domain.split(':')
port = int(port_str)
java_status, = status_java_server(host, port)
bedrock_status = status_bedrock_server(host, port)
else:
host = doma... | Python | 1 |
) }
}
}
impl Default for PostedVAAData {
fn default() -> Self {
PostedVAAData(MessageData::default())
}
}
impl Clone for PostedVAAData {
fn clone(&self) -> Self {
PostedVAAData(self.0.clone())
}
}
#[derive(Default, BorshSerialize, BorshDeserialize, Clone, Serialize, Deserialize)]
... | Rust | 0 |
"""Auto-generated preparation for proteingym-dms/CAPSD_AAV2S_Sinai_2021_designed_indels."""
from pathlib import Path
import pandas as pd
import numpy as np
def prepare(raw: Path, public: Path, private: Path) -> None:
"""
Prepare the proteingym-dms/CAPSD_AAV2S_Sinai_2021_designed_indels dataset from ProteinG... | Python | 1 |
transfer_all(creep: &mut Creep, target_id: &Id, resource: ResourceType) -> Res<()> {
let target = get_structure_from_id(target_id)?;
let target_pos = target.pos();
let target = target
.as_transferable()
.ok_or_else(|| format!("{} is not transferable", target_id))?;
prepend_go_to_if_far... | Rust | 0 |
unsafe { *gpfsel3 };
gpfsel3_val &= !(7 << 15);
gpfsel3_val |= 1 << 15;
unsafe { *gpfsel3 = gpfsel3_val };
let mut gpfsel4_val = unsafe { *gpfsel4 };
gpfsel4_val &= !(7 << 21);
gpfsel4_val |= 1 << 21;
unsafe { *gpfsel4 = gpfsel4_val };
loop {
unsafe { *gpset1 = GPIO47 };
... | Rust | 0 |
tive_function),
self.unweighted_partition.precalc_move(move, self.objective_function) \
+ self.weighted_partition.precalc_move(move, self.objective_function))
class TestNxPartitionGraphBasedCovariatesDirected(TestNxPartitionGraphBasedCovariates):
#... | Python | 1 |
},
},
{
"__dl_type__": "dl_native_type",
"value": {
"explicit_timezone": True,
"lowcardinality": True,
"name": "datetimewithtz",
"native_type_class_name": "clickhouse_datetimewithtz_native_type",
... | Python | 1 |
buf: buf, loc: loc },
}
}
}
impl<'a> SampleResult<'a> {
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
SampleResult {
_tab: table,
}
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
_fbb: &'m... | Rust | 0 |
eaceCandle, PERSIAN_PINK);
blocktype_map.insert(BlockType::WaterDrip, PERSIAN_BLUE);
blocktype_map.insert(BlockType::LavaDrip, SCARLET);
blocktype_map.insert(BlockType::HoneyDrip, CALIFORNIA);
blocktype_map.insert(BlockType::FishingCrate, LEATHER);
blocktype_map.insert(BlockType::SharpeningStation, ... | Rust | 0 |
# 4 - Sequência de Collatz:
# Crie um programa que solicite um número ao usuário e use um
# laço while para gerar e exibir a sequência de Collatz até chegar
# ao número 1.
n = i | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.