text
string
label_name
string
labels
int64
S(shWrite DATA to the underlying SSL channel. Returns number of bytes of DATA actually transmitted.(R,twrite(R:tdata((sssl.pyRDscCs|jj|S(sReturns a formatted version of the data in the certificate provided by t...
Python
1
@property def denoising_start(self): return self._denoising_start
Python
1
0xb86; pub const mhpmcounter7h: u64 = 0xb87; pub const mhpmcounter8h: u64 = 0xb88; pub const mhpmcounter9h: u64 = 0xb89; pub const mhpmcounter10h: u64 = 0xb8a; pub const mhpmcounter11h: u64 = 0xb8b; pub const mhpmcounter12h: u64 = 0xb8c; pub const mhpmcounter13h: u64 = 0xb8d; pub const mhpmcounter14h: u64 = 0xb8e; pub...
Rust
0
self.button_state.get(&list_button_id).is_some(), "list_button_item must be called inside list_button_begin/list_button_end" ); if *self.button_state.get(&list_button_id).unwrap() != self.list_button_index - 1 { return false; } self.list_button_label = label.to_ow...
Rust
0
{ match bytes { b"0" => Some(ClearingInstruction::ProcessNormally), b"1" => Some(ClearingInstruction::ExcludeFromAllNetting), b"2" => Some(ClearingInstruction::BilateralNettingOnly), b"3" => Some(ClearingInstruction::ExClearing), b"4" => Some(Clearing...
Rust
0
/// use modio::filter::prelude::*; /// use modio::mods::EventType; /// use modio::user::filters::events::EventType as Filter; /// /// let filter = Id::gt(1024).and(Filter::eq(EventType::ModfileChanged)); /// ``` pub mod events { #[doc(inline)] pub use crate::filter::prelude::Id; ...
Rust
0
esolution_presets[:10]}") # --- End Load Resolution Presets --- def start_queue(prompt_workflow): p = {"prompt": prompt_workflow} data = json.dumps(p).encode('utf-8') URL = "http://127.0.0.1:8188/prompt" max_retries = 5 retry_delay = 10 request_timeout = 60 for attempt in range(max_retrie...
Python
1
\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum GAIN5_A { #[doc = "0: Gain factor = 1"] VALUE1, #[doc = "1: Gain factor = 3"] VALUE2, #[doc = "2: Gain factor = 6"] VALUE3, #[doc = "3: Gain factor = 12"] VALUE4, } impl From<GAIN5_A> for u8 { #[inline(always)]...
Rust
0
self.archetypes[old_ty as usize]; let old_comps = B1::read(old_archetype, old_idx); B2::drop::<B1>(old_archetype, old_idx); let new_idx = self.move_(ent.id, old_ty, new_ty, old_idx); new_comps.write(&mut self.archetypes[new_ty as usize], new_idx); Some(o...
Rust
0
# flake8: noqa # Copyright 2022 The HuggingFace Team. 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 requi...
Python
1
#coding=utf-8 from scipy import misc import tensorflow as tf import src.align.detect_face as detect_face import cv2 import matplotlib.pyplot as plt minsize = 20 # minimum size of face threshold = [0.6, 0.7, 0.7] # three steps's threshold factor = 0.709 # scale factor gpu_memory_fraction = 1.0 print('Creating ne...
Python
1
let pf = { let get_attr = |attrib: appkit::NSOpenGLPixelFormatAttribute| -> i32 { let mut value = 0; NSOpenGLPixelFormat::getValues_forAttribute_forVirtualScreen_( *pixelformat, ...
Rust
0
::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 12); self.0 |= value << 12; self } #[doc="Receiver wakeup method"] #[inline] pub fn wake(&self) -> ::bobbin_bits::U1 { ...
Rust
0
tput.append(t.id) output.append(t.conf) output.append(t.cls) output.append(t.det_ind) outputs.append(output) outputs = np.asarray(outputs) return outputs # id, class_id, conf def joint_stracks(tlista, tlistb): exists = {} res = [] for t in ...
Python
1
_err(RafsError::SwapBackend) } fn destroy(&mut self) { let state = DirectMappingState::new(&RafsSuperMeta::default(), false); self.state.store(Arc::new(state)); } fn get_blob_infos(&self) -> Vec<Arc<BlobInfo>> { self.state.load().blob_table.entries.clone() } } <filename>cl...
Rust
0
""" Given an integer N , Print all binary strings of size N which do not contain consecutive 1s. A binary string is that string which contains only 0 and 1. Example 1: Input: N = 3 Output: 000 , 001 , 010 , 100 , 101 Explanation: None of the above strings contain consecutive 1s. "110" is not an answer as it has '1's...
Python
1
eader_block.as_ref())?; }, Frame::GoAway { stream_id } => { b.put_varint(GOAWAY_FRAME_TYPE_ID)?; b.put_varint(octets::varint_len(*stream_id) as u64)?; b.put_varint(*stream_id)?; }, Frame::MaxPushId { push_id } => { ...
Rust
0
emplateVocab[template] = placeHolder elif template not in templateVocab: tokens = template_tokens[template] wordCounter = Counter(tokens) for token in tokens: simple_words = like_camel_to_tokens(token) emb = np.zeros(emb...
Python
1
.fmtstr += mavfmt(f) m.order_map = [ 0 ] * len(m.fieldnames) for i in range(0, len(m.fieldnames)): m.order_map[i] = m.ordered_fieldnames.index(m.fieldnames[i]) print("Generating %s" % filename) outf = open(filename, "w") generate_preamble(outf) generate_msg_table(outf, msgs)...
Python
1
Ok(WORDS_IN_README), ); }) }) as fn(_) -> _, ) } #[test] fn decode_async_std() { quickcheck( (|ops: PartialWithErrors<GenWouldBlock>| { let buf = include_bytes!("../README.md"); async_std::task::block_on(async { ...
Rust
0
DR: i32 = 5; pub const KBD_FILENAME: i32 = 6; pub const KBD_URL: i32 = 7; pub const KBD_DATE: i32 = 8; pub const KBD_TIME: i32 = 9; pub const KBD_DATETIME: i32 = 10; pub const KBD_HEX: i32 = 11; pub const KBD_HOURS: i32 = 12; pub const KBD_UPPER: i32 = 16; pub const KBD_LOWER: i32 = 32; pub const KBD_FIRSTUPPER: i32 = ...
Rust
0
from django.utils.translation import gettext_lazy as _ from temba.channels.views import AuthenticatedExternalClaimView from temba.contacts.models import URN from ...models import ChannelType class MbloxType(ChannelType): """ A Mblox channel (https://www.mblox.com/) """ code = "MB" category = Ch...
Python
1
print("ID:D1345159") print("Name:HongJingTang")
Python
1
joint, second_disjoint, self_less, .. } => { if self_less { pop_start(first_disjoint); push_end(second_disjoint); } else { pop_end(second_disjoint); ...
Rust
0
"size": 45, "color": COLORS["black"], "fillcolors": { "normal": "#7AFF16", "hover": "#5AC707", "pressed": "#439B02", } } } SINGLEBTN_DESIGN = { "place": (SCREEN_CENTER[0]-150,SCREEN_CENTER[1]+50), "size": (300,100), "text": "Solo", ...
Python
1
match action { VerifyAction::Ok => (), VerifyAction::Wait => { // put block_data back to pending_block match &mut pending_block.state { PendingBlockState::Downloaded { block_data: bd, .. } => *bd = block_data, _ => unreachable!("qed"), }; // put pending_block back self.pe...
Rust
0
/ 发送命令 S{ href: String, hint: String, } } impl<'lua> ToLua<'lua> for &Label { fn to_lua(self, lua: &'lua Lua) -> mlua::Result<Value<'lua>> { let tb = match self { Label::None => return Ok(Value::Nil), Label::H(n) => { let table = lua.create_ta...
Rust
0
c = "Bits 0:9 - Slave Device ID"] #[inline(always)] pub fn slave_dev_id(&self) -> SLAVE_DEV_ID_R { SLAVE_DEV_ID_R::new((self.bits & 0x03ff) as u16) } #[doc = "Bit 12 - 10-bit ID Mode"] #[inline(always)] pub fn ten_bit_id_mode(&self) -> TEN_BIT_ID_MODE_R { TEN_BIT_ID_MODE_R::new((...
Rust
0
2c1); let discr = srad * srad + dot * dot - c2c1.length_squared(); if discr > 0.0 { let dist = -(dot + discr.sqrt()) * inv_rv_len; if dist >= 0.0 && dist <= 1.0 { return Some((dist, (c2c1 + rv * dist) / srad)); } } None } fn poly_poly_sweep(b1: &Body, p1: &Poly, b2: &...
Rust
0
ive(Debug, Size, ToBytes, FromBytesWithInput, Header)] pub struct Ifaddrmsg { /// Interface address family pub ifa_family: RtAddrFamily, /// Interface address prefix length pub ifa_prefixlen: libc::c_uchar, /// Interface address flags pub ifa_flags: IfaFFlags, /// Interface address scope ...
Rust
0
can_validate_dag_config() { let dag_config = create_dag_config(); assert!(dag_config.validate()); } #[test] fn it_can_take_config_to_dag() { init_logger(); // create from config let dag_config = create_dag_config(); let result_dag = Dag::from(dag_config); info!("Comparing DAG"); print...
Rust
0
)), ]; schema_definition.append(&mut transfer_schema_definition); Schema::new(schema_definition) } pub fn remove_exchange_offer_transaction_schema() -> Schema { let mut schema_definition = schema_common_definition(); let mut transfer_schema_definition: Vec<Box<dyn SchemaAttribute>> = vec![ ...
Rust
0
+= tv2; let mut tv4 = gxd.square(); tv2 = gx1 * gxd; tv4 *= tv2; let y1 = tv4.pow_vartime(&Self::PARAMS.c1) * tv2; let x2n = tv3 * x1n; let y2 = y1 * Self::PARAMS.c2 * tv1 * self; tv2 = y1.square() * gxd; let e2 = tv2.normalize().ct_eq(&gx1.normalize(...
Rust
0
olumn Operation command"] pub mod cau_aesic_ca4; #[doc = "General Purpose Register 5 - AES Inverse Column Operation command\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust...
Rust
0
dp[i]; ans = cnt[i]; // 重置计数 } else if dp[i] == max_len { ans += cnt[i]; } } ans } } fn main() { { let nums = vec![1, 3, 5, 4, 7]; assert_eq!(Solution::find_number_of_lis(nums), 2); } { let nums = vec![2, ...
Rust
0
)) # Plot historical data plt.plot(self.analyzer.processed_data.index, self.analyzer.processed_data['sales'], label='Historical Sales') # Plot forecast plt.plot(self.forecast_data.index, self.forecast_data['sales_foreca...
Python
1
#[display("[23]")] Reg23 = 22, /// Register with index `[24]` #[display("[24]")] Reg24 = 23, /// Register with index `[25]` #[display("[25]")] Reg25 = 24, /// Register with index `[26]` #[display("[26]")] Reg26 = 25, /// Register with index `[27]` #[display("[27]")] ...
Rust
0
at_response.text) # Multilingual tip translation lang = st.selectbox("🌍 Translate tip to:", ["English", "Hindi", "Spanish", "Tamil"]) if st.session_state.tip and lang != "English": translate_prompt = f"Translate this disposal instruction to {lang}: {st.session_state.tip}" translated = model.generate_content(t...
Python
1
Return a single example from an article JSON record.""" def _strip(collection): return [item.strip() for item in collection] if "Answer" in article: answer = article["Answer"] answer_dict = { "aliases": _strip(answer["Aliases"]), "normalized_aliases": _strip(ans...
Python
1
class: &'s str, message: &'s str) -> Self { Self { class, message: Some(message), } } /// Parses a Throwable from the a line of a full Java StackTrace. /// /// # Example /// ```rust /// use proguard::Throwable; /// /// let parsed = Throwable::try_...
Rust
0
] first. //! We also have several [How-to guides][how-to] to help you use `tbot`. //! You can always refer to our API docs on [_docs.rs_][api-docs] //! (also, docs for `master` are available [here][master-docs]). //! //! If you have a question, ask it in [our group] on Telegram. If you find //! a bug, file an issue on ...
Rust
0
pm.eval("{a = 9}", evalOpts) except Exception as e: assert str(e).__contains__("ReferenceError: assignment to undeclared variable a") def test_globalThis(): obj = pm.eval('globalThis') assert str(obj).__contains__("{'python': {'pythonMonkey':") def test_console_globalThis(): temp_out = StringIO() sy...
Python
1
Plane::new(blk_w, blk_h, 0, 0, 0, 0); if fi.config.speed_settings.diamond_me { let predictors = vec![best_mv]; diamond_me_search( fi, &po, &fs.input.planes[0], &rec.frame.planes[0], &predictors, fi.sequence.bit_depth, pmv, lambda, mvx_min, mvx_ma...
Rust
0
nupg-v1-002", true); // RSA msg_test!(msg_gnupg_v1_003, "gnupg-v1-003", false); msg_test!(msg_gnupg_v1_4_11_001, "gnupg-v1-4-11-001", true); msg_test!(msg_gnupg_v1_4_11_002, "gnupg-v1-4-11-002", false); msg_test!(msg_gnupg_v1_4_11_003, "gnupg-v1-4-11-003", true); msg_test!(msg_gnupg_v1_4_11_004, "gnupg-v1-4-11-004", t...
Rust
0
k prices for " + exchange) else: logger.error(exchange +" empty mark prices") logger.error("Unable to collect mark prices for " + exchange) return True try: if config["mark_prices"]["store_type"] == "timeseries": self.mark_prices_db.insert_many(mark_prices) elif...
Python
1
graph' plugin. Must be 'latest-0', 'latest-2', or an exact version preceeded with an '='.", &plugin_version))?; Ok(Plugin::Supergraph(federation_version)) } else { Err(anyhow!( "Invalid plugin name {}. Possible values are [supergraph].", ...
Rust
0
for Socket { #[inline] fn as_raw_fd(&self) -> RawFd { self.fd() } } #[cfg(feature = "std")] impl std::os::unix::io::IntoRawFd for Socket { #[inline] fn into_raw_fd(self) -> RawFd { self.into_fd() } } impl From<Socket> for FileDesc { #[inline] fn from(s: Socket) -> Self...
Rust
0
rocess in parallel parameters["std_out_all_processes"] = False; # Load mesh from file mesh = Mesh(DOLFIN_EXAMPLE_DATA_DIR+"/lshape.xml.gz") # Define function spaces (P2-P1) V = VectorFunctionSpace(mesh, "Lagrange", 2) Q = FunctionSpace(mesh, "Lagrange", 1) # Define trial and test functions u = TrialFunction(V) p = T...
Python
1
ad2ee15d0c"), tag: &hex!("33afec59c45baf689a5e1b13ae423619"), }, TestVector { key: &hex!("2d176607883aface75011d14818f1be6"), nonce: &hex!("02162c3635bf6d543e1cc148"), plaintext: &hex!("71905ad5df601d056effd80dd7333662"), aad: &hex!(""), ciphertext: &hex!("1b68598...
Rust
0
import matplotlib.pyplot as plt import pandas as pd def plot_stride_rate_fluctuations(all_players_data, frame_num,active_ids): plt.figure(figsize=(8, 6)) # Color palette for different players (e.g., a set of distinct colors) colors = plt.cm.get_cmap('tab10', len(all_players_data)) # 'tab10' provides 10 di...
Python
1
d to get child UUID."); // Only update the state of the child that has changed. Do not // update the other children or "clean shutdown" information. // This should only be called on a child state change. nexus_info.children.iter_mut().for_each(|c| { ...
Rust
0
: A, b: B) -> C where A: Mul<B, Output = C>, { a * b } pub fn div<A, B, C>(a: A, b: B) -> C where A: Div<B, Output = C>, { a / b } impl<A, R> Node for Box<dyn Fn(A) -> R> { type Return = Self; fn eval(self) -> Self::Return { self } } impl<T> Node for Box<T> { type Return = T; ...
Rust
0
: String, pub nonce: String, pub encoded_payload: String, pub uri_path: String, } impl SignatureInput { // Kraken's doc provide a formula for the API signature at the following URL: // https://docs.kraken.com/rest/#section/Authentication/Headers-and-Signature // This yields the following algori...
Rust
0
import discord import os from dotenv import load_dotenv from datetime import datetime from openai import OpenAI load_dotenv() TOKEN = os.getenv("DISCORD_TOKEN") OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") client_ai = OpenAI(api_key=OPENAI_API_KEY) intents = discord.Intents.default() intents.message_content = True i...
Python
1
= np.zeros_like(thresholds) # compute recall for each IoU threshold for i, t in enumerate(thresholds): recalls[i] = (gt_overlaps >= t).sum() / float(num_pos) ar = recalls.mean() # print results print('average recall for {}: {:.3f}, number:{}...
Python
1
import matplotlib.pyplot as plt import random from typing import List def is_sorted(arr: List[int]) -> bool: """ Check if the array is sorted. """ return all(arr[i] <= arr[i + 1] for i in range(len(arr) - 1)) def bogoSort(arr: List[int]) -> None: """ Bogo Sort algorithm """ while not is_sorted(arr): ...
Python
1
size, ProbT)>, b_curr: &[ProbT], num_states: usize, norm: ProbT, fprob: &[Vec<ProbT>], ) { let is_valid_state = |state: usize| match state { //0 | 1 | 2 | 4 | 10 | 11 => true, 0 | 1 | 2 | 3 | 8 | 9 | 11 => true, //0 | 1 => true, _ => false, }; let probs: Vec...
Rust
0
# Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2024 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import fields, models class BasePartnerMergeAutomaticWizard(models.TransientModel): _inherit = "base.partner.merge.automatic.wizard" gro...
Python
1
="49514"/> <Channel>Linux-Sysmon/Operational</Channel> <Computer>tux</Computer> <Security UserId="0"/> </System>"#; let mut tokenizer = xmlparser::Tokenizer::from(xml); let system = System::try_from(&mut tokenizer)?; assert_eq!( system, Syste...
Rust
0
import torch import torch.nn as nn from oil.model_trainers import Trainer from lie_conv.lieConv import PointConv, Pass, Swish, GlobalPool from lie_conv.lieConv import norm, LieResNet, BottleBlock from lie_conv.utils import export, Named from lie_conv.datasets import SO3aug, SE3aug from lie_conv.lieGroups import SE3 imp...
Python
1
pub fn new(from: Option<EmailAddress>, to: Vec<EmailAddress>) -> EmailResult<Envelope> { if to.is_empty() { return Err(Error::MissingTo); } Ok(Envelope { forward_path: to, reverse_path: from, }) } /// Destination addresses of the envelope ...
Rust
0
from typing import Type from eth.abc import ChainDatabaseAPI from eth.chains import Chain from trinity._utils.async_dispatch import async_method from trinity.db.eth1.chain import AsyncChainDB from .base import AsyncChainAPI class AsyncChainMixin(AsyncChainAPI): chaindb_class: Type[ChainDatabaseAPI] = AsyncChai...
Python
1
( conn.as_raw_fd(), // src.as_ptr() as *const iovec, cmp::min(src.len(), c_int::max_value() as usize) as c_int, ) }; Ok(res as usize) }) } fn poll_flush(self: Pin<&mut Self>, _: &mut task::Context<'_>) -...
Rust
0
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
Python
1
(mount_command); } let cache_command = SubCommand::with_name("build") .about("Creates the cache to be used") .arg( Arg::with_name("root") .value_name("ROOT_DIR") .required(true) .help("set root directory from which the cache will be cr...
Rust
0
from django.forms import ModelForm from .models import Investment class InvestmentForm(ModelForm): class Meta: model = Investment fields = '__all__'
Python
1
401.into() ); } use regex::Regex; use super::Linke; pub fn parse_linke(input: &str) -> Result<Linke, String> { let single_re = Regex::new(r"^\d+\.{0,1}\d*$").unwrap(); let monthly_re = Regex::new(r"^(\d+\.{0,1}\d*,){11}\d+\.{0,1}\d*$").unwrap(); if single_re.is_match(input) { let single_lin...
Rust
0
} // Step 3 of the scheme's accumulation decider, as detailed in BCLMS20. let a_times_blinded_witness = matrix_vec_mul( &decider_key.a, &instance.r1cs_input, &witness.r1cs_blinded_witness, ); let b_times_blinded_witness = matrix_vec_mul( ...
Rust
0
x85, // ADD A,L 0xC6, 0x44, // ADD A,0x44 ] ); // ADD A, r cpu.registers.a = 0x44; cpu.registers.c = 0x11; cpu.execute_next_instruction(&mut bus); assert_eq!(0x55, cpu.registers.a); // ADD A, n cpu.registers.a = 0x23; ...
Rust
0
with other commonly-used crypto libraries. let Key { n, e, n_bits } = Key::from_modulus_and_exponent(n, e, params.min_bits, max_bits, 3)?; // The signature must be the same length as the modulus, in bytes. if signature.len() != n_bits.as_usize_bytes_rounded_up() { return Err(error::Unspecified); ...
Rust
0
f, "Flags(0x{:02X}: ToW({}), WN({}), UTC({}))", self.0, self.time_of_week_valid(), self.week_number_valid(), self.utc_valid() ) } } impl fmt::Display for UtcTime { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writ...
Rust
0
High frame rate camera headlight control :param value: [0, 100] ''' self.Headlight_client.wait_for_service() request = HeadlightRequest() request.Headlight = value try: response = self.Headlight_client.call(request) if isinstance(response, Head...
Python
1
nd optional images """ message: dict[str, str | list[str]] = {"role": "user", "content": content} if images: message["images"] = images return message def predict(self, image: str | Path, prompt: Prompt) -> str: """Predict whether an image contains anomalies. ...
Python
1
lib::*; use ::alloc::boxed::Box; #[repr(align(4096))] struct Page([u8; 12000]); #[no_mangle] pub unsafe extern "C" fn kernel_bootstrap() -> ! { disable_interrupts!(); kernel::mem::setup_memory(); kernel::idt::setup_idt(); kernel::apic::setup_apic(); drivers::acpi::setup_acpi(); exec_with_new...
Rust
0
ight.size(0))).float() if m.bias is not None: m.bias.data = torch.tensor(np.random.randn(*list(m.bias.size())) / np.sqrt(m.bias.size(0))).float() phi_std.apply(init_weights) phi.apply(init_weights) for i in range(1): test_input = torch.randn(100, ...
Python
1
fn Tcl_ZlibStreamInit( interp: *mut Tcl_Interp, mode: ::std::os::raw::c_int, format: ::std::os::raw::c_int, level: ::std::os::raw::c_int, dictObj: *mut Tcl_Obj, zshandle: *mut Tcl_ZlibStream, ) -> ::std::os::raw::c_int; } extern "C" { pub fn Tcl_ZlibStreamGetComm...
Rust
0
,13,21,34,1000,D,55..89"); } #[test] fn write_from_locals() { const fn inner(f: &mut Formatter<'_>) -> Result<(), Error> { let foo = 13u8; let bar = "58"; innerb(f, foo, bar) } const fn innerb(f: &mut Formatter<'_>, foo: u8, bar: &str) -> Result<(), Error> { writec!( ...
Rust
0
impl DFIntegerType for UInt8Type {} impl DFIntegerType for UInt16Type {} impl DFIntegerType for UInt32Type {} impl DFIntegerType for UInt64Type {} impl DFIntegerType for Int8Type {} impl DFIntegerType for Int16Type {} impl DFIntegerType for Int32Type {} impl DFIntegerType for Int64Type {} impl DFIntegerType for Date32...
Rust
0
= pickle.load(f) except FileNotFoundError as e: print(f"Error loading data files: {e}") print(f"Please ensure {dataset_path}/ contains eod_data.pkl, mask_data.pkl, gt_data.pkl, price_data.pkl") exit() # Verify stock_num if data is loaded (e.g., from eod_data shape) if eod_data.shape[0] != s...
Python
1
fy!(sfSoundStreamChunk)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<sfSoundStreamChunk>())).samples as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sfSoundStreamChunk), "::", stringify!(samples) ) );...
Rust
0
rig_recon_psnr / len(eval_dataloader) def main(): conf_path = Path(Path(__file__).parent.parent, 'conf', sys.argv[1]) conf = OmegaConf.load(conf_path) train_dataset = ImageDataset( orig_img_path=conf.train_data_path, sigma=conf.noise_sig, patchnum=conf.patch_num ...
Python
1
_training_datasets_name.append(ds_name) all_training_datasets_meta.append(meta_info) all_training_datasets_weight[ds_name] = ds_config.weight all_training_datasets.append(training_dataset) # to ensure the consistency of n_obs_img_steps and n_pred_img_steps across all datasets if...
Python
1
public_key_for_reflect, PeerTicketPublicKey::mut_public_key_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::<PeerTicketPublicKey>( "PeerTicketPublicKey", fields, file_descriptor_proto() ...
Rust
0
} // end of check_transpose_owned } // end of module test<filename>tests/command/test_wrap.rs use branchless::core::effects::Effects; use branchless::core::eventlog::testing::{get_event_replayer_events, redact_event_timestamp}; use branchless::core::eventlog::{Event, EventLogDb, EventReplayer}; use branchless::core:...
Rust
0
.as_str())?), None => None, }; let config = Config { admin, denom: msg.denom, unstaking_duration: msg.unstaking_duration, }; CONFIG.save(deps.storage, &config)?; set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; Ok(Response::new()) } #[cfg_a...
Rust
0
import numpy as np def solve_cramers_rule(coeff_matrix, const_vector): """ Solves a system of linear equations using Cramer's Rule. Parameters: coeff_matrix (list of list of floats): The coefficient matrix of the system. const_vector (list of floats): The constant terms vector. Returns: l...
Python
1
let mut cindex: HashMap<usize, usize> = HashMap::new(); let mut current: usize = 0; for node in 0..size { let nindex = index[node] - 1; let pos: usize; if cindex.contains_key(&nindex) { pos = *cindex.get(&nindex).unwrap(); } else { ...
Rust
0
#!/usr/bin/env python3 from typing import Tuple import torch as th import numpy as np ########################################################################## # Sine/Cosine Positional Embedding Functions # ########################################################################## # http...
Python
1
e: CMuVarNode, cur_stack_clause: CMuCurStackClause, new_stack_clause: CMuNewStackClause, exc_clause: CMuExcClause, keepalive_clause: CMuKeepaliveClause ) { let mut _arg_b = from_MuIRBuilder_ptr(b); let mut _arg_id = from_MuID(id); let mut _arg_result_ids = from_MuID_array(result_ids, n_resul...
Rust
0
from setuptools import setup # import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215) import multiprocessing assert multiprocessing def get_long_description(): desc = '' with open('./README.md') as f: desc = f.read() return desc setup( name='pip-conflict-chec...
Python
1
id': video_data.get('id'), 'title': title, 'thumbnail': video_data.get('data-thumbnail'), 'timestamp': timestamp, 'ie_key': 'N1InfoAsset'}) embedded_videos = re.findall(r'(<iframe[^>]+>)', webpage) for embedded_video in embedded_videos: ...
Python
1
import random from random import random import discord from discord.ext import commands from discord.commands import Option #Importing the packages from discord.commands import slash_command class Fun(commands.Cog): def __init__(self, bot):#to Initialise self.bot = bot @slash_command(guild_ids=[......
Python
1
(); nrf24.set_rf(&nrf24::DataRate::R2Mbps, 3).unwrap(); nrf24.set_pipes_rx_lengths(&[Some(32),None,None,None,None,None]).unwrap(); nrf24.set_pipes_rx_enable(&[true, false, false, false, false, false]).unwrap(); nrf24.set_auto_ack(&[false; 6]).unwrap(); nrf24.set_crc(nrf24::CrcMod...
Rust
0
se: data.extend(self.socket.recv(slices)) break except Exception as e: if opcode == "04": self.recvQ.put(("04", '1', None)) elif opcode == "11": self.recvQ.put(("11", '1', path, selected_path, None)) eli...
Python
1
from enum import Enum import random class Suite(Enum): '''花色''' SPADE, HEART, CLUB, DIAMOND = range(4) class Card: '''牌''' def __init__(self, suite, face): self.suite = suite self.face = face def __repr__(self): suites = '♠♥♣♦' faces = ['', 'A', '2', '3', '4', '5',...
Python
1
str> { self.find_ns(qname).map(|(_, host)| host).next() } fn find_ns<'a>(&'a self, qname: &'a str) -> impl Iterator<Item = (&'a str, &'a str)> { self.authorities .iter() .filter_map(|e| match e { Record::NS { domain, host, .. } => Some((domain.as_str(), ...
Rust
0
ider[i : i + window_size, ch] += window # Normalize the result by the overlap count sub = np.where(divider > 1e-6, sub / divider, sub) sub_size = np.abs(sub).mean() sub_mapper = {**sub_mapper, **{sub_size: sub}} # print("SUB_LEN", len(list(sub_mapper.values()))) sub = ensemble...
Python
1
"no primary monitor - cannot create fullscreen window" )) })?; glfw.create_window( width as u32, height as u32, title, WindowMode::FullScreen(m), ) ...
Rust
0
#!/usr/bin/env python3 """ Download all TensorFlow event files from the specified jobs' output files. """ import argparse import os import os.path as osp import subprocess import time from multiprocessing import Process def get(job_id, out_dir): print("Listing files...") cmd = "floyd data listfiles {}/outpu...
Python
1
` enum. /// /// This enum has the following variants: /// /// - [`Xevie::Datatype::Unmodified`](XCB_XEVIE_DATATYPE_UNMODIFIED) /// - [`Xevie::Datatype::Modified`](XCB_XEVIE_DATATYPE_MODIFIED) pub type xcb_xevie_datatype_t = u32; /// The `Xevie::Datatype::Unmodified` enum variant. /// /// This is a variant of [`xcb_xevi...
Rust
0