text
string
label_name
string
labels
int64
RIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Apache license, Version 2.0 * * Copyright (c) 2018-2022 <NAME>os Software * * L...
Rust
0
, 3]), ("b1", &vec![4, 5, 7]), ("c1", &vec![7, 8, 9]), ); let right = build_table( ("a2", &vec![10, 20, 30]), ("b1", &vec![4, 5, 6]), // 6 does not exist on the left ("c2", &vec![70, 80, 90]), ); let on = &[("b1", "b1")]; ...
Rust
0
foob"); let fooo = InvertIndex::from(baar.clone()); assert_eq!(baar.query("oof"), fooo.query("oof")); } #[test] fn test_start_end_sensitive() { let mut baar = InvertIndex::<&str>::default(); baar.insert_bounded("blazed", "Adiaeresis"); baar.insert_bounded("crazed"...
Rust
0
self) -> bool { *self == EVOBS_SEL_A::AUXIO25 } #[doc = "Checks if the value of the field is `AUXIO24`"] #[inline(always)] pub fn is_auxio24(&self) -> bool { *self == EVOBS_SEL_A::AUXIO24 } #[doc = "Checks if the value of the field is `AUXIO23`"] #[inline(always)] pub fn ...
Rust
0
KNNAlgorithm::CoverTree(ref cover) => cover.find_radius(from, radius), } } } <gh_stars>1-10 pub mod mem; use libbarrelfish::pci::*; use libbarrelfish::*; use libc; /// Has to be > 0xffff pub const PCI_DONT_CARE: u32 = 0x10000; #[derive(Debug)] pub struct PciDriver { bus: u32, dev: u32, fu...
Rust
0
elf.surface_config.width, physical_height: self.surface_config.height, scale_factor: self.window.scale_factor() as f32, }; self.render_pass.update_texture( &self.device, &self.queue, &self.platform.context().texture(), ); self.r...
Rust
0
 Yc@`ssddlmZmZmZmZddlZddlmZmZdZ dZ dej efdYZ dS(i(tabsolute_importtdivisiontprint_functiontunicode_literalsN(tABCMetatabstractmethodu Kiran Mathewukmathew@lbl.govtAbstractBuilder...
Python
1
get_pointer_width = "64")] #[test] #[should_panic] fn bsl64_ll32_empty() { BitSlice::<Lsb0, u64>::empty().load_le::<u32>(); } #[cfg(target_pointer_width = "64")] #[test] #[should_panic] fn bsl64_ll64_empty() { BitSlice::<Lsb0, u64>::empty().load_le::<u64>(); } #[cfg(target_pointer_width = "64")] #[test] #[should_pani...
Rust
0
OUR_WIRE_1 = 1, } impl From<DETECT_FOUR_WIRE_A> for bool { #[inline(always)] fn from(variant: DETECT_FOUR_WIRE_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `DETECT_FOUR_WIRE`"] pub type DETECT_FOUR_WIRE_R = crate::R<bool, DETECT_FOUR_WIRE_A>; impl DETECT_FOUR_WIRE_R { #[doc = r"G...
Rust
0
able and unsuitable for comparing as test outputs. if not verbose: _m5.core.setLogLevel(_m5.core.LogLevel.WARN) # instantiate configuration m5.instantiate() # Determine the switching period, this has to be done after # instantiating the system since the time base must be fixed. period ...
Python
1
let fields: Vec<quote::Tokens> = fields.iter().map(|ref fld| { let id = fld.ident.as_ref().unwrap().clone(); quote!{ #id } }).collect(); let fields2 = fields.clone(); let fields3 = fields.clone(); quote! {...
Rust
0
t(num_batches * batch_size - len(idx)) idx += idx[:add_for_full_batches] preds = np.zeros(([int(num_batches * batch_size)] + list(self.output_layer.output_shape[1:]))) for b in range(num_batches): preds[idx[b*batch_size : (b+1) * batch_size]] = self.pred_proba(X[idx[b*batch_size : (b...
Python
1
scribe<Observer>(self, observer: Observer) where Observer: core::Observer<Cancellable, Item, Error> + Send + 'static, { let observable = self.observable; self.scheduler.schedule(async move { observable.subscribe(observer).await; }); } } #[cfg(test)] mod tests { ...
Rust
0
e_using_json_rpc(&config); verify_init_and_basic_rotation(node); } fn verify_init_and_basic_rotation<T: LibraInterface>(mut node: Node<T>) { // Verify correct initialization (on-chain and in storage) assert!(node.key_manager.compare_storage_to_config().is_ok()); assert!(node.key_manager.compare_info_to...
Rust
0
glium::index::NoIndices(glium::index::PrimitiveType::TrianglesList), &program, &glium::uniform! { matrix : matrix, perspective: perspective, view: view, u_light: ligh...
Rust
0
ta.bytecode_runtime.hex()}" def build_opcodes_output(compiler_data: CompilerData) -> str: return _build_opcodes(compiler_data.bytecode) def build_opcodes_runtime_output(compiler_data: CompilerData) -> str: return _build_opcodes(compiler_data.bytecode_runtime) def _build_opcodes(bytecode: bytes) -> str: ...
Python
1
<a href="/blogdata/feed.xml">{"RSS"}</a> </div> </div> </div> <div class="col-auto"> <div class="form-row"> <div cl...
Rust
0
::record::RecordSet; use dataplane::Offset; use fluvio_storage::{FileReplica, StorageError, ReplicaStorage}; use fluvio_types::SpuId; use crate::replication::leader::ReplicaOffsetRequest; use crate::core::DefaultSharedGlobalContext; use crate::storage::SharableReplicaStorage; use super::group::FollowerGroups; pub typ...
Rust
0
/// the result is zero fn logical_shift_right8(&mut self, data: u8) -> u8 { self.p.c = data & 0x01 > 0; let result = data >> 1; self.p.n = result > 0x7F; self.p.z = result == 0; result } /// Returns the data shifted right by one /// /// Low bit is shifted to ...
Rust
0
{ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 pack xmml, xmml, xmmh, ext=0, srcSize=2, destSize=1 pack xmmh, ufp1, ufp2, ext=0, srcSize=2, destSize=1 }; def macroop PACKUSWB_XMM_P { rdip t7 ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize...
Python
1
′ are IORs // we can have in some cases e.g. // $ sin(θ′) = 1.5 * sin(θ) // which for some values of θ has no solution. // e.g. when θ=90dgr the right side is 1.5 and sin(θ′) will never have this value let cannot_refract = etai_over_etat * sin_theta > 1.0; if cannot_refract { return None; } let r...
Rust
0
def checkTriangle(a,b,c): if(a==b==c): print ("equilateral triangle.") elif ((a==b and a!=c) or (a!=b and b==c) or (a==c and a!=b)): print("Isosceles triangle.") elif(a!=b!=c): print("Scalene triangle.") checkTriangle(1,2,3) checkTriangle(2,2,3) checkTriangle(3,3,3) x,y=10,20 prin...
Python
1
_type: stringify!($name).into() }), } } } impl<'s> ::std::convert::TryFrom<&::segsource::Segment<'s, u8>> for $name { type Error = crate::Error; fn try_from(segment: &::segsource::Segment<'s, u8>) -> ::std::res...
Rust
0
def déchiffrement_vigenere(texte: str, cle: str) -> str: """Fonction qui déchiffre un texte avec la méthode de Vigenère . Args: texte (str): Texte chiffré cle (str): clef de chiffrement Returns: str: Texte déchiffré """ texte_dechiffre = [] longueur_cle = len(cle) i...
Python
1
_ns: nanotime(), ..Event::default() } } /// atomically count up from 0 to a given max /// and fail incrementing further if that max is reached. struct AtomicMaxCounter { counter: AtomicUsize, max: usize, } impl AtomicMaxCounter { fn new(max: usize) -> Self { Self { counter:...
Rust
0
mHiF) setup_freq_power(sdrHiF, synthStreamHiF, freq_KHz, pwr) else: setup_freq_power(sdrHiF, synthStreamHiF, freq_KHz, pwr) sdrHiF.deactivateStream(synthStreamHiF) window["ActiveHiF"].Update(value=activeHiF) if (activeHiF): freq_KHz = freq_KHz + step_Hz if (freq_KHz > freq_end*1000): f...
Python
1
, etc. thread::spawn(|| console::connection::listen(grpc_handle, "http://[::1]:50051")); let mut app = ui::App::new(app_handle)?; app.run()?; Ok(()) } <gh_stars>0 use input::Input; use ncurses; use ncurses::ll::{attr_t, chtype, mmask_t}; use ncurses::NCURSES_ATTR_SHIFT; pub use ncurses::{ACS_LLCORNER...
Rust
0
tive.str.html#method.parse) method //! on a string) can be used for parsing `DateTime<FixedOffset>`, `DateTime<Utc>` and //! `DateTime<Local>` values. This parses what the `{:?}` //! ([`std::fmt::Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html)) //! format specifier prints, and requires the offse...
Rust
0
import math import traceback import numpy as np # TODO use Decimal not floats # for get_dist_on_earth GEO_R1 = 6378.137 GEO_R2 = 6356.752314140 GEO_R1_2 = (GEO_R1 * 1000) ** 2 GEO_R2_2 = (GEO_R2 * 1000) ** 2 GEO_E2 = (GEO_R1_2 - GEO_R2_2) / GEO_R1_2 G_DISTANCE_BY_LAT1S = GEO_R2 * 1000 * 2 * np.pi / 360 / 60 / 60 # ...
Python
1
#!/usr/bin/python3 """module json""" import json def to_json_string(my_obj): """ Returns: str: The JSON representation of the object as a string. """ return json.dumps(my_obj)
Python
1
""" Write a function to count bidirectional tuple pairs. assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3 """ def count_bidirectional(tuples): """ :param tuples: list of tuples :return: number of bidirectional pairs """ count = 0 for i in range(len(tuples)): ...
Python
1
s = ['Open', 'High', 'Low', 'Close', 'Volume'] missing_columns = [col for col in required_columns if col not in ohlcv_data.columns] if missing_columns: return {'error': f'필수 컬럼 누락: {missing_columns}'} # 데이터 타입 보장 print(f"🔍 데이터 타입 확인 및 변환...")...
Python
1
ngsButton.setToolTip( "Enable plugin and then click to configure") if item.category in self.__pluginManager.inactivePlugins: self.__pluginManager. \ inactivePlugins[item.category].append(item.plugin) else: self.__pluginMana...
Python
1
} } pub(crate) fn message(&self, request: Request<Body>) -> ResponseFuture { let flight_counter = Arc::clone(&self.in_flight); self.in_flight.fetch_add(1, atomic::Ordering::SeqCst); let (reply, response): (HttpResponseSender, HttpResponseReciever) = oneshot::channel(); ...
Rust
0
nuationEventArgs = _ns_module.WebUIFileSavePickerContinuationEventArgs WebUIFolderPickerContinuationEventArgs = _ns_module.WebUIFolderPickerContinuationEventArgs WebUILaunchActivatedEventArgs = _ns_module.WebUILaunchActivatedEventArgs WebUILockScreenActivatedEventArgs = _ns_module.WebUILockScreenActivatedEventArgs WebU...
Python
1
app_dirs = ["/Applications", "/System/Applications"] # app_paths = [] # for app_dir in app_dirs: # for root, dirs, files in os.walk(app_dir): # for item in dirs: # if item.endswith('.app'): # app_path = os.path.join(root, item)...
Python
1
self.assertIn(book1, books_language, "Книга 'Изучаем Python' не найдена по языку Python") # Тестирование поиска книг по ключевому слову в названии def test_search_by_keyword(self): library = Library() book1 = Book("Изучаем Python", "Иван Иванов", 2021) book2 = Book("Основы Python", "И...
Python
1
val']: eval(os.path.join(args.work_dir, 'tracking_result.json'), args.version, args.work_dir, args.data_root ) else: print('Only support for v1.0-mini or v1.0-trainval') def eval(res_path, version="v1.0-trainval", output_dir=None, root_path=None): fro...
Python
1
tType.SSTRING, ArgumentType.USTRING): name = 'bytes' elif type in (ArgumentType.WSTRING, ArgumentType.ASCII_STRING, ArgumentType.LATIN1_STRING, ArgumentType.UTF8_STRING): name = 'bytes' if self.object.array is ArrayArgument.ARRAY else 'str' elif type in (ArgumentType.BYTE, Argu...
Python
1
a, O, I, E>> { let Self { owner, inner, .. } = self; Some(BoxOwned { owner, inner: inner?, _phantom: PhantomData, }) } } impl<'a, O, Ok, Err, E> BoxOwned<'a, O, Result<Ok, Err>, E> where O: ?Sized, E: EqKind, { /// Transpose an [BoxOwned] of a...
Rust
0
rr'r+rEs                 z_formatArray.<locals>.recurserr')rYrrNr')r{rrrrrrr;r'rr+r<s h rcC...
Python
1
nt( linear_operator_circulant.LinearOperatorCirculant) def _adjoint_circulant(circulant_operator): spectrum = circulant_operator.spectrum if spectrum.dtype.is_complex: spectrum = math_ops.conj(spectrum) # Conjugating the spectrum is sufficient to get the adjoint. return linear_operator_circulant.Linear...
Python
1
Err(__ParseError::User { error: e }), }; match __lookahead { None | Some((_, Tok::RParen(..), _)) | Some((_, Tok::Times(..), _)) | Some((_, Tok::Plus(..), _)) | Some((_, Tok::Minus(..), _)) | Some((_, Tok::Div(..), _)) => { ...
Rust
0
a, _| { Ok(TemperatureValue { value: a.value().value, unit: Some("fahrenheit"), latent: false, }) }); b.rule_2("<temp> Kelvin", temperature_check!(), b.reg(r#"k(?:elvin)?\.?"#)?, ...
Rust
0
self._notebook_container.value = "%s" % html elif not self._ipython_mode: self._log.info(repr(self)) def calculate_end_condition(self) -> bool: """Implement the logic for deciding if the algorithm has finished. \ The algorithm will stop if it returns True.""" ...
Python
1
from typing import Annotated, List from fastapi import APIRouter, Depends from sqlalchemy.orm import Session from controllers.salaries import create_salary from models import schemas from models.database import get_db from secure import apikey_scheme from views.salaries import get_salaries from views.users import get...
Python
1
itch. # # ImSwitch is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ImSwitch is distributed in the hope that it will be useful, # bu...
Python
1
from django.contrib import admin from product import models # Register your models here. # class MediaInline(admin.StackedInline): # model = models.ProductMedia # extra = 1 # @admin.register(models.Product) # class ProductAdmin(admin.ModelAdmin): # list_display = ('title', 'price') # inlines = [ # ...
Python
1
{ unsafe { std::mem::MaybeUninit::zeroed().assume_init() } } } /// The `Shape::GetRectangles` reply. /// /// The following fields can be accessed via accessor functions: /// /// - `rectangles` #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct xcb_shape_get_rectangles_reply_t { pub response_type: u8,...
Rust
0
"""Sanity test using rstcheck and sphinx.""" from __future__ import annotations import re import subprocess import sys def main(): paths = sys.argv[1:] or sys.stdin.read().splitlines() encoding = 'utf-8' ignore_substitutions = ( 'br', ) cmd = [ sys.executable, '-m', 'rs...
Python
1
it?; self.info = Some(info.clone()); Ok(info) } } pub async fn config(&self) -> anyhow::Result<Config> { Ok(Config::new()?) } /// Create the client builder pub fn client_builder() -> anyhow::Result<reqwest::ClientBuilder> { // create basic builder ...
Rust
0
self.bot.api_client.post.assert_has_calls(calls, any_order=True) self.assertEqual(self.bot.api_client.post.call_count, len(roles)) self.bot.api_client.put.assert_not_called() self.bot.api_client.delete.assert_not_called() async def test_sync_updated_roles(self): """Only PUT r...
Python
1
from unittest.mock import MagicMock from lightning.pytorch.loggers.logger import Logger from calvera.benchmark.logger_decorator import OnlineBanditLoggerDecorator def test_online_bandit_logger_decorator_basic() -> None: mock_logger = MagicMock(spec=Logger) decorator = OnlineBanditLoggerDecorator(mock_logger...
Python
1
let scale = 1.0 / samples_per_pixel as f64; // r *= scale; // g *= scale; // b *= scale; r = (scale * r).sqrt(); g = (scale * g).sqrt(); b = (scale * b).sqrt(); fp.write( format!( "{} {} {}\n", 256.0 * clamp(r, 0.0, 0.999), 256.0 * clamp(g, ...
Rust
0
hat is left is waiting for the child to exit: if let Some(mut child) = std::mem::take(&mut *this.child) { if let Poll::Ready(sts) = Pin::new(&mut Box::pin(child.wait())).poll(cx) { return Poll::Ready(Some(Item::Done(sts))); } // Sometimes t...
Rust
0
""" Driver has a vehicle Customer can book Ride(s) 1.Driver - Name, phoneNumber, vehicleType [1 - 1], licenceNumber, rating, gender, Age 1 driver has 1 vehicle 2.Vehicle - regNumber, Brand, model, color 3.Customer - Name , phoneNumber, Address, email, gender, age 4. Ride - custo...
Python
1
asm_x86_att_syntax, clippy::missing_inline_in_public_items, clippy::pedantic, clippy::transmute_undefined_repr, clippy::undocumented_unsafe_blocks )] #![allow(clippy::doc_markdown, clippy::module_inception, clippy::type_complexity)] #![cfg_attr( not(any( target_arch = "x86", target_a...
Rust
0
def print_params(a=1, b='строка', c=True): print(a, b, c) print_params() print_params(4, 5, 8) print_params(b = 25) print_params(c = [1,2,3]) values_list = [False, "слово", 4] values_dict = {'a': 8, 'b': True, 'c': 'предложение'} print_params(*values_list) print_params(**values_dict) values_list_2 = [54.32, 'Стр...
Python
1
'<div class="error-message">', '<h3>页面出错了</h3>', '<p>', '遇到一些未知错误,请尝试刷新页面、清除浏览器缓存或截图<a target="_blank" href="' + feedBackUrl + '">反馈</a>给我们', '</p>', '<p>' + feedback + '</p>', '</div>', '<div>', '<img class="unknown-error" src="https://gw...
Python
1
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_data.external.ipynb (unless otherwise specified). __all__ = ['m4_base', 'dummy_data_generator'] # Cell from ..core import * from fastcore.utils import * from fastcore.imports import * from fastai.basics import * # Cell m4_base = "https://motionnet-m4-dataset.s3.eu-c...
Python
1
in_unchecked(rng, slice)) } } } #[inline] fn try_rand_in<R: ?Sized + TryRng>(rng: &mut R, slice: &'a mut [A]) -> Result<Option<Self>, R::Error> { if slice.is_empty() { Ok(None) } else { unsafe { Self::try_rand_in_unchecked(rng, slice).map(Some) } } ...
Rust
0
minator: &str, span_end: Option<BytePos>, where_clause_option: WhereClauseOption, force_single_line: bool, ) -> Option<String> { let span_start = predicates[0].span().lo(); // If we don't have the start of the next span, then use the end of the // predicates, but that means we miss comments. ...
Rust
0
corners = np.concatenate([corners, corners[[0]]]) gt_color = np.asarray([0, 106, 128]) / 255.0 plt.plot(corners[:, 0], corners[:, 1], c=gt_color, linewidth=1.0) plt.scatter(c_x, c_y, s=10, c=[gt_color]) # plt.scatter(corners[0,0], corners[0,1]...
Python
1
⭣ // f(x)⭣ * g(x)⭣ => unknown // f(x)⭣ / g(x)⭣ => ⭡ // f(x)⭡ * g(x)⭣ => ⭣ // f(x)⭡ / g(x)⭣ => unknown // f(x)⭣ * g(x)⭡ => ⭡ // f(x)⭣ / g(x)⭡ => unknown ...
Rust
0
point in path: while env.episode_over: best_action = follower.get_next_action(point) obs = env.step(best_action) assert "rgb" in obs, "RGB image is missing in observation." assert ( "instruction" in ...
Python
1
mewhereGoer { room_name: room_name.into(), }) } #[derive(Clone)] struct RoomStateChanger { room_name: &'static str, new_state: &'static str, } impl Transition for RoomStateChanger { fn transit(&self, map: Map) -> Map { let mut rooms = map.rooms.clone(); let mut room = rooms[sel...
Rust
0
d}; pub fn run_standard_cli_app<F, Fut>(name: &str, app: App<F, Fut>) -> Result<()> where F: Fn(Config) -> Fut + Send + Clone + 'static, Fut: Future<Output = Result<Router>> + Send, { let matches = Command::new(name) .arg_required_else_help(true) .subcommand( Command::new("start...
Rust
0
[u8]] = &[ has_bl_4x4, // 4x4 has_bl_4x8, // 4x8 has_bl_8x4, // 8x4 has_bl_8x8, // 8x8 has_bl_8x16, // 8x16 has_bl_16x8, // 16x8 has_bl_16x16, // 16x16 has_bl_16x32, // 16x32 has_bl_32x16, // 32x16 has_bl_32x32, // 32x32 has_bl_32x64, // 32x64 has_bl_64x32, // 6...
Rust
0
compatibilité avec l'interface existante if num_bits % 2 != 0: num_bits += 1 # Génération des bits aléatoires bits = np.random.randint(0, 2, num_bits) # Modulation BPSK (Mapper 1 bit → 1 symbole réel) symbols = (2 * bits - 1) # Conversion: 0 → -1, 1 → +1 symbols = torch.tensor(symbols...
Python
1
kedAssetCount: int :param _NewAttackedAssetCount: 今日新增受攻击资产数量 注意:此字段可能返回 null,表示取不到有效值。 :type NewAttackedAssetCount: int :param _AttackedPortCount: 总受攻击端口数量 注意:此字段可能返回 null,表示取不到有效值。 :type AttackedPortCount: int :param _NewAttackedPortCount: 今日新增受攻击端口数量 注意:此字段可能返回 null,表示取不到有效值。 ...
Python
1
# Copyright 2023, YOUDAO # # 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 writing, s...
Python
1
.write("="*80 + "\n") f.write("CDAN模型轴承故障迁移诊断可解释性分析综合报告\n") f.write("="*80 + "\n\n") # 1. 执行摘要 f.write("1. 执行摘要\n") f.write("-"*40 + "\n") f.write("本报告基于Word文档中的理论框架,对CDAN模型进行了全面的可解释性分析,\n") f.write("涵盖事前、迁移过程和事后三个维度的解释机制。\n\n") # 2. 事前可解释性分析结果 f...
Python
1
"Consumption"].sum() * (plan["discount"] / 100) # Applying discount for weekends if plan["plan_type"] in ["Weekends", "Both"]: if plan["start_hour"] > plan["end_hour"]: # Overnight discount mask1 = (temp_weekends["Hour"] >= plan["start_hour"]) # From start_hour to 23:59 ...
Python
1
); let tmp = graph.conv2d( tmp, w3, /*stride_h=*/ 1, /*stride_w=*/ 1, /*padding=*/ PSAME, /*activation=*/ ACTNONE, ); if (strides.0 > 1) || (input_dim_1 != out_channels * 2) { let w4 = graph.new_weight(&[out_channels * 2, input_dim_1, 1, 1]); input = graph.conv2d( ...
Rust
0
setzero_si512().as_i64x8(); transmute(simd_select_bitmask(k, and, zero)) } /// Compute the bitwise AND of 512 bits (representing integer data) in a and b, and store the result in dst. /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_and_si512&expand=302) #[inli...
Rust
0
clone(), avg_color, width, height); let width = width as f32; let height = height as f32; let shape = match options.shape.as_str() { "rectangle" => Shapes::Rectangle, "triangle" => Shapes::Triangle, _ => Shapes::Rectangle, }; let mut evolutions = 0; for i in 0..options....
Rust
0
""" 问题: 给定一个二维网格和一个单词,找出该单词是否存在于网格中。单词必须按照字母顺序, 通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同 一个单元格内的字母不允许被重复使用。 示例: board = [ ['A','B','C','E'], ['S','F','C','S'], ['A','D','E','E'] ] 给定 word = "ABCCED", 返回 true. 给定 word = "SEE", 返回 true. 给定 word = "ABCB", 返回 false. """ class Solution: def exist(self, board...
Python
1
expressions .iter() .map(|e| { let children = e.children.clone(); let mut expressions = Vec::new(); for elements in children.split(|e| e == &Element::Group(Group::MSep)) { expressions.push(Expression { c...
Rust
0
] suspiciousCategories = [ "network", "encryption", "anti-vm", "anti-analysis", "anti-av", "anti-debug", "anti-emulation", "persistence", "stealth", "discovery", "injection", "generic", "account", "bot", "browser", "allocation", "command", "execution", ] ...
Python
1
d)+1e-12) for d in windows ] names += ["VSUMP%d" % d for d in windows] if use("VSUMN"): # The total volume increase / the absolute total volume changed # Can be derived from VSUMP by VSUMN = 1 - VSUMP fields ...
Python
1
idr>().unwrap(); assert!( c2.contains(&IpAddr::V4(addr)), "{:?} must include {:?} (through IpCidr)", c2, addr ); } fn test_v4_contains_not(s: &'static str, addr: Ipv4Addr) { let c1 = s.parse::<Ipv4Cidr>().unwrap(); assert!( !c1.contains(&addr), "{:?} must not include {:?} (through Ipv4Cidr)", c1, a...
Rust
0
mut opts = DrawOptions::new(); if g.canvas.cam_zoom < MIN_ZOOM_FOR_DETAIL { ui.draw(g, opts, &DontDrawAgents {}, &ShowEverything::new()); g.redraw(&self.unzoomed); } else { opts.override_colors = self.zoomed_override_colors.clone(); ui.draw(g, opts, &ui.pr...
Rust
0
()) .try_sign(&private_key)?; // //validate the test vector //now let's try to decrypt it let json = Paseto::<V1, Public>::try_verify(&token, &public_key, footer)?; assert_eq!(payload, json); Ok(()) } #[cfg(feature = "public")] #[test] fn test_1_s_3() -> Result<()> { //setup ...
Rust
0
trace!("{} - Locked", ident); return Ok(MutexGuard { inner: guard, id: ident, }); } Err(StdTryLockError::WouldBlock) => { let spin = loop { let load = self....
Rust
0
numcols + 1 # updiv canvas = np.zeros((numrows * const.H, numcols * const.W, 3), dtype=np.uint8) for i in range(n): col = i % numcols row = i / numcols canvas[row * const.H:(row + 1) * const.H, col * const.W:(col + 1) * const.W, :] = images[i] imsave(pth, canvas) def plot_flow(flo...
Python
1
from fastapi import FastAPI from starlette.middleware import Middleware from starlette.middleware.cors import CORSMiddleware from auth.service import auth_router from auth.user import user_router from config import settings from grid_generator.services.grid import grid_router from tournaments.services.sport import spo...
Python
1
/// # } /// ``` #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)] #[postgres(oid = "790", array_oid = "791")] pub struct Money; /// The [`MACADDR`](https://www.postgresql.org/docs/9.6/static/datatype-net-types.html) SQL type. /// /// ### [`ToSql`] impls /// /// - `[u8; 6]` ...
Rust
0
upside_down: false, } } } /// Holds meshes, fonts, scenes and other materials used by this game struct GameMaterials { text_font: Handle<Font>, digit_font: Handle<Font>, notification_font: Handle<Font>, tile_normal: Handle<StandardMaterial>, tile_hovered: Handle<StandardMate...
Rust
0
w: &'a mut W, } impl<'a> AGC_PEAK_DET_EN_AGC_PEAK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AGC_PEAK_DET_EN_AGC_PEAK_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "`0`"] #[inline(always)] pub f...
Rust
0
_node_id: NodeRef<K, V, Color>, ) -> Option<NodeRef<K, V, Color>> { let mut current = Some(base_node_id); let mut right_most_node = current; while let Some(id) = current { right_most_node = current; current = id.as_ref().right; } right_most_node } ...
Rust
0
sync_trait; use bytes::Bytes; use futures::{SinkExt, StreamExt}; use hyper::Uri; use tokio::io::{AsyncRead, AsyncWrite}; #[cfg(target_family = "unix")] use tokio_tungstenite::tungstenite::client::IntoClientRequest; use tokio_tungstenite::{ tungstenite::{self, Message}, WebSocketStream, }; use url2::{Url2, Url2E...
Rust
0
wrap_err(), LEB128DecodeError::IntegerOverflow ); } #[test] fn sleb128_encode_buffer_overflow() { let val = i64::max_value(); let mut buf = [0; 9]; assert_eq!( SLEB128::from(val).write_into(&mut buf).unwrap_err(), LEB128EncodeError::BufferOverflow ); } #[test] fn uleb128_e...
Rust
0
as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - If this bit is set to 1 the context interrupt is enabled"] #[inline(always)] pub fn des_irqenable_m_contex_in(&self) -> DES_IRQENABLE_M_CONTEX_INR { let bits = ((self.bits >> 0) & 1) != 0; ...
Rust
0
bit(34) } fn r_cpp(&mut self) -> &mut Cb { self.bit(33).bit(34) } fn r_tos(&mut self) -> &mut Cb { self.bit(32).bit(33).bit(34) } fn r_opc(&mut self) -> &mut Cb { self.bit(35) } fn get(&self) -> [bool; 36] { self.command } fn bit(&mut self, i: usize) -> &mut Cb { self.command[i] = true; ...
Rust
0
crate::error::invalid_content_location::Builder::default() } } <reponame>svartalf/rust-memcached-protocol use extras::Set; #[test] fn test_blank() { let extra = Set::default(); let mut raw: Vec<u8> = Vec::with_capacity(8); extra.write(&mut raw); assert_eq!(0, extra.flags()); assert_eq!(...
Rust
0
let mut interpreter = Interpreter::new(); let code_vector = vec![ ("(list:unzip '((1 a)))", "'((1) (a))"), ("(list:unzip '((1 a) (2 b)))", "'((1 2) (a b))"), ("(list:unzip '((1 a) (2 b) (3 c)))", "'((1 2 3) (a b c))"), ( "(list:unzip '((1 a)...
Rust
0
s += new_flashes; } return flashes; } pub fn part2(input: String) -> u16 { let mut grid = parse_input(input); for round in 1.. { let (new_grid, new_flashes) = do_round(&grid); grid = new_grid; if new_flashes == 100 { return round; } } panic!("How did ...
Rust
0
ring(), parent: root.clone(), author: root.clone(), verify: "".to_string(), data: kd_sys_kind::KdSysKindApp { name: "test".to_string(), } .to_json() .unwrap(), }, v...
Rust
0
lUAACAAQAAgAAAAIABAAAAAAAAAAA=": "02000000012df577be6c1e0f5cdc373aa4b959b6bf221abbcff0eb878188e7c1586d93c086010000006a47304402207856b69bc00ce99a46d0d2cd0d7f2ee1f6883a117b34f35fe0b67dcdae8c8bca02201dce9d202a6f71ac83a6c805b8887d0e27724ea6e4f01be3d9adb75b60e079f70121030da02533586252379fa5491a51a76197f530012bac58029383ee6b...
Python
1
rbitrary` for `Graph` creates a graph by selecting a node count /// and a probability for each possible edge to exist. /// /// The result will be simple graph or digraph, with possible /// self loops, no parallel edges. impl<N, E, Ty, Ix> Arbitrary for Graph<N, E, Ty, Ix> where N: Arbitrary, E: Arbitrary,...
Rust
0