text
string
label_name
string
labels
int64
>, marker: PhantomData<S>, } impl<S: ParamsSpec> Params<S> { pub fn new() -> Params<S> { Params { params: Vec::new(), marker: PhantomData, } } #[inline] pub fn is_empty(&self) -> bool { self.params.is_empty() } #[inline] pub fn with(mut ...
Rust
0
self.client._call_node_rpc = MagicMock(return_value=fake_response) self.client._call_node_api = MagicMock(return_value=fake_response) self.client.ping() # successful run does NOT throw an exception. self.client._call_node_rpc.assert_called_once_with("status", {}) self.client._call_n...
Python
1
] * &b; for i in (0..13).rev() { c = &a[i] * c; } let tmp = c.sum(); let t = now.elapsed().as_secs_f64(); // let flops = 2.0 * (a[0].nrows() * a[0].ncols() * b.ncols()) as f64 / t / 1e9; println!("{}s {}", t, tmp); } fn gemm_bench2() { let a = vec![na::DMatrix::<f32>::from_fn(64, 64...
Rust
0
L.LLLLL.LL".to_string(), ]; let expected = 26; assert_eq!(expected, part2(&input)) } #[test] fn display_works_as_expected() { let input = vec![ "L.LL.LL.LL".to_string(), "LLLLLLL.LL".to_string(), "L.L.L..L..".to_string(), "LL...
Rust
0
urself for prim in (0..primative_count).rev() { let i1 = *ptr.add(prim * 3 + 0); let i2 = *ptr.add(prim * 3 + 1); let i3 = *ptr.add(prim * 3 + 2); // One triangle forward. ptr.add(prim * 6 + 0).write(i1); ptr.ad...
Rust
0
(var_map, &child[1])), -1)]) } else { parse_int_expr(var_map, &child[1]) - parse_int_expr(var_map, &child[2]) } } else if op_name == "if" { assert_eq!(child.len(), 4); parse_bool_expr(var_map, &child[1]).ite( ...
Rust
0
(marker_trait_attr)] //! # fn main() {} //! use drone_cortexm::{map::thr::*, thr}; //! //! thr::nvic! { //! // See the `drone_core` documentation of `thr::pool!` macro for details. //! thread => pub Thr {}; //! //! // See the `drone_core` documentation of `thr::pool!` macro for details. //! local => pub...
Rust
0
r(e), TlsCertFromRegistryError::CertificateNotInRegistry { node_id, registry_version, } => TlsServerHandshakeError::CertificateNotInRegistry { node_id, registry_version, }, TlsCertFromRegistryError::Certifica...
Rust
0
from langchain import utilities EXPECTED_ALL = [ "AlphaVantageAPIWrapper", "ApifyWrapper", "ArceeWrapper", "ArxivAPIWrapper", "BibtexparserWrapper", "BingSearchAPIWrapper", "BraveSearchWrapper", "DuckDuckGoSearchAPIWrapper", "GoldenQueryAPIWrapper", "GoogleFinanceAPIWrapper", ...
Python
1
"source_documents": relevant_docs, "tokens_used": { "prompt_tokens": cb.prompt_tokens, "completion_tokens": cb.completion_tokens, "total_tokens": cb.total_tokens }, "cost": cb....
Python
1
rn "" def autotune(self) -> Config: if os.environ.get("HELION_SKIP_CACHE", "") not in {"", "0", "false", "False"}: return self.autotuner.autotune() if (config := self.get()) is not None: counters["autotune"]["cache_hit"] += 1 log.debug("cache hit: %s", str(confi...
Python
1
pub fn month(&self) -> u32 { let Mdf(mdf) = *self; mdf >> 9 } #[inline] pub fn with_month(&self, month: u32) -> Mdf { let month = Mdf::clamp_month(month); let Mdf(mdf) = *self; Mdf((mdf & 0b1_1111_1111) | (month << 9)) } #[inline] pub fn day(&self) -> u3...
Rust
0
suhu = input("Input temperature? (ex: 30C, 20F, 21K, 44R): ") drjt = int(suhu[:-1]) inputan = suhu[-1] if inputan.upper() == "C": hasil1 = float((9 * drjt) / 5 + 32) hasil2 = float(drjt + 273.15) hasil3 = float(4/5 * drjt) jenisX = "Celcius" jenis1 = "Fahrenheit" jenis2 = "Kelvin" jenis3 = "Reamur" ...
Python
1
ugslafy-ugflsafewfl-918[xbmpo] nwlddtqtpo-ojp-xlcvpetyr-639[ptdlo] nzcczdtgp-prr-opdtry-587[wsiym] ynssr-yehpxk-wxlbzg-111[plhnx] xjmmjndqz-xcjxjgvoz-xjiovdihzio-967[jxioz] enqvbnpgvir-pubpbyngr-znexrgvat-585[qtsjn] gvcskirmg-qekrixmg-ikk-xvemrmrk-126[kmrgi] gpbepvxcv-uadltg-ejgrwphxcv-921[gpvce] kmjezxodgz-nxvqzibzm-c...
Rust
0
\]\[[0-9]+,[0-9]+\])"', line) if bounds_match: # 确保找到匹配项 bounds_text = bounds_match.group(1).strip() bounds.append(bounds_text) # 函数结束后返回结果 return inputs, icons, bounds def actions_generate(html, xml): # 初始化列表 inputs = [] icons = [] bounds = [] ...
Python
1
"), Some(Airport::Gatwick)); //! ``` //! //! The `#[enumscribe(str = "...")]` allows us to specify what string should be used to represent a //! particular variant. If this is omitted, the name of the variant will be used instead. //! //! The `#[enumscribe(case_insensitive)]` attribute can be used to make the "Unscribe...
Rust
0
ed, %d failed" % (len(nb_to_test), len(nb_to_test) - len(fail_nb_dict), len(fail_nb_dict)) if len(fail_nb_dict) > 0: test_summary.write("\n%d notebook tests failed:\n" % le...
Python
1
import yfinance as yf import chainlit as cl import plotly query_stock_price_def = { "name": "query_stock_price", "description": "Queries the latest stock price information for a given stock symbol.", "parameters": { "type": "object", "properties": { "symbol": { "type": "string...
Python
1
ded_pipe = self.pipeline_class.from_pretrained(tmpdirname, torch_dtype=torch_dtype_dict) self.assertEqual(loaded_pipe.transformer.dtype, torch.float16) self.assertEqual(loaded_pipe.text_encoder.dtype, torch.float16) self.assertEqual(loaded_pipe.vae.dtype, torch.float16) @slow @req...
Python
1
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli...
Python
1
Library to generate a random name //! //! The intention here is to have a random name for situations you need to spin up some cloud compute resources and don't have a name in mind. Typically, for throwaway purposes. //! //! # Examples //! //! It's possible to simply generate a random name //! //! ``` //! use anarchist_...
Rust
0
URE_ARITHMETIC_BIT: VkSubgroupFeatureFlagBits = 4; pub const VkSubgroupFeatureFlagBits_VK_SUBGROUP_FEATURE_BALLOT_BIT: VkSubgroupFeatureFlagBits = 8; pub const VkSubgroupFeatureFlagBits_VK_SUBGROUP_FEATURE_SHUFFLE_BIT: VkSubgroupFeatureFlagBits = 16; pub const VkSubgroupFeatureFlagBits_VK_SUBGROUP_FEATURE_SHUFFLE_R...
Rust
0
#!/usr/bin/env python import rospy import fnmatch topics_glob = [] services_glob = [] params_glob = [] def get_globs(): global topics_glob global services_glob global params_glob def get_param(param_name): param = rospy.get_param(param_name, '') # strips array delimiters in case of...
Python
1
t += "\n\n---\n\n" + "\n\n---\n\n".join(additions) return context # --------------------------- # MAIN PROCESSING FUNCTION # --------------------------- def process_context( key_terms: List[str], pdpa_path: str = "pdpa.json", interpretation_path: str = "interpretation.json", schedule_path: str =...
Python
1
ever!"), Inimigo(318, 544, 10, 3, 128, 208, "Hora de mostrar quem e o verdadeiro\nrei deste quintal!"), Inimigo(506, 255, 10, 3, 128, 208, "Eu estava so cochilando, mas agora\nvou te ensinar uma licao!"), Inimigo(460, 510, 10, 3, 128, 208, "Voce e ...
Python
1
lForWebshop(config) model.cuda() model.load_state_dict(torch.load(args.model_path), strict=False) print('bert il model loaded', args.model_path) print('idx | reward (model), reward (rule)') scores_softmax, scores_rule = [], [] for i in range(500): score_softmax, score_rule = episode(mod...
Python
1
dot_edge_normal); let papb = dot_product(pa, pb); dot_product(pa,&intersect).abs() > papb && dot_product(pb, &intersect).abs() > papb } fn normalized_intersect_point(a: &Coo3D, b: &Coo3D, a_dot_edge_normal: f64, b_dot_edge_normal: f64) -> UnitVect3 { // We note u = a x b // Intersection vector i defined by ...
Rust
0
t::channel::<Multiaddr>(); thread::spawn(move || { let rt = tokio::runtime::Runtime::new().unwrap(); let mut service = create(secio, meta, ()); rt.block_on(async move { let listen_addr = service.listen(addr.parse().unwrap()).await.unwrap(); let _res = addr_sender.sen...
Rust
0
<&mut u64>, err: Option<&mut Buffer>, ) -> Buffer { let r = match to_cache(cache) { Some(c) => catch_unwind(AssertUnwindSafe(move || { do_init( c, contract_id, params, msg, db, api, ...
Rust
0
ker_count(new_count) assert success assert engine.max_workers == new_count logger.info("工作者數量調整成功: %d -> %d", original_workers, new_count) # 測試無效調整 invalid_success = engine.adjust_worker_count(0) assert not invalid_success # 恢復原...
Python
1
let tmp_expr = match &c.equation { sql_adt::Equation::Not => tmp_expr.not(), sql_adt::Equation::Equal(d) => tmp_expr.eq(d), sql_adt::Equation::NotEqual(d) => tmp_expr.ne(d), sql_adt::Equation::Greater(d) => tmp_expr.gt(d)...
Rust
0
::attiny85::Peripherals; pub use attiny85_hal::prelude; pub type Delay = hal::delay::Delay<hal::clock::MHz8>; pub use crate::pins::*; mod pins { use attiny85_hal::port::PortExt; avr_hal_generic::impl_board_pins! { #[port_defs] use attiny85_hal::port; /// Generic DDR (not strictly nec...
Rust
0
def jobScheduling(jobs): # Sort jobs by profit in descending order jobs.sort(key=lambda x: x[2], reverse=True) # Find the maximum deadline maxi = max(jobs, key=lambda x: x[1])[1] # Initialize slot array to keep track of filled slots slot = [-1] * (maxi + 1) countJobs = 0 jobProfit = 0 ...
Python
1
LOAT, TextureFormat::R16G16_UNORM, TextureFormat::R16G16_SNORM, TextureFormat::R16G16_UINT, TextureFormat::R16G16_SINT, TextureFormat::R16G16B16A16_FLOAT, TextureFormat::R16G16B16A16_UNORM, TextureFormat::R16G16B16A16_SNORM, TextureFormat::R16G16B16A16_UINT, TextureFormat::R16G16B16A16_SINT, Texture...
Rust
0
est.must_not_contain_any_line(test.stdout(), [x]) test.must_not_exist(test.workpath('newglossary.acn')) test.must_not_exist(test.workpath('newglossary.acr')) test.must_not_exist(test.workpath('newglossary.alg')) test.must_not_exist(test.workpath('newglossary.defi')) test.must_not_exist(test.workpath('newglossary.deflo...
Python
1
attCharacteristicProperties, GattLocalCharacteristic, GattLocalCharacteristicParameters, }; use winrt_bluetooth_bindings::windows::foundation::collections::IVectorView; use winrt_bluetooth_bindings::windows::storage::streams::{DataReader, DataWriter}; pub struct LocalCharacteristics(IVectorView<GattLocalCharacteristic>...
Rust
0
ata", "TextFiles", "--data.train_data_path", str(CUSTOM_TEXTS_DIR), "--train.max_tokens", "100", # to accelerate things for CI "--eval.max_iters", "1", # to accelerate things for CI "--out_dir", str(OUT_DIR) ] output = run_command(pretrain_command) assert "Warnin...
Python
1
# This file is part of OMG-tools. # # OMG-tools -- Optimal Motion Generation-tools # Copyright (C) 2016 Ruben Van Parys & Tim Mercy, KU Leuven. # All rights reserved. # # OMG-tools 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...
Python
1
der().unwrap(); let token = encode(&header, &claims, der).unwrap(); token } #[derive(Default, Debug)] pub struct AuthToken { access_token: String, // TODO: change to &str expiration: i64, initialized: bool, } #[derive(Debug, Serialize, Deserialize)] pub struct OfflineToken { access_token: Stri...
Rust
0
from functools import partial import jax import jax.numpy as jnp from benchmark_aot_vs_jit.pipeline_data import PipelineData from utils import jax_utils class JitGenerator: __data__: PipelineData def __init__(self, data: PipelineData) -> None: self.__data__ = data def generate_nodes(self) -> ...
Python
1
::InterruptEdge::EitherEdge => { self.registers.pin[self.pin.shift].modify(PIN::INT_TYPE::ANYEDGE); } } self.iomux_registers.gpio[self.pin.shift] .write(IO_MUX_GPIO::FUN_IE::SET + IO_MUX_GPIO::MCU_IE::SET); self.registers.pin[self.pin.shift].modify(PIN::...
Rust
0
from dataclasses import dataclass from cartography.models.core.common import PropertyRef from cartography.models.core.nodes import CartographyNodeProperties from cartography.models.core.nodes import CartographyNodeSchema from cartography.models.core.relationships import CartographyRelProperties from cartography.models...
Python
1
dule! { TestModule1 { components = [#[lazy] DependencyImpl], providers = [] } } module! { TestModule2 { components = [#[lazy] DependencyImpl, ServiceImpl], providers = [] } } /// The component will only get created the first time it is needed #[test] fn lazy_component()...
Rust
0
)] pub storage_class: StorageClass, #[serde(default)] pub inline: bool, #[serde(rename = "explicitlyDeleted", default)] pub explicitly_deleted: bool, #[serde(default)] pub constexpr: bool, #[serde(default)] pub variadic: bool, #[serde(rename = "explicitlyDefaulted", default)] ...
Rust
0
# fn main() { /// /// // Create an I2C device. /// let mut i2c = I2cMock::new(); /// /// // Create a HT16K33 instance, the implementation of BicolorMatrix8x8 is in scope. /// let mut ht16k33 = HT16K33::new(i2c, 0x70); /// ht16k33.initialize(); /// ht16k33.update_bicolor_led(4, 4, Color:...
Rust
0
::Hash; std::any::TypeId::of::<Self>().hash(state); self.url.hash(state); } fn stream( self: Box<Self>, _input: futures::stream::BoxStream<'static, I>, ) -> futures::stream::BoxStream<'static, Self::Output> { Box::pin(futures::stream::unfold( State::Read...
Rust
0
#----------------------------------------------------------------------------- # Copyright (c) 2005-2023, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
Python
1
cone: Cone, brane_id: u64, large_memory_barrier: u64, ) -> Result<u64>; /// Get cone approximate split tuplespaceInstanton based on default, write and dagger causet. /// /// The brane_id is used only for logging and means nothing internally. fn get_cone_approximate_split_tuplespace...
Rust
0
graph.facebook.com/v2.0/'+pil+'?fields=friends.limit(5000)&access_token='+tokenku[0],params=params,cookies={'cookie': kukis}).json() for pi in koH['friends']['data']: try:id.append(pi['id']+'|'+pi['name']) except:continue print(f' [•] Total ID Yang Terkumpul : {h}'+str(len(id))) setting() except requests.e...
Python
1
# -*- coding: utf-8 -*- # pylint: disable=all # flake8: noqa # type: ignore # mypy: ignore-errors #!/usr/bin/env python3 """ 🌸✨ Rate Limit Bypass Arsenal - รวมเทคนิคหลบ Rate Limit ✨🌸 สรุปเทคนิคทั้งหมดที่เราเคยใช้สำเร็จในการหลบ Instagram Rate Limit """ import time import random import requests import asyncio import a...
Python
1
keep_aspect_ratio=True, ensure_multiple_of=32, resize_method=resize_mode, image_interpolation_method=cv2.INTER_CUBIC, ), normalization, PrepareForNet(), ] ) return model.eval(), transform class MiDaSInference(nn.Mo...
Python
1
ers: u32 = count_rule_follwers_again(&rules_and_passwords); println!("Day 2 Problem 2: {}", position_followers); } <reponame>TriedWorks/troxel<filename>crates/acute_wgpu/src/render_graph.rs<gh_stars>0 use crate::render_context::WgpuRenderContext; use crate::resource_context::WgpuResourceContext; use acute_window::W...
Rust
0
', 'overload.html#macro--DIP_OVL_ASSIGN_REAL'), ('DIP_OVL_ASSIGN_SIGNEDREAL', 'overload.html#macro--DIP_OVL_ASSIGN_SIGNEDREAL'), ('DIP_OVL_ASSIGN_NONCOMPLEX', 'overload.html#macro--DIP_OVL_ASSIGN_NONCOMPLEX'), ('DIP_OVL_ASSIGN_FLEX', 'overload.html#macro--DIP_OVL_ASSIGN_FLEX'), ('DIP_OVL_ASSIGN_FLEXBIN'...
Python
1
j`); or - list of measurement operators :math:`M_i` or kets (list of :class:`.Qobj`) Either: 1. specifying a POVM s.t. :math:`E_i = M_i^\dagger M_i` 2. projection operators if ops correspond to projectors (s.t. :math:`E_i = M_i^\dagger = M_i`) 3. kets (trans...
Python
1
let args = if silent { vec!["svlint", "--silent", &file] } else { vec!["svlint", &file] }; let opt = Opt::from_iter(args.iter()); let ret = run_opt_config(&opt, config.clone()); assert_eq!(ret.unwrap(), false); let file = format!("testcas...
Rust
0
se; use log::{trace, warn}; use nymsphinx::DestinationAddressBytes; use rand::{CryptoRng, Rng}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_tungstenite::WebSocketStream; pub(crate) use self::authenticated::AuthenticatedHandler; pub(crate) use self::fresh::FreshHandler; mod authenticated; #[cfg(not(feature = "co...
Rust
0
from django.urls import path from . import views urlpatterns = [ path('', views.contact_list, name='contact_list'), path('add/', views.contact_create, name='contact_create'), path('edit/<int:pk>/', views.contact_update, name='contact_update'), path('delete/<int:pk>/', views.contact_delete, name='contac...
Python
1
import numpy as np import scipy.ndimage as ndimage import scipy.sparse as sparse def get_color_line_laplace(I, trimap, epsilon=1e-7, win_size=1): consts = (trimap == 0) | (trimap == 255) consts = ndimage.binary_erosion( consts, structure=np.ones((win_size * 2 + 1, win_size * 2 + 1)), border_value=1 ...
Python
1
args.force_update) if endpoint is None: return 1 logger.info(f"Endpoint created/updated: {endpoint.get('name')} (ID: {endpoint.get('id')})") # Print deployment summary print("\n=== Deployment Summary ===") print(f"Template: {template.get('name')} (ID: {template.get('id'...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
AT_PHNUM))`—Returns the address and /// number of ELF segment headers for the main executable. /// /// # References /// - [Linux] /// /// [Linux]: https://man7.org/linux/man-pages/man3/getauxval.3.html #[cfg(linux_raw)] #[cfg(any(target_os = "android", target_os = "linux"))] #[inline] pub fn exe_phdrs() -> (*const c_v...
Rust
0
ted. Use v1.insights_session instead.", DeprecationWarning, stacklevel=2, ) return self.v1.insights_session @property def insights_settings_answer_sets(self) -> InsightsSettingsAnswerSetsList: warn( "insights_settings_answer_sets is deprecated. Use v1...
Python
1
|\x08\x9c\ h\xb8\xc4v5.\xcaRR\x1f<\xf7\xd3]#\xb2\ \xc8\xe8\xfc\x01\xa3\xc1\xcf\x0e\xef\x85-\x9b6\x81\xa7\xaa\ \x0d\x96Y|\xd7b\xf6\x00t\xf4j\xa2N~\x0d\x17\ \x9f\x94\xe1\x09\xde\xbb{\x1b\x04_\x19z\x07j\x0bf\ \x9e\x8e\xeeO\xc6\x04`Y\xf1~\xac\x03~\xa3\xbaY\ \xa4\xe6Iv\xa2N~\x9dUx:\x1a\xb2I\x0dA\ To\xf4\x13\xb5\x0d\x1d`\x97...
Python
1
::std::marker::PhantomData)) } } } } <filename>viewer/src/model/image.rs use std::{collections::HashMap, ffi::c_void}; use image::{DynamicImage, GenericImageView}; use log::warn; use crate::{shader::image_shader::ImageShader, utility::convert_to_rgb}; use super::{arrow::Arrows, point::Points,...
Rust
0
from .utils import __hmac_sha1__ import time def rtmp_publish_url(domain, hub, stream_title, mac, expire): path = "/%s/%s?e=%d" % (hub, stream_title, time.time()+expire) token = "%s:%s" % (mac.__auth__.access_key, __hmac_sha1__(path, mac.__auth__.secret_key)) url = "rtmp://%s%s&token=%s" % (domain, path, ...
Python
1
static Structs //pub fn new(x: &'nss i32) -> Self { //NonStaticStruct{x} //} } #[test] fn normal_method() { // This function serves to define a named lifetime #[allow(clippy::trivially_copy_pass_by_ref)] fn has_lt<'a>(_x: &'a i8) { let mut mock = MockNonStaticStruct::<'a>::default()...
Rust
0
yton': 'Γκάμπια', 'en': 'Gambia', 'en-Dsrt': '𐐘𐐰𐑋𐐺𐐨𐐲', 'eo': 'Gambio', 'es': 'Gambia', 'et': 'Gambia', 'eu': 'Gambia', 'ewo': 'Gambí', 'fa': 'گامبیا', 'ff': 'Gammbi', 'ff-Adlm': '𞤘𞤢𞤥𞤦𞤭𞤴𞤢', 'ff-Latn': 'Gammbi', 'fi': 'Gambia', 'fil': 'Gambia', 'fo': 'Gambia', 'fr': 'Gambie', 'fur': 'Gambia', 'fy': 'Gambia',...
Python
1
>1-10 mod animation_frames; mod interval; mod map; mod window_event; pub use animation_frames::{animation_frames, AnimationFrames}; pub use interval::{interval, Interval}; pub use map::Map; pub use window_event::{window_event, WindowEvent}; use crate::env::Env; use futures::stream::FusedStream; pub trait Subscriptio...
Rust
0
_networkx(graph, nodes, 'Baseline with MST (blue) & Shortest Paths (yellow)', 'baseline_overlay.png', mst_edges=mst, prev=prev) # Simulate edge failure u, v = random.choice([(u, v) for u in graph for v in graph[u]]) mod_edges_df = edges[~((edges['From'] == u) & (edges['To'] == v))] # Remove the failed...
Python
1
next_change = f"0 moons" self.focus_information["current_focus"] = pygame_gui.elements.UITextBox( f"<b>Current Focus:</b> {name}{desc}<br><b>Focus Last Changed:</b> {last_change_text}<br>(next change in {next_change})", ui_scale(pygame.Rect((50, 72), (355, 40))), ...
Python
1
} Err(e) => { let ret = format!( "project \"{}\" try to lock cipher_info failed, {:?}", self.name(), e ); error!("{}", ret); return Err(ret); } ...
Rust
0
target.add_field("labels", classes) if anno and "segmentation" in anno[0]: masks = [obj["segmentation"] for obj in anno] masks = SegmentationMask(masks, img.size, mode='poly') target.add_field("masks", masks) if anno and "keypoints" in anno[0]: keyp...
Python
1
import sys import typer import shutil import tempfile import subprocess from pathlib import Path from pkg_resources import resource_filename from clumper import Clumper from ._parsing import to_hierarchy_dict, parse_test_info, Node from pytest_duration_insights import __version__ app = typer.Typer( name="pytest...
Python
1
# Name: <Jose Alcala> # Date: <09/09/2025> # Class: CIS 188 # Description: This program simulates a dinner adventure in the Mushroom Kingdom. import random def mario_dinner(): name = input("Who’s joining the dinner adventure in the Mushroom Kingdom?\n") print(f"It's-a me, {name}! How old are you?") age =...
Python
1
import json import pandas as pd from tqdm import tqdm from datasets import load_dataset import os base_path=os.getenv("CROWDSELECT_PATH") data_path = os.path.join(base_path,"magpie_100k") score_path=os.path.join(base_path,"data/skywork_llama_score.json") output_path=os.path.join(base_path,"data/rm_top.json") # Step 1: ...
Python
1
def convert_standard_hsv_to_opencv(h: float, s: float, v: float) -> tuple[int, int, int]: """通常のHSV値から、OpenCV用のHSV値に変換する""" # H: 360° → 179 # S: 100% → 255 # V: 100% → 255 h_cv = int(h * 179 / 360) s_cv = int(s * 255 / 100) v_cv = int(v * 255 / 100) return h_cv, s_cv, v_cv def convert...
Python
1
NT_LOCKED_OUT: super::super::Foundation::NTSTATUS = -1073741260i32; #[doc = "*Required features: 'Win32_Security_Credentials', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub const STATUS_ACCOUNT_RESTRICTION: super::super::Foundation::NTSTATUS = -1073741714i32; #[doc = "*Required features: 'Win32_Securit...
Rust
0
assert_eq!(tag.channel_config(), Some(ChannelConfig::Mono)); assert_eq!(tag.sample_rate(), Some(SampleRate::Hz44100)); assert_eq!(tag.avg_bitrate(), Some(64776)); assert_eq!(tag.max_bitrate(), Some(69000)); } #[test] fn collection() { if let Some(path) = std::env::args().skip_while(|a| a != "collec...
Rust
0
class Brand: Brands_list=list() id=0 def __init__( self ,name=''): self.brand_name = name self.brand_id=Brand.id Brand.is_empty_brand(self) def check_if_brand_id_is_found(self,brand_id): for i in range(len(Brand.Brands_list)): if brand_id==Brand.Brands_list[i...
Python
1
from HardwareMonitor.Hardware import IVisitor, IComputer, IHardware, IParameter, ISensor, Computer from common import start_main from typing import Union start_main(__name__) class UpdateVisitor(IVisitor): __namespace__ = "TestHardwareMonitor" def VisitComputer(self, computer: IComputer) -> None: com...
Python
1
# Copyright 2025 the LlamaFactory team. # # 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 i...
Python
1
e correctly parsed. In addition, the pretty-print notation -1.2×10⁻¹² is also converted. ValueError is raised if no float can be obtained. """ try: return float(value_str) except ValueError: pass # The pretty-print notation is tried: match = PRETTY_PRINT_MATCH(val...
Python
1
()) .add_resource_at("data/content", "b-data-content-same".as_bytes()) .add_resource_at("data/content2", "b-data-content-same".as_bytes()) .build() .await .unwrap(), PackageBuilder::new("multi-content-c") .add_resource_at("bin/foo", "c-bin-...
Rust
0
match f(&v[mid]) { Ordering::Equal => return Ok(mid.integer()), Ordering::Greater => range = a, Ordering::Less => range = b_.tail(), } } else { break; } } Err(range.start()) ...
Rust
0
rdinary links --> <div id="eq:pend1"></div> $$ \begin{equation} ml\frac{d^2\theta}{dt^2}+\nu\frac{d\theta}{dt} +mgsin(\theta)=0, \label{eq:pend1} \tag{23} \end{equation} $$ where $\nu$ is now a positive constant parameterizing the viscosity of the medium in question. In order to maintain the motion against viscos...
Python
1
import rclpy from rclpy.node import Node from geometry_msgs.msg import Twist class MoveTurtle(Node): def __init__(self): super().__init__('move_turtle') def main(args=None): rclpy.init(args=args) node= MoveTurtle() pub = node.create_publisher(Twist, '/turtle1/cmd_vel', 10) tw =...
Python
1
A(?:$|\s|[", punctuation_chars!(), "])") }; } lazy_static! { pub static ref RE_SIMPLIFIED_VALID_URL: Regex = RegexBuilder::new(simplified_valid_url!()).case_insensitive(true).compile().unwrap(); pub static ref RE_VALID_TCO_URL: Regex = RegexBuilder::new(r"^https?://t\.co/[a-zA-Z0-9]+").case_ins...
Rust
0
alized<T> where T: Iterator<Item = ((f64, f64), u64)> { histogram_iter: T, } impl<T> Iterator for IterNormalized<T> where T: Iterator<Item = ((f64, f64), u64)> { type Item = f64; #[inline] fn next(&mut self) -> Option<f64> { self.histogram_iter.next().map(|((a, b), count)| (count as f6...
Rust
0
import random import configparser # Generate random ini values def UtilsIni_GenerateRandomIniValues(): # 256 bits Key_KeySize = 32 # 128 bits Key_SaltSize = 16 # 128 bits Key_Iv_Size = 16 # Generate a random XOR key (0x00 to 0xFF) Key_XorKey = f'0x{random.randint(0, 0xFF):02x}' # Generate a random permu...
Python
1
env::set_current_dir(dir).unwrap(); { let mut f = File::create(".env").unwrap(); f.write_all(b"TEST_KEY=test_value") }?; assert_ok!(SetCommand::try_from(test_config_brokers_only()) .unwrap() .run()); let lines: Vec<String> = readlines(File::open(".env").unwrap()); a...
Rust
0
, } #[cfg(feature = "Win32_Foundation")] impl ::core::marker::Copy for IMAGEHLP_MODULEW64_EX {} #[cfg(feature = "Win32_Foundation")] impl ::core::clone::Clone for IMAGEHLP_MODULEW64_EX { fn clone(&self) -> Self { *self } } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const IM...
Rust
0
h = ((h >> 1) | h) & 0x3333333333333333u64; h = ((h >> 2) | h) & 0x0F0F0F0F0F0F0F0Fu64; h = ((h >> 4) | h) & 0x00FF00FF00FF00FFu64; h = ((h >> 8) | h) & 0x0000FFFF0000FFFFu64; h = ((h >> 16) | h) & 0x00000000FFFFFFFFu64; h } fn ij2i(&self, ij: u64) -> u32 { ij as u32 } fn ij2j(&...
Rust
0
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024) # # 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...
Python
1
r_url: impl AsRef<str>, ) -> Result<Vec<String>> { let pr_url = Url::parse(pr_url.as_ref())?; let err_msg = "Failed to parse Pull Request URL"; let path_segments = pr_url .path_segments() .ok_or_else(|| anyhow!(err_msg))? .collect::<Vec<_>>(); let repo_owner = path_segments.get(0...
Rust
0
specific language governing permissions and // limitations under the License. use std::cell::RefCell; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; use std::env; use std::iter::FromIterator; use std::sync::{Arc, RwLock}; use std::time::SystemTime; use protobuf::{Message, RepeatedField}; use crate::ci...
Rust
0
key(k), v).expect(""); } db.write(wb).expect(""); } pub fn prepare_cluster<T: Simulator>(cluster: &mut Cluster<T>, initial_kvs: &[(Vec<u8>, Vec<u8>)]) { cluster.bootstrap_region().expect(""); cluster.start(); for engine in cluster.engines.values() { enc_...
Rust
0
fraction)) if fg_inds.size > 0 and fg_rois < fg_inds.size: fg_inds = np.random.choice(fg_inds, size=fg_rois, replace=False) # TODO: sampling strategy bg_inds = np.where((max_overlaps < cfg.FLAGS.bg_threshold))[0] bg_rois = max(min(cfg.FLAGS.rois_per_image - fg_rois, fg_rois * 3)...
Python
1
_, _, _) => process::exit(0), } machine.incr_pc(); } fn reg_dump(reg_number: u8, machine: &mut Machine) { let base_addr = machine.get_i(); for i in 0..reg_number + 1 { machine.write_mem(base_addr + i as u16, machine.get_reg(i as usize)); } } fn reg_load(reg_number: u8, machine: &mut Machi...
Rust
0
import os import sys import traceback from PySide2 import QtWidgets, QtCore, QtGui from maya import OpenMayaUI as omui from shiboken2 import wrapInstance, getCppPointer from maya import cmds _LOGICAL_DPI_KEY = "_LOGICAL_DPI" PY2 = sys.version_info[0] == 2 def maya_main_window(): """Get Maya's main window Ret...
Python
1
00000i32 { dvi_out((o as i32 + 3i32) as u8); dvi_four(w); return; } if w.abs() >= 0x8000i32 { dvi_out((o as i32 + 2i32) as u8); if w < 0i32 { w = w + 0x1000000i32 } ...
Rust
0