text string | label_name string | labels int64 |
|---|---|---|
e of N values, including 0 and 5 (greater than default)
m = powers.shape[1]
for n in range(6):
v = vander(c, N=n)
assert_array_equal(v, powers[:, m-n:m])
def test_dtypes(self):
c = array([11, -12, 13], dtype=np.int8)
v = vander(c)
expected = np.array(... | Python | 1 |
ntrol_panel.entity_armed_vacation", STATE_ALARM_ARMED_NIGHT),
State("alarm_control_panel.entity_disarmed", STATE_ALARM_ARMED_VACATION),
State("alarm_control_panel.entity_triggered", STATE_ALARM_DISARMED),
# Should not raise
State("alarm_control_panel.non_existing", "on"),... | Python | 1 |
_verify_one_file! {
#[test] test_refinements2 code! {
struct P<A> {
a: A,
}
#[spec]
#[verifier(opaque)]
fn id<A>(a: A) -> A {
a
}
fn fp(p: P<u64>) {
assert(p.a >= 0);
let p2: P<u8> = P { a: 2 };
ass... | Rust | 0 |
pub VpException: WHV_VP_EXCEPTION_CONTEXT,
pub InterruptWindow: WHV_X64_INTERRUPTION_DELIVERABLE_CONTEXT,
pub UnsupportedFeature: WHV_X64_UNSUPPORTED_FEATURE_CONTEXT,
pub CancelReason: WHV_RUN_VP_CANCELED_CONTEXT,
pub ApicEoi: WHV_X64_APIC_EOI_CONTEXT,
pub ReadTsc: WHV_X64_RDTSC_CONTEXT,
pub... | Rust | 0 |
nfig: &ProducerConfig) -> KafkaProducer;
fn send_data(&mut self, edge_bits: u32, share: Share) -> Result<()>;
}
impl GrinProducer for KafkaProducer {
fn from_config(cfg: &ProducerConfig) -> KafkaProducer {
let mut client = KafkaClient::new(cfg.brokers.clone());
client.set_client_id("kafka-grin... | Rust | 0 |
, _)) in kvs.iter().enumerate() {
let random_version = rng.gen_range(i..i + num_versions);
let (value, proof) = tree
.get_with_proof(*k, random_version as Version)
.await
.unwrap();
assert_eq!(value.unwrap(), *v);
assert!(proof.verify(roots[random_vers... | Rust | 0 |
ns = utils.volatile_variable(tokens)
avg_probs = None
avg_attn = None
for model, encoder_out in zip(self.models, encoder_outs):
with utils.maybe_no_grad():
decoder_out, attn = model.decoder(tokens, encoder_out, incremental_states[model])
probs = model.get... | Python | 1 |
Ok((binary_term, after_data_bytes))
} else {
Err(badarg!().into())
}
}
#[macro_use]
extern crate log;
use anyhow::Context;
use futures::StreamExt;
use k8s_openapi::{api::core::v1::ConfigMap, apimachinery::pkg::apis::meta::v1::ObjectMeta};
use kube::{
api::{ListParams, Patch, PatchParams},
... | Rust | 0 |
extrinsics = np.copy(camera_pose)
scale = np.float32(1.0)
# store all informations
views.append(dict(
img=rgb_image,
depthmap=depthmap.astype(np.float32),
camera_pose=camera_pose.a... | Python | 1 |
}
fn main() {
// setup clap argument parser
let matches = App::new("rusty-transparent")
.version("0.0.1")
.author("edelsonc")
.about("Simple Image Background Transparency App")
.args( &[
Arg::from_usage("<INPUT... | Rust | 0 |
R::new(((self.bits >> 9) & 0x03) as u8)
}
#[doc = "Bit 8 - GPIO26 input enable."]
#[inline(always)]
pub fn gpio26incfg(&self) -> GPIO26INCFG_R {
GPIO26INCFG_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 7 - GPIO25 interrupt direction."]
#[inline(always)]
pub fn gpio25intd... | Rust | 0 |
r`
Examples
--------
>>> from xyzservices.lib import TileProvider
>>> provider = TileProvider.from_qms("OpenTopoMap")
"""
qms_api_url = "https://qms.nextgis.com/api/v1/geoservices"
services = json.load(
urllib.request.urlopen(f"{qms_api_url}/?search=... | Python | 1 |
from rich.prompt import Confirm, Prompt
from src.ui.theme import UIColors, UITheme
class UIActions:
@classmethod
def print(cls, content, **xtra_styles):
cls.console.print(f"{content}", style=UIColors.TRANSLAPY)
@classmethod
def print_bold(cls, content, **xtra_styles):
cls.console.pri... | Python | 1 |
structure"]
impl crate::Writable for IOMODE {}
#[doc = "Input Output Mode Controls pull-up pull-down and output mode for the IO pins assigned to AUX"]
pub mod iomode;
#[doc = "General Purpose Input Output Data In\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--mod... | Rust | 0 |
]
pub fn variant(&self) -> crate::Variant<u8, RX_IF_RESAMPLE_PH_IF_A> {
use crate::Variant::*;
match self.bits {
0 => Val(RX_IF_RESAMPLE_PH_IF_A::RX_IF_RESAMPLE_PH_IF_DEFAULT),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `RX_IF_RESAMPLE_PH_IF... | Rust | 0 |
ver_client::ReceiverClient;
use std::str::FromStr;
use std::sync::Arc;
use tokio::net::TcpStream;
use tokio::sync::mpsc::{channel, Sender};
use tokio_stream::StreamExt;
use tokio_util::codec::{FramedRead, FramedWrite};
use tonic::transport::Channel;
use uuid::Uuid;
/// 连接管理器
#[derive(Clone)]
pub struct ConnectionManag... | Rust | 0 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | Python | 1 |
angle]
pub extern fn hl_crypto_bls_sign_key_new(seed: *const u8,
seed_len: usize,
sign_key_p: *mut *const c_void) -> ErrorCode {
trace!("hl_crypto_bls_sign_key_new: >>> seed: {:?}, seed_len: {:?}, sign_key_p: {:?}", seed, seed_len... | Rust | 0 |
self.assertEqual(operation.query, self.query)
query = dict(name=self.faker.unique.name())
operation.query = query
self.assertEqual(operation.query, query)
async def run_mixin_test_execute_list(self, **kwargs):
operation = self.build_operation(action=OperationType.LIST, **kwargs)
... | Python | 1 |
')
fname = options.get('data')
push = options.get('push')
listing = options.get('list')
token = options.get('token')
# List objects
if listing:
print(list_ids(url=url, token=token))
return
if push and not fname:
logger.error("... | Python | 1 |
688797766666667e-05 13
16 5.806737777777779e-05 9
17 0.00011154542933333333 22
18 6.4092288e-05 12
19 0.00013667977600000003 23
20 3.5484373611111105e-05 2
21 9.293575555555556e-05 16
22 6.877619200000001e-05 11
23 3.542471233333334e-05 6
24 2.5303048027777777e-05 1
25 0.0001755806888888889 32
26 0.00048203428977777773... | Rust | 0 |
: &Module, options: &BuildOptions) -> Vec<McFunction> {
// Steps in compiling a module:
// 1. Lay out global variables
// 2. Convert LLVM functions to abstract blocks
// 3. Extend abstract blocks with "chains"
// 4. Reify call graph to MC functions
// 5. Do relocations
// 6. Add global varia... | Rust | 0 |
from datetime import datetime, timedelta
import pandas as pd
from lumibot.data_sources import PandasData
from lumibot.entities import Asset
from lumibot.entities.data import Data
from tests.fixtures import pandas_data_fixture
class TestPandasData:
def test_pandas_data_fixture(self, pandas_data_fixture):
... | Python | 1 |
ch when Enabled
self.data.write(0b00000011);
// > MSB of Divisor Latch when Enabled
self.int_en.write(0b00000000);
// Disable DLAB and set data word length to 8 bits
self.line_ctrl.write(0b00000011);
// Enable FIFO, clear TX/RX queues and
... | Rust | 0 |
1")
net = lrelu(net)
net = conv2d(net, df_dim * 4, 5, 5, 2, 2, name="d_conv3",
use_sn=self._spectral_norm)
net = self.batch_norm(net, y=y, is_training=is_training, name="d_bn2")
net = lrelu(net)
net = conv2d(net, df_dim * 8, 5, 5, 2, 2, name="d_conv4",
use_sn=self.... | Python | 1 |
# Atividade 08:
# Média de Notas:
# Desenvolva um programa que solicite as notas dos alunos até
# que o usuário digite -1. Calcule e exiba a média das notas
# inseridas.
c = 0
n = 0
m = 0
s = 0
while n >= 0:
n = float(input('Insira a nota: '))
c += 1
if n >= 0:
n += n
m = s / c
print(f'A média das notas ... | Python | 1 |
ield_nl",
"body_streamfield_ky",
"body_streamfield_ru",
)
en_content_panels = [FieldPanel("body_streamfield_en")]
de_content_panels = [FieldPanel("body_streamfield_de")]
nl_content_panels = [FieldPanel("body_streamfield_nl")]
ky_content_panels = [FieldPanel("body_streamfield_ky")... | Python | 1 |
_valid.map_or_else(|| self.inner.valid(), Ok)
}
fn validate_key(&self, key: &Key) -> Result<()> {
self.inner.validate_key(key)
}
fn key(&self) -> &[u8] {
// need map_or_else to lazy evaluate the default func, as it will abort when invalid.
self.cur_key.as_deref().unwrap_or_else... | Rust | 0 |
let mantissa;
let exp;
if shift <= 18 {
// Fit everything in the mantissa because we can.
mantissa = self.bitrate;
exp = 0;
} else {
// We can only use 18 bits of precision, so truncate.
mantissa = self.bitrate >> (shift - 18)... | Rust | 0 |
LowShelf(_,_) => self.H0*(x+y1)/2.0 + x,
HighShelf(_,_) => self.H0*(x-y1)/2.0 + x
};
// Store our results
self.x_last[i] = *x;
self.y1_last[i] = y1;
outputs[i] = y;
}
}
}
pub mod parser;
use crate::ir::module::name::Name;
use id_a... | Rust | 0 |
= YamlEmitter::new(&mut header_str);
emitter.dump(&header_node).unwrap();
}
{
let mut emitter = YamlEmitter::new(&mut resources_str);
emitter.dump(&resources_node).unwrap();
}
//println!("header: {}", header_str);
println!("resources: {}", resources_str);
let mut tera =... | Rust | 0 |
h().await?;
client.next_auth_step(AuthStepResponse::Initial).await?;
client
.next_auth_step(AuthStepResponse::choice("login"))
.await?;
let login_result = client
.next_auth_step(AuthStepResponse::form(vec![
Field::String(EMAIL.to_string()),
Field::Bytes(PASSWO... | Rust | 0 |
"Avg.AcceptanceTime": np.mean(acceptance_times),
"Std.AcceptanceTime": np.std(acceptance_times),
"Avg.Round": np.mean(rounds),
"Std.Round": np.std(rounds),
"Avg.ProductScore": np.mean(product_score),
"Std.ProductScore": np.std(product_score),
... | Python | 1 |
# License: BSD 3 clause
import unittest
import numpy as np
from tick.base import TimeFunction
from tick.hawkes import HawkesKernelTimeFunc
class Test(unittest.TestCase):
def setUp(self):
size = 10
self.y_values = np.random.rand(size)
self.t_values = np.arange(size, dtype=float)
... | Python | 1 |
(AbstractModel):
"""智能精彩片段任务输入类型
"""
def __init__(self):
r"""
:param _Definition: 视频智能精彩片段模板 ID。
:type Definition: int
"""
self._Definition = None
@property
def Definition(self):
"""视频智能精彩片段模板 ID。
:rtype: int
"""
return self.... | Python | 1 |
u know is a function to something else. In that
// case handle.apply(f: &Val, x: Val) is the way to go. `handle` mainly exists to allow for this, as well
// as to access handle.data (generic global data) which may be needed for implementation details of certain very complex domains
// but should... | Rust | 0 |
mbed = voxel_embed.view(bev_z, bev_h, bev_w, bs, self.embed_dims)
bev_embed = bev_embed.permute(1, 2, 3, 0, 4)
bev_embed = bev_embed.flatten(3)
bev_embed = self.voxel2bev(bev_embed)
elif self.voxel_2_bev_type == 'pool':
bev_embed = voxel_embed.... | Python | 1 |
"""
數據處理組件 (重構版)
此模組提供數據處理的統一入口點,直接調用重構後的數據處理頁面。
重構後的頁面提供兩個核心功能:
1. 資料更新 - 手動更新和批量更新功能
2. 資料檢視 - 股票搜尋和圖表顯示功能
主要特點:
- 簡化的介面設計
- 專注於核心功能
- 完整的錯誤處理
- 直接調用重構後的頁面
Example:
使用方式:
```python
from src.ui.components.data_management import show
show() # 顯示重構後的數據處理介面
```
Note:
此組件直接調用 src.ui.pages.data... | Python | 1 |
))
.map(|t| self.process_term(t))??;
pairs.try_fold(t1, |app, t| {
let term = self.process_term(t)?;
Ok(Term::Application(box app, box term))
})
},
rule => unreachable!("{:?}", rule),
}
... | Rust | 0 |
me>src/layer3/ipv6.rs<gh_stars>1-10
use arrayref::array_ref;
use crate::Error;
use crate::layer3::InternetProtocolId;
use log::*;
use nom::*;
use std;
const ADDRESS_LENGTH: usize = 16;
#[derive(Clone, Copy, Debug)]
pub struct IPv6<'a> {
pub dst_ip: std::net::IpAddr,
pub src_ip: std::net::IpAddr,
pub proto... | Rust | 0 |
(alts % 7) < 0 {
true => FLAT_ORDER.to_vec(),
false => SHARP_ORDER.to_vec(),
};
altered.truncate(alts.abs() as usize);
let mut res: Vec<Note> = Vec::with_capacity(7);
for base in SCALE_ORDER.iter().cycle() {
if *base == tonic_base {
re... | Rust | 0 |
t ranks
dist.init_process_group(backend=args.dist_backend,world_size=args.world_size, rank=args.rank)
dist.barrier()
def reduce_value(self,value,average=True):
with torch.no_grad():
dist.all_reduce(value)
if average:
value /= self.world_size
... | Python | 1 |
tour = Tour::default();
tour.set_start(test_tour_activity_without_job());
let pointer = get_pointer(&activity);
tour.set_end(activity);
assert_eq!(pointer, get_pointer(tour.end().unwrap()));
assert_ne!(get_pointer(&test_tour_activity_without_job()), get_pointer(tour.end().unwrap()));
assert_e... | Rust | 0 |
ath/mod.rs
mod aabb;
mod bezier;
mod color;
mod mat;
mod vec;
pub use aabb::Aabb;
pub use bezier::Bezier;
pub use color::Color;
pub use mat::Mat;
pub use vec::Vec;
pub const CIRCLE_CONSTANT: f32 = 0.552284749831;
pub fn lerp(a: f32, b: f32, ratio: f32) -> f32 {
a + (b - a) * ratio
}
pub fn arc_constant(angle: f... | Rust | 0 |
#!/usr/bin/env python
import sys
from pathlib import Path
import json
# Add project root to path
PROJECT_ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(PROJECT_ROOT))
from core.plan.loader import load_plan
from core.plan.runner import PlanRunner
from core.blocks.registry import BlockRegistry
from c... | Python | 1 |
Item=Domain, Location=Identity<Domain>, Output=Domain> + 'static,
CStore: IntCStore<VStore>,
Domain: IntDomain<Item=Bound> + 'static,
Bound: IntBound + Copy + 'static,
R: FreezeSpace<VStore, CStore> + Snapshot<State=Space<VStore, CStore, R>>
{
fn distribute(&mut self, space: Space<VStore, CStore, R>, var_idx:... | Rust | 0 |
+ 2];
r3 ^= subkeys[12 + 3];
r2 = r0;
r0 |= r3;
r3 ^= r4;
r4 &= r2;
r2 ^= r1;
r1 ^= r3;
r3 &= r0;
r2 |= r4;
r3 ^= r2;
r0 ^= r4;
r2 &= r0;
r4 ^= r3;
r2 ^= r1;
r4 |= r0;
r4 ^= r1;
r0 ^= r3;
r1 = r4;
r4 |= r3;
r4 ^= r0;
r4 = r4.rotate_lef... | Rust | 0 |
#!/usr/bin/env python3
import subprocess
import os
import sys
sys.path.append("../")
sys.path.append("../../system/lib/")
sys.path.append("../volume/")
sys.path.append("../array/")
import json_parser
import pos
import pos_util
import cli
import api
import json
import MOUNT_ARRAY_BASIC
import fio
import time
import pos... | Python | 1 |
_increment());
}
if instr.condition_code() != iced_x86::ConditionCode::None {
println!("\tCondition code: {:?}", instr.condition_code());
}
if instr.rflags_read() != iced_x86::RflagsBits::NONE {
println!("\tRFLAGS Read: {}", flags(instr.rflags_read()));
}
if instr.rflags_written(... | Rust | 0 |
bad_missing_version.tbs.bin");
/// X509 certificate generated from `bad_serial_too_long.tbs`.
#[rustfmt::skip]
pub const BAD_SERIAL_TOO_LONG: &[u8] = include_bytes!("x509/generated/bad_serial_too_long.tbs.bin");
/// X509 certificate generated from `bad_unknown_critical.tbs`.
#[rustfmt::skip]
pub const BAD_UNKNOWN_CRI... | Rust | 0 |
n = 0
p = 0
c = 0
senha = '1234'
while c <= 2:
n = input('Tente a senha: ')
c += 1
if n == senha:
print('Senha correta.')
break1234
else:
print('Sem tentativas!.')
| Python | 1 |
from rtde_control import RTDEControlInterface as RTDEControl
from rtde_control import Path, PathEntry
import time
rtde_c = RTDEControl("localhost")
path = Path()
vel = 0.5
acc = 4.0
blend = 0.099
path.addEntry(PathEntry(PathEntry.MoveJ, PathEntry.PositionTcpPose, [-0.140, -0.400, 0.100, 0, 3.14, 0, vel, acc, 0.0]))
p... | Python | 1 |
td::convert::TryInto;
daml_codegen!(dar_file = r"resources/testing_types_sandbox/TestingTypes-latest.dar");
#[tokio::test]
async fn test_rent() -> TestResult {
let _lock = SANDBOX_LOCK.lock().await;
let client = new_static_sandbox().await?;
let alice_executor = DamlSimpleExecutorBuilder::new(&client).act_... | Rust | 0 |
b- ?j ?i (b+ ?i ?j ?x))", "(trans ?x)"),
rw("ra_lit", "(lit ?n)", "(b+ _ _ (llit ?n))"),
rw("sum_d1", "(sum (dim _ 1) ?x)", "?x"),
drw("ra-bind", "?e", RABind),
drw("ra-add", "(+ ?a ?b)", RAAdd),
drw("ra-mul", "(* ?a ?b)", RAMul),
drw("ra-sum", "(sum ?i ?x)", RASum),
... | Rust | 0 |
,
);
Diagnostic::new_error(message)
.with_label(Label::new_primary(fn_span).with_message("the type"))
.with_labels(
arg_spans.iter().map(|&span| {
Label::new_secondary(span).with_message("applied... | Rust | 0 |
debug!(
"Updating device: '{}' / '{}' / '{:?}'",
app_id,
device_id,
device
);
if app_id.is_empty() || device_id.is_empty() {
return Ok(HttpResponse::BadRequest().finish());
}
if app_id != device.metadata.application || device_id != device.metadata.name {
... | Rust | 0 |
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 & !(0x01 << 4)) | (((value... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# CREDITS: Initially suggested by Jason Ramapuram, see
# https://github.com/facebookresearch/xformers/issues/203
import ... | Python | 1 |
= U;
fn next(&mut self) -> Option<U> {
self.iter.next().map(|x| {
let (state, res) = (self.fun)(self.state, x);
self.state = state;
res
})
}
}
// Copyright 2018 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may... | Rust | 0 |
etting", style="bold white")
settings_table.add_column("Value", style="red")
settings_table.add_row("Serial Port", config['port'])
settings_table.add_row("Baudrate", str(config['baudrate']))
settings_table.add_row("Data Pattern", config['pattern'] or "[red]Not configured[/red]")... | Python | 1 |
import pygame
from pygame.locals import *
import random
# shape parameters
size = width, height = (800, 800)
road_w = int(width/1.6)
roadmark_w = int(width/80)
# location parameters
right_lane = width/2 + road_w/4
left_lane = width/2 - road_w/4
# animation parameters
speed = 2
# initiallize the app
pygame.init()
runn... | Python | 1 |
# Scrapy settings for lkeria_crawler project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-mid... | Python | 1 |
#!/usr/bin/env python
import os
import time
from yaml import safe_load
import requests
here = os.path.abspath(os.path.dirname(__file__))
cache_path = os.path.join(here, '..', 'doc', '_static', 'cache')
badge = os.getenv('BADGE')
cache = {
# Override the label with a space to disable it and reduce the badge size
... | Python | 1 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Morituri - for those about to RIP
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of morituri.
#
# morituri is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... | Python | 1 |
se = llm.generate(message, system)
return response
def rag_response(message):
response=rag_qa_chain({"query": message})["result"]
return response
def check_and_response(system, message, history, contain_history=False):
if any(element in message for element in hero_list) and any(element in message fo... | Python | 1 |
(3, true), // B1-frame (first)
(4, true), // B0-frame (show existing)
(4, false), // Missing
(4, false), // Missing
][..]
}
3 => {
&[
(0, true), // I-frame
(0, false), // Missing
(2, true), // B0-frame
(1, true), //... | Rust | 0 |
import pandas as pd
import math
import numpy as np
# Function to calculate the difficulty
def calculate_difficulty(N, M):
difficulty = 1 / (math.factorial(N) ** M)
return difficulty
# Generate the difficulty table
data = []
for N in range(2, 7):
row = []
for M in range(2, 7):
difficulty = ca... | Python | 1 |
class Solution:
def numberOfSpecialChars(self, word: str) -> int:
# Initialize sets to store lowercase and corresponding uppercase letters encountered in the word
lowercase_letters = set()
uppercase_letters = set()
# Iterate through each character in the word
for cha... | Python | 1 |
fn description(&self) -> &str {
"not found"
}
fn response(&self) -> Option<Response> {
let mut response = json_response(&Bad {
errors: vec![StringError {
detail: "Not Found".to_string(),
}],
});
response.status = (404, "Not Found");
... | Rust | 0 |
xpath = normalize_xpath(pattern)
normalize_to_text = False
if xpath.endswith('/text()'):
xpath = xpath[:-7]
normalize_to_text = True
subtrees = tree.findall(xpath)
if len(subtrees) == 1:
... | Python | 1 |
aa2,
0xb8449c,
0xcec08a,
0xe7facc,
0x1044915,
0x1240b8c,
0x147ae14,
0x16fa9bb,
0x19c8651,
0x1cedc3d,
0x207567a,
0x246b4e4,
0x28dcebc,
0x2dd958a,
0x337184e,
0x39b8719,
0x40c3714,
0x48aa70b,
0x5188480,
0x5b7b15b,
0x66a4a53,
0x732ae18,
... | Rust | 0 |
`top = Expr`, does not exist.
/// // IExprZip, IExprZipSpec,
/// };
///
/// // // Not generated because of global `own_gen = false`, does not exist.
/// // use zip_own::*;
///
/// // ...
/// }
/// ```
#[proc_macro]
pub fn fast_expr(stream: proc_macro::TokenStream) -> proc_macro::TokenStream {
... | Rust | 0 |
e: &str) {
let mut to_write = format!("P3\n{} {}\n255\n", width, height);
for pixel in framebuffer {
let color = pixel.to_le_bytes();
to_write.push_str(&format!("{} {} {}\n", color[2], color[1], color[0]));
}
fs::write(file_name, to_write).expect(&format!("Failed to write: {}", file_name... | Rust | 0 |
: gpioc, extigpionr: 3),
pins: [
2 => { reset: Input<Floating>, afr: L/l, exticri: 1, af: [1] },
],
},
{
port: (F/f, pac: gpioc, extigpionr: 5),
pins: [
0 => { reset: Input<Floating>, afr: L/l, exticri: 1, af: [4, 5, 6] },
1 => { reset: Input<F... | Rust | 0 |
_iterable(value):
return isinstance(value, (tuple, list))
def check_form_fields(*fields):
fields_data = []
for field in fields:
if is_iterable(field):
fields_data.extend([field.data for field in field])
else:
fields_data.append(field.data)
return all(fields_data)
def generate_next_url(ne... | Python | 1 |
"X",
"Y",
"Z",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v... | Python | 1 |
MS_CTRL\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 inf... | Rust | 0 |
# -*- coding: utf-8 -*-
import unittest
from quantized_mesh_tile.utils import zigZagDecode, zigZagEncode
class TestZigZag(unittest.TestCase):
def testTo(self):
self.assertEqual(zigZagEncode(-1), 1)
self.assertEqual(zigZagEncode(-2), 3)
self.assertEqual(zigZagEncode(0), 0)
self.a... | Python | 1 |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import unittest
from nltk.stem.snowball import SnowballStemmer
class SnowballTest(unittest.TestCase):
def test_russian(self):
# Russian words both consisting of Cyrillic
# and Roman letters can be stemmed.
ste... | Python | 1 |
ALGO_CAMELLIA192 => Self::Camellia192,
ffi::GMIME_CIPHER_ALGO_CAMELLIA256 => Self::Camellia256,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GMimeContentEncoding")]
pub enum ContentEncodin... | Rust | 0 |
{
let mut pud_e: u64;
READ_KERN_PA!(((pud_paddr) + 8*i), pud_e);
if pud_e != 0 {
let pmd_paddr = pud_e & 0xFFFF_FFFF_F000;
tableWalk_pmd(pmd_paddr);
}
}
}
pub fn checkKernelPT() {
let ttbr1_el1 = getTtbr1_el1() as u64;
for i in 0..512 {
let mut pgd_e: u64;
READ_KERN_PA!(((ttbr1_el1) + 8*i), pgd_e)... | Rust | 0 |
E`, `F`, and `G`, it can be determined that `A` it is necessarily
/// closer to `B` than the other points without even computing exact distances
/// to them.
///
/// Ball trees are most commonly used as a form of predictive model where the
/// points are features and each point is associated with a value or label. Thu... | Rust | 0 |
genre(genre_website_id: str, page: int) -> ParsedTitlesPage:
async with aiohttp.ClientSession() as session:
url = f'{WEBSITE_URL}/zhanr/{genre_website_id}'
if page > 1:
url += f'/page/{page}/'
async with session.post(url) as response:
html = await response.text()
... | Python | 1 |
10254 => EventType::StreamStart,
12814 => EventType::Caps,
17934 => EventType::Segment,
19230 => EventType::StreamCollection,
20510 => EventType::Tag,
23054 => EventType::Buffersize,
25630 => EventType::SinkMessage,
26894 => E... | Rust | 0 |
import requests
import concurrent.futures
import warnings
warnings.filterwarnings('ignore')
def test_ip_speed(hostname: str, ip: str):
try:
r = requests.head(f"https://{ip}", headers={"host": hostname}, verify=False, timeout=5)
if r.status_code < 500:
return {'ip': ip, 'speed': r.elapse... | Python | 1 |
private_key(peer_session)
.map_err(|err| rpc_internal_error("get_ingress_private_key", err, logger))?;
Ok(private_key.into())
}
/// Set the private key of this enclave
pub fn set_ingress_private_key_impl(
&mut self,
msg: Message,
logger: &Logger,
) -> Result... | Rust | 0 |
nate but to your left in image coordinates
gt_cop_metric[:, 1] = mat_marker_bl[1] / 1000 - self.gt_cops_relative[:, 1]
return gt_cop_metric
def vis_heatmap_seq(pressure, normalize=True):
# normalize pressure value over all frames
# if normalize:
# pressure = (pressure - np.min(pressure... | Python | 1 |
, v_rnd will be a number which is greater than any round the
// acceptor has participated in. v_rnd is thus set only when the acceptor wants to send a Accept
// message to the proposers, after having received enough Proposals. So, here, by casting a vote
// we mean to send a Accept message to the proposers.... | Rust | 0 |
count: u32,
pub registered_time: i64,
}
#[derive(Debug)]
pub struct Album {
pub name: String,
pub album_art: String,
}
#[allow(dead_code)]
// Only QueryPeriod::SevenDay is used right now
pub enum QueryPeriod {
Overall,
SevenDay,
OneMonth,
ThreeMonths,
SixMonths,
TwelveMonths,
}
im... | Rust | 0 |
path, &info, TextureFormat::Uint8Srgb).await;
let texture_node = pools.borrow_mut::<Box<dyn MaterialNode>>().add(
Box::new(TextureNode::new(texture, sampler)),
);
let texture_rgb = pools.borrow_mut::<Box<dyn MaterialNode>>().add(
Box::new(XYZNode::new(texture_node)),
);
pools.borrow_mut::<Box<dyn Ma... | Rust | 0 |
-01/resources.json"];
run(Config {
api_version: Some(api_version.to_owned()),
output_folder: output_folder.into(),
input_files: input_files.iter().map(Into::into).collect(),
..Config::default()
})?;
Ok(())
}
extern crate crossbeam;
pub mod read;
pub mod write;
fn unwrap_or... | Rust | 0 |
class NewObj:
def __init__(self, **entries):
self.__dict__.update(entries)
| Python | 1 |
) ) . major as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SDL_version ) , "::" ,
stringify ! ( major ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SDL_version ) ) . minor as * const _ as
usize }... | Rust | 0 |
a suficientes datos
if len(window_returns) < window_size * 0.8:
# Si la ventana es muy pequeña, usar todos los datos disponibles hasta el momento
window_returns = future_returns[:i+1]
if len(window_returns) < 10: # Mínimo de datos para percentiles
... | Python | 1 |
ppend(f"{i}. {source_emoji} {mod['username']} ({mod['user_type']})")
await self.highrise.chat("\n".join(info_lines))
elif message == "اكتشف_مشرفين" and self.user_manager.check_permissions_advanced(user, "moderate"):
# فحص تلقائي لاكتشاف مشرفين جدد
await ... | Python | 1 |
from typing import Optional
from langflow import CustomComponent
from langchain.llms.baidu_qianfan_endpoint import QianfanLLMEndpoint
from langchain.llms.base import BaseLLM
class QianfanLLMEndpointComponent(CustomComponent):
display_name: str = "QianfanLLMEndpoint"
description: str = (
"Baidu Qianfan... | Python | 1 |
4, 10))
# Plot Loss over Time
plt.subplot(2, 2, 1)
plt.plot(losses, label="Loss", color="red")
plt.title("Loss over Time")
plt.xlabel("Training Step")
plt.ylabel("Loss")
plt.legend()
# Plot Reward over Time
plt.subplot(2, 2, 2)
plt.plot(rewards, label="Reward", color="blue")
plt.title("Reward over Time")
plt.xlabel("... | Python | 1 |
/// BRUNEI DARUSSALAM
#[serde(rename = "BN")]
BruneiDarussalam,
/// BULGARIA
#[serde(rename = "BG")]
Bulgaria,
/// BURKINA FASO
#[serde(rename = "BF")]
BurkinaFaso,
/// BURUNDI
#[serde(rename = "BI")]
Burundi,
/// CAMBODIA
#[serde(rename = "KH")]
Cambodia,
/// CAMEROON
#[serde(rename = "CM")]
Cameroo... | Rust | 0 |
webcam/peru/cusco/machu-picchu.html",
"refresh_sec": 600,
"category": "city",
},
{
"id": "santorini-caldera",
"name": "Santorini Caldera View",
"url": "https://www.skylinewebcams.com/webcam/greece/cyclades/santorini.html",
"refresh_sec": 300,
"category": "... | Python | 1 |
ead_local! {
static DEDUP_NODE : RefCell<Dedup<Node, Arc<Node>>>
= RefCell::new(Dedup::new(DedupControl::Inline, HashMap::new()));
}
type DrcNode = Drc<Node, Arc<Node>>;
impl InstanceId for Node {
fn id(&self) -> &str { &self.id }
}
impl FromId for DrcNode {
f... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.