text
string
label_name
string
labels
int64
str<E>(self, input: &str) -> Result<Self::Value, E> where E: de::Error { return self.visit_string(input.to_string()); } fn visit_string<E>(self, input: String) -> Result<Self::Value, E> where E: de::Error { // template aliases match input.as_ref() { ...
Rust
0
rain if hook_type == "gradient_tape_callback_error" else helper_keras_fit ) helper() assert error_handling_agent.disable_smdebug is True with open(stack_trace_filepath) as logs: stack_trace_logs = logs.read() # check that one error was caught assert stack_trace_...
Python
1
: Res<AssetServer>, mut pathfinding_map: ResMut<PathfindingMap>, mut wardens: Query<(&Position, &Direction, &mut Action), With<Warden>>, mut doors: Query<(Entity, &GridPosition, &Door, &ItemInfo)>, prisoners: Query<(Entity, &Position, &SpawnPoint), (With<Prisoner>, With<Escaping>)>, broken_wires: Qu...
Rust
0
] as u16) << 8 | bytes[1] as u16; if rh > MAX_HUMIDITY { return Err(SensorError::HumidityTooHigh); } let celsius = (bytes[2] as u16) << 8 | bytes[3] as u16; if bits.len() >= 40 { let cksum: u8 = bits[32..40] .iter() .enumerate() .map(|(idx, &x)| x << (7 - idx)) ...
Rust
0
Its API may change at anytime. /// A procedural macro that parses a string literal or an inline stylesheet into a [`Sheet`]. /// /// Please consult the documentation of the [`macros`](crate::macros) module for the supported syntax of this macro. /// /// # Warning /// /// Use of this macro is discouraged. /// /// Any p...
Rust
0
os((len(train_subj))) skf = StratifiedKFold(n_splits=n_folds, random_state=42, shuffle=True) for fold, (train_ind, val_ind) in enumerate(skf.split(fake_tr , fake_tr_la)): print('FOLD:', fold+1, 'TRAIN:', len(train_ind), 'VALIDATION:', len(val_ind)) train_index, val_index = train...
Python
1
refers to a side (north, south, east, or west) that the window will "stick" to. If both n and s (or e and w) are specified, the window will be stretched to fill the entire height (or width) of its cavity. width size Specify a width for the window. The...
Python
1
from django.db import models NULLABLE = {"null": True, "blank": True} class Manufacturer(models.Model): """Модель производителя.""" MANUFACTURER_TYPE = ( ('factory', 'Завод'), ('retail network', 'Розничная сеть'), ('sole proprietor', 'Индивидуальный предприниматель'), ) name...
Python
1
f32; for ii in 0..numBoxIndex { let boxIndex3D = self.unmorton(boxIndexFull[ii]); boxCenter.x = boxMin.x + (boxIndex3D.x as f32 + 0.5) * boxSize; boxCenter.y = boxMin.y + (boxIndex3D.y as f32 + 0.5) * boxSize; boxCenter.z = boxMin.z + (boxIndex3D.z as f32 + 0.5) * boxSize; for i in 0....
Rust
0
re: Texture<'t>, layout: PhantomData<SL>, } impl<'t, SL: SpritesheetLayout> Spritesheet<'t, SL> { pub fn new(texture_creator: &'t TextureCreator<WindowContext>, spritesheet: &str) -> Self { let texture = texture_creator .load_texture(Path::new(spritesheet)) .unwrap(); S...
Rust
0
chart_view::ChartViewBarLabelPosition; use crate::proto::render::ChartView; use lc_render::BarLabelPosition; // Get bar label position from protobuf. pub(crate) fn get_bar_label_position(view: &ChartView) -> Result<BarLabelPosition, RendererError> { match ChartViewBarLabelPosition::from_i32(view.bar_label_position...
Rust
0
mod parse; <reponame>SimonCadge/ttspico-rs // Copyright (c) 2019 <NAME> <<EMAIL>> // // 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 //...
Rust
0
stf.set_peak_start( gDurations[n]+70.12, True )) ): return -1 if ( not(stf.set_peak_end( gDurations[n]+70.12+gPeakWindowSize, True )) ): return -1 if ( not(stf.set_base_start( gDurations[n]+70-1, True )) ): return -1 if ( not(stf.set_base_end( gDurations[n]+7...
Python
1
{ if event.args.len() > 1 { (&*event.args[0], Some(event.args[1..].join(" "))) } else { (&*event.args[0], None) } } else { (event.channel(), Some(event.args.join(" "))) }; event.client.part(channel, reason); event.client.reply_notice(event, format...
Rust
0
sts() { return Ok(()); } info!("generating sources index"); let path = PathBuf::from([dist_base, "/", component, "/source/"].concat()); fs::create_dir_all(&path)?; Command::new("apt-ftparchive") .arg("sources") .arg(pool_path) .stderr(Stdio::inherit()) .stdo...
Rust
0
gister"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::TX_DAC_PA { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { ...
Rust
0
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
1
.post_tx(&tx_add_assets); testkit.create_block(); // check post response assert_eq!(status, StatusCode::Created); assert_eq!(response, Ok(Ok(TransactionResponse { tx_hash }))); let (_, tx_status) = api.get_tx_status(&tx_add_assets); assert_eq!(tx_status, Ok(Err(Error::InsufficientFunds))); } ...
Rust
0
# Imports ###################### import numpy as np import matplotlib.pyplot as plt from matplotlib import colors import random # Main ######################### def main(): """ Main Function Call """ # Functions #################### def simple_array_plot(A,label_colors =None): figure, ax = plt.subplots() ...
Python
1
, V> where F: Float + 'a, FF: NumCast, V: Vector<F>, { CombiIter { cur: 0, choices: choices, _marker: PhantomData, } } /// Trait that allows flat mapping inplace. pub trait Inplace<T> { /// Does flat map inplace without maintaining order of elements. fn flat_map_inpl...
Rust
0
Returns: """ # 卡住的进程状态 TASK_INTERRUPTIBLE1 = "__skb_wait_for_more_packets" TASK_INTERRUPTIBLE2 = "futex_wait_queue_me" shell_output = "" try: shell_output = self.adb.shell("ps -A| grep minicap") except: try: shell_output...
Python
1
import pandas as pd # Function to find Var Selected for df_2 based on df_1 def populate_var_selected(df_1, df_2): # Create a set of tuples (Var A, Var B, Var Selected) and (Var B, Var A, Var Selected) from df_1 for easy lookup df_1_pairs = {} for _, row in df_1.iterrows(): key1 = (row['Var A'], r...
Python
1
ic [u8] = include_bytes!("data/encode_webm_test.webm"); } <reponame>bytewax/bytewax //! Internal code for writing to recovery stores. //! //! For a user-centric version of recovery, read the //! `bytewax.recovery` Python module docstring. Read that first. //! //! Because the recovery system is complex and requires coor...
Rust
0
til.Process(os.getpid()).memory_info().rss / 1024 ** 3 print(f"avg_cache_usage:{pipeline_opt_metrics.avg_cache_usage:.2f}% max_cache_usage:{pipeline_opt_metrics.max_cache_usage:.2f}% rss_usage:{rss_usage_gb:.3f} GB") print() max_cache_usage = pipeline_opt_metrics.max_cache_usage ...
Python
1
first argument by matching. fn read(code: &mut [Morphism; 2], a: Morphism, neg: bool) -> bool { if code[0] == a { if neg {*code = [code[1], code[0]]}; true } else if code[1] == a { if !neg {*code = [code[1], code[0]]}; true } else { ...
Rust
0
num_side_faces } #[inline] fn dependent_dim_for_oshape_side(&self, os: OShape, sf: SideFace) -> Dim { self.oshapes[*os].dep_dims_by_side_face[*sf] } #[inline] fn fe_inclusions_of_nb_side(&self, nbsn: NBSideNum) -> NBSideInclusions { self.nbsideincls_by_nbsidenum[*nbsn] } #[inline] // Retur...
Rust
0
import pytest import requests_mock as r_mock from shellhub import ShellHub from tests.utils import MOCKED_DOMAIN_URL @pytest.fixture(scope="function") def shellhub(): with r_mock.Mocker() as m: # Mock the login URL login_url = f"{MOCKED_DOMAIN_URL}/api/login" mock_response = { ...
Python
1
doc = "Bit 18 - This bit configures the level of output signal in CHANNEL%s when the latter is in IDLE state."] #[inline(always)] pub fn idle_out_lv_ch0(&self) -> IDLE_OUT_LV_CH0_R { IDLE_OUT_LV_CH0_R::new(((self.bits >> 18) & 0x01) != 0) } #[doc = "Bit 19 - This is the output enable-control bit...
Rust
0
T: Parse, Op: Copy + Peek + FnOnce(Any) -> T, F: FnOnce(Vec<Regex>) -> Regex, { let head = input.call(higher)?; let mut tail = vec![]; while input.peek(op) { input.parse::<T>()?; let expr = input.call(higher)?; tail.push(expr); } if tail.is_empty() { Ok(h...
Rust
0
'''Crie um programa que imprima "Olá, mundo!" na tela''' print("Olá, mundo!")
Python
1
if let Some(token) = self.syntax().and_then(|s| s.as_token()) { let mut text = token.text().to_string(); // SAFETY: we're replacing single-byte characters. unsafe { for b in text.as_bytes_mut() { if *b == b' ' || *b == b'...
Rust
0
# coding=utf-8 # Copyright (C) 2019 Alibaba Group Holding Limited # # 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 app...
Python
1
# 📄 tools/rollback_analytics.py """ Скрипт отката: отключает стек аналитики v2 и возвращает проект к v1. Поддерживает параметры: --config ../core/config.py --backup analytics_old/analytics_v1_backup.py --target analytics/analytics_v1_backup.py """ import os from pathlib import Path import argparse def ...
Python
1
import sys import os sys.path.append(os.path.join(os.getcwd(), 'path', 'to', 'directory')) os.chdir(os.path.join(os.getcwd(), 'path', 'to', 'directory')) from utility_functions import * import numpy as np from pls_analysis import pls_analysis import matplotlib.pyplot as plt data = from_pkl('final_data_expanded.pkl') n...
Python
1
def f(s): return ''.join(reversed(s.rstrip()))
Python
1
Terms, expiration_block: &T::BlockNumber, call: bool, seed: u8, ) -> Result<(AddressId<<T>::Hash>, AskOrderId<T::BlockNumber, T::Hash>, Vec<u8>), crate::Error<T>> { let hex_addr = &format!("f04349B4A760F5Aed02131e0dAA9bB99a1d1da{:02x}", seed)[..]; let address_id = register_eth_addr::<T>(who, hex_addr); let guid =...
Rust
0
e)) }).map_err(|e| Error::from(e)) ) } use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "t", content = "c")] pub enum DockerImageType { File(String), Image(String), } <reponame>TyOverby/rust-hl-lua<filename>hlua/src/userdata.rs use std::any::TypeId; use std...
Rust
0
from django.db import models class Product(models.Model): title = models.CharField('Название', max_length=100) price = models.IntegerField('Цена') description = models.TextField() catagory = models.CharField('Категория', choices=[('Первая', 'Первая'), ('Вторая', 'Вторая...
Python
1
("actors initiated"); Ok(collect_actors) } fn start_actor(actor:&Actor,secure:&String,base_dir:&String,app_dir:&String,session:&io::Session,composer:&io::Composer,node:&io::Node) -> Result<(),String> { if actor.r#type == "files".to_string() { let actor_path = format!( "{}{} --secure={} ...
Rust
0
[`cookie_store::CookieStore`] wrapped internally by a [`std::sync::Mutex`], suitable for use in /// async/concurrent contexts. #[derive(Debug)] pub struct CookieStoreMutex(Mutex<CookieStore>); impl Default for CookieStoreMutex { /// Create a new, empty [`CookieStoreMutex`] fn default() -> Self { Cookie...
Rust
0
"ndash" => "–" &[0x6e, 0x64, 0x61, 0x73, 0x68, ] => Some(&[0xe2, 0x80, 0x93, ]), //"oelig" => "œ" &[0x6f, 0x65, 0x6c, 0x69, 0x67, ] => Some(&[0xc5, 0x93, ]), //"compfn" => "∘" &[0x63, 0x6f, 0x6d, 0x70, 0x66, 0x6e, ] => Some(&[0xe2, 0x88, 0x98, ]), //"lAarr" => "⇚" ...
Rust
0
import os # PostgresSQL POSTGRES_USER = os.getenv('POSTGRES_USER', 'postgres') POSTGRES_PASSWORD = os.getenv('POSTGRES_PASSWORD', 'postgres') POSTGRES_DB = os.getenv('POSTGRES_DB', 'inventory') POSTGRES_HOST = os.getenv('POSTGRES_HOST', 'localhost') POSTGRES_PORT = os.getenv('POSTGRES_PORT', '5432') # Redis REDIS_HOS...
Python
1
import torch import cv2 import open3d as o3d def depth_to_points(datasets,depth,c2w,image=None): W ,H = datasets.W ,datasets.H CX,CY = datasets.cx ,datasets.cy FX,FY = datasets.fx ,datasets.fy x_grid, y_grid = torch.meshgrid(torch.arange(W).cuda().float(), to...
Python
1
pub fn default(t: T) -> Spanned<T> { Spanned::new(Default::default(), t) } } impl<T> Deref for Spanned<T> { type Target = T; fn deref(&self) -> &T { &self.value } } impl<T> DerefMut for Spanned<T> { fn deref_mut(&mut self) -> &mut T { &mut self.value } } impl<T:...
Rust
0
transaction hash that can be used on a later run with `--resume`. async fn broadcast<T, U>( signer: &SignerMiddleware<T, U>, legacy_or_1559: TypedTransaction, ) -> Result<(TransactionReceipt, U256), BroadcastError> where SignerMiddleware<T, U>: Middleware, { tracing::debug!("sending transaction: {:?}", ...
Rust
0
def sum_mix(arr): return sum(int(x) for x in arr)
Python
1
Equivalent to ak.argmin(ak.nan_to_none(array)) with all other arguments unchanged. See also #ak.argmin. """ # Dispatch yield (array,) # Implementation return _impl( ak.operations.ak_nan_to_none._impl(array, True, behavior, None), axis, keepdims, ...
Python
1
# -*- coding:utf-8 -*- # # Copyright (C) 2015, Maximilian Köhl <mail@koehlma.de> # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 3.0 of the License, or # (at your option)...
Python
1
import os import numpy as np import pytest import torch import torchcrepe ############################################################################### # Testing fixtures ############################################################################### @pytest.fixture(scope='session') def activation_full(): "...
Python
1
from janito.llm.provider import LLMProvider from janito.llm.model import LLMModelInfo from janito.llm.auth import LLMAuthManager from janito.llm.driver_config import LLMDriverConfig from janito.drivers.openai.driver import OpenAIModelDriver from janito.tools import get_local_tools_adapter from janito.providers.registry...
Python
1
u8>, features_: GdbConnectionFeatures, connection_alive_: bool, /// client supports multiprocess extension multiprocess_supported_: bool, } impl GdbConnection { pub const CPU_64BIT: u32 = 0x1; pub const CPU_AVX: u32 = 0x2; pub const CPU_64BIT_AND_CPU_AVX: u32 = 0x1 | 0x2; pub fn new(tg...
Rust
0
::align_of::<virtio_scsi_cmd_req>(), 1usize, concat!("Alignment of ", stringify!(virtio_scsi_cmd_req)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<virtio_scsi_cmd_req>())).lun as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringi...
Rust
0
ogress: gr.Progress) -> str: """結果をオーバーレイ描画した動画を生成する""" output_filename = f"output_event_detection_{int(time.time())}.mp4" w, h = features["original_size"] out_writer = cv2.VideoWriter(output_filename, cv2.VideoWriter_fourcc(*'mp4v'), features["fps"], (w, h)) for idx, frame in enumerate(progress.tq...
Python
1
d) @pytest.mark.parametrize( "data", [ [(["1", "2", "3"], cudf.Decimal64Dtype(1, 0))], [ (["1", "2", "3"], cudf.Decimal64Dtype(1, 0)), (["1.0", "2.0", "3.0"], cudf.Decimal64Dtype(2, 1)), (["10.1", "20.2", "30.3"], cudf.Decimal64Dtype(3, 1)), ], ...
Python
1
Kana key. Kana, /// The KanaLock key. KanaLock, /// The KpLeft key. KpLeft, /// The KpDown key. KpDown, /// The KpRight key. KpRight, /// The KpUp key. KpUp, /// The Left key. Left, /// The ParenthesisLeft (() key. ParenthesisLeft, /// The ParenthesisRigh...
Rust
0
iveToken>() { while !parser.is_empty() { directives.push(parser.parens(|p| p.parse())?); } } else { let module = parser.parse::<Wat>()?; directives.push(WastDirective::Wat(QuoteWat::Wat(module))); } Ok(Wast { directives }) } } ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from odoo import fields, models, api _logger = logging.getLogger(__name__) try: from num2words import num2words except ImportError: _logger.warning("The num2words python library is not installe...
Python
1
tudy.GetCircuit().GetComponent("CS4").SetValue("Frequency", "freq") study.GetCircuit().GetComponent("CS2").SetValue("Frequency", "freq") # max_nonlinear_iteration = 50 # study.GetStudyProperties().SetValue(u"NonlinearMaxIteration", max_nonlinear_iteration) study.GetStudyProperties()...
Python
1
111,d1111,e11111\n\ a2,b22,c222,d2222,e22222\n\ a3,b33,c333,d3333,e33333\n\ a4,b4,,,"; let n0 = b','; let n1 = b'\n'; let mut bf = bufchr::iter::Bufchr2::new(haystack, n0, n1); // line 1 let no_0 = bf.next(); println!("{}", no_0.unwrap() == 2); let no_1 = bf.next(); ...
Rust
0
== points_nd.T[i, :]): pn = np.delete(pn, i, axis=1) logging.info(f"Convex hull lower dimensional - removing dimension {i}") remove_dim.append(i) hull = ConvexHull(pn, qhull_options="QG0") logging.info("done calculating hull") hull.remove_dim = remove_dim return hu...
Python
1
at(u32), UnknownAccessQualifier(u32), UnknownLoopControl(u32), UnknownSelectionControl(u32), } impl Display for ReadError { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for ReadError { fn description(&self) -> &str { use s...
Rust
0
the diff to send back to tendermint let (diff, add, remove) = calculate_diff(validators.clone(), old_validators); let update_members = RewardsDistribution::UpdateMembers { add: add.clone(), remove: remove.clone(), }; if cfg.verify_validators { // pending validators are validato...
Rust
0
(m.migrate()) } else if let Ok(m) = bincode::deserialize::<ver_5f166d::Session>(data) { info!("Migrating torrent session from v5f166d"); Some(m.migrate()) } else if let Ok(m) = bincode::deserialize::<ver_8e1121::Session>(data) { info!("Migrating torrent session from v...
Rust
0
let layout_favorite_color = ui::GridLayout::new(1, 2, vec![label_favorite_color, palette_favorite_color.clone()], 0.0, 0.0, 0.02, 0.0, 0.0, 0.01, rect_renderer.clone()); let buttons_birthmonth: Vec<Rc<RefCell<ui::Button>>> = (0..13).map(|i| {ui::Button::new(ID_B...
Rust
0
mp=True) nojump = stack_effect(code, 0, jump=False) if code in has_jump or code in has_exc: self.assertEqual(common, max(jump, nojump)) else: self.assertEqual(jump, common) self.assertEqual(nojump, common) ...
Python
1
error); } })); } mpb.listen(); for child in jobs { let _ = child.join(); } } <filename>src/core/analysis/whitespace_tokenizer.rs // Copyright 2019 Zhizhesihai (Beijing) Technology Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not...
Rust
0
import os from utils.data_operation import IMGDataset, read_csv_normal, \ load_mask_component, load_mask_object from utils.visualization import result_heatmap import time def get_heatmap(pathManager, config): """ 图片可视化结果,保存在 ./visualization_result/class/version/heatmap/model/... """ folder_pa...
Python
1
def __init__(self, vocab_file, do_lower_case=True, do_basic_tokenize=True, never_split=None, unk_token='<unk>', sep_token='<sep>', pad_token= '<pad>', cls_token='<cls>', mask_token='<mask>', bos_token='<s>', eos_token='</s>', tokenize_chinese_chars=True, strip_accents=None, **kwargs ): super().__ini...
Python
1
Enum_ImGuiSetCond_ = c_uint; pub const ImGuiSetCond_Always: c_uint = 1; pub const ImGuiSetCond_Once: c_uint = 2; pub const ImGuiSetCond_FirstUseEver: c_uint = 4; pub const ImGuiSetCond_Appearing: c_uint = 8; #[repr(C)] #[derive(Copy)] pub struct ImVector<T> { pub Size: c_int, pub Capacity: c_int, pub Data...
Rust
0
Self(rads.to_degrees()) } /// Convert a degree value into radians. pub fn into_radians(self) -> f64 { self.0.to_radians() } } impl From<f64> for Degrees { fn from(degrees: f64) -> Self { Self(degrees) } } impl Into<f64> for Degrees { fn into(self) -> f64 { ...
Rust
0
class HesapMakinesi: def topla(self, n1, n2): return n1 + n2 def cikar(self, n1, n2): return n1 - n2 def carp(self, n1, n2): return n1 * n2 def bol(self, n1, n2): return n1 / n2 hesaplayici = HesapMakinesi() print(f""" {hesaplayici.topla(10, 5)} ...
Python
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
Python
1
} async fn raise_system_frequency( flash_acr: reg::flash::Acr<Srt>, // pwr_cr: reg::pwr::Cr<Srt>, rcc_pllcfgr: reg::rcc::Pllcfgr<Srt>, rcc_cfgr: reg::rcc::Cfgr<Srt>, rcc_cir: reg::rcc::Cir<Srt>, rcc_cr: reg::rcc::Cr<Srt>, rcc_apb1enr: reg::rcc::Apb1Enr<Srt>, thr_rcc: thr::Rcc, ) { /...
Rust
0
h, [1]), (atan, [1]), (atanh, [1]), (cos, [1]), (cosh, [1]), (cospi, [1]), (sin, [1]), (sinh, [1]), (sinpi, [1]), (tan, [1]), (tanh, [1]), (tanpi, [1]), (atan2, [1, 1]), (beta, [1, 1]), (choose, [1, 1]), (digamma, [1]), (lgamma, [1]), (lbeta, [1, 1]), ...
Python
1
ters:"] #[doc = " document - Handle to document. Returned by FPDF_LoadDocument."] #[doc = " page_index - Page index, zero for the first page."] #[doc = " width - Pointer to a double to receive the page width"] #[doc = " (in points)."] ...
Rust
0
特徵 '{name}' 版本 '{version}'") return features_df, metadata def list_features(self) -> List[str]: """ 列出所有特徵名稱 Returns: List[str]: 特徵名稱列表 """ if not os.path.exists(self.base_dir): return [] return [ d for d in ...
Python
1
##################################################################################### # MIT License # # # # Copyright (C) 2019 Charly Lamothe ...
Python
1
size for the x,y ticks and set which ticks to display plt.tick_params(labelsize=14) scan_times *= 1e9 plt.gca().set_yticks([round(ii, 2) for ii in scan_times[::n_time_pts // 8]]) plt.gca().set_xticks([round(ii) for ii in np.linspace(0, 355, 355)[::75]]...
Python
1
84, 0x0A,// 1284 = "sysretq" // Invd 0x01,// Normal_1 0xF7, 0x07,// 1015 = "invd" // Wbinvd 0x01,// Normal_1 0xDA, 0x09,// 1242 = "wbinvd" // Wbnoinvd 0x01,// Normal_1 0xDB, 0x09,// 1243 = "wbnoinvd" // Cl1invmb 0x01,// Normal_1 0xEA, 0x06,// 874 = "cl1invmb" // Ud2 0x01,// Normal_1 0xD9, 0x09,// 12...
Rust
0
}, ); } // Prototype https://github.com/denoland/deno/blob/golang/os.go#L171-L184 fn handle_read_file_sync(d: *const DenoC, filename: &str) { debug!("handle_read_file_sync {}", filename); let result = fs::read_file_sync(Path::new(filename)); if result.is_err() { let err = result.unwrap_err(); let ...
Rust
0
# * static, i_s is scalar and x_s is i_s. symmetric = azp_adj is None x_q, x_s, x_zp = ops.scaled_int8_quant(x.contiguous(), i_s, i_zp, symmetric=symmetric) ...
Python
1
int score][feature:board score] .move a1a2 - make a move .moves.list - prints list of legal moves [issue:moves list][feature:moves list] .move.random - make a random legal move [feature:moves list] [issue:random move][feature:random move] .moves.history - prints list of moves [issue: history] .move.undo - undo las...
Rust
0
cw_freq_khz: f64, start_attenuation: Attenuation, start_power_level: PowerLevel, stop_attenuation: Attenuation, stop_power_level: PowerLevel, step_delay: Duration, }, StartAmpSweepExp { cw_freq_khz: f64, start_power_dbm: f64, step_power_db: f64, ...
Rust
0
IX /// does not require that `sun_len` include the terminating null even for normal /// sockets. Note that the actual sockaddr length is greater by /// `offset_of!(libc::sockaddr_un, sun_path)` #[derive(Copy)] pub struct UnixAddr(pub libc::sockaddr_un, pub usize); impl UnixAddr { /// Create a new sockaddr_un repr...
Rust
0
mbined_units -> division_of_units','combined_units',1,'p_combined_units','cds.py',163), ('product_of_units -> unit_expression PRODUCT combined_units','product_of_units',3,'p_product_of_units','cds.py',169), ('product_of_units -> unit_expression','product_of_units',1,'p_product_of_units','cds.py',170), ('division_...
Python
1
import pytest from decimal import Decimal from app.utils.helpers import adjust_to_step_size, format_quantity_for_api @pytest.mark.parametrize( "quantity, step_size, expected", [ (0.12345, "0.001", 0.123), (153.45, "10", 150.0), (0.12345678, "0.000001", 0.123456), (10.99, "0.1",...
Python
1
import asyncio import importlib.util from concurrent import futures from typing import Optional from . import _base # Attempt to find winrt module and let error propagate if it is not available. We don't want to # import winrt here because it needs to be done in a background thread. if not importlib.util.find_spec("w...
Python
1
(pady=30) # Result Frame results_heading = Label(result_frame, text="", font=("Arial", 36, "bold"), bg="#2C2620", fg="#F1C40F") results_heading.pack(ipady=20, fill="x") results_card = Frame(result_frame, bg="#3E342C", bd=3, relief="ridge") results_card.pack(pady=(60, 20), ipadx=70, ipady=25) ...
Python
1
"); // 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 writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WA...
Rust
0
de<Mssql>>::encode_by_ref(&self.as_str(), buf) } } impl Decode<'_, Mssql> for String { fn accepts(ty: &MssqlTypeInfo) -> bool { matches!( ty.0.ty, DataType::NVarChar | DataType::NChar | DataType::BigVarChar | DataType::VarChar ...
Rust
0
ntln!("first cluster = {} nxt = {}", first_cluster, manager_writer.get_fat().read().get_next_cluster(first_cluster, self.block_device.clone())); if let Some(cluster) = manager_writer.alloc_cluster(needed) { //println!("*** cluster alloc = {}",cluster); if first_cluster == 0 { //未分配簇 ...
Rust
0
# Problem: Find the Smallest Divisor Given a Threshold - https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold/ class Solution: def smallestDivisor(self, nums: List[int], threshold: int) -> int: n = len(nums) if n == threshold: return max(nums) nums.sort() ...
Python
1
", Pattern::empty())); assert_eq!("+4", format!("{}", pat![Plus(4)])); assert_eq!("+4, %-6", format!("{}", pat![Plus(4), Mod(-6)])); assert_eq!("+4, %-6, -12, *42, /3, =9", format!("{}", pat![Plus(4), Mod(-6), Plus(-12), Mult(42), Div(3), Const(9)])); assert_eq!("^2, root 2, ^3, root 3",...
Rust
0
pace/rust/rust_plugin_sty/target/debug/ if current_exe_dir.contains("/deps/") { let i = current_exe_dir.find("/deps/").unwrap(); String::from(&current_exe_dir.as_str()[..i + 6]) } else { let i = current_exe_dir.rfind('/').unwrap(); String::from(&current_exe_dir.as_str()[..i]) ...
Rust
0
""" GPU Acceleration Module for Python-SLAM This module provides GPU acceleration support for SLAM operations using: - CUDA (NVIDIA) - ROCm (AMD) - Metal (Apple) The module automatically detects available GPU backends and provides a unified interface for accelerated SLAM computations. """ from .gpu_detector import G...
Python
1
""] #[doc = " Note that if a range of bytes used as an argument of a system call"] #[doc = " (such as read() or write()) contains pages that have not been \"realized\", the"] #[doc = " system call will fail with EFAULT. CPLVirtualMemPin() can be used to work"] #[doc = " around this issue."] #[doc =...
Rust
0
err(); assert_eq!(err.status(), 406); Ok(()) } #[test] fn negotiate_wildcard() -> crate::Result<()> { let mut accept = Accept::new(); accept.push(MediaTypeProposal::new(mime::JSON, Some(0.8))?); accept.set_wildcard(true); assert_eq!(accept.negotiate(&[mime::...
Rust
0
, DataPrinterFlags::WD_ALL | DataPrinterFlags::WITH_SIBLINGS, ) .expect("Failed to print data tree"); Ok(()) } // Copyright (c) Microsoft. All rights reserved. extern crate edgelet_core; extern crate edgelet_hsm; use edgelet_core::{Certificate, GetTrustBundle}; use edgelet_hsm::Crypto;...
Rust
0
"num_boost_round": 1_500, "lambda_l1": 1.0, "lambda_l2": 1.0, }, "train": {"is_scale": False, "length": int(3.0 * 525_600), "shifts": []}, "predict": {"length": 1440} }, { "name": "gb-y", "algo": "gb", "params": { #"...
Python
1
basic and mutable #[derive(Debug, Clone, PartialEq, PartialOrd)] pub enum Calx { Nil, Bool(bool), I64(i64), F64(f64), Str(String), List(Vec<Calx>), // to simultate linked structures Link(Box<Calx>, Box<Calx>, Box<Calx>), } #[derive(Debug, Clone, PartialEq, PartialOrd)] pub enum CalxType { Nil, Boo...
Rust
0