text
string
label_name
string
labels
int64
<f64> + Copy> UniformSphereSample for Vector2<N> { #[inline] fn sample<F: FnMut(Vector2<N>)>(mut f: F) { for sample in SAMPLES_2_F64.iter() { f(Cast::from(*sample)) } } } impl<N: Cast<f64> + Copy> UniformSphereSample for Vector3<N> { #[inline] fn sample<F: FnMut(Vect...
Rust
0
bis::ServerResponse; use httpbis::SinkAfterHeaders; use httpbis::SinkAfterHeadersBox; use std::mem; pub(crate) enum ServerResponseUntypedSink { Headers(ServerResponse), AfterHeaders(SinkAfterHeadersBox), Done, } impl SinkUntyped for ServerResponseUntypedSink { fn poll(&mut self, cx: &mut Context<'_>) ...
Rust
0
st.mark.parametrize("dtype", [torch.bfloat16, torch.float16]) def test_half_precision_models(dtype): model_id = "hf-internal-testing/tiny-random-OPTForCausalLM" model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=dtype) tokenizer = AutoTokenizer.from_pretrained(model_id) inputs = tokenize...
Python
1
al results compared with the non-orthogonalized version. As with the Girard-Hutchinson estimator, it requires $\mathbb{E}[\omega] = 0$ and $\mathbb{E}[\omega \omega^T] = \mathbf{I}$. """ sampler: AbstractSampler = SphereSampler() improved: bool = True def estimate(self, key: PRNGKeyArray, op...
Python
1
// ((c1 < 6) AND (c2 > 5)) OR (c2 > 5) let expr = binary_expr(l, Operator::Or, r); // no rewrites if c1 can be null let expected = expr.clone(); assert_eq!(simplify(expr), expected); } #[test] fn test_simplify_or_and_non_null() { let l = col("c2_non_null").g...
Rust
0
sv = Array::of2(&out, &err).unchecked_into(); Ok(jsv) */ //Ok(JsValue::from_serde(&(out, err)).unwrap()) JsValue::from_serde(&(out, err)).map_err(|_| JsValue::from(err)) } fn err_encode(err: &str) -> ResultJJ { /* let (out, err) = (JsValue::from(out), JsValue::from(err)); let jsv = Array::of2(&out,...
Rust
0
timestamp() store("some", name, value, timestamp) return {"fuck"} end "#; let mut worker = Worker::new(code, chans, runtime.handle()).unwrap(); let now = std::time::SystemTime::now(); for i in 0..1_000_000 { worker.run(good_metric.clone()).unwrap(); } ...
Rust
0
21 = 20, USART2 = 28, WWDG = 0, } unsafe impl cortex_m::interrupt::InterruptNumber for InterruptEnum { #[inline(always)] fn number(self) -> u16 { self as u16 } } declare!(ADC1_COMP); declare!(AES_LPUART1); declare!(DMA1_Channel1); declare!...
Rust
0
Box::new(Ether::new(level))]), }; map.insert(key.to_string(), items); map } impl Default for Chest { fn default() -> Self { Self { gold: 0, sword: None, shield: None, items: HashMap::new(), } } } #[cfg(test)] mod tests { use super...
Rust
0
self.variant(WMENB_A::WMENB_0) } #[doc = "Write mask is enabled, DQS(RWDS) pin will be driven by FlexSPI as write mask output when writing to external device."] #[inline(always)] pub fn wmenb_1(self) -> &'a mut W { self.variant(WMENB_A::WMENB_1) } #[doc = r"Sets the field bit"] ...
Rust
0
u16; } fn top_left_coarse_y_scroll(&self) -> u8 { ((self.vram_address_top_left >> 5) & 0b11111) as u8 } fn set_top_left_coarse_y_scroll(&mut self, coarse_y: u8) { // clear second 5 bits self.vram_address_top_left &= 0xFC1F; // copy new value self.vram_address_to...
Rust
0
import numpy as np import pytest from sklearn.utils.estimator_checks import parametrize_with_checks from sklego.decomposition import UMAPOutlierDetection pytestmark = pytest.mark.umap @parametrize_with_checks([UMAPOutlierDetection(n_components=2, threshold=0.1, n_neighbors=3)]) def test_sklearn_compatible_estimator...
Python
1
.len() <= MAX_INLINE_LENGTH { assert!(!compact.is_heap_allocated()); } else { assert!(compact.is_heap_allocated()); } } use amethyst::{ assets::{AssetStorage, Handle, Loader}, core::transform::Transform, input::{is_close_requested, is_key_down, VirtualKeyCode}, prelude::*, re...
Rust
0
"BigInteger"), Float => write!(f, "Float"), Tuple => write!(f, "Tuple"), List => write!(f, "List"), Map => write!(f, "Map"), Closure => write!(f, "Closure"), ProcBin => write!(f, "ProcBin"), HeapBinary => write!(f, "HeapBinary"), ...
Rust
0
Some(Token::Op(Operator::Plus))), MINUS => (false, Some(Token::Op(Operator::Minus))), SLASH => (false, Some(Token::Op(Operator::Div))), N0 | N1 | N2 | N3 | N4 | N5 | N6 | N7 | N8 | N9 => { state = match state { LexerState::Normal => LexerState::Re...
Rust
0
0] - self.seq_len) wav = wav[offset : offset + self.seq_len] # add random gaussian noise if self.gaussian_augmentation_config and self.gaussian_augmentation_config["p"]: if random.random() < self.gaussian_augmentation_config["p"]: ...
Python
1
e_record_rowid( table_def.option.full_table_name.clone(), rowid.as_ref(), ); log::debug!("record_rowid_key: {:?}", record_rowid_key); let result = store_engine.delete_key(record_rowid_key); if let Err(e) = result { re...
Rust
0
, sentence.5, sentence.6], }) } named!(pub (crate) parse_gsv<GsvData>, map_res!( do_parse!( number_of_sentences: opt!(map_res!(take_until!(","), parse_num::<u16>)) >> char!(',') >> sentence_num: opt!(map_res!(take_until!(","), parse_num::<u16>)) >> char!(...
Rust
0
import RPi.GPIO as GPIO M0 = 14 GPIO.setmode(GPIO.BCM) GPIO.setup(M0, GPIO.OUT) while True: GPIO.output(M0, GPIO.HIGH)
Python
1
= "#e74c3c" else: countdown_text = f"⏰ 剩余时间:{minutes}分{seconds:02d}秒" countdown_color = "#2c3e50" if self.countdown_label: self.countdown_label.config(text=countdown_text, fg=countdown_color) # 减少1秒 self.remaining_seconds -= 1 ...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. from .rtmcc_head import RTMCCHead from .rtmcc_head_3d import RTMCCHead3D from .simcc_head import SimCCHead __all__ = ['SimCCHead', 'RTMCCHead', 'RTMCCHead3D']
Python
1
tack:tt) => { block!(@scan $paren $life $ret ($($tail)*) -> ($($out)* $head) $stack) }; // reformats arguments when popping a context off the tree walker stack // TODO this could be folded into the @scan rules that call it, to reduce recursion depth (@up $life:tt $ret:ident $thing:tt (($paren:t...
Rust
0
d(msg='不存在任何权限组') for group in groups: auths = db.session.query( manager.auth_model.auth, manager.auth_model.module ).filter_by(soft=False, group_id=group.id).all() auths = [{'auth': auth[0], 'module': auth[1]} for auth in auths] res = _split_modules(auths) seta...
Python
1
# 计算损失 loss = loss_fn(y_pred, y) #print(y,y_pred) avg_loss = avg_loss + loss.item()/10 # 反向传播和优化 optimizer.zero_grad() loss.backward() for name, param in model_emb.named_parameters(): if param.grad is not None: ...
Python
1
# Copyright 2025 The Magenta Authors. # # 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 agreed to in ...
Python
1
ssibly no surface extracted from the level set.') return # convert back to world coordinates vertices = verts + np.array( [grid['xyz'][0][0], grid['xyz'][1][0], grid['xyz'][2][0]]) if color_func is not None: # color is extracted by pas...
Python
1
[doc(alias = "M")] #[doc(alias = "M1")] #[doc(alias = "M2")] pub const fn client_proof(&self) -> &[u8; PROOF_LENGTH as usize] { self.client_proof.as_le() } /// Called `A` in [RFC2945](https://tools.ietf.org/html/rfc2945). /// Also sometimes referred to as `a`, although this is the abbre...
Rust
0
import pandas as pd file_path = "E:\Internship\Ass 2\diamonds.csv" diamonds = pd.read_csv(file_path) diamonds_cleaned = diamonds.dropna(subset=['carat', 'cut']) diamonds_numeric = diamonds_cleaned.select_dtypes(include='number') print(diamonds_numeric.shape) print(diamonds_numeric.head())
Python
1
.y / relative_stop.x opening_slope = (center_slope * -1) ** -1 opening_y_intercept = (end_center_pos.x * opening_slope) - end_center_pos.y # Find needed x coordinates of outer points # x = dist / sqrt(1 + slope^2) first_x = end_center_pos.x + (dist / math.sqrt(1 + (opening_sl...
Python
1
color = input("enter a color : ") plural_noun = input("enter a plural noun: ") celebrity = input("enter a celebrity: ") print ("roses are " +color) print (plural_noun + " heare blue") print ("I love " + celebrity )
Python
1
figEP.axes[0].xaxis.set_ticklabels([]) figEP.axes[1].xaxis.set_ticklabels([]) figEP.suptitle('Principal components of one-electron images,\n' + cap, fontsize=11) plt.text(0.05, 0.05, 'DoTC={0:.3f}'.format(dotcP), ...
Python
1
import os import sys import toml from setuptools import setup try: from setuptools_rust import RustBin except ImportError: import subprocess subprocess.check_call([sys.executable, "-m", "pip", "install", "setuptools-rust"]) if sys.platform == "linux": os.environ["RUSTFLAGS"] = ( "-C link-arg...
Python
1
Address(c)); } constraints } fn generate_constraint(f: &Field, c: &Constraint) -> proc_macro2::TokenStream { match c { Constraint::Init(c) => generate_constraint_init(f, c), Constraint::Zeroed(c) => generate_constraint_zeroed(f, c), Constraint::Mut(c) => generate_constraint_mut(f, c...
Rust
0
ALL: pv_cmd_id = 6; pub type pv_cmd_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct kvm_pv_cmd { pub cmd: u32, pub rc: u16, pub rrc: u16, pub data: u64, pub flags: u32, pub reserved: [u32; 3usize], } pub const sev_cmd_id_KVM_SEV_INIT: sev_cmd_id = 0; pub...
Rust
0
W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(...
Rust
0
# coding: utf-8 import nose.tools as nt from IPython.core.splitinput import split_user_input, LineInfo from IPython.testing import tools as tt tests = [ ('x=1', ('', '', 'x', '=1')), ('?', ('', '?', '', '')), ('??', ('', '??', '', '')), (' ?', (' ', '?', '', '')), (' ??', (' ', '??', '', '')), ...
Python
1
fmt::skip] static DATA: &[u8] = &[ 0xe0, 0x7f, 0x10, 0x00, // (7FE0, 0010) PixelData b'O', b'B', // VR 0x00, 0x00, // reserved 0xff, 0xff, 0xff, 0xff, // length: undefined // -- 12 -- Basic offset table 0xfe, 0xff, 0x00, 0xe0, // item star...
Rust
0
done(&self) -> bool { self.base.is_done() } } use crate::mac::Poly1305; use crate::mem::constant_time_eq; mod chacha20; use self::chacha20::Chacha20; /// ChaCha20 and Poly1305 for OpenSSH Protocols (<EMAIL>) /// /// <https://github.com/openbsd/src/blob/master/usr.bin/ssh/PROTOCOL.chacha20poly1305> #[deriv...
Rust
0
1750, 1800, 2000, 2150, 2300] # actor = [1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1] # style = [['di...
Python
1
::YES; #[cfg(target_os = "macos")] use std::mem; #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] use ash::extensions::khr::XlibSurface; use ash::extensions::{ ext::DebugReport, khr::{Surface, Swapchain}, }; #[cfg(target_os = "windows")] use ash::extensions::khr::Win32Surface; #[cfg(tar...
Rust
0
# callback=callback) # my_board.set_pin_mode_dht(9, sensor_type=22, differential=20.0, # callback=callback) # my_board.set_pin_mode_dht(10, sensor_type=22, differential=20.0, # ...
Python
1
까지 탐색 for page in range(1, 6): # 기업 리스트 대기 WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.XPATH, "//div[@data-sentry-element='Tabs.Content' and contains(@id, '-content-corp')]//a[@data-sentry-element='BaseLink']")) ) # 기업 리스트 ...
Python
1
ProgressDetails. :type: list[oci.devops.models.DeployStageExecutionStep] """ self._steps = steps @property def rollback_steps(self): """ Gets the rollback_steps of this DeployStageExecutionProgressDetails. Details about all the rollback steps for one target envir...
Python
1
g1', 'ting2', 'ting3', 'ting4', 'tong1', 'tong2', 'tong3', 'tong4', 'tong5', 'tou1', 'tou2', 'tou3', 'tou4', 'tou5', 'tu1', 'tu2', 'tu3', 'tu4', 'tuan1', 'tuan2', 'tuan3', 'tuan4', 'tui1', 'tui2', 'tui3', 'tui4', 'tun1', 'tun2', 'tun3', 'tun4', 'tuo1', 'tuo2', 'tuo3', 'tuo4', 'wa1', 'wa2', 'wa3', 'wa4', 'wa5', 'wai1', ...
Python
1
output()); RADIO_BUSY = Some(radio_busy); RNG = Some(rng); ANT_SW = Some(AntSw { ant_en: ant_en.into_push_pull_output(), se_csd: se_csd.into_push_pull_output(), se_cps: se_cps.into_push_pull_output(), se_ctx: se_ctx.into...
Rust
0
str>().copied()) .unwrap_or(""); let location = info.location(); unsafe { let _ = match location { Some(loc) => { let file = loc.file(); let line = loc.line(); let column = loc.column(); externs::register_panic( ...
Rust
0
checkList = [0]*4 # 'A', 'C', 'G', 'T' 확인 myList = [0]*4 check = 0 # 새로 들어온 문자를 처리하는 함수 def myadd(c): global checkList, myList, check # 전역변수 if c == 'A': myList[0] += 1 # 현재 상태 리스트에서 A 1 증가 if myList[0] == checkList[0]: # 현재 상태와 체크 리스트가 같다면 check += 1 # 충족한 문자의 수 1 증가 eli...
Python
1
# -*- coding: utf-8 -*- """Exceptions for the vcfpy module""" __author__ = "Manuel Holtgrewe <manuel.holtgrewe@bihealth.de>" class VCFPyException(RuntimeError): """Base class for module's exception""" class InvalidHeaderException(VCFPyException): """Raised in the case of invalid header formatting""" clas...
Python
1
########################################################################## # # Copyright (c) 2009-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
Python
1
translation = { "aiCommentary": "AI Commentary", "askAI": "Bible Q&amp;A with AI", "bibleAnswers": "Bible Answers", "experimental": "experimental", "menu1_app": "UniqueBible", "menu1_screenSize": "창 크기", "menu1_preferences": "UBA 환경 설정", "menu1_generalPreferences": "일반", "menu1_fullS...
Python
1
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ie form fields. tests = r""" # IECountySelect ######################################################### >>> from django.contrib.localflavor.ie.forms import IECountySelect >>> f = IECountySelect() >>> f.render('counties', 'dublin') u'<select name="counties">\...
Python
1
import geocoder def get_address_with_geocoder(latitude, longitude): g = geocoder.osm([latitude, longitude], method='reverse') if g.ok: return g.address else: return "Manzil topilmadi" # Foydalanish latitude = 41.351816 longitude = 69.215185 print(get_address_with_geocoder(latitude, longitu...
Python
1
used_variables)] #[allow(dead_code)] pub struct Uri { scheme: Option<String>, authority: Option<Authority>, } #[allow(unused_variables)] #[allow(dead_code)] impl Uri { fn parse_scheme(uri: &str) -> Option<String> { let authority_or_path_delimiter_position = uri.find('/'); let colon_after_sc...
Rust
0
raw_pkt).to_string(); debug!("Raw GDB packet: {}", pkt); if pkt == "qSupported" || pkt.starts_with("qSupported:") { Ok(GdbCommand::SupportedQueries(pkt)) } else if pkt == "D" { Ok(GdbCommand::Disconnect) } else if pkt == "QStartNoAckMode" { Ok...
Rust
0
e) == 2: bins_med = np.tile(bins_med, (spectra.shape[0], 1)) elif len(spectra_linear.shape) == 3: bins_med = np.tile(bins_med, (spectra.shape[0], spectra.shape[1], 1)) kurt = np.nansum(spec_med * (bins_med - mean_vel) ** 4 * diffs, axis=-1) / ref return kurt / spec_width**4 def _get_noise_...
Python
1
Algorithm::Naive, false); let opt = Output::compute(&all_facts, Algorithm::DatafrogOpt, true); assert_eq!(naive.borrow_live_at, opt.borrow_live_at); } } macro_rules! tests { ($($name:ident($dir:expr, $fn:expr),)*) => { $( #[test] fn $name() -> Result<(), Error> ...
Rust
0
import torch from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk import numpy as np from FlexReg_Method.propagation import Dilation def drawPatch(outlinePoints: list,polydata,mid,index:int): step = 0.2 radius = 0.5 # celui de Nathan radius = 1.1 P0 = torch.tensor(np.array(outlinePoints)).uns...
Python
1
= r#"Parsed email from <NAME>: <div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">order_ship via procurement</strong> <span dir="auto">&lt;;</span><br>Date: Fri, Aug 13, 2021 at 9:41 PM<br>Subjec...
Rust
0
.read_n(pointer, str_len) .ok_or_else(|| CodeEndedAt("string data".to_string()))?; let str = String::from_utf8(str_data).map_err(|_err| StringConstantParsingError)?; Ok(JexConstant::String(str)) } fn parse_function_constant( bytes: &RawBytes, pointer: &mut RawBytesPointer, ) -> Result<...
Rust
0
sed for ratelimiting special routes. /// /// This is needed because `hyper`'s `Method` enum does not derive Copy. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum LightMethod { /// Indicates that a route is for the `DELETE` method only. Delete, /// Indicates that a route is for the `GET` method o...
Rust
0
(self.prev_index.option().unwrap()), // ) // .field( // "value", // &self.list.read_data_in_node_at(self.index.option().unwrap()), // ) // .finish() // } // } impl<T, Idx, Kind, const N: usize> fmt::Debug for SortedLinkedList<T, Idx, K...
Rust
0
x25519::X25519KeyPair, }; #[cfg(test)] pub mod test { use crate::{didcore::Config, KeyPair, Payload}; use super::*; #[test] fn test_demo() { let secret_key = "<KEY>"; let public_key = "<KEY>"; let sk = Ed25519KeyPair::from_seed(bs58::decode(secret_key).into_vec().unwrap().a...
Rust
0
array1: *const u16, length1: u32, array2: *const u16, length2: u32, output: *mut u16, ) -> u32; } extern "C" { /// A fast SSE-based difference function. pub fn difference_vector16( A: *const u16, s_a: usize, B: *const u16, s_b: usize, ...
Rust
0
tprintfunc(v: HSQUIRRELVM) -> SQPRINTFUNCTION; pub fn sq_geterrorfunc(v: HSQUIRRELVM) -> SQPRINTFUNCTION; pub fn sq_suspendvm(v: HSQUIRRELVM) -> SQRESULT; pub fn sq_wakeupvm(v: HSQUIRRELVM, resumedret: SQBool, retval: SQBool, raiseerror: SQBool, throwerror: SQBool) -> SQRESULT; pu...
Rust
0
.into_iter() .map(test_utils::make_span) .collect::<Vec<_>>(); f(tcx, body_id, &body_with_facts.body, spans); }); } #[test] fn test_span_to_places() { let src = r#"fn foo(`(z)`: i32){ let `(x)` = 1; let y = 1; `(x + y)`; `(x)` + y; `(x + )`y; ...
Rust
0
from protowhat.sct_syntax import EagerChain, ExGen, LazyChainStart, state_dec_gen, LazyChain from pythonwhat.checks.check_wrappers import scts from pythonwhat.State import State from pythonwhat.probe import Node, Probe, TEST_NAMES from pythonwhat.utils import include_v1 from pythonwhat import test_funcs from functools ...
Python
1
from django import forms from users.models import CustomUser class UpdateProfileForm(forms.ModelForm): class Meta: model = CustomUser fields = ('username', 'first_name', 'last_name', 'email','profile_picture') class RegisterForm(forms.ModelForm): class Meta: model = CustomUser ...
Python
1
ntext, (n, m).into()) }; array.copy_from(&src); dst.copy_from(&array); dbg!(dst.as_slice()); for i in 0..n { assert_eq!(dst[i], 2_u32); } Ok(()) } #[test] fn memcpy_d2a2d_1d() -> Result<()> { let device = Device::nth(0)?; let conte...
Rust
0
"""As walk1Dp.py but with computing statistics.""" import random import time, sys import numpy from scitools.std import plot, savefig, compute_histogram random.seed(11) try: np = int(sys.argv[1]) ns = int(sys.argv[2]) except IndexError: np = 100 # no of particles ns = 100 # no of steps positions =...
Python
1
load_m128i(&self) -> [__m128i; 8] { let ptr = &self.data as *const _ as *const __m128i; [ _mm_loadu_si128(ptr), _mm_loadu_si128(ptr.add(1)), _mm_loadu_si128(ptr.add(2)), _mm_loadu_si128(ptr.add(3)), _mm_loadu_si128(...
Rust
0
ideonormalizedrect) /// struct. #[cfg_attr(docsrs, doc(cfg(feature = "dshow")))] #[repr(C)] #[derive(Default, Copy, Clone, PartialEq)] pub struct MFVideoNormalizedRect { pub left: f32, pub top: f32, pub right: f32, pub bottom: f32, } impl std::fmt::Display for MFVideoNormalizedRect { fn fmt(&self, f:...
Rust
0
_with_str(&mut self, current: Option<Vec<&'a Value>>, key: &'a str) -> Option<Vec<&'a Value>> { if current.is_none() { debug!("collect_all_with_str: {}, {:?}", key, &current); return current; } let ret = ValueWalker::all_with_str(current.as_ref().unwrap(), key); ...
Rust
0
lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the System.Windows.Media.TextHintingMode of the System.Windows.Media.Visual. """ VisualTextRenderingMode=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the System.Windows.Media.TextRenderingMode of...
Python
1
_idx=pack_dict[MODEL_NAME][3], ) else: mod = mod["main"] # Compile Relay program with AlterOpLayout disabled with vta.build_config(disabled_pass={"AlterOpLayout", "tir.CommonSubexprElimTIR"}): lib = relay.build( mod, target=tvm.target.Target(target, host=env.target_h...
Python
1
x: *mut liquid_float_complex, _y: *mut liquid_float_complex, ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct msresamp2_cccf_s { _unused: [u8; 0], } pub type msresamp2_cccf = *mut msresamp2_cccf_s; extern "C" { pub fn msresamp2_cccf_create( _type: ::std::os::raw::c_int, _num_...
Rust
0
#!/usr/bin/python3 """Script that reads stdin line by line and computes metrics.""" import sys import signal file_size = 0 status_counts = { 200: 0, 301: 0, 400: 0, 401: 0, 403: 0, 404: 0, 405: 0, 500: 0 } line_count = 0 def print_stats(): """Prints the statistics collected s...
Python
1
X@7690,0|\ Y@8054,0|\ Z@8386,0|\ A@8708,0" ); } #[test] fn morx_31_008() { assert_eq!( shape( "tests/fonts/text-rendering-tests/TestMORXThirtyone.ttf", "\u{004D}\u{0050}\u{0051}\u{0052}\u{0042}\u{0058}\u{0059}\u{005A}\u{0042}", "--ned --rem...
Rust
0
# ex079: Desenvolva um aplicativo que leia o peso e a altura de 5 pessoas, mostrando no final: # a) Qual foi a média de altura do grupo # b) Quantas pessoas pesam mais de 90Kg # c) Quantas pessoas que pesam menos de 50Kg e tem menos de 1.60m # d) Quantas pessoas que medem mais de 1.90m e pesam mais de 100Kg. alturas =...
Python
1
idden, num_embed, num_label, dropout=0.): seqidx = 0 embed_weight=mx.sym.Variable("embed_weight") cls_weight = mx.sym.Variable("cls_weight") cls_bias = mx.sym.Variable("cls_bias") param_cells = [] last_states = [] for i in range(num_lstm_layer): param_cells.append(LSTMParam(i2h_weigh...
Python
1
enum value"), } match type_ { GL_DEBUG_TYPE_ERROR => println!("Type: Error"), GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR => println!("Type: Deprecated Behaviour"), GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR => println!("Type: Undefined Behaviour"), GL_DEBUG_TYPE_PORTABILITY => println!("Type: Por...
Rust
0
.iter() .map(|c| c.to_string()) .collect::<Vec<String>>() .join("; "); let req = c .get(URL) .header("user-agent", USER_AGENT) .header("cookie", cookie_header) .build() .unwrap(); let rsp = c.execute(req).await; match rsp { Ok(r) => {...
Rust
0
>= 2 = false); } #[test] fn test_const_collections() { let object = rune!(runestick::Object => pub fn main() { VALUE } const VALUE = #{};); assert!(object.is_empty()); let tuple = rune!(runestick::Tuple => pub fn main() { VALUE } const VALUE = ();); assert!(tuple.is_empty()); let tuple = rune!(r...
Rust
0
/ 4) } fn aead_poly1305(tag_out: &mut [u8; aead::TAG_LEN], chacha20_key: &chacha::Key, counter: &chacha::Counter, ad: &[u8], ciphertext: &[u8]) { debug_assert_eq!(counter[0], 0); let key = poly1305::Key::derive_using_chacha(chacha20_key, counter); let mut ctx = poly1305::SigningContext::f...
Rust
0
import logging import yaml def load_config(config_file: str) -> dict: ''' config_file: input config file path return: a dict of configuration ''' # make filters pretty def pretty_filters(**config) -> dict: keywords = dict() EXCAPE = '\"' QUOTA = '' # NO-USE O...
Python
1
pass else: print('No Improvement, stopped') m_nn = tf.keras.models.load_model( f'{model_output_folder}/tmp.h5', custom_objects={'logloss': logloss}) print(loop, 'loop ---> After Non-frozen-step ...
Python
1
_gr3_srcpos = src_arr_label.lad_pos(casl2::Register::Gr3), size = src_arr_label.size(), copy = copystr )); self.code(recovers); self.return_if_temp_arr_label(src_arr_label); self.return_if_temp_arr_label(dst_arr_label); self.return_temp_int_var_label(temp...
Rust
0
: usize = 10; enum CMD { ExecCMD(Rc<RefCell<ExecCmd>>), RedirCMD(Box<RedirCMD>), PipeCMD(Box<PipeCMD>), ListCMD(Box<ListCMD>), BackCMD(Box<BackCMD>), } struct ExecCmd { pub argv: [*const u8; MAXARGS], pub eargv: [*mut u8; MAXARGS], } struct RedirCMD { pub cmd: CMD, pub file: *cons...
Rust
0
Framebuffer { #[inline] pub fn info(&self) -> &FramebufferInfo { &self.inner.info } #[inline] pub(super) fn new( info: FramebufferInfo, owner: WeakDevice, handle: vk1_0::Framebuffer, index: usize, ) -> Self { resource_allocated(); Frameb...
Rust
0
use] extern crate quote; macro_rules! format_ident { ($ident:expr, $fstr:expr) => { syn::Ident::new(&format!($fstr, $ident), $ident.span()) }; } pub struct Contract { pub trait_name: proc_macro2::Ident, pub endpoint_name: proc_macro2::Ident, pub client_name: proc_macro2::Ident, pub str...
Rust
0
eKmap; let mut m: [Option<Parser>; 256] = [None; 256]; let mut fill = |kmap: ByteKmap, parser| { for i in kmap.enumerate().iter() { // Don't overwrite things. This makes it easier to do things like the "HALT" cut out // in the ld block. if m[*i as usize].is_none() ...
Rust
0
ckground_color: Color, pub widgets: [button::State; 5], pub is_exit: bool, pub is_shown: bool, pub pre_kind: ControlType, pub kind: ControlType, pub now: chrono::DateTime<chrono::Local>, proxy: EventLoopProxy<Message>, monitor_visible: bool, sound_visible: bool, battery_visible: ...
Rust
0
able => main_ui_disabled = false, UiToggle::Disable => main_ui_disabled = true, } }; _msg: GetUiStateRequest =!> { tracing::debug!("Received get ui state request"); answer!(ctx, GetUiStateResponse(main_ui_disabled)).expect("unab...
Rust
0
import logging from freqtrade.constants import Config from freqtrade.enums import RunMode from freqtrade.exceptions import OperationalException from freqtrade.exchange import available_exchanges, is_exchange_known_ccxt, validate_exchange from freqtrade.exchange.common import MAP_EXCHANGE_CHILDCLASS, SUPPORTED_EXCHANGE...
Python
1
from pytest import fixture from lambda_function.lambdabot import LambdaBot import json import requests import os os.environ['AWS_ACCESS_KEY_ID'] = "derp" os.environ['AWS_SECRET_ACCESS_KEY'] = "merp" class dummy_response(object): def __init__(self, text): self.text = text @fixture def bot(): return ...
Python
1
__all__ = [ "ID", "Mutation", "Query", "Subscription", "graphql_schema", "interface", "relay", "resolver", ] try: from .schema import ID, Query, Mutation, Subscription, graphql_schema from .interfaces import interface from .resolvers import resolver from . import relay ...
Python
1
import pytest from networkx import DiGraph from networkx.utils import graphs_equal from dvc.repo.graph import get_subgraph_of_nodes @pytest.mark.parametrize( "nodes,downstream,expected_edges", [ ([], False, {1: [2, 3], 2: [4, 5], 3: [6, 7], 8: [9]}), ([1], False, {1: [2, 3], 2: [4, 5], 3: [6,...
Python
1
/// <details class="rustdoc-toggle top-doc"> /// <summary class="docblock">zh-cn</summary> /// s中最后一个满足函数f的unicode码值的位置i,不存在则返回-1。 /// </details> /// /// # Example /// /// ``` /// use gostd::strings; /// /// let f = |x: u32| char::from_u32(x).unwrap().is_ascii_digit(); /// /// assert_eq!(5, strings::LastIndexFunc...
Rust
0
if = "Option::is_none")] #[serde(deserialize_with = "fix_common::workarounds::from_opt_str")]// https://github.com/serde-rs/serde/issues/1183 #[serde(default)] #[serde(rename = "2539")] pub tot_no_party_detail_reports: Option<i32>, /// TotNoEntitlementReports #[serde(skip_serializing_if = "Option::is_none")] #[s...
Rust
0
from arm.logicnode.arm_nodes import * class DrawPolygonNode(ArmLogicTreeNode): """Draws a polygon. @input Draw: Activate to draw the polygon on this frame. The input must be (indirectly) called from an `On Render2D` node. @input Color: The color of the polygon. @input Filled: Whether the polyg...
Python
1
nviron.get('SECRET_KEY') or secrets.token_urlsafe(32) def get_secret_key(self) -> str: """Get the main secret key.""" return self.secret_key def generate_api_key(self) -> str: """Generate a new API key.""" return secrets.token_urlsafe(32) def generate_user_id(s...
Python
1