text
string
label_name
string
labels
int64
InvalidCandidate(WasmInvalidCandidate::ParamsTooLarge(l))) => Ok(ValidationResult::Invalid(InvalidCandidate::ParamsTooLarge(l as u64))), Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::CodeTooLarge(l))) => Ok(ValidationResult::Invalid(InvalidCandidate::CodeTooLarge(l as u64))), Err(ValidationError...
Rust
0
# Form implementation generated from reading ui file 'progress.ui' # # Created by: PyQt6 UI code generator 6.4.2 # # WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. from PyQt6 import QtCore, QtGui, QtWidgets class Ui_P...
Python
1
; #[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"] pub const IMMPID_RP_SMTP_STATUS_STRING: IMMPID_RP_ENUM = 8206i32; #[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"] pub const IMMPID_RP_DSN_PRE_CAT_ADDRESS: IMMPID_RP_ENUM = 8207i32; #[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"] pub const I...
Rust
0
to-ie6-only {\ \n * html {\ \n @content;\ \n }\ \n}\ \n@include apply-to-ie6-only {\ \n #logo {\ \n background-image: url(/logo.gif);\ \n }\ \n}\n"), "div {\ \n /* with a cont...
Rust
0
proc_macro_attribute] pub fn bridge(_args: TokenStream, raw_input: TokenStream) -> TokenStream { let module_data = parse_macro_input!(raw_input as JNIBridgeModule); let mut transformer = ModTransformer::new(module_data); let tokens = transformer.transform_module(); tokens.into() } #[proc_macro_error]...
Rust
0
ID, Vec<CaveID>>, } type Path = Vec<CaveID>; // ================================================== AUX FUNCTIONS ================================================== fn count_element<T: PartialEq>(vector: &Vec<T>, element: &T) -> u64 { let mut count : u64 = 0; for elem in vector { if elem == element {...
Rust
0
; assert_eq!(response.status(), actix_web::http::StatusCode::OK); let response: Value = test::read_body_json(response).await; assert_eq!(response, json!(["lang1", "lang2", "lang3", "lang4"])); } //! Join MM1/MM0 files with imports by concatenation //! //! This module implements a very simple import-by-text-...
Rust
0
b"al\xc0\x10\x00\x01\x80\x01\x00\x00\x00\x01\x00\x04\xc0\xa8\xd0\x05\x04a" b"tk2\x04dns2\xc0\x14\x00\x01\x80\x01\x00\x00\x00\x01\x00\x04\xc0\xa8\xd0\x05" b"\x04atk3\xc0\x10\x00\x01\x80\x01\x00\x00\x00\x01\x00\x04\xc0\xa8\xd0" b"\x05\x04atk4\x04dns5\xc0\x14\x00\x01\x80\x01\x00\x00\x00\x01\x00\x04...
Python
1
"""Visualize convergence of the BCH formula approximation on so(n). Visualize the first, second and third order approximation of the Baker Campbell Hausdorff formula on so(n). To this end, sample 2 random elements a,b of so(n) and compute both the BCH approximations of different orders as well as log(exp(a)exp(b)) and...
Python
1
4iv (GLuint index, const GLint *v); // GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); // GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); // GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); // GLAPI void APIENTRY glVertexAt...
Rust
0
e = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center") for i in range(0, image.shape[1], 16): image[:, i: i + 16] = self.process_latent_in(image[:, i: i + 16]) image = utils.resize_to_batch_size(image, noise.shape[0]) if not se...
Python
1
let q = Quat::<f32>::init_from_axis_angle_degree( (axis, 90f32) ); let ( axis, angle ) = q.to_axis_angle(); assert!( axis.is_equal( &axis_normalize, 0.0001f32 ).expect("is_equal invalid") ); assert!( angle/PI*180f32 == 90f32 ); } { //compute rotation using quaternion ...
Rust
0
import pandas as pd import numpy as np import matplotlib.pyplot as plt #库 data_0 = pd.read_csv('D:/桌面/数据3/区域负荷2020-2023数据.csv', encoding='gbk')#导入数据 data_0['总有功功率(kw)'] = data_0['总有功功率(kw)']/4 #如果为15min数据,假设每一段功率恒定,用功率计算用电量 data_0.columns = ['Date', 'Usage_kWh'] plt.figure(figsize=(16, 8)) plt.plot(data_0['Usage_kWh...
Python
1
+= sampling_l * self.output_sampling_step as f32; self.now_input_sampling_r += sampling_r * self.output_sampling_step as f32; } fn drain(&mut self) -> (f32, f32) { (self.output_sampling_l, self.output_sampling_r) } fn change_sapmling_rate(&mut self, _sampling_rate: u32) { todo...
Rust
0
from datetime import datetime, UTC, timedelta from database import db class User(db.Model): __tablename__ = "user" id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(120), unique=True, nullable=False) password = db.Column(db.String(255), nullable=False) name = db.Column(db.S...
Python
1
FuncType = 1, NanFuncServiceId = 2, NanFuncPublishType = 3, NanFuncPublishBcast = 4, NanFuncSubscribeActive = 5, NanFuncFollowUpId = 6, NanFuncFollowUpReqId = 7, NanFuncFollowUpDest = 8, NanFuncCloseRange = 9, NanFuncTtl = 10, NanFuncServiceInfo = 11, NanFuncSrf = 12, Nan...
Rust
0
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ############################################################# # File: OSAG.py # Created Date: Tuesday April 28th 2022 # Author: Chen Xuanhong # Email: chenxuanhongzju@outlook.com # Last Modified: Sunday, 23rd April 2023 3:08:49 pm # Modified By: Chen Xuanhong # Copyright (...
Python
1
""" Test that environment variables may be defined """ import os import subprocess import sys import tempfile import time from getpass import getuser def test_env(capfd): """ Validate that you can define environment variables See https://gist.github.com/hwine/9f5b02c894427324fafcf12f772b27b7 for how...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from . import hr_employee from . import res_partner from . import res_users from . import hr_homeworking from . import hr_work_location
Python
1
parser.add_argument('-l', '--listtools', action='store_true', help='list the available tools') parser.add_argument('-b', '--build', action='store_true', help='run the desired build process') parser.add_argument('-d', '--deploy', action='store_true', ...
Python
1
idebar.number_input("area_worst") smoothness_worst= st.sidebar.number_input("smoothness_worst") compactness_worst= st.sidebar.number_input("compactness_worst") concavity_worst= st.sidebar.number_input("concavity_worst") concave_points_worst= st.sidebar.number_input("concave points_worst") symmetry_w...
Python
1
ErrorKind, msg: String) -> PsError { return PsError { kind, msg }; } } impl From<std::io::Error> for PsError { fn from(err: std::io::Error) -> Self { PsError { kind: PsErrorKind::IoError, msg: err.to_string(), } } }...
Rust
0
# SPDX-License-Identifier: MPL-2.0 # Copyright 2020-2025 John Mille <john@compose-x.io> """ Manages to add the SSM Parameter for FireLens configuration """ from __future__ import annotations from json import dumps from typing import TYPE_CHECKING if TYPE_CHECKING: from ecs_composex.ecs.ecs_family import Compo...
Python
1
ank_proof(None) .build() .unwrap() } } #[cfg(test)] mod tests { use ring::rand::SystemRandom; use super::*; #[test] fn test_if_answering_proofs_verify() { let rng = Arc::new(Mutex::new(SystemRandom::new())); let pass = Password::gen(rng.clone()); //...
Rust
0
s = input().strip() N = len(s) p = 0 while p < N and s[p] != 'h': p += 1 while p < N and s[p] != 'e': p += 1 while p < N and s[p] != 'l': p += 1 p += 1 while p < N and s[p] != 'l': p += 1 while p < N and s[p] != 'o': p += 1 if p < N: print("YES") else: print("NO")
Python
1
lf) { self.make_ascii_uppercase(); } #[inline] fn make_ascii_lowercase(&mut self) { self.make_ascii_lowercase(); } } } #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] impl AsciiExt for u8 { type Owned = u8; delegating_ascii_methods!(); } #[stable(feature = "rust1", sin...
Rust
0
t, "image": image}, ) else: return ( "/_send_group_notice", {"group_id": group_id, "content": content}, ) async def get_group_notice(self, group_id: Union[int, str]): """ :param group_id: 群号 :return: 获取群公告 "...
Python
1
self.big_map[ self.now_loc[0] - 88 + i, self.now_loc[1] - 88 + j ] += 50 # 移动后根据旧坐标获得新坐标(匹配) # rg:匹配的范围(以旧坐标为中心) fbw:是否进行缩放 # fbw:(人物静止/移动时小地图会有个缩放的过程,fbw=0表示当前人物是静止状态,因此缩放到移动状态与大地图匹配)ps:大地图是移动状态录制的 def get_loc(self, bw_map, rg=10, fbw=0, o...
Python
1
w } } #[doc = "Reader of field `M7_APC_AC_R0_BOT`"] pub type M7_APC_AC_R0_BOT_R = crate::R<u32, u32>; #[doc = "Write proxy for field `M7_APC_AC_R0_BOT`"] pub struct M7_APC_AC_R0_BOT_W<'a> { w: &'a mut W, } impl<'a> M7_APC_AC_R0_BOT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] p...
Rust
0
#! /usr/bin/env python # coding=utf8 # # Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. #...
Python
1
len()); for (i, transformed) in transformed.iter().enumerate() { let mut r = D::zero(); for (j, data) in data.iter().enumerate() { r = r + data.clone().mul_unity_root_pow(3 * i * j); } assert_eq!(*transformed, r, "mismatch at index {}", i); ...
Rust
0
C::decode(&mut decoder)?, D::decode(&mut decoder)?, E::decode(&mut decoder)?, )) } } impl<A, B, C, D, E, F> Decode for (A, B, C, D, E, F) where A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, { fn decode<_D: Decoder>(mut decoder: &m...
Rust
0
""" Adds subtitles to the recorded video. """ path = os.getcwd() + '/recordings' input_video = f"{path}/{self._filename}_1.webm" video_input_stream = ffmpeg.input(input_video) output_video = input_video.replace(".webm", ".mp4") stream = ffmpeg.output(video_input_s...
Python
1
# Generated by Django 5.1.4 on 2025-01-17 18:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracker', '0049_add_milestone_run'), ] operations = [ migrations.RenameField( model_name='interview', old_name='inte...
Python
1
import os from dotenv import load_dotenv from typing import Optional load_dotenv() class Settings: OPENAI_API_KEY: Optional[str] = os.getenv("OPENAI_API_KEY") if not OPENAI_API_KEY: raise EnvironmentError("OPENAI_API_KEY not set in environment variables") DOC_SOURCE_PATH: Optional[str] = "./knowl...
Python
1
uple(outputs) self.write_to_logger(output_str) if self.pickle_f_custom_freq is not None and epoch % self.pickle_f_custom_freq == 0: if self.custom_eval_func is not None: self.custom_eval_func(self.model, paths.get_custom_eval_path(epoch, self.model.root_p...
Python
1
identifier. /// /// This expects and relies upon the existence of canonical encodings for /// each effecting component of a transaction. /// /// This implements the [TxId Digest section of ZIP 244](https://zips.z.cash/zip-0244#txid-digest) pub struct TxIdDigester; impl<A: Authorization> TransactionDigest<A> for TxIdD...
Rust
0
(&req)?) } #[derive(Debug, Clone)] struct Config { root: String, index: String, } #[actix_web::main] async fn main() -> std::io::Result<()> { set_var("RUST_LOG", "actix_web=info"); env_logger::init(); let matches = clap::App::new("server") .version("1.0") .arg(clap::Arg::with_name...
Rust
0
/www.w3.org/2000/09/xmldsig#", namespace = "md: urn:oasis:names:tc:SAML:2.0:metadata" )] pub struct AuthnAuthorityDescriptors { #[yaserde(attribute, rename = "ID")] pub id: Option<String>, #[yaserde(attribute, rename = "validUntil")] pub valid_until: Option<UtcDateTime>, #[yaserde(attribute, ren...
Rust
0
CK_DBG_EN_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `LOCK_DBG_EN`"] pub type LOCK_DBG_EN_R = crate::R<bool, LOCK_DBG_EN_A>; impl LOCK_DBG_EN_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOCK_DBG_EN_A { match self.bits { ...
Rust
0
}; } #[no_mangle] pub unsafe extern "C" fn print_write_whatsit(mut s: *const i8, mut p: i32) { print_esc_cstr(s); if (*mem.offset((p + 1i32) as isize)).b32.s0 < 16i32 { print_int((*mem.offset((p + 1i32) as isize)).b32.s0); } else if (*mem.offset((p + 1i32) as isize)).b32.s0 == 16i32 { p...
Rust
0
Pyg, Qar, Rhd, Rok, Rol, Ron, Rsd, Rub, Rur, Rwf, Sar, Sbd, Scr, Sdd, Sdg, Sdp, Sek, Sgd, Shp, Sit, Skk, Sll, Sos, Srd, Srg, Ssp, Std, Stn, Sur, Svc, Syp, Szl, Thb, Tjr, Tjs, ...
Rust
0
mapped.offset(*comps_indices.offset(i as isize) as isize) = 1 as libc::c_int; i = i.wrapping_add(1) } opj_free(already_mapped as *mut libc::c_void); opj_free( (*p_j2k) .m_specific_param .m_decoder .m_comps_indices_to_decode as *mut libc::c_void, ); if numcomps != 0 { (*p_j2k) ...
Rust
0
ge(self._version, response, self._solution) def get_page(self, target_url: str) -> SchemaVersionPage: """ Retrieve a specific page of SchemaVersionInstance records from the API. Request is executed immediately :param target_url: API-generated URL for the requested results page ...
Python
1
from django.urls import path from .views import JobListCreateView, JobDetailView,JobApplicationCreateView,EmployerDashboardView,JobSeekerDashboardView,JobDetailUpdateView,JobApplicantsView,JobSeekerDetailView,CategoryListView urlpatterns = [ path('jobs/', JobListCreateView.as_view(), name='job-list-create'),#j...
Python
1
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limita...
Python
1
GTSVECTOR - GiST index internal text representation for text search"] 3642 => Gtsvector: Kind::Simple, #[doc="TSVECTOR[]"] 3643 => TsvectorArray: Kind::Array(Type::Tsvector), #[doc="GTSVECTOR[]"] 3644 => GtsvectorArray: Kind::Array(Type::Gtsvector), #[doc="TSQUERY[]"] 3645 => TsqueryArray: K...
Rust
0
lue: tuple[int, int, int, int], *, disabled: bool = False, visible: bool = True, hint: str | None = None, order: float | None = None, ) -> GuiRgbaHandle: """Add an RGBA picker to the GUI. All values should be in [0, 255]. Args: label: Label to dis...
Python
1
ls = row[-1].replace('"', "") if frame_labels != "": labels[video_name].append( [int(x) for x in frame_labels.split(",")] ) else: labels[video_name].append([]) if return_list: keys = image_paths.keys() image...
Python
1
values(self, observed, parameter=None, ndraw=10000, burnin=2000, stepsize=None, sample=None, alternative='twosided'): ...
Python
1
let mut q = std::collections::VecDeque::new(); for i in 0..n { while let Some(&id) = q.front() { if id + k <= i { q.pop_front(); } else { break; } } while let Some(&id) = q.back() ...
Rust
0
from_millis(250), callback_ch.recv()) .await .expect_err("should have been deleted so no callback"); let watchers = client.get_watch_volume(&volume.spec().uuid).await.unwrap(); assert!(watchers.is_empty()); } } struct A<T>(T); impl A<&'static u8> { fn f() { let ...
Rust
0
@pytest.mark.parametrize(*test_distant_http_model_args) def test_sync_distant_http_model(item, headers, params, expected, distant_http_model_lib, run_mocked_service): try: m = distant_http_model_lib.get('test_distant_http_model') assert expected == m(item, endpoint_headers=headers, e...
Python
1
hape[0], 3)) true_boxes = true_batch_filtered[:, :4] detection_boxes = detection_batch_filtered[:, :4] detection_conf = detection_batch_filtered[:, 5] iou_batch = box_iou_batch(boxes_true=true_boxes, boxes_detection=detection_boxes) matched_idx = np.asarray(iou_batch > iou_thres...
Python
1
888 888 888 888oooo88 {G3} 888 888o o888 888 {G4} o888o 88ooo88 o888o {B}•━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━• {style}{G0} FACEBOOK {RE}●{G0} REFAT SHAHRIAR {style}{G1} GITHUB {RE}●{G1} REFAT-156 {style}{G2} VERSION {RE}●{G2} {vr} {B}•━━━━━━━━━━━━━━━━━━━━━━━━━━...
Python
1
------------------------- fn codegen_atomic_cxchg( &mut self, intrinsic: &str, mut fargs: Vec<Expr>, p: &Place<'tcx>, loc: Location, ) -> Stmt { emit_concurrency_warning!(intrinsic, loc); let var1_ref = fargs.remove(0); let var1 = var1_ref.derefer...
Rust
0
special: Option<fn(&Param) -> Vec<Box<p<String>>>>, ) -> Result<()> where Param: ToBase<MainWeaponBaseData>, { let param = weapon.param; let main = param.to_base(); let element = has_element(param); let second_element = has_second_element(param); let close_range = has_close_range(param); ...
Rust
0
ror::Error; use tracing::{debug, instrument}; /// Everything that can go wrong. #[derive(Error, Debug)] pub enum PwmError { #[error("{0:?} not found")] ControllerNotFound(Controller), #[error("{0:?}/{1:?} not found")] ChannelNotFound(Controller, Channel), #[error("{0:?} not exported")] NotExpor...
Rust
0
camera parameters x = self.cam_param_fc(pred_vertices_sub2) x = x.transpose(1,2) x = self.cam_param_fc2(x) x = self.cam_param_fc3(x) cam_param = x.transpose(1,2) cam_param = cam_param.squeeze() temp_transpose = pred_vertices_sub2.transpose(1,2) pred_verti...
Python
1
), // Common (0x61c, 0x61d), // Arabic (0x61e, 0x61f), // Arabic (0x61f, 0x620), // Common (0x620, 0x640), // Arabic (0x640, 0x641), // Common (0x641, 0x64b), // Arabic (0x64b, 0x656), // Inherited (0x656, 0x670), // Arabic (0x670, 0x671), // I...
Rust
0
of_two(x), 4); } #[test] fn get_generalized_index_length_test() { assert_eq!(get_generalized_index_length(4), 2); assert_eq!(get_generalized_index_length(7), 2); assert_eq!(get_generalized_index_length(9), 3); } #[test] fn get_generalized_index_bit_test() { asse...
Rust
0
values=["0.5", "1.0", "1.5", "2.0", "3.0", "4.0"], width=5, state="readonly") monitor_time_combo.pack(side=tk.LEFT, padx=5) # 按钮区域 button_frame1 = ttk.Frame(control_frame) button_frame1.pack(fill=tk.X, ...
Python
1
(&params.host_and_port, &params.username).await?; // Now we have a connected session, set up the ssh domain and make it // the default domain let gui = front_end().unwrap(); let cmd = if !opts.prog.is_empty() { let builder = CommandBuilder::from_argv(opts.prog); Some(builder) } else...
Rust
0
", "tekelo", "sugars", "soccer18", "mollydog", "melanie1", "littleone", "katerine", "indians", "gatitos", "derrick1", "dalila", "andrada", "aggies", "DAVID", "ANDREW", "123love", "tumadre", "tomas", "symone", "ryan123", "roswell", "...
Rust
0
/// /// Must be combined with a non-[`Raw`] container. /// /// [`Raw`]: Container::Raw Opus, /// The inner bytestream is encoded using raw `i16` samples. /// /// Must be combined with a [`Raw`] container. /// /// [`Raw`]: Container::Raw Pcm, /// The inner bytestream is enco...
Rust
0
the property group and update flags: - monopoly_multiplier runs every time property ownership changes. 1. Properties can have 1/2 depending on if the player owns a monopoly. 2. Railroads can have 1/2/4/8 depending on how many owned 3. Utilities can have 4/10 depending on if ownin...
Python
1
# Generated by Django 2.2.28 on 2023-03-20 19:22 from typing import List, Tuple from django.db import migrations, models import django.db.models.deletion import ietf.utils.models class Migration(migrations.Migration): initial = True dependencies: List[Tuple[str, str]] = [ ] operations = [ ...
Python
1
tree node. #[inline] pub fn get_or_create_node_traversing_with<P, I, F, M>( &mut self, segments: P, mut cons_missing: F, mut callback: M, ) -> &mut HashMapTree<K, T, S> where P: IntoIterator<Item = I>, I: Into<K>, F: FnMut() -> T, M: FnMut...
Rust
0
�', 'ᄼ', '➳', '\u{a9bc}', '\u{11c99}', '௦', 'ﭓ', '\u{1fa19}', '𓍳', '\u{11ca7}', '꘣', 'ꋻ', '៲', '𛁶', 'ﰻ', 'ẹ', '𐌶', '𐩫', '𒊼', 'Ⴝ', '\u{e0139}', '\u{11839}', 'ל', '𑋢', 'ڞ', 'ᆆ', '𔐌', '\u{11c3c}', '⅄', '𖥌', '🎡', '𑊹', '𐅴', 'Բ', '𒑩', '𐧹', 'س', '𘧞', '𛆚', '𑻨', '\u{1e135}', 'ኁ', '㎰', '\u{111cc}'...
Rust
0
percussion"], }, #[cfg(feature = "fr_CA")] crate::Annotation { lang: "fr_CA", tts: Some("boomerang"), keywords: &["australie", "boomerang", "outil", "retour", "répercussion"], }, #[cfg(feature = "ga")] crate::Annotation { la...
Rust
0
mut peripherals.PM, &mut peripherals.SYSCTRL, &mut peripherals.NVMCTRL, ); #[cfg(feature = "usbserial")] { use oven_temp_rs::usbserial::USBSerial; USBSerial::init( &mut peripherals.PM, peripherals.USB, &mut core.NVIC, &mut cloc...
Rust
0
from __future__ import annotations import attr from dl_core.connection_executors.async_sa_executors import DefaultSqlAlchemyConnExecutor from dl_connector_mssql.core.adapters_mssql import MSSQLDefaultAdapter from dl_connector_mssql.core.dto import MSSQLConnDTO from dl_connector_mssql.core.target_dto import MSSQLConn...
Python
1
{{ return 0; }} return 1; }} "#, reference .iter() .map(|x| format!("0x{:02x}", x)) .collect::<Vec<_>>() .join(", "), runtime.name(), ) .unwrap(); let status = Command::new("clang++") .arg("--std=c++17") .arg("...
Rust
0
_retriever(similarity_top_k=5, vector_store_query_mode="hybrid", alpha=1.0) # Testing answers = { "regular": [], "regular_filtered": [], "bm25": [], "hybrid_retriever": [], "hsnw": [], } query = "testing, I would like to order a large pizza with mango, thai ...
Python
1
import json import sys import json from pathlib import Path import pytest from squadmanager.cli import cli def run_cli(args): sys.argv = ['squadmanager'] + args return cli() def test_cli_demo_default(tmp_path, capsys): # Copie du template spec demo_template = Path(__file__).resolve().parents[1] / 'd...
Python
1
split('/') { for bad_str in PATH_ILLEGAL_COMPONENTS { if component == *bad_str { return Err(Error::IllegalArgument(format!( "Path cannot have component {:?}", component ))); } } let component_lower =...
Rust
0
": "CHOCOLATE"}, "value_with_unknown": {"S": "chocolate"}, "value_with_prefix": {"S": "SHAKE_FLAVOR_CHOCOLATE"}, }, ), ], ) def test_serialization( value: Optional[diner_pb2.ShakeFlavor], expected_attributes: Dict[str, Any], uuid_key: str, ) -> None: ...
Python
1
"""로깅 설정 모듈""" import logging import os import sys from typing import Optional def setup_logger(name: str, level: Optional[str] = None) -> logging.Logger: """모듈별 로거 설정""" logger = logging.getLogger(name) # 이미 핸들러가 설정되어 있으면 중복 설정 방지 if logger.handlers: return logger # 로그 레벨 설정 (환경변수 또는 기...
Python
1
name, meshedchannels_name, n_sessions, msg, }) } } impl From<SendCancel> for TokenStream { fn from(input: SendCancel) -> TokenStream { input.expand() } } impl SendCancel { fn expand(&self) -> TokenStream { // Get the basic elements le...
Rust
0
. When you translate, use longer sub_sentence first, then replace short sub_sentence. From left to rigt, step by step using hash_dict to do the translation. It would be very quick and accurate. How to get sub_sentences? Use punctuation to do the spliting. all sub_sentences that does not have punctuation are good s...
Python
1
import network import socket import urandom import uasyncio as asyncio import machine import json # from .dns import DNSServer from .utils import ( remove_wifi_network, modify_wifi_network, get_wifi_network, ) class WiFiAP: def __init__(self, ssid: str = None, password: str = None): """ ...
Python
1
fn decimal_summation_in_256(a: Decimal, b: Decimal) -> Decimal { let a_u256: Decimal256 = a.into(); let b_u256: Decimal256 = b.into(); let c_u256: Decimal = (b_u256 + a_u256).into(); c_u256 } /// return a - b pub fn decimal_subtraction_in_256(a: Decimal, b: Decimal) -> Decimal { let a_u256: Decima...
Rust
0
r of movement commands to move repair droid to oxygen system is {:?}", moves); let minutes = longest_path(goal, 0, &map, &mut HashSet::new()); println!("It will take {:?} minutes to fill all locations with oxygen", minutes); } <reponame>nkinkade/vector use super::InternalEvent; use metrics::counter; #[deriv...
Rust
0
() } } #[test] fn test_pollqueue_empty() { let mut q = PollQueue::new(); assert!(q.is_empty()); assert_eq!(0, q.len()); assert_eq!(q.peek(), None); assert_eq!(q.pop(), None); } #[test] fn test_pollqueue_repeat_push() { let mut q = PollQueue::new(); assert_eq!( q.push(SequenceNu...
Rust
0
>>, } impl _shelving { /*here goes the funcion get, that catch the item from the shelving and put it in the inventory.*/ fn print(&self) { println!("shelving: {}",self.g); } } #[derive(Clone, Debug)] pub struct node { /*this is the general struct for the nodes of the expansion tree of the A_star algor...
Rust
0
return Err(data.to_vec()); } &mut hash.as_mut()[..data.len()].copy_from_slice(data); Ok(ChildReference::Inline(hash, data.len())) } } } } /// Compact and cache-friendly storage for Trie nodes. struct NodeStorage<H> { nodes: Vec<Stored<H>>, free_indices: VecDeque<usize>, } impl<H> NodeStorage<H> {...
Rust
0
. ASKNAME = RB_ASKNAME, /// Tell `init` to boot into single user mode. SINGLE = RB_SINGLE, /// Don't `sync()` the disks before halting/rebooting. /// /// Unlike Linux, on macOS/\*BSD `reboot(2)` normally *does* sync the disks. NOSYNC = RB_NOSYNC, #[cfg(not(any(target_os = "macos", targe...
Rust
0
.has(&module_name) { debug!( "fetch local or reload {} is_module_remote {}", module_name, is_module_remote ); // Note that local fetch is done synchronously. match fetch_local_source(deno_dir, &module_url, &filepath, None) { Ok(Some(output)) => { debug!("found local source ")...
Rust
0
s: 1.0, m: 1.0, } } } impl Distribution for Frechet { type Support = Interval; fn support(&self) -> Interval { Interval::left_bounded(self.m) } fn cdf(&self, x: f64) -> Probability { let z = self.z(x); (-(z.powf(-self.alpha))).exp().into() ...
Rust
0
, user: &str, password: &str) -> Result<Vec<model::Balance>> { client.get(&format!("{}/account/balance", base_url(env))) .basic_auth(user, Some(password)) .execute() } use pinwheel::prelude::*; use tangram_app_layouts::{ app_layout::{AppLayout, AppLayoutInfo}, document::Document, }; use tangr...
Rust
0
// South pole axis yields smaller cap. (-1., PI / 2. + self.lat.hi) } else { (1., PI / 2. - self.lat.lo) }; let pole_cap = Cap::from_center_angle(&Point::from_coords(0., 0., pole_z), &Rad(pole_angle).into()); // For bounding rectangles th...
Rust
0
x = 1 while x <= 6: print(x) x = x + 1
Python
1
registry = "{}" repository = "{}" manifestref_key = "{}" fetch_concurrency = {} anonymous_auth = true "#, &registry, &repo, DEFAULT_MANIFESTREF_KEY, DEFAULT_FETCH_CONCURRENCY, ))?, ...
Rust
0
put[@name="email"]') login_email.send_keys(fake_email) login_password = driver.find_element(By.XPATH, '//*[@id="box-account-login"]//input[@name="password"]') login_password.send_keys(reg_data.get('password')) login_button = driver.find_element(By.XPATH, '//*[@id="box-account-login"]//button[text()="Login"]') login_b...
Python
1
// #[derive(Debug)] // struct Rider { // id: u64, // name: String, // position: Point, // } // // // #[derive(Debug)] // struct World { // id: u64, // height: u32, // weight: u32, // // orders: Vec<Order>, // riders: Vec<Rider>, // } // struct Action { // // } // // #[derive(Debug)] // ...
Rust
0
from threading import Thread import time class Spinner(Thread): """Helper class for examples""" def __init__(self, spinner_style: int = 1) -> None: super().__init__() self.style = spinner_style self.running = False self.output_queue = [] def start(self) -> None: ...
Python
1
fn async_fn_test() { foo().await; let s = String::from("foo"); foo().await; } // FIXME: No way to reliably check the filename. // CHECK-DAG: [[ASYNC_FN:!.*]] = !DINamespace(name: "async_fn_test" // CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "{async_fn#0}", scope: [[ASYNC...
Rust
0
fn encode(&self, target: Ref<'_, Self::Target>) -> u64 { target.as_raw_fd() as u64 } #[inline] unsafe fn decode<'call>(&self, raw: u64) -> Ref<'call, Self::Target> { Ref::new(BorrowedFd::<'a>::borrow_raw_fd(raw as RawFd)) } #[inline] fn release(&self, target: Ref<'_, Self::...
Rust
0
/// better of worse. routes: HashSet<Route, xx::Hash64>, } impl fmt::Display for Routes { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!( formatter, "Routes([{}\n])", self.iter() .map(|route| format!("{}", route)) ...
Rust
0
self.encode_vision(input_frames,test=True).float() clip_feat /= clip_feat.norm(dim=-1, keepdim=True) return clip_feat def get_vid_feat_with_grad(self, input_frames): clip_feat = self.encode_vision(input_frames,test=True).float() clip_feat = clip_feat / clip_feat.norm(dim=-1,...
Python
1