text string | label_name string | labels int64 |
|---|---|---|
{
let signals = members
.iter()
.map(|i| app.primary.map.get_traffic_signal(*i).clone())
.collect();
BundleEdits { signals }
}
// If the intersections haven't been edited together before, the number of stages and the
// durations might not match up. Just... | Rust | 0 |
::TilePixels;
use crate::mapcss::color::Color;
use crate::mapcss::styler::{is_non_trivial_cap, LineCap};
pub fn draw_lines(
points: PointPairIter<'_>,
width: f64,
color: &Color,
opacity: f64,
dashes: &Option<Vec<f64>>,
line_cap: &Option<LineCap>,
use_caps_for_dashes: bool,
pixels: &mut ... | Rust | 0 |
peIdentifier::Boolean => format!("{}Bool{}{}{}Filter", nested, nullable, list, aggregates),
TypeIdentifier::DateTime => format!("{}DateTime{}{}{}Filter", nested, nullable, list, aggregates),
TypeIdentifier::Json => format!("{}Json{}{}{}Filter", nested, nullable, list, aggregates),
TypeIdentifier... | Rust | 0 |
calc);
let desc_id = match self.pool.borrow_mut().pop() {
Some(id) => id,
None => return Err(VirtqError::NoDescrAvail),
};
Ok(MemDescr {
ptr: (&slice[0] as *const u8) as *mut u8,
len: slice.len(),
_init_len: slice.len(),
_mem_len: slice.len(),
id: Some(desc_id),
dealloc: Dealloc::Not,
... | Rust | 0 |
Initiator,
dlci: DLCI::try_from(3).unwrap(),
data: FrameData::UnnumberedInfoHeaderCheck(UIHData::User(UserData {
information: vec![
0b00000001, // Data octet #1.
0b00000010, // Data octet #2.
],
})),
... | Rust | 0 |
perdeu, a meta era 10 pontos e voce so conseguiu {} pontos", points);
}
}<reponame>gembin/actix-web-custom-macro-example
use std::{
cell::RefCell,
future::Future,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_web::{
dev::{
Service,
ServiceRequest,
ServiceRes... | Rust | 0 |
{
Ok(Async::Ready(Some(msg))) => {
match msg {
SignalsMessage::Add(sig, signal, handler) =>
self.add_signal_handler(sig, signal, handler),
SignalsMessage::Remove(sig) =>
self.remove_signal_handler(sig),
... | Rust | 0 |
]).is_ok());
assert!(from_utf8(&[0xED, 0x9F, 0xBF]).is_ok());
assert!(from_utf8(&[0xEE, 0x80, 0x80]).is_ok());
assert!(from_utf8(&[0xEF, 0xBF, 0xBF]).is_ok());
assert!(from_utf8(&[0xF0, 0x90, 0x80, 0x80]).is_ok());
assert!(from_utf8(&[0xF4, 0x8F, 0xBF, 0xBF]).is_ok());
}
... | Rust | 0 |
return daemon_set_name
except ApiException as e:
logger.error(f"Failed to create DaemonSet: {e}")
raise HTTPException(
status_code=500, detail=f"Failed to create DaemonSet: {str(e)}"
)
def deploy_daemon_sets(self) -> List[str]:
"""
Depl... | Python | 1 |
7
'# leak_stitch_bilge -> population_quarterdecks_minimums'
dsg2v5rjmpa = dm_u6z1r_uf = kx0xnjja2ae = vwvpbwxphxe = False
del a5pcsyb8ec5
'# leak_stitch_bilge -> population_quarterdecks_minimums'
def gh82vu70o_h(ho0s3p7wrfq: rf_0wg4fr7p):
del ebq804td6p9
'# leak_stitch_bilge -> population_quarte... | Python | 1 |
from enum import Enum
class DeviceType(Enum):
ADMIN = 0
CLIENT = 1 | Python | 1 |
r'C:\Users\86875\Desktop\learning\t-pred\code\model_save\kernelsize18.pth'
# model_tcrep = torch.torch.load(model_path)
# momentum = 0.9
optm_tcrep = Adam(model_tcrep.parameters(), lr_initial)
lr_scheduler = ReduceLROnPlateau(optm_tcrep, mode='min', factor=0.1, patience=args.patience4lr, verbose=True)... | Python | 1 |
dr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
let request = Request {
message: request,
src: socket,
};
let handler_mock = MockDnsResponseHandler::new();
let cache = StreamsCache::with_default_cleanup_duration(
|| Ok(Stream::new(Builder::new... | Rust | 0 |
# https://dmoj.ca/problem/ccc03s3
flooring = int(input())
rows = int(input())
columns = int(input())
floor_plan = []
for _ in range(rows):
floor_plan.append([*input()]) # turn string into list of characters
# "." represents an empty space. Will turn these to "," after processing
def get_neighbors(target):
... | Python | 1 |
: *mut DDVIDEOPORTDATA,
}
impl ::core::marker::Copy for DDGETPOLARITYININFO {}
impl ::core::clone::Clone for DDGETPOLARITYININFO {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub struct DDGETPOLARITYOUTINFO {
pub bPolarity: u32,
}
im... | Rust | 0 |
is_infinite() {
Err(AstroAlgorithmsError::EncounteredInf)
} else {
Ok(DMSAngle {
degrees: degrees,
minutes: minutes,
seconds: seconds,
})
}
}
}
impl HMSAngle {
/// Create a new angle using hours, minutes, second... | Rust | 0 |
tag(tag_list: &Vec<XMLEntry>, name: &str) -> XMLEntry {
let mut entry: XMLEntry = XMLEntry::new();
for tag in tag_list {
if tag.tag == name {
return tag.clone();
} else {
entry = XMLParser::find_tag(&tag.sub_tags, name);
if entry.... | Rust | 0 |
luation
print("evaluating for epoch %d"%current_epoch)
caption_generator.cnn_model=model.cnn
caption_generator.cnn_model.train=False
caption_generator.rnn_model=model.rnn
caption_generator.rnn_model.train=False
for lang,truth in val_datasets.items():
scores=ev... | Python | 1 |
return X86Arg::Reg8(X86Reg::R11),
4 => return X86Arg::Reg8(X86Reg::R12),
_ => return X86Arg::Empty,
};
}
pub fn amd64_op_reg16(pos : i32) -> X86Arg {
match pos {
0 => return X86Arg::Reg16(X86Reg::RBX),
1 => return X86Arg::Reg16(X86Reg::RCX),
2 => return X86Arg::Reg16(X8... | Rust | 0 |
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
lcs = [[0 for i in range(len(text2) + 1)] for j in range(len(text1) + 1)]
for i in reversed(range(len(text1))):
for j in reversed(range(len(text2))):
if text1[i] == text2[j]:
... | Python | 1 |
# Copyright 2016 The TensorFlow Authors. 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 applica... | Python | 1 |
#Tipo de Dados
pessoa = {
'nome': 'Everton Espedito',
'sobrenome': 'Silva Santos',
'idade': 21,
'altura': 1.66,
'peso': 67.0,
'endereços':[
{'rua': 'Rua do Sol',
'bairro': 'Centro',
'cidade':'São Paulo',
'numero':22
},
]
}
# print(pessoa.__len__()) ... | Python | 1 |
ax.text(bar.get_x() + bar.get_width() / 2., bottom[bar_idx] + height / 2.,
f'{height:.0f}%', ha='center', va='center', color='white', fontsize=7, fontweight='bold')
bottom += percentages
ax.set_ylim(0, 100)
ax.set_ylabel("Outcome Percentage", c... | Python | 1 |
0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! The Gamma and derived distributions.
use self::GammaRepr::*;
u... | Rust | 0 |
iter() {
write!(writer, "{}", tree).unwrap();
}
writeln!(writer).unwrap();
}
}
fn clear_screen(writer: &mut BufWriter<StdoutLock>) {
let output = Command::new("clear").output().unwrap();
write!(writer, "{}", String::from_utf8_lossy(&output.stdout)).unwrap();
}
use parser::Identi... | Rust | 0 |
: 0.0, Add
pub f_confused: f32,
/// Cur: Wants to run away. Boolean.
/// ModBase: 0.0, Add
pub f_afraid: f32,
/// Cur: Cowers. Boolean.
/// ModBase: 0.0, Add
pub f_terrorized: f32,
/// Cur: Cannot move or execute powers. Boolean.
/// ModBase: 0.0, Add
pub f_held: f32,
/// Cur: Cannot move. Boolean.
/// ModB... | Rust | 0 |
# ------------------------------------------------------------
# Copyright (c) VCU, Nanjing University.
# Licensed under the Apache License 2.0 [see LICENSE for details]
# Written by Qing-Long Zhang
# ------------------------------------------------------------
_base_ = [
'../_base_/models/upernet_restv2.py', '..... | Python | 1 |
# https://leetcode.com/problems/generate-parentheses/
class Solution:
def generateParenthesis(self, n):
res = []
def dfs(openP, closeP, path):
if openP == closeP == n:
res.append(path)
if openP < n:
dfs(openP+1, close... | Python | 1 |
tch_len = |max_capacity, len, name| {
let cache = BaseCache::<u8, u8>::new(
max_capacity,
None,
RandomState::default(),
None,
None,
false,
);
assert_eq!(
cache.inner.freque... | Rust | 0 |
# 2025 Jan Provaznik (provaznik@optics.upol.cz)
# 2025 Simon Brauer (brauer@optics.upol.cz)
import numpy as np
import numba as na
# Operator (2) in Fock representation
#
@na.njit(cache = True)
def catable_operator (dim, parity, alpha, gamma):
'''
Computes the operator (2) in Fock basis.
Parameters
... | Python | 1 |
eProperties::RHS.default_value()),
|old_state, (o, value)| match *o {
OperatorPosition::LHS => old_state.lhs(*value),
OperatorPosition::RHS => old_state.rhs(*value),
},
);
// The internal result
let internal_result = expression.map(move |e... | Rust | 0 |
split_at(16);
x2::new([W::unsafe_read_le(input.0), W::unsafe_read_le(input.1)])
}
#[inline(always)]
unsafe fn unsafe_read_be(input: &[u8]) -> Self {
x2::unsafe_read_le(input).bswap()
}
#[inline(always)]
fn write_le(self, out: &mut [u8]) {
let out = out.split_at_mut(16);
... | Rust | 0 |
that we're about to reset the object to its default state, and then reset state
if not short_exec:
input("\nObject will be reset to default state. Press ENTER to continue.")
obj.states[object_states.Temperature].set_value(macros.object_states.temperature.DEFAULT_TEMPERATURE)
obj.states[object_states... | Python | 1 |
for ModulePrefix<T> {
fn parse<U: TokenRead>(parser: &mut Parser<U>) -> Result<Self> {
Ok(ModulePrefix {
name: track!(T::parse_non_left_recor(parser))?,
_colon: track!(parser.expect(&Symbol::Colon))?,
})
}
}
impl<T: PositionRange> PositionRange for ModulePrefix<T> {
... | Rust | 0 |
import heapq
def initialize():
coins = [27, 23, 11, 23, 6, 197, 7, 21, 2, 22, 12, 38, 15, 32, 5, 19, 6, 28, 31, 31, 10, 10, 28, 24, 41, 6, 39, 16, 11, 37, 23, 7, 2]
tax_values = {41: 14, 23: 15, 31: 19, 21: 18, 22: 2, 6: 3, 11: 5, 12: 11, 37: 10, 7: 2, 32: 19, 28: 10, 16: 12, 2: 2, 197: 7, 39: 18, 19: 18, 15:... | Python | 1 |
, accept additional env var
pub fn manager(
interface_command: &str,
namespace: &str,
helm_chart: &str,
release_name: &str,
config: Config<'_>,
custom_env: Option<Vec<(String, String)>>,
) -> Result<up_down::Manager<CommandBuilder>> {
let Config {
custom_helm_values,
custom_r... | Rust | 0 |
def process_frame(self, frame):
"""
Procesa un frame: preprocesamiento, detección de intersección y control.
"""
# 1. Preprocesamiento de la imagen (convierte, recorta, desenfoque)
hsv, vis, shape = self._preprocess_image(frame)
# 2. Detección de intersección (líneas... | Python | 1 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from .._models import BaseModel
__all__ = ["KYBBusinessEntity", "Address"]
class Address(BaseModel):
address1: str
"""Valid deliverable address (no PO boxes)."""
city: str
"""Nam... | Python | 1 |
UInt<
UInt<
UInt<
UInt<
UInt<U0, Bn<{ I & 32768 }>>,
... | Rust | 0 |
INFINITY);
assert_eq!(s.pop::<f32>(), -1.0);
assert_eq!(s.pop::<f32>(), 3.14);
assert_eq!(s.pop::<f32>(), 0.0);
}
#[test]
fn f64_value() {
let mut s = Stack::default();
s.push(0.0f64);
assert_eq!(s.top::<f64>(), 0.0f64);
s.push(3.14f64);
... | Rust | 0 |
sub_system_capability = sub_system_capability.parent if sub_system_capability.find_parent() else sub_system_capability
if sub_system_capability:
sub_system_capability_text = sub_system_capability.text
sub_params = next_div.find('div', {'class': '\\"tablenoborder\\"'})... | Python | 1 |
= 0;
SigVerifyStage::discard_excess_packets(&mut batches, max, |packet| {
if packet.meta.is_tracer_packet() {
total_tracer_packets_discarded += 1;
}
});
let total_non_discard = count_non_discard(&batches);
let total_discarded = total_num_packets -... | Rust | 0 |
X
morse!(- . - -), // Y
morse!(- - . .), // Z
];
const DIGITS: [&'static [Signal]; 10] = [
morse!(- - - - -), // 0
morse!(. - - - -), // 1
morse!(. . - - -), // 2
morse!(. . . - -), // 3
morse!(. . . . -), // 4
morse!(. . . . .), // 5
morse!(- . . . .), // 6
morse!(- - . . .), ... | Rust | 0 |
[:, kk:kk + 1]
X_k = construct_X_multi(z_k, v_k_1, n_channels=1)[0, 0]
# compute the 'envelope' of the reconstructed signal X_k
correlation = np.abs(fast_hilbert(X_k))
# loop over all events IDs
for this_event_id in event_id:
this_events = events[events[:, 2] == this_event_id]
# pl... | Python | 1 |
import heapq
def restricted_sorting(stacks):
colors = {'Green': 0, 'Yellow': 1, 'Red': 2, 'Blue': 3, 'Black': 4}
costs = [4, 8, 9, 9, 5, 7, 9, 6]
block_counts = {color: 0 for color in colors}
color_stacks = {color: [] for color in colors}
pq = []
for i, blocks in enumerate(stacks):
if... | Python | 1 |
"""Utilities for constructing and fitting coil curves.
This module wraps common functions from the `essos.coils` namespace and
adds a few convenience helpers for packing arrays into the `gamma`
format and creating simple initial guesses. The functions defined
here are used by both the Boozer and near–axis examples.
"... | Python | 1 |
ArrowExpr,
AssignExpr,
AssignPat,
AssignPatProp,
AssignProp,
AwaitExpr,
BigInt,
BinExpr,
BindingIdent,
BlockStmt,
Bool,
BreakStmt,
CallExpr,
CatchClause,
Class,
ClassDecl,
ClassExpr,
ClassMethod,
ClassProp,
ComputedPropName,
CondExpr,
Constructor,
ContinueStmt,
DebuggerStmt... | Rust | 0 |
_dst);
inst.emit(sink, info, state);
let inst = Inst::jmp_known(done);
inst.emit(sink, info, state);
// x86's min/max are not symmetric; if either operand is a NaN, they return the
// read-only operand: perform an addition between the two operands, which has... | Rust | 0 |
#!/usr/bin/env python
from Crypto.Util.number import *
from gmpy import *
from random import *
import sys,os
sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0)
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
rnd = SystemRandom()
def calcA(g,n,data):
num = bytes_to_long(data)
res = pow(g,num,n*n)
r = rnd.ra... | Python | 1 |
his.
"""
model = self._dequantize(model)
# Delete quantizer and quantization config
del model.hf_quantizer
return model
def _dequantize(self, model):
raise NotImplementedError(
f"{self.quantization_config.quant_method} has no implementation of `dequanti... | Python | 1 |
import numpy as np
from numpy._typing import NDArray
def difference_function(audio_chunk, lag):
if lag == 0:
return 0.0
diff = audio_chunk[:-lag] - audio_chunk[lag:]
return np.sum(diff[:len(audio_chunk) // 2 - lag] ** 2)
def get_running_average(diff, window_size):
indices = np.arange(1, wind... | Python | 1 |
# Copyright (c) DP Technology.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function
import yaml
import os
from addict import Dict
import logging
from .base_logger import logger
cl... | Python | 1 |
import torch
import logging
import argparse
from pathlib import Path
from s3prl import hub
from s3prl.util.pseudo_data import get_pseudo_wavs
SAMPLE_RATE = 16000
logger = logging.getLogger(__name__)
def extract_single_name(
name: str,
ckpt: str,
legacy: bool,
output_dir: str,
device: str,
re... | Python | 1 |
nglethread: true,
max_atomic_width: Some(64),
abi_blacklist: abi_blacklist(),
.. Default::default()
},
})
}
<gh_stars>10-100
//
// ________.__ __ .__ __
// / _____/|__| _______/ |_|__|/ |_
// / \ ___| |/ ___/\ __\ \ __\
// \ \_\ \ |\___ \ ... | Rust | 0 |
rompt', '### Response'),
messages=(),
offset=0,
sep_style=SeparatorStyle.ADD_COLON_SINGLE,
sep='\n',
stop_str='###',
))
# manticore default template
register_conv_template(
Conversation(
name='manticore',
system='',
roles=('USER', 'ASSISTANT'),
... | Python | 1 |
"]
impl crate::Writable for FCCLKSELX6 {}
#[doc = "Peripheral reset control register"]
pub mod fcclkselx6;
#[doc = "Flexcomm Interface 7 clock source select for Fractional Rate Divider\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::wri... | Rust | 0 |
rets["mle_loss"]
state = rets["final_state"]
iters += num_steps
ppl = np.exp(loss / iters)
if verbose and step % (epoch_size // 10) == 10:
print("%.3f perplexity: %.3f speed: %.0f wps" %
(step * 1.0 / epoch_size, ppl,
... | Python | 1 |
eive TCP Error Frame Counter Interrupt Mask"]
#[inline(always)]
pub fn rxtcperfim(&self) -> RXTCPERFIM_R {
RXTCPERFIM_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 12 - MMC Receive ICMP Good Frame Counter Interrupt Mask"]
#[inline(always)]
pub fn rxicmpgfim(&self) -> RXICMPGFIM_... | Rust | 0 |
tada)
if cv2.waitKey(1) == 27:
break
cv2.destroyAllWindows()
cap.release()
# import cv2
# import numpy as np
# from time import sleep
# largura_min = 80 # Largura minima do retangulo
# altura_min = 80 # Altura minima do retangulo
# offset = 6 # Erro permitido entre pixel
# pos_linha = 550 # Po... | Python | 1 |
PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
if not hass.data[DOMAI... | Python | 1 |
2020, 3, 1)).await
}
#[command]
#[description = "Post the current date.\n\n(https://en.wikipedia.org/wiki/Eternal_September)"]
#[num_args(0)]
async fn september(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
eternal(ctx, msg, NaiveDate::from_ymd(1993, 9, 1)).await
}
#[command]
#[description = "Post... | Rust | 0 |
import pandas as pd
from scrapegraphai.graphs import SmartScraperGraph
# Step 1: Define the configuration for SmartScraperGraph
graph_config = {
"llm": {
"model": "ollama/llama2",
"temperature": 0,
"format": "json",
"base_url": "http://localhost:11434",
},
"embeddings": {
... | Python | 1 |
teTime> = None;
let stdin = std::io::stdin();
let lines = stdin.lock().lines().filter_map(|x| x.ok());
for line in lines {
let maybe_msg = logcat::parse::threadtime(&line);
if let Err(e) = maybe_msg {
println!("error: {}: {}", e, line);
continue;
}
l... | Rust | 0 |
"Id = {}
Outgoing publishes : Received = {:<7} Throughput = {} messages/s
Incoming publishes : Received = {:<7} Throughput = {} messages/s
Reconnects : {}",
self.link.id,
acks_count,
outgoing_throughput,
incoming_count,
... | Rust | 0 |
for i in range(0,10):
print('*' *i)
| Python | 1 |
fn visit_variable(&mut self, loc: Location, var: Var, ty: TypeId) -> Self::Output;
fn visit_literal(&mut self, loc: Location, literal: &Literal) -> Self::Output;
fn visit_scope(&mut self, loc: Location, body: &Block<&'ctx Stmt<'ctx>>) -> Self::Output;
fn visit_func_call(&mut self, loc: Location, call: ... | Rust | 0 |
e_with_and_without_dropout() {
let vocab: Vocab = [
("u".into(), 0),
("n".into(), 1),
("r".into(), 2),
("e".into(), 3),
("l".into(), 4),
("a".into(), 5),
("t".into(), 6),
("d".into(), 7),
("re".into(), 8)... | Rust | 0 |
storage/types/double_map.rs
// This file is part of Substrate.
// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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... | Rust | 0 |
ng the final exponentation following
// https://eprint.iacr.org/2016/130.pdf.
// We don't use their "faster" formula because it is difficult to make
// it work for curves with odd `P::X`.
// Hence we implement the slower algorithm from Table 1 below.
let f1 = f.frobenius_map(cs.... | Rust | 0 |
vd2rust/#read--modify--write-api).\n\nFor information about available fields see [p5sel](index.html) module"]
pub struct P5SEL_SPEC;
impl crate::RegisterSpec for P5SEL_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [p5sel::R](R) reader structure"]
impl crate::Readable for P5SEL_SPEC {
type Reader = R;
... | Rust | 0 |
_store : bool;
match instr.instr_type {
LtacType::Str | LtacType::StrQ => {
line = create_arm64_instr(Arm64Type::Str);
is_store = true;
},
LtacType::Ld => {
line = create_arm64_instr(Arm64Type::Ldr);
is_store = false;
},
... | Rust | 0 |
ri3;
use crate::shapes::{GeoKind, Scratchpad};
use crate::StrError;
use russell_chk::assert_approx_eq;
#[test]
fn new_works() -> Result<(), StrError> {
// Tri3 # 1 from Figure 1.18, page 29 of [@bhatti]
//
// [@bhatti] <NAME>. (2005) Fundamental Finite Element Analysis
... | Rust | 0 |
"""ioHub Common Eye Tracker Interface"""
# Part of the psychopy.iohub library.
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).
| Python | 1 |
imilation_update(
self,
model: AbstractLinearGaussianModel,
state_mean: ArrayLike,
state_covar: ArrayLike,
observation: ArrayLike,
time_index: int,
) -> Tuple[ArrayLike, ArrayLike]:
observation_mean = model.observation_mean(state_mean, time_index)
obse... | Python | 1 |
self.canvas.clear();
// CPU registers
let surface = font
.render(&format!("Register contents: \
v0: {:#06x} v1: {:#06x} \
v2: {:#06x} v3: {:#06x} \
v4: {:#06x} v5: {... | Rust | 0 |
from django.shortcuts import render
# Create your views here.
| Python | 1 |
doc = "Read Wait\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum READ_WAIT_A {
#[doc = "0: Clear SDIO read wait"]
CLEAR = 0,
#[doc = "1: Assert SDIO read wait"]
ASSERT = 1,
}
impl From<READ_WAIT_A> for bool {
#[inline(always)]
fn from(variant: READ_WAIT_A) -> Self {
... | Rust | 0 |
# -*- coding: UTF-8 -*-
import typing
class LibRouterosError(Exception):
"""Base exception for all other."""
# TODO append with Error
class ConnectionClosed(LibRouterosError): # noqa N818
"""Raised when connection have been closed."""
class ProtocolError(LibRouterosError):
"""Raised when e.g. encodin... | Python | 1 |
from __future__ import division, print_function
import unittest.mock as mock
import unittest
from smqtk.representation import DataSet
class DummyDataSet (DataSet):
@classmethod
def is_usable(cls):
return True
def __init__(self):
super(DummyDataSet, self).__init__()
def __iter__(sel... | Python | 1 |
_fragment() {
assert_eq!(
Body::from(indoc!(
"
Example 1
Example 2"
)),
Body::from("Example 1").append(&Body::from("Example 2"))
);
}
#[test]
fn it_can_tell_me_if_it_is_empty() {
assert!(Body::from("").is_empty());
}
#[test]
fn it_can_tell_me_if_... | Rust | 0 |
ame__ == "__main__":
print("🎯 Manual Device Change Detection Test")
print("=" * 50)
# Wait for API to be ready
print("⏳ Waiting for PyWemo API to be ready...")
api_ready = False
max_wait = 180 # 3 minutes max wait
wait_time = 0
while not api_ready and wait_time < max_wait:
... | Python | 1 |
TABLE_NAME, SFA_POWER_SUPPLY_TABLE_NAME, SFA_STORAGE_SYSTEM_TABLE_NAME,
},
snapshot::{
SnapshotInterval, SnapshotRecord, SnapshotRetention, SNAPSHOT_INTERVAL_TABLE_NAME,
SNAPSHOT_RETENTION_TABLE_NAME, SNAPSHOT_TABLE_NAME,
},
};
use serde::de::Error;
use std::convert::TryFrom;
/// Records fr... | Rust | 0 |
) => Some(_inner),
GetQualificationScoreErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetQualificationType` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetQualificationTypeError {
/// Kind of error that occurred.
pub kind: Ge... | Rust | 0 |
with open(outfile+".tmp") as tmp_seq:
seqout = ""
# This is where the transposing happens
for line in tmp_seq:
seqout += line[s]
# Write FASTA line
if args.fasta:
ou... | Python | 1 |
g_assert!(!u.is_zero() && bits <= 8 && big_digit::BITS % bits == 0);
let last_i = u.data.len() - 1;
let mask: BigDigit = (1 << bits) - 1;
let digits_per_big_digit = big_digit::BITS / bits;
let digits = u
.bits()
.div_ceil(&u64::from(bits))
.to_usize()
.unwrap_or(core::us... | Rust | 0 |
ne, 0), val(line, ith)))
}
fn in_time_range(l: &str, start: f32, end: f32) -> bool {
let time = val(l, 0);
start <= time && time <= end
}
fn tranlate_time_expr(time: &str, lines: &[&str]) -> Result<f32, Box<dyn std::error::Error>> {
time.parse::<f32>().or_else(|_| {
lines
.iter()
... | Rust | 0 |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class RegionalAuthority(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Identifies a regiona... | Python | 1 |
from TV import *
kus_vas=faili_laadimine('06 - Töö failidega/kusimused_vastused.txt')
vastuvoetud=[]
eisobi=[]
while len(vastuvoetud)<5:
nimi=input("Sisestage nimi: ")
points=intervue(nimi,kus_vas)
if points>=3:
vastuvoetud.append((nimi,points))
vastuvoetud.sort(key=lambda x: x[1], reverse... | Python | 1 |
plt.rcParams['font.family'] = "Hiragino Sans"
fig, ax = plt.subplots(layout='constrained')
bar_container = ax.barh(party_list[::-1], party_counts[::-1])
ax.set(xlabel='得票数', title=f'{year}-{month}')
ax.bar_label(bar_container)
def setPLT_transition(from_month, to_month):
votes_counts = {
"自民": ... | Python | 1 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents Large Object
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | Python | 1 |
.allowlist_function("cef_do_message_loop_work")
.allowlist_function("cef_enable_highdpi_support")
.allowlist_function("cef_initialize")
.allowlist_function("cef_browser_view_create")
.allowlist_function("cef_execute_process")
... | Rust | 0 |
, None, None, None);
let job_request = JobRequest::new("dummy_id_1", "dummy", "/tmp/somewhere", vec![]);
let outcome = failed_job_request(tx, persistence, job_request);
let output = rx.recv_timeout(Duration::from_millis(1000)).unwrap();
assert_eq!(Dispatch::ProcessRequest, output);
assert_eq!("FAI... | Rust | 0 |
a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits... | Rust | 0 |
):
context = in_memory_runtime_context
datasource = context.data_sources.add_pandas(name="my_pandas_ds")
asset = datasource.add_csv_asset(name="my_csv_asset", filepath_or_buffer="data.csv")
batch_definition = asset.add_batch_definition(name="my_batch_def")
asset.delete_batch_definition("my_batch_de... | Python | 1 |
b"remark");
new_test_ext_initialized(src_id, r_id, b"System.remark".to_vec()).execute_with(|| {
let prop_id = 1;
let proposal = make_proposal(vec![10]);
// Create proposal (& vote)
assert_ok!(BridgeCommon::acknowledge_proposal(
Origin::signed(RELAYER_A),
prop_id,... | Rust | 0 |
"""Nepal specific form helpers."""
from django.forms.fields import RegexField, Select
from django.utils.translation import gettext_lazy as _
from .np_districts import DISTRICTS
from .np_provinces import PROVINCES
from .np_zones import ZONES
class NPPostalCodeFormField(RegexField):
"""
A form field that ... | Python | 1 |
);
let root = SVGBackend::new(&output, (1920, 1080)).into_drawing_area();
root.fill(&WHITE)?;
let mut chart = ChartBuilder::on(&root)
.set_label_area_size(LabelAreaPosition::Left, (8).percent())
.set_label_area_size(LabelAreaPosition::Bottom, (4).percent())
.caption("I/O", ("sans-s... | Rust | 0 |
from dotenv import load_dotenv
from app.api.routes import router
from fastapi import FastAPI
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
load_dotenv()
app = FastAPI(title="Financial Insight Engine")
app.include_router(router)
| Python | 1 |
s_ptr(),
tmp_coeffs.as_mut_ptr(),
k,
)
})
}
pub fn pb_eq(&self, other: &[&Bool<'ctx>], coeffs: Vec<i32>, k: i32) -> Bool<'ctx> {
Bool::new(self.ctx, unsafe {
let guard = Z3_MUTEX.lock().unwrap();
let mut tmp = vec![self.z3_ast];... | Rust | 0 |
"""phantom_2 blobs tracking and plots display"""
import os
import sys
print(sys.executable)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from phantom_2 import Dataset # , tracking
from get_valid_intervals import get_valid_intervals
def main():
ds_read = Dataset("dataset_ph... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.