text string | label_name string | labels int64 |
|---|---|---|
lizationError::UnexpectedValueError {
value: format!("{:x}", error_type),
field: "error type".to_string(),
message: "error".to_string(),
});
}
};
Ok(Error::Error(code, bytes.fill_buf().unwrap().to_vec()))
}
... | Rust | 0 |
import os
from dotenv import load_dotenv
from pydantic import BaseSettings
# .envファイルを読み込む
load_dotenv()
class Settings(BaseSettings):
# アプリケーションの設定
APP_NAME: str = "My FastAPI App"
DEBUG: bool = os.getenv("DEBUG", "False").lower() == "true"
# セキュリティ設定
SECRET_KEY: str = os.getenv("SECRET_KEY", "s... | Python | 1 |
hash, new_seed);
<SeedOwner<T>>::insert(seed_identifier_hash, &to);
<AllSeedArray<T>>::insert(all_seed_count, seed_identifier_hash);
<AllSeedCount<T>>::put(new_all_seed_count);
<AllSeedIndex<T>>::insert(seed_identifier_hash, all_seed_count);
<OwnedSeedArray<T>>::insert((to... | Rust | 0 |
from woningwaardering.vera.bvg.generated import Referentiedata
from woningwaardering.vera.referentiedatasoort import Referentiedatasoort
class MonitorintervalReferentiedata(Referentiedata):
pass
class Monitorinterval(Referentiedatasoort):
monitorinterval_5_minuten = MonitorintervalReferentiedata(
co... | Python | 1 |
= pts.shape[0]
sample_size = int(num_points / 10)
sampled_pts = pts[np.random.choice(num_points, size=sample_size, replace=False)]
pca = PCA(n_components=3)
pca.fit(sampled_pts)
eigenvalues = pca.explained_variance_
lambda1, lambda2, lambda3 = sorted(eigenvalues, revers... | Python | 1 |
#########################################################################################
##
## PathSim event detection example with thermostat
##
#########################################################################################
# IMPORTS =======================================================... | Python | 1 |
#[pallet::constant]
type EarnTradingFeeDecimals: Get<u8>;
#[pallet::constant]
type CurrentLiquidateVersionId: Get<VersionIdOf<Self>>;
}
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);
/// store the basic attributes of al... | Rust | 0 |
]
},
"responsetime": "2019-03-19T02:15:06.086Z"
}
"#;
const SAMPLE_EMPTY_RESPONSE: &str = r#"
{
"status": 0,
"data":{},
"responsetime":"2020-11-15T06:32:13.747Z"
}
"#;
#[tokio::test]
async fn test_latest_executions() {
let body... | Rust | 0 |
])
reject_y.append(new_y)
reject_y_lens.append(len(new_y))
elif process_item_idx==1:
new_y = lost_P(y_o[b])
reject_y.append(new_y)
reject_y_lens.append(len(new_y))
max_length = max(reject_y_lens)
for b in range(bs):
pad_length = max_len... | Python | 1 |
{
if let Some(lightlike_value) = self.lightlike.remove(&key) {
self.timelike.insert(key, (value, lightlike_value));
} else {
self.spacelike.insert(key, value);
}
}
}
}
}
impl<K, V> TimestepEvaluation<K, V> ... | Rust | 0 |
!($fmt, "\r\n") $(, $($arg)+)?));
}
}
#[cfg(any(feature = "board_qemu", feature = "board_lrv"))]
pub mod uart {
use crate::user_console::{IN_BUFFER, OUT_BUFFER};
use alloc::sync::Arc;
use lazy_static::*;
use spin::Mutex;
#[cfg(feature = "board_qemu")]
use uart8250::{InterruptType, MmioUart8... | Rust | 0 |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | Python | 1 |
#[inline]
pub fn _from(value: bool) -> I2C0_RST_NR {
match value {
false => I2C0_RST_NR::ASSERT_THE_I2C0_RESE,
true => I2C0_RST_NR::CLEAR_THE_I2C0_RESET,
}
}
#[doc = "Checks if the value of the field is `ASSERT_THE_I2C0_RESE`"]
#[inline]
pub fn is_assert_the_i... | Rust | 0 |
的可能性是随机购买的{lift:.1f}倍")
elif lift == 1:
print(f" 提升度=1,表明购买{antecedents}与购买{consequents}相互独立")
else:
print(f" 提升度<1,表明购买{antecedents}会降低购买{consequents}的可能性")
print("\n电商应用建议:")
print("="*50)
print("1. 捆绑销售策略:对于提升度高的商品组合,可以考虑打包销售或促销活动")
print("2. 商品布局优化:在网页设... | Python | 1 |
<u64>,
pub running_processes: Option<u32>,
pub blocked_processes: Option<u32>,
}
// In kilobytes unless specified otherwise
#[derive(Default, Clone, PartialEq, Debug, Serialize, Deserialize)]
pub struct MemInfo {
pub total: Option<u64>,
pub free: Option<u64>,
pub available: Option<u64>,
pub buf... | Rust | 0 |
self.b.sqrt(),
}
}
pub fn hex(&self) -> u32 {
let r = (self.r * 255.0) as u32;
let g = (self.g * 255.0) as u32;
let b = (self.b * 255.0) as u32;
r << 16 ^ g << 8 ^ b
}
pub fn hex_string(&self) -> String {
format!("{:x}", self.hex())
}
pub fn hs... | Rust | 0 |
import random
from Crypto.Util import number
from sympy import mod_inverse, isprime
def generate_prime(bits):
return number.getPrime(bits)
def generate_dsa_keys():
# Schritt 1: Wähle zwei Primzahlen p und q
q = generate_prime(256)
# Finde eine 3072-Bit Primzahl p, so dass q ein Primzahlfaktor von p... | Python | 1 |
len() == 1);
//Enforce equality with the root
root.conditional_enforce_equal(
&mut cs.ns(|| "root_is_last"),
&prev_level_nodes[0],
should_enforce,
)?;
Ok(())
}
}
pub(crate) fn hash_inner_node_gadget<H, HG, ConstraintF, CS>(
cs: CS,
left... | Rust | 0 |
# Copyright 2019 Google LLC. 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 applicable law or a... | Python | 1 |
(&self) {
counter!("vector_started_total", 1);
}
}
#[derive(Debug)]
pub struct VectorReloaded<'a> {
pub config_paths: &'a [PathBuf],
}
impl InternalEvent for VectorReloaded<'_> {
fn emit_logs(&self) {
info!(
target: "vector",
message = "Vector has reloaded.",
... | Rust | 0 |
> {
if let None = std::env::var_os("RUST_LOG") {
std::env::set_var("RUST_LOG", "hotserve=info,actix_web=warn");
}
env_logger::init();
let Opt {
port,
dir,
route,
index_file,
} = Opt::from_args();
// little racy
if !fs::metadata(&dir).map(|md| md.is_di... | Rust | 0 |
ate::Readable for ACS_VDDRET_CTRL {}
#[doc = "`write(|w| ..)` method takes [acs_vddret_ctrl::W](acs_vddret_ctrl::W) writer structure"]
impl crate::Writable for ACS_VDDRET_CTRL {}
#[doc = "Retention Regulator Configuration / Control register"]
pub mod acs_vddret_ctrl;
#[doc = "RC Oscillator Configuration / Control regis... | Rust | 0 |
t;
///
/// And vice versa:
///
/// quot = cyc >> time_shift;
/// rem = cyc & (((u64)1 << time_shift) - 1);
/// timestamp = time_zero + quot * time_mult +
/// ((rem * time_mult) >> time_shift);
pub time_zero: u64,
/// Header size up to __reserved[] fields.
pub... | Rust | 0 |
let start = map
.iter()
.with_coords()
.find_map(|(x, y, t)| if *t == b'S' { Some((x, y)) } else { None })
.unwrap();
let dest = map
.iter()
.with_coords()
.find_map(|(x, y, t)| if *t == b'D' { Some((x, y)) } else { None })
.unwrap();
print... | Rust | 0 |
/*
std::panic::panic_any(Log::print_fatal(&format!(
"(Err.254) まだ駒台は実装してないぜ☆(^~^)!",
)))
*/
}
}
}
pub fn piece_num_board_at(&self, addr: &FireAddress) -> Option<PieceNum> {
match addr {
FireAddr... | Rust | 0 |
te('SENSe1:POWer:BURSt:DTOLerance 1e-9') # Sets the dropout time. The dropout time is a time interval
# in which the pulse end is only recognized if the signal level no longer exceeds the trigger level.
def measurement():
"""Perform burst measurements in a row"""
print('Starting measurement...')
... | Python | 1 |
a[1] == flags
@pytest.mark.parametrize(
"fn_name,flag",
(
("credentials_establish", PamCred.PAM_ESTABLISH_CRED),
("credentials_delete", PamCred.PAM_DELETE_CRED),
("credentials_refresh", PamCred.PAM_REFRESH_CRED),
("credentials_reinitialize", PamCred.PAM_REINITIALIZE_CRED),
... | Python | 1 |
set_test!(
set_int_pin_pol_active_low,
$create,
CTRL_REG3,
0,
set_interrupt_pin_polarity,
InterruptPinPolarity::ActiveLow
);
set_test!(
set_int_pin_pol_active_high,
... | Rust | 0 |
self.versions.get_version_for_number(version_num).unwrap();
if self.will_fit(num_input_bits, version, ec_level) {
return Ok(version);
}
}
Err(WriterException {
reason: String::from("Data too big"),
})
}
/**
* @return the code poi... | Rust | 0 |
as usize },
// 0usize,
// concat!(
// "Offset of field: ",
// stringify!(_xmlXPathParserContext),
// "::",
// stringify!(cur)
// )
// );
// assert_eq!(
// unsafe { &(*(::std::ptr::null::<_xmlXPathParserContext>())).base as *const _ as usize },
// 8usize,
// concat!(
... | Rust | 0 |
e.parse().unwrap()).await {
Ok(result) => if result.clone() {
HttpResponse::NoContent().body(Body::None)
} else {
HttpResponse::NotFound().body(Body::None)
},
_ => HttpResponse::InternalServerError().body(Body::None)... | Rust | 0 |
pacecraft
barycenter = np.mean(vertices, axis=0) # Calculate the barycenter
centered_vertices = vertices - barycenter # Center the polyhedron at the origin
T = np.mean([np.outer(v, v) for v in centered_vertices], axis=0) # Volumetric tensor
eigenvalues = np.linalg.eigvalsh(T)
e... | Python | 1 |
_beads[1].to_vec(), vec![10, 20, 30]);
assert_eq!(fs_beads[2].to_vec(), vec![30, 50, 90]);
assert_eq!(fs_beads[3].to_vec(), vec![130, 150, 190]);
}
#[test]
fn roundtrip_fixed_size_beads_with_incremental_uint_builder() {
let mut builder = FixedSizeBeadsIncrementalUintBuilder::new();
builder.push(1);
... | Rust | 0 |
decrypting block: {:?}", e)
}
}
}
extern crate feembox;
extern crate feed_rs;
mod util;
mod options;
use crate::core::{Backend, BackendArgs, ExternalBackends, Ops};
use crate::errors::{BackendError, DelegateError};
use serde::{Deserialize, Serialize};
use std::fmt;
#[derive(Debug, PartialEq, Serialize, ... | Rust | 0 |
/// Panics if too many arguments have been set.
///
/// * `arg` - a reference to the data for the kernel argument.
///
/// returns a reference to self.
pub fn set_arg<'b, T>(&'b mut self, arg: &T) -> &'b mut Self {
assert!(
self.arg_index < self.num_args,
"ExecuteKe... | Rust | 0 |
from openai import OpenAI
from ratelimiter import RateLimiter
from retrying import retry
import urllib
import base64
from constants import OPENAI_API_KEY, ORGANIZATION
if ORGANIZATION:
client = OpenAI(api_key=OPENAI_API_KEY, organization=ORGANIZATION)
else:
client = OpenAI(api_key=OPENAI_API_KEY)
def save_i... | Python | 1 |
.vecstore.search.assert_not_called()
# Verify empty results due to zero limit
assert len(result) == 0
@pytest.mark.asyncio
async def test_query_graph_embeddings_different_vector_dimensions(self, processor):
"""Test querying graph embeddings with different vector dimensions"""
... | Python | 1 |
Random::new();
let pkcs8_bytes = ring::signature::Ed25519KeyPair::generate_pkcs8(&rng)?;
let key_pair = ring::signature::Ed25519KeyPair::from_pkcs8(pkcs8_bytes.as_ref())?;
let ident = ic_agent::identity::BasicIdentity::from_key_pair(key_pair);
let agent = Agent::builder()
.with_url(url)
... | Rust | 0 |