text
string
label_name
string
labels
int64
.to_owned()]; rp_config.types.insert( event::log_schema().timestamp_key().clone(), "timestamp|%+".to_owned(), ); RegexParser::build(&rp_config).expect("regexp patterns are static, should never fail") }; Self { regex_parser } } } ...
Rust
0
3 = 3, } impl From<INTERWORK_INSTRS_A> for u8 { #[inline(always)] fn from(variant: INTERWORK_INSTRS_A) -> Self { variant as _ } } #[doc = "Reader of field `INTERWORK_INSTRS`"] pub type INTERWORK_INSTRS_R = crate::R<u8, INTERWORK_INSTRS_A>; impl INTERWORK_INSTRS_R { #[doc = r"Get enumerated value...
Rust
0
}", exporters=[FileExporterSettings(path=str(trace_file))], ) ) app = MCPApp(name=f"concurrent-{app_num}", settings=settings) async with app.run(): # Generate some spans if app._context....
Python
1
() { let cfg = dev.config().unwrap(); let _command = cfg.read16(PciReg16::Command); // let status = cfg.read16(PciReg16::Status); // if (command & PCIE_CFG_COMMAND_INT_DISABLE) != 0 { // continue; // } let inner = dev.inner.lock(); ...
Rust
0
binder_ty).get_res(*binder)?.iter_pairs() { res = res .set(*ty_n, less_quoted_ty(ty, Some(n("Pat")), &parts.this_ast)?); } } Ok(res) }) }), ...
Rust
0
rn "C" { pub fn dur_stats_val(v: *const dur_stats) -> *mut cst_val; } extern "C" { pub fn default_segmentanalysis(u: *mut cst_utterance) -> *mut cst_utterance; } extern "C" { pub fn default_tokenization(u: *mut cst_utterance) -> *mut cst_utterance; } extern "C" { pub fn default_textanalysis(u: *mut cst_...
Rust
0
e_binding; // Error // _mutable_binding = 20; println!("Mutable Binding {}", _mutable_binding) } _mutable_binding = 3; println!("Mutable Binding {}", _mutable_binding) } use super::{ p2p::{ comm::{BlockEventSubscription, Subscription}, topology, }, subs...
Rust
0
&($target, $crate::log::__log_module_path!(), $crate::log::__log_file!(), $crate::log::__log_line!()), ) } else { Ok(()) } }); ($lvl:expr, $($arg:tt)+) => ($crate::try_log!(target: $crate::log::__log_module_path!(), $lvl, $($arg)+)) } // There is a synt...
Rust
0
import json import random import requests server_url = 'http://localhost:8069' db_name = 'book-db-14' username = 'admin' password = 'admin' json_endpoint = "%s/jsonrpc" % server_url headers = {"Content-Type": "application/json"} def get_json_payload(service, method, *args, **kwargs): kwargs = kwargs or {} ...
Python
1
import pandas as pd import os import ast from scipy import spatial class VectorDB: def __init__(self, embedding, save_path): self.save_path = save_path self.embedding = embedding self.chunks = [] def store(self, text: str | list): '''保存 vector''' if isinstance(text,...
Python
1
{ 'name': 'Contract Management', 'version': '1.0.4', 'category': 'Contract Management', 'website': '', 'author': '', 'depends': ['base', 'hr', 'hr_replacement'], 'data': [ 'data/contract_data.xml', 'security/contract_security.xml', 'security/ir.model.access.csv', ...
Python
1
6i = _mm256_set1_epi16((KYBER_Q - 1) as i16/2); let hhq: __m256i = _mm256_set1_epi16((KYBER_Q - 1) as i16/4); for i in 0..KYBER_N/32 { f0 = _mm256_load_si256(&a.vec[2*i+0]); f1 = _mm256_load_si256(&a.vec[2*i+1]); f0 = _mm256_sub_epi16(hq, f0); f1 = _mm256_sub_epi16(hq, f1); g0 = _...
Rust
0
#!/usr/env/python # -*- python -*- # # Multisetup # # Distributed under the Cecill-C License. # See accompanying file LICENSE.txt or copy at # http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html # # OpenAlea WebSite : http://openalea.gforge.inria.fr # #testing buildbot """ Mul...
Python
1
>> (kw) ) ); pub fn escape_if_keyword(s: &str) -> String { if sql_keyword(CompleteByteSlice(s.as_bytes())).is_ok() { format!("`{}`", s) } else { s.to_owned() } } <filename>yeditor/src/room/room.rs<gh_stars>10-100 use actix::prelude::*; use failure::{err_msg, Fallible}; use std:...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 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
import time from tkinter import * from tkinter import messagebox root = Tk() root.title("Countdown Timer") root.geometry("800x800") root.configure(bg="lightblue") f = ("Times Roman", 10, "bold") def countdown(n): if n < 0: return lab_msg.config(text=n) root.after(1000, lambda: countdown(n - 1)) ...
Python
1
import matplotlib.pyplot as plt import numpy as np if __name__=="__main__": x=np.linspace(0,10,100) y=4+5*np.sin(6*x) linewidth_num=2.0 xlim_param=[0,10] ylim_param=[-2,10] xticks_param=np.arange(1,11) yticks_param=np.arange(-2,11) ax=plt.subplot() ax.plot(x,y,linewidth=linewidth_num) ax....
Python
1
> { obstruct: F, iter: CircleIter<()>, } impl<F> RPAShadowcasting<F> where F: FnMut(i32, i32) -> bool, { /// Create a new **RPAShadowcasting**. /// /// The function **obstruct(x, y)** should return **true** /// if the relative coordinates **x, y** are obstructing vision. pub fn new(radi...
Rust
0
asid: self.asid(), rights: self.rights(), }, }, ), kind: self.kind, _size_bits: PhantomData, _shared_status: PhantomData, }, )) } /...
Rust
0
ers of the branch where we entered the macro definition. binders: &'a Binders, /// The stack of Kleene operators (outermost first) where we entered the macro definition. ops: SmallVec<[KleeneToken; 1]>, } /// Checks that meta-variables are used correctly in a macro definition. /// /// Arguments: /// - `ses...
Rust
0
_Vfmsubadd231pd_xmm_k1z_xmm_xmmm128b64 0x22AC_00B7,// EVEX_Vfmsubadd231pd_ymm_k1z_ymm_ymmm256b64 0x232C_00B7,// EVEX_Vfmsubadd231pd_zmm_k1z_zmm_zmmm512b64_er 0x220C_00B8,// VEX_Vfmadd231ps_xmm_xmm_xmmm128 0x228C_00B8,// VEX_Vfmadd231ps_ymm_ymm_ymmm256 0x222C_00B8,// VEX_Vfmadd231pd_xmm_xmm_xmmm128 0x22AC_00B8,// ...
Rust
0
, reverse=True) sorted_book_names = [book[0] for book in sorted_books] print(sorted_book_names) return sorted_book_names[:10] def lambda_handler(event, context): """ AWS Lambda function handler to process the event, generate keywords, and fetch book recommendations. Parameters: ...
Python
1
"Offset of field: ", stringify!(cudaLaunchParams), "::", stringify!(func) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).gridDim as *const _ as usize }, 8usize, concat!( "Offset of field: ", str...
Rust
0
d on the calculated height. Arrays = Arrays.reshape(Depth, Height, Width); Contact_surface = calculate_contact_surface(Arrays); # * Create sliding windows for CHUNK for faster access to sub-volumes VIEW_CHUNK = np.lib.stride_tricks.sliding_window_view(Arrays, (Config.Octovoxel_size, Con...
Python
1
# Wap that input marks of a student and print the grade of the student marks=int(input("Enter marks:")) if(marks>=90): print("Grade A") elif(marks>=80): print("Grade B") elif(marks>=60): print("Grade C") elif(marks>=40): print("Grade Pass") else: print("Fail")
Python
1
mt = select( kline_table.c.open_time, kline_table.c.open, kline_table.c.high, kline_table.c.low, kline_table.c.close, kline_table.c.volume ).order_by(kline_table.c.open_time.asc()) kline_data = pd.rea...
Python
1
to_pool_opened(&mut self, cto_pool_arc: &CtoPoolArc) { self.common_initialization(cto_pool_arc); self.deref_mut().cto_pool_opened(cto_pool_arc); } #[inline(always)] pub(crate) fn lock<'mutex>(&'mutex self) -> CtoMutexLockGuard<'mutex, Value> { #[cfg(unix)] { let result = unsafe { pthread_mutex_lock...
Rust
0
.enumerate() { for (x, b) in line.iter().enumerate() { if *b { octopuses[y][x] = 0; } } } if has_flashed.iter().flatten().filter(|b| **b).count() == 100 { break; } step += 1; } step } /*! Con...
Rust
0
charge = Chem.GetFormalCharge(mol) if not charge == 0: chargestring = '+%s' % charge if charge > 0 else '%s' % charge self.log.info('Not an overall neutral system (%s)', chargestring) class IsotopeValidation(Validation): """Logs if molecule contains isotopes.""" def run(self,...
Python
1
. The ICMP messages are typically generated in response to the errors in /// IP datagrams or for diagnostic/routing purposes. /// The ping command sends an ICMP echo request to the remote host and waits for its ICMP echo reply. If the /// echo reply packet is not received, it means that the remote host is not reachabl...
Rust
0
# coding: utf-8 """ XI Sdk Resellers For Resellers seeking to innovate with Ingram Micro's API solutions, automate your eCommerce experience with our array of API's and webhooks to craft a seamless journey for your customers. The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (...
Python
1
l_rot_by_vec2(q_a, this.m_local_anchor_a - this.m_local_center_a); let r_b: B2vec2 = b2_mul_rot_by_vec2(q_b, this.m_local_anchor_b - this.m_local_center_b); let d: B2vec2 = (c_b - c_a) + r_b - r_a; let m_a: f32 = this.m_inv_mass_a; let m_b: f32 = this.m_inv_mass_b; let i_a: f32 = this.m_inv_ia; let i_b: f32 = th...
Rust
0
# 제대로 추론되지 않은 이미지를 따로 모아두기 위함 # 0. 추론할 이미지 폴더(images), 잘못 추론한 이미지 폴더(garbages) 필요 # 1. 모델 불러오기 # 2. 모델에 이미지 넣기 (추론) # 3. 추론 결과 확인 (imshow) # 4. 제대로 됐으면 Enter, 제대로 안 됐으면 Esc(이미지 저장) import torch import cv2 import os import shutil import numpy as np from pathlib import Path import sys sys.path.append(str(Path(__file__...
Python
1
from src.main import main def test_main() -> None: main()
Python
1
underline_size: span_data.underline_size.unwrap_or(metrics.stroke_size), strikeout_offset: metrics.strikeout_offset, strikeout_size: metrics.stroke_size, advance, }); } fn push_glyph(&mut self, glyph: &ShapedGlyph) -> u32 { let glyph_index = self.data.g...
Rust
0
::Error for TryRecvError {} #[cfg(test)] mod tests { use super::*; use proptest::prelude::*; proptest! { #[test] fn send_error_implements_error_trait(err: SendError<()>) { assert_eq!( format!("{}", err), format!("{}", Box::<dyn error::Error>::fro...
Rust
0
from flask.cli import AppGroup from .users import seed_users, undo_users from .clubs import seed_clubs, undo_clubs from .club_members import seed_club_members, undo_club_members from .club_messages import seed_club_messages, undo_club_messages from .books import seed_books, undo_books from .liked_books import seed_like...
Python
1
or. /// /// See [size](../ops/fn.size.html). pub fn size(&self) -> Tensor { ::ops::size(self) } #[doc(hidden)] #[inline] /// Returns true if this node has no incoming nodes. pub fn is_source(&self) -> bool { self.inputs.is_empty() } } // empty implementation...
Rust
0
}; near_sdk::env::set_blockchain_interface(Box::new(MockedBlockchain::new( $context, $config, $fee_config, vec![], storage, $validator ))); }; ($context:expr, $config:expr, $fee_config:expr) => { testing_env!($cont...
Rust
0
# Copyright (C) 2023 Intel Corporation # # SPDX-License-Identifier: MIT import shutil from time import sleep import pytest from tests.utils.test_utils import TestCaseHelper, TestDir def pytest_configure(config): # register additional markers config.addinivalue_line("markers", "unit: mark a test as unit tes...
Python
1
from enum import Enum from objects.phones import Phone from config.fx import * vowel_list = ["A", "E", "I", "O", "U"] class Vowel(Phone): def __init__(self, arpa: str, fx: str, is_stressed): super().__init__(arpa, fx) self.is_stressed = is_stressed self.lexical_set = "" # prints un...
Python
1
channel.wait_close().unwrap(); } } } /* tag::catalog[] Title:: Boundary nodes nginx test Goal:: Verify that nginx configuration is correct by running `nginx -T` on the boundary node. Runbook: . Set up a subnet with 4 nodes and a boundary node. . SSH into the boundary node and execute `sudo nginx -t`...
Rust
0
queue family"); let (device, mut queues) = { let device_ext = DeviceExtensions { khr_swapchain: true, .. DeviceExtensions::none() }; Device::new(physical, physical.supported_features(), &device_ext, [(queue_family, 0.5)].iter().cloned()) ...
Rust
0
""" * EJERCICIO: * ¡Deadpool y Wolverine se enfrentan en una batalla épica! * Crea un programa que simule la pelea y determine un ganador. * El programa simula un combate por turnos, donde cada protagonista posee unos * puntos de vida iniciales, un daño de ataque variable y diferentes cualidades * de regeneración...
Python
1
} #[doc = "Bit 15 - RTC Offset Calibration Sign"] #[inline(always)] pub fn rtcocals(&self) -> RTCOCALS_R { RTCOCALS_R::new(((self.bits >> 15) & 0x01) != 0) } } impl W { #[doc = "Bit 0 - RTC Offset Calibration Bit 0"] #[inline(always)] pub fn rtcocal0(&mut self) -> RTCOCAL0_W { ...
Rust
0
/// ``` /// /// *Incorrect* usage of this function: /// ```no_run /// # use const_buffer::ConstBuffer; /// let buffer = ConstBuffer::<&'static u32, 10>::zeroed(); /// let x = unsafe { buffer.read(0) }; /// ``` #[inline] pub fn zeroed() -> Self { Self::from_maybe_uninit_array(...
Rust
0
option. pub mod checkbox_widget; <gh_stars>0 //! An implementation of the [MD6 hash function](http://groups.csail.mit.edu/cis/md6), via FFI to reference implementation. //! //! For more information about MD6 visit its [official homepage](http://groups.csail.mit.edu/cis/md6). //! //! There are two APIs provided: one fo...
Rust
0
"""Test Module for People Class""" # pylint: disable=invalid-name from Classes import GameBase, People from Handlers import Matching def test_PeopleIdTest() -> None: currentGame = GameBase.MainGame(activateScreen=True) worker1 = People.Worker.CreateWorker(activeGame=currentGame)[0] worker2 = People.Work...
Python
1
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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 requ...
Python
1
""" 此脚本的主要内容 1. 将外部框架的数据格式转换成pascal voc格式,仅支持水平框格式 数据集目录结构 . ├── images │   ├── ...... │   └── xxx.jpg ├── labels │   ├── ...... │   └── xxx.txt └── classes.txt 使用方法,需要输入三个参数: --csv-file: .csv文件存放的路径 --img-dir: 标签文件对应图片的存放路径 --output-dir: yolo格式输出的路径,默认路径为labelme标签文件夹的同级 annotations目录 """ import argparse import gl...
Python
1
_list.append(ipt_score_mean) # print(f"ipt is {self.ipt}") # print(f"exp_avg_ipt is {self.exp_avg_ipt[n]}") # print(f"exp_avg_unc is {self.exp_avg_unc[n]}") return ipt_name_list, ipt_score_list def _combine_ipt(self, ipt_E, ipt_AB): ipt_AB = ipt_AB.sum(dim=1, keepdim=False) ...
Python
1
}; use sshkeys::PublicKey; use std::collections::HashMap; use std::fmt; use std::net::{IpAddr, Ipv4Addr}; #[derive(Debug, Deserialize, PartialEq, Clone, Serialize)] #[serde(rename_all = "lowercase")] pub enum Arch { AARCH64, ARMHF, } impl fmt::Display for Arch { fn fmt(&self, f: &mut fmt::Formatter) -> fm...
Rust
0
ValueBaseObject { _unused: [u8; 0], } extern "C" { pub fn alt_IMValueBaseObject_CAPI_Free(ptr: *mut alt_IMValueBaseObject); } extern "C" { pub fn alt_CRefCountable_to_alt_IMValueBaseObject( from: *mut alt_CRefCountable, ) -> *mut alt_IMValueBaseObject; } extern "C" { pub fn alt_IMValueBaseOb...
Rust
0
""" Модуль для обробки транзакцій """ import os from datetime import datetime from decimal import Decimal import asyncio from loguru import logger from typing import Optional from solders.keypair import Keypair import base58 from api.jupiter import JupiterAPI from api.quicknode import QuicknodeAPI # Константи WSOL_A...
Python
1
from flask import Blueprint main = Blueprint('blueprint', __name__) @main.route('/one', methods=['GET']) def one(): return ('<h1>HOME</h1>')
Python
1
rotoEntry; use protover::ProtoverVote; use protover::UnvalidatedProtoEntry; #[test] fn parse_protocol_with_single_proto_and_single_version() { let _: ProtoEntry = "Cons=1".parse().unwrap(); } #[test] fn parse_protocol_with_single_protocol_and_multiple_versions() { let _: ProtoEntry = "Cons=1-2".parse().unwrap...
Rust
0
rue) } #[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 & !(0x01 << 24)) | ((value ...
Rust
0
import tkinter as tk from tkinter import ttk # Crear la ventana principal root = tk.Tk() root.title("Formulario de Cálculo con Pestañas") # Ajustar el tamaño de la ventana root.geometry("600x300") root.config(bg="#f2f2f2") # Función para calcular en la primera pestaña def calcular_pestana1(): try: h = fl...
Python
1
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns def estatisticas_basicas(df: pd.DataFrame) -> pd.DataFrame: """ Calcula estatísticas básicas para o DataFrame de dados. """ stats = df.describe().T[['mean', 'std']] stats['correlacao_selic_ipca'] = df['selic'].corr(df['ipca'...
Python
1
erand::Implied => self.opcode.fmt(f), _ => write!(f, "{} {}", self.opcode, self.operand) } } } pub fn decode(buf: &[u8]) -> Option<Instruction> { fn op16(buf: &[u8]) -> Option<u16> { Some(((buf.get(2)?.clone() as u16) << 8) | (buf.get(1)?.clone() as u16)) } fn op8(buf: &[...
Rust
0
profile::GeoRedundantBackup>, #[doc = "Max storage allowed for a server."] #[serde(rename = "storageMB", default, skip_serializing_if = "Option::is_none")] pub storage_mb: Option<i32>, #[doc = "Enable Storage Auto Grow."] #[serde(rename = "storageAutogrow", default, skip_serializing_if = "Option::is...
Rust
0
32; #[doc = "*Required features: 'Win32_System_Com'*"] pub const CLSCTX_RESERVED3: CLSCTX = 256u32; #[doc = "*Required features: 'Win32_System_Com'*"] pub const CLSCTX_RESERVED4: CLSCTX = 512u32; #[doc = "*Required features: 'Win32_System_Com'*"] pub const CLSCTX_NO_CODE_DOWNLOAD: CLSCTX = 1024u32; #[doc = "*Required f...
Rust
0
This also sets the `SO_REUSEPORT` and `SO_REUSEADDR` options on the /// socket. pub fn bind(address: SocketAddr) -> io::Result<TcpListener> { sys::TcpListener::bind(address).map(|inner| TcpListener { inner }) } /// Create a independently owned handle to the underlying socket. /// /// Th...
Rust
0
<4)) # print("22H:0x%X" % reg) self._writeReg(0x22, reg) # MIC PGA else: pass # print("invalid micropython gain") def setD2sePga(self, gain): if ((gain>D2SE_PGA._D2SE_PGA_GAIN_MIN) and (gain<D2SE_PGA._D2SE_PGA_GAIN_MAX)): reg = self._readR...
Python
1
""" Write a function to find the nth jacobsthal number. https://www.geeksforgeeks.org/jacobsthal-and-jacobsthal-lucas-numbers/ 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, ... assert jacobsthal_num(5) == 11 """ def jacobsthal_num(n): """ :param n: int :return: int """ if n < 0: ...
Python
1
nt.request(proxy_req).await; metrics.lock().unwrap().concurrent_requests.decrement(); result } fn determine_delay(scenario: &Scenario, metrics: &Mutex<Metrics>) -> Fault { let x: f32 = rand::random(); if x <= scenario.frequency { metrics.lock().unwrap().delays.increment(); return (No...
Rust
0
part1(&input); part2(&input); } ); fn part1(origami: &Origami) -> Output { fold(&origami.coords, origami.folds[0]).len().to_string() } fn part2(origami: &Origami) -> Output { let coords = origami.coords.clone(); let coords = origami.folds.iter().fold(coords, |c, f| fold(&c, *f)); let (wid...
Rust
0
rror::Error for DateError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { DateError::ParseError(pie) => Some(pie), DateError::IoError(ioe) => Some(ioe), _ => None, } } } impl std::convert::From<std::io::Error> for DateError { ...
Rust
0
 c@sEddlZejdedddlmZeZdZdZdS(iNs1the md5 module is deprecated; use hashlib insteadi(tmd5ii(twarningstwarntDeprecationWarningthashlibRtnewt blocksizet digest_size(((smd5.pyt...
Python
1
1 || opts.pxe; let stdout = std::io::stdout(); let is_stdout = opts.dest == "-"; if is_stdout && nix::unistd::isatty(1)? { return Err(anyhow!("Refusing to output to a tty")); } let target = match (is_stdout, have_multiple) { (true, true) => OutputTarget::Tar(tar::Builder::new(stdout...
Rust
0
hanged("package \n\t//comment\n\tfoo\n"); assert_unchanged("{\n\t//comment\n\tfoo with a: 1, b: 2}"); assert_unchanged("{foo\n\t//comment\n\t with a: 1, b: 2}"); assert_unchanged("{foo with \n\t//comment\n\ta: 1, b: 2}"); assert_unchanged("fn = (tables=\n\t//comment\n\t<-) =>\n\t(tables)"); // Co...
Rust
0
SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 64; pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 65; pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 66; pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 67; pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdent...
Rust
0
Self::Root { self } fn num_constraints(&self) -> usize { todo!() } } fn lc_to_string<F: PrimeField>(lc: &LinearCombination<F>) -> String { let mut string = String::new(); let mut is_first = true; for (var, c) in lc.as_ref() { let c_value = utils::fr_to_bigint_signed(c...
Rust
0
webauthstate = ''.join(random.choice(string.ascii_letters) for _ in range(32)) webauthparms = {'client_id': '42e8e8e9d844e45c2d05', 'redirect_uri': 'https://github.com/login/oauth/success', 'scope': 'gist', 'state': webauthstate} w = QGithubDeviceA...
Python
1
addr={:#x}", vaddr); let mut rkey_buf = [MaybeUninit::uninit(); 100]; let len = endpoint.stream_recv(&mut rkey_buf).await; println!("recv rkey: len={}", len); let rkey = RKey::unpack(&endpoint, unsafe { transmute(&rkey_buf[..len]) }); let mut buf = vec![0; 0x1000]; endpoint.get(&mut buf, vaddr...
Rust
0
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
1
qpair: *mut spdk_nvme_qpair, lba: u64, lba_count: u32, cb_fn: spdk_nvme_cmd_cb, cb_arg: *mut ::std::os::raw::c_void, io_flags: u32, reset_sgl_fn: spdk_nvme_re...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 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
guid_iter = GUIDerator() seq_guid_iter = SequentialGUIDerator() # """ # May actually be faster to do an isinstance check for a str path # $ python -m timeit -s "x = [1]" "x[0]" # 10000000 loops, best of 3: 0.0207 usec per loop # $ python -m timeit -s "x = [1]" "try: x[0] \nexcept: pass" # 10000000 loops, best of 3...
Python
1
come<Function>> { db.lookup_intern_cc_fn(*self) } } intern_key!(NamespaceId); impl NamespaceId { #[allow(unused)] pub fn lookup(&self, db: &impl CcSourceIr) -> Namespace { db.lookup_intern_cc_namespace(*self) } } #[derive(Copy, Clone, Debug, ...
Rust
0
ine_to_byte(5); } #[test] fn line_to_char_01() { let r = Rope::from_str(TEXT_LINES); assert_eq!(0, r.line_to_char(0)); assert_eq!(32, r.line_to_char(1)); assert_eq!(59, r.line_to_char(2)); assert_eq!(88, r.line_to_char(3)); assert_eq!(100, r.line_to_char(4))...
Rust
0
} } } impl fmt::Display for Color { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Color::Reg(r) => write!(f, "{}", r), Color::StackSlot(slot) => write!(f, "{}", slot), } } } <reponame>hjiayz/quickjs_regex<filename>benches/benchmark.rs // Copyri...
Rust
0
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..dti import TractSkeleton def test_TractSkeleton_inputs(): input_map = dict( alt_data_file=dict( argstr="-a %s", extensions=None, ), alt_skeleton=dict( argstr="-s %s", extensions=Non...
Python
1
#!/usr/bin/python3 # -*- coding: utf-8 -*- from wikiapi import WikiApi import requests, pprint # This is suitable for extracting content that is organized by categories and sub-categories # This code requires the wiki-api python library created by Richard O'Dwyer of UK # https://github.com/richardasaurus/wiki-api # N...
Python
1
#Абстрактный класс. Метод будет переопределен в дочерних классах, чтобы реализовать свой собственный способ обработки платежа class PaymentAdapter: def process_payment(self, amount): raise NotImplementedError #Реализация для paypal class PayPalPaymentAdapter(PaymentAdapter): def process_payment(self, am...
Python
1
RuntimeDebug)] pub enum DataIndustry { Business = 0, Internet, Finance, Healthcare, PoliticsAndCulture, ComputerScience, EngineeringAndTransportation, Safety, FashionAndArt, NatureScience, } #[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug)] pub enum DataTechno...
Rust
0
flags: &NumberFlags, __0: (usize, Precision, usize), __1: (usize, (usize, &'input str, usize), usize), ) -> Result<(Precision, isize),__lalrpop_util::ParseError<usize,number_lexer::Tok<'input>,number_lexer::Error>> { let __start0 = __0.2.clone(); let __end0 = __1.0.clone(); let __temp0 = __action...
Rust
0
1 = 1 + test1 # These tests work if rtol < eps t2 = 1 + test2 if t2 <= 1: istop = 2 if t1 <= 1: istop = 1 if itn >= maxiter: istop = 6 if Acond >= 0.1/eps: istop = 4 if epsx >= b...
Python
1
impl Consensus for ConsensusStrategy { fn calculate_next_difficulty(&self, reader: &dyn ChainReader) -> Result<U256> { match self { ConsensusStrategy::Dummy => DUMMY.calculate_next_difficulty(reader), ConsensusStrategy::Argon => ARGON.calculate_next_difficulty(reader), C...
Rust
0
allowed_moves.append(forward) if start_position[0] == initial_position: # If pawn is in starting position allow double moves double_forward = (forward[0] + direction, forward[1]) if model.get_alphanumeric_position(double_forward) not in prohibited: ...
Python
1
info = { "name": "nmg", "date_order": "DMY", "january": [ "ng1", "ngwɛn matáhra" ], "february": [ "ng2", "ngwɛn ńmba" ], "march": [ "ng3", "ngwɛn ńlal" ], "april": [ "ng4", "ngwɛn ńna" ], "may": [ "ng5", ...
Python
1
skip_serializing_if = "Option::is_none")] pub authentication_type: Option<storage_endpoint_properties::AuthenticationType>, } impl StorageEndpointProperties { pub fn new(connection_string: String, container_name: String) -> Self { Self { sas_ttl_as_iso8601: None, connection_stri...
Rust
0
crate: @ast::crate, ext_cx: @ExtCtxt, path: ~[ast::ident], fns: ~[ListenerFn] } fn fold_mod(_ctx: @mut ReadyCtx, m: &ast::_mod, fold: @fold::ast_fold) -> ast::_mod { fn strip_main(item: @ast::item) -> @ast::item { @ast::item { attrs: do item.attrs.iter().filt...
Rust
0
as_bytes()) .map_err(|e| Error::Internal(e.to_string()))?, (false, false) => src .write_all(EVAL_BOTH_IPVER.as_bytes()) .map_err(|e| Error::Internal(e.to_string()))?, } src.write_all(PROGRAM.as_bytes()) .map_err(|e| Error::Internal...
Rust
0
: return an error in case of mutex failure return Ok(Async::NotReady); } } } // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-...
Rust
0
xeb\xb5\x1a\ \x15\xff\x00f\x93\xfc\xdb\x81F\x0c\xfc\xea\xbc\x0e\x98\xdc\ \x1fn\xd5D\x92\x0f\xb5\x00P\x11T\x15\xcd\x88\xc5\x0c\ \x07#S\x04g\xff\x00\x9a\xdc8{W\xfb\xda>\xed\ q\x01\xe6\xd29L\xfcc\xfb\xd6\x9c\x0f\x9a\xa0T\x19\ L\x83 \x835\xaa\xce\xeev\xf59\x96\xddW\x88S\ \xc0\xdd\x7fAV\x8b\xca\x9bv\xac\xdd\xd2^R\xc2\xd5\ s...
Python
1
1_hit_num + l1_miss_num) as f32) as f32 ); // Average hit latency println!( "Cache Hit Latency = {} cycles", (l1_hit_num as f32 * L1_CACHE_HIT_LATENCY as f32 + l1_miss_num as f32 * L2_CACHE_HIT_LATENCY as f32) / (l1_hit_num as f32 + l1_miss_num as f32) ); // Average miss latency println!( ...
Rust
0
# n = 0 v = 0 ma = 0 me = 0 numeros = [6, 2, 3, 1, 9, 6, 7, 3] for n in numeros: if n > v: ma = n elif n < v: me = v print(ma) print()
Python
1
# image_dataset.pre_patch = np.ones([1920,1920,3]) *255* ratio img_list = [] patch_list = [] for i in range(1000): img ,patch = image_dataset.__getitem__(idx,fst=True,cmp=True) img = img.astype(np.float32) img_list.append(img) ...
Python
1
/ 2.); let br_uv = vec2(0., 0.); let tr_pos = vec3(x + width / 2., y + height / 2., z + length / 2.); let tr_uv = vec2(1., 0.); let tl_pos = vec3(x + width / 2., y - height / 2., z + length / 2.); let tl_uv = vec2(1., 1.); draw_quad([ (bl_pos, bl_uv, color), (br_pos, br_uv, c...
Rust
0