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
R 5iM snS5R 5$s snf)NrSrrr^rrr&)r_rs r,rr%DictKeySetVariable.as_python_constantA@}}04 ?1TT $ $ & ? $&  ?#Ar=rr cN>US;a[SU...
Python
1
import unittest import os import os.path import shutil import re class TestTextCNN(unittest.TestCase): def setUp(self) -> None: if os.path.exists('./outputs'): shutil.rmtree('./outputs') os.system('python main.py --train --num_epochs=4 --output_dir "./outputs" --gpu') def test_trai...
Python
1
(load, align.bytes() as c_uint); load } } fn volatile_load(&mut self, _: &'ll Type, ptr: &'ll Value) -> &'ll Value { trace!("Volatile load `{:?}`", ptr); unsafe { let load = llvm::LLVMBuildLoad(&mut self.llbuilder.lock().unwrap(), ptr, unnamed()); llv...
Rust
0
TSFresh time series feature extraction\n", "4. **Modeling**: XGBoost with hyperparameter optimization\n", "5. **Evaluation**: Multiple metrics including MASE and R²\n", "\n", "### Missing Data Sources for Enhanced Accuracy:\n", "\n", "- **Social sentiment**: Twitter, Reddit, news sentiment\n", ...
Python
1
#!/usr/bin/env python3 """ Development server runner """ import uvicorn from app.main import app from app.config import settings if __name__ == "__main__": print(f"Starting {settings.app_name} v{settings.app_version}") print(f"Server will be available at: http://{settings.api_host}:{settings.api_port}") p...
Python
1
, label_type: &'a [types::Value], end_type: &'a [types::Value], instrs: &'a [ast::Instr], ) -> Option<()> { push_frame(frames, label_type, end_type, operands.len()); for instr in instrs { check_instr(mod_ctx, func_ctx, operands, frames, instr)?; } pop_frame(frames, operands) } fn check_instr<'a>( mod_ctx: ...
Rust
0
lines(10000); ucmd.args(&["-l", "1000", name, "d"]).succeeds(); assert_eq!(glob.count(), 10); assert_eq!(glob.collate(), at.read(name).into_bytes()); } use crate::game_renderer::{GameRenderer, GameRendererInner}; use renderer::nodes::{PrepareJobSet, FramePacket, RenderView, RenderRegistry}; use crate::rende...
Rust
0
older.toLowerCase().includes('chat')) { textarea.value = text; textarea.dispatchEvent(new Event('input', { bubbles: true })); textarea.focus(); // Visual feedback textarea.style.background = 'rgba(79, 172, ...
Python
1
n argument is given. /// /// # Errors /// /// Any error that occur during the execution of the program will be returned by this function. fn main() -> Result<(), Error> { let mut args = std::env::args(); match (args.nth(1), args.nth(2)) { (_, Some(_)) => return Err(Error::TooManyArguments(args.len() - 1...
Rust
0
n(sales_train_validation))] # Build training set train_ds = [ { FieldName.TARGET: target.tolist(), FieldName.START: start, FieldName.FEAT_DYNAMIC_REAL: fdr.tolist(), FieldName.FEAT_STATIC_CAT: fsc.tolist(), FieldName.ITEM_ID: id, } ...
Python
1
*program, index, buf.len() as SizeI, length.as_mut_ptr(), size.as_mut_ptr(), typ.as_mut_ptr(), buf.as_mut_ptr() as *mut Char, ); } let length = unsafe { length.assume_init() } as usize; le...
Rust
0
if map.is_err() { return fail() }; let map = map.unwrap(); let (url, post_id, amount) = (get(map, "url"), get(map, "post_id"), get(map, "amount")); if post_id.is_none() || amount.is_none() { return fail() }; let (post_id, amount) = (post_i...
Rust
0
import os import logging from .sampling import get_representative_json debug_logger = logging.getLogger('debug') def is_valid_anki(anki_file, check_notes=True): anki_json = get_representative_json(anki_file) file_type = os.path.splitext(anki_file)[1] debug_logger.debug(file_type) empty_tables_allow...
Python
1
# Copyright 2016-2018, Rigetti Computing # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ QuantumFlow Meta """ import sys import typing import numpy as np import networkx as nx import cvxpy as cvx import pyquil impor...
Python
1
k, n = map(int, input().split()) arr = [] for _ in range(k): arr.append(int(input())) arr.sort() def cal_lans(split_length): count = 0 for lan in arr: if lan >= split_length: count += lan // split_length return count min_length = 1 max_length = arr[-1] result = 0 while mi...
Python
1
z).sqrt(); // no rotation around nothing if len.abs() <= EPSILON { debug_assert!(len.abs() > EPSILON); return self; } x /= len; y /= len; z /= len; let (s, c) = angle.sin_cos(); let t = 1. - c; let v00 = self[0]; ...
Rust
0
, ]; let mut c = Identity {}; for input in inputs.iter() { let result = c.execute(input); assert_eq!( result, Ok(input.clone()), "executing Indentity on input {} work", input ) } } ...
Rust
0
stamp).finish(), Predicate::Modulus(interval, unit) => f.debug_tuple("Predicate::Modulus") .field(interval) .field(unit) .finish(), Predicate::Time(hour, minute, second) => f.debug_tuple("Predicate::Time") .field(hour) ...
Rust
0
cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn bench_many_parents_sse2(b: &mut Bencher) { if let Some(platform) = Platform::sse2() { bench_many_parents_fn(b, platform); } } #[bench] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn bench_many_parents_sse41(b: &mut Bencher) { if...
Rust
0
def lower_bound(arr, x): lo, hi = 0, len(arr) while lo < hi: mid = (lo + hi) // 2 if arr[mid] < x: lo = mid + 1 else: hi = mid return lo def lis_length(sequence): tails = [] for x in sequence: # x를 어디에 놓아야 tails가 오름차순을 유지하며 # '끝값 최소' 상...
Python
1
sys.stderr.write("Warning: no instances for entity type %s in gold standard.\n" % c) c_rec = 1 else: c_rec = c_tp / float(c_tp + c_fn) if (c_tp + c_fp) == 0: sys.stderr.write("Warning: prediction file does not contain any instances of e...
Python
1
xes, bbox=dict(boxstyle="round,pad=0.3", fc="white", ec="gray", alpha=0.8)) print(f"✅ Hindcast visualization saved as: {plt_hindcast_path}") print(f"✅ Combined Forecast saved to: {combined_output_file}") print(f"✅ Historical values fixed to match: {known_historical_data}") print(f"✅ Calibration factor applied: {calibr...
Python
1
.is_none() { gamma = (2.0 * 11.70 * 8.854214871e-12 * Q * nsub * 1e6/*(cm**3/m**3)*/).sqrt() / cox_per_area; } if specs.vt0.is_none() { let nss = if let Some(val) = specs.nss { val } else { 0.0 }; let wkfngs = wkfng - (3.25 + 0....
Rust
0
::request::Builder, body: Vec<u8>, ) -> Result<HttpResponse<Bytes>, api::ApiError<Self::Error>> { use futures_util::TryFutureExt; let call = || async { let http_request = request.body(body)?; let request = http_request.try_into()?; let rsp = self.client.ex...
Rust
0
ter]); #[rustfmt::skip] pub static LAYERS: keyberon::layout::Layers = &[ &[ &[k(Grave), k(Kb1),k(Kb2),k(Kb3), k(Kb4),k(Kb5),k(KpMinus),k(KpSlash),k(KpAsterisk),k(Kb6), k(Kb7), k(Kb8), k(Kb9), k(Kb0), k(Minus) ], &[k(Tab), k(Q), k(W), k(E), k(R), k(T), k(Kp7), k(Kp8), k(Kp9)...
Rust
0
)).expect("Could not write statistics.json"); }<gh_stars>0 extern crate proc_macro2; use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, Data, DeriveInput, Fields}; use syn::spanned::Spanned; use proc_macro2::{Ident, Span}; #[proc_macro_derive(Insert)] pub fn insert_derive(input: TokenStream) ...
Rust
0
st::{black_box, Bencher}; #[bench] fn part_a(b: &mut Bencher) { b.iter(|| day_18::part_a(black_box(None))); } pub(crate) mod test_sealing; <filename>src/models/mod.rs<gh_stars>1-10 //! Models put an abstraction between controller or "business logic" code and //! the database itself. They hide SQL queries and inclu...
Rust
0
c = LossAndFlatGradient(build_loss) # convert initial model parameters to a 1D tf.Tensor params = tf.dynamic_stitch(func.indices, tf.trainable_variables()) # train the model with L-BFGS solver lbfgs_op = tfp.optimizer.lbfgs_minimize( value_and_gradients_function=func, initial_position=params, m...
Python
1
from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from pydantic import BaseModel, model_validator class GPT4AllEmbeddings(BaseModel, Embeddings): """GPT4All embedding models. To use, you should have the gpt4all python package installed Example: .. cod...
Python
1
g"); } #[test] fn t_cartesian_product_ball_and_rectangle() { /* Rectangle 1 */ let xmin1 = vec![-1.0; 3]; let xmax1 = vec![1.0; 3]; let rectangle1 = Rectangle::new(Some(&xmin1), Some(&xmax1)); /* Ball */ let radius = 1.0; let ball = Ball2::new(None, radius); /* Rectangle 2 */ let ...
Rust
0
# -*- coding: utf-8 -*- """ @brief 生成数据的部分(从IMDB中适配) @update 2016.04.21: 原始的label数据有出生年龄标注为0的情况,更新去除这一部分的数据。 2016.04.26: 原先的训练数据和验证数据划分存在着人物之前的重叠,更正为根据 不同的人进行划分训练和测试数据。 2016.05.02: 适配OnlineData。 2016.05.04: 去除掉57和77标注的人脸数据。 """ import os def make_dict_from_file(file_list): ...
Python
1
# app.py from flask import Flask, render_template, Response, jsonify import cv2 from CV3T import recognize_plate import time from pymongo import MongoClient from concurrent.futures import ThreadPoolExecutor import threading app = Flask(__name__) camera = cv2.VideoCapture(0) # Configura a resolução da câmera (pode tes...
Python
1
extern crate alloc; use alloc::string::String; use core::fmt::{Debug, Display}; use mc_account_keys::PublicAddress; use mc_crypto_keys::RistrettoPublic; #[cfg(any(test, feature = "automock"))] use mockall::*; pub mod ingest_report; /// Represents a fog public key validated to use for creating encrypted fog hints. /...
Rust
0
descriptor_t, client: *mut debugserver_client_t, ) -> debugserver_error_t; } extern "C" { #[doc = " Starts a new debugserver service on the specified device and connects to it."] #[doc = ""] #[doc = " @param device The device to connect to."] #[doc = " @param client Pointer that will point t...
Rust
0
pub const FMOD_OUTPUTTYPE_UNKNOWN: FMOD_OUTPUTTYPE = 1; pub const FMOD_OUTPUTTYPE_NOSOUND: FMOD_OUTPUTTYPE = 2; pub const FMOD_OUTPUTTYPE_WAVWRITER: FMOD_OUTPUTTYPE = 3; pub const FMOD_OUTPUTTYPE_NOSOUND_NRT: FMOD_OUTPUTTYPE = 4; pub const FMOD_OUTPUTTYPE_WAVWRITER_NRT: FMOD_OUTPUTTYPE = 5; pub const FMOD_OUTPUTTYPE_WA...
Rust
0
Shift + Alt "kUP4": "shift+alt+up", "kDN4": "shift+alt+down", "kLFT4": "shift+alt+left", "kRIT4": "shift+alt+right", "kIC4": "shift+alt+inset", "kDC4": "shift+alt+delete", "kHOM4": "shift+alt+home", "kEND4": "shift+alt+end", # Control + Shift "kUP6": "ctrl+shift+up", "kDN6...
Python
1
it.is_scripting(): func = _multi_tensor_adam else: func = _single_tensor_adam func( params, grads, exp_avgs, exp_avg_sqs, max_exp_avg_sqs, state_steps, amsgrad=amsgrad, has_complex=has_complex, beta1=beta1, beta2=be...
Python
1
alues().sum::<u64>() } pub fn execute_v2(input: &[Self]) -> u64 { let mut map = HashMap::<u64, u64>::new(); let mut bits = [0u64; 36]; let mut bits_len; let mut current_mask = BitMask::default(); for &instruction in input { m...
Rust
0
import pytest from skfp.distances import ( sokal_sneath_2_binary_distance, sokal_sneath_2_binary_similarity, ) from skfp.distances.sokal_sneath import ( bulk_sokal_sneath_2_binary_distance, bulk_sokal_sneath_2_binary_similarity, ) from tests.distances.utils import ( run_test_bulk_similarity_and_dis...
Python
1
pub udmach1bsel: UDMACH1BSEL, #[doc = "0x510 - Output Selection for DMA Channel 2 SREQ"] pub udmach2ssel: UDMACH2SSEL, #[doc = "0x514 - Output Selection for DMA Channel 2 REQ"] pub udmach2bsel: UDMACH2BSEL, #[doc = "0x518 - Output Selection for DMA Channel 3 SREQ"] pub udmach3ssel: UDMACH3S...
Rust
0
(128 - b_read - 8) as u128); if b_rem < 8 { b_read += b_rem; b_rem = 0; } else { b_rem -= 8; b_read += 8; } } byte_c += 1; } retval = retval >> (128 - b_read); if order == BitOrder::Lsb0 { ...
Rust
0
id: &str) -> Result<SbmlTransitionInput, String> { let species = input.attribute((SBML_QUAL, "qualitativeSpecies")); let effect = input.attribute((SBML_QUAL, "transitionEffect")); let sign = input.attribute((SBML_QUAL, "sign")); let id = input.attribute((SBML_QUAL, "id")); // WARNING: This attribute...
Rust
0
.map(|(x, &y)| { if x == 0 && index_0_num > nums.len() / 3 { return y; } if x == 1 && index_1_num > nums.len() / 3 { return y; } None }) .filter(|x| x.is_some()) ...
Rust
0
#!/usr/bin/env python3 import json data = ' {"base_waist_joint":0,"waist_link1_joint":0,"link1_link2_joint":30,"right_gripper_joint":0} ' joint_angles = json.loads(data) print(f"Jointangles = {joint_angles}\n") def assign_values(joint_angles:dict): base_waist_joint = 1.250 waist_link1_joint = 1.001 l...
Python
1
Fix(14.0) }); cx.add_instances(&SHADER, &[CodeIconIns { base: QuadIns::from_rect(rect), icon_type: icon_type.shader_float() }]); cx.end_padding_box(); } } mod dynamodb; mod password; mod role; mod session; mod user; pub use dynamodb::{ AuthDynamoClient, AuthDynamoClientError, }; pub use pa...
Rust
0
import uuid import pytest from fastapi.testclient import TestClient from tests.utils import create_room, delete_room from clueless.app.db.models.room import RoomCreate def test_create_room(test_client, test_user_a, test_user_a_header): create = { "name": "My-Room", "host": test_user_a.id } ...
Python
1
#!/usr/bin/env python3 import sys import openvr import json if len(sys.argv) != 3: print("Usage: [device_index] [outfile]") exit(1) openvr.init(openvr.VRApplication_Scene) i_system = openvr.IVRSystem() device_index = int(sys.argv[1]) def try_get_property(id, optional=False): try: return i_syste...
Python
1
output_hidden_states=inputs["output_hidden_states"], return_dict=inputs["return_dict"], training=inputs["training"], ) sequence_output = outputs[0] logits = self.qa_outputs(sequence_output) start_logits, end_logits = tf.split(logits, 2, axis=-1) ...
Python
1
x_mask = 0; let mut memory = FxHashMap::with_capacity_and_hasher(size, Default::default()); for x in data { match x { Mask(or_mask, _, x_mask) => { current_or_mask = or_mask; current_x_mask = x_mask; } A...
Rust
0
new(4, 6, 5, 7, 1, 8, 2, 3).min_elem(), 1); assert_eq!(N8::<u32>::new(4, 6, 5, 7, 1, 8, 2, 3).min_elem(), 1); assert_eq!(T8xu32::new(4, 6, 5, 7, 1, 8, 2, 3).min_elem(), 1); assert_eq!(N8xu32::new(4, 6, 5, 7, 1, 8, 2, 3).min_elem(), 1); } #[test] fn vec_fn_max_elem() { assert_eq!(T8::<u32>::new(4, 6, 5...
Rust
0
# ماژول مدیریت کارمزد تراکنش برای PersianChain # نویسنده: Mohammad Nasser Haji Hashemabad # توضیحات: این ماژول کارمزد تراکنش‌ها را محاسبه و به ماینر اختصاص می‌دهد. class مدیریت_کارمزد: def __init__(self): self.کل_کارمزد = 0 def محاسبه_کارمزد_تراکنش(self, تراکنش): # فرض: هر تراکنش دارای فیلد 'ک...
Python
1
, Some(to), false).build_read_opts(); let handle = box_try!(get_cf_handle(&self.engines.kv, CF_RAFT)); let mut iter = DBIterator::new_cf(Arc::clone(&self.engines.kv), handle, readopts); iter.seek(SeekKey::from(from.as_ref())); let fake_snap_worker = Worker::new("fake-snap-worker"); ...
Rust
0
mage_component, Some(Image(true))); } enum UnitType { Soldier, Truck, } type UnitNames = (&'static str, &'static str); fn soldier_factory(m: &mut Minion, n: &mut UnitNames) { m.name = n.0; m.value = 1; } fn truck_factory(m: &mut Minion, n: &mut UnitNames) { m.name = n.1; m.value = 2; } #[test] fn ca...
Rust
0
#!/usr/bin/env python3 # Copyright © 2019-2020 Salamandar <felix@piedallu.me> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
Python
1
operation_replace_route( input: &crate::input::ReplaceRouteInput, ) -> Result<smithy_http::body::SdkBody, std::convert::Infallible> { let mut out = String::new(); #[allow(unused_mut)] let mut writer = smithy_query::QueryWriter::new(&mut out, "ReplaceRoute", "2016-11-15"); #[allow(unused_mut)] le...
Rust
0
specified BoundingSphere. /// /// ## Parameters /// /// `sh` The BoundingSphere to test against. /// /// ## Return value /// /// A ContainmentType value indicating whether the BoundingSphere contains the specified BoundingSphere. /// /// ## Reference /// /// <https://doc...
Rust
0
specific core /// /// If 'notify' is true, an interrupt will be sent to the recipient. pub fn send_msg_core( &self, msg: VirtualMachineMsg, core_id: percore::CoreId, notify: bool, ) -> Result<()> { let context = self .context_by_core_id(core_id) ...
Rust
0
oaded("libX11.so"): LOG.warning( "libX11.so is loaded prior to initializing the Embedded Instance of Mechanical.\ Python will crash on shutdown..." ) def initialize(version: int = None): """Initialize Mechanical embedding.""" global INITIALIZED_VERSION if ...
Python
1
import random def inicio(): print('----------------------------------------') print('Bienvenido a este juego') print('----------------------------------------') def juego(): play = True while play: # Generar un nuevo número aleatorio cada vez que se juega cpu = random.randint(0, 1...
Python
1
# -*- coding:utf-8 -*- from flask import current_app from celery.signals import task_postrun, worker_process_init from app.services.framework.staff_sync import StaffSync from app.services.docker_engine_service import DockerEngineService from app.services.docker_cluster_service import DockerClusterService from app.ser...
Python
1
"name": "Search issues and pull requests", "description": SEARCH_ISSUES_AND_PRS_PROMPT, "args_schema": SearchIssuesAndPRs, }, { "mode": "search_code", "name": "Search code", "description": SEARCH_CODE_PROMP...
Python
1
from metaflow import profile NUM_HASH_BINS = 10000 PRECISION = 6 class FeatureEncoder(): NAME = 'grid' FEATURE_LIBRARIES = {'python-geohash': '0.8.5', 'tensorflow-base': '2.6.0'} CLEAN_FIELDS = ['pickup_latitude', 'pickup_longitude', 'dropoff_latitude', 'dropoff...
Python
1