text
string
label_name
string
labels
int64
if *c == ')' { *position += 1; } else { let err = SyntaxError { position: *position, expected: "a ')'".to_string(), continues: chars .get(*position..*position + 10)...
Rust
0
n generator(input: &str) -> Self::Generated { input.parse().unwrap() } fn part1(intcode: Self::Generated) -> Self::Output { intcode.run_no_io(&[(1, 12), (2, 2)])[0] } fn part2(start_intcode: Self::Generated) -> Self::Output { for noun in 0..=99 { for verb in 0..=99 ...
Rust
0
#Python v3, OpenCV v3.4.2 import numpy as np import cv2 videoCapture = cv2.VideoCapture("video.mp4") ret,camera_input = videoCapture.read() rows, cols = camera_input.shape[:2] ''' Video dosyası üzerine Mean Shift için bir alan belirlenir. Bu koordinatlar ağırlıklı ortalaması belirlenecek olan dörtgen alanıdır. ''' ...
Python
1
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class WagtailTestsAppConfig(AppConfig): default_auto_field = "django.db.models.AutoField" name = "wagtail.test.modeladmintest" label = "modeladmintest" verbose_name = _("Test Wagtail Model Admin")
Python
1
filenames = df_filenames[1].tolist() print('Total filenames: ', len(filenames), filenames[0]) # filename_bbox = {img_file[:-4]: [] for img_file in filenames} numImgs = len(filenames) for i in range(0, numImgs): # bbox = [x-left, y-top, width, height] bbo...
Python
1
>) -> Result<Message, CstError> { let mut args = args.into_iter(); let key_name = args.next_bytes()?; //let o = server.db.entry(key_name).or_insert(Object::new(Encoding::from(Set::empty()), uuid, 0).into()); let o = match server.db.query(&key_name, uuid) { None => { let o = Object::n...
Rust
0
e("extern myfunc(arg1)"); let declare3 = tokenize("extern myfunc()"); let declare4 = tokenize("extern myfunc(arg1 arg2"); let declare5 = tokenize("extern myfunc(;a"); let declare6 = tokenize("extern myfunc(arg1"); let res1 = parse(&declare1).unwrap(); let res2 = parse(&d...
Rust
0
}; let url = format!("http://{}/loop", server.addr()); let err = reqwest::get(&url).await.unwrap_err(); assert!(err.is_redirect()); } #[tokio::test] async fn test_redirect_policy_can_stop_redirects_without_an_error() { let server = server! { request: b"\ GET /no-redirect HTTP/1....
Rust
0
wrap(); builder.set_version(2).unwrap(); builder .set_not_before(&Asn1Time::days_from_now(0).unwrap()) .unwrap(); builder .set_not_after(&Asn1Time::days_from_now(365).unwrap()) .unwrap(); builder.set_subject_name(&name).unwrap(); bu...
Rust
0
DCCTL1_CIM`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADC_DCCTL1_CIMW { #[doc = "Always"] ADC_DCCTL1_CIM_ALWAYS, #[doc = "Once"] ADC_DCCTL1_CIM_ONCE, #[doc = "Hysteresis Always"] ADC_DCCTL1_CIM_HALWAYS, #[doc = "Hysteresis Once"] ADC_DCCTL1_CIM_HONCE, } impl ADC_DCCTL1_CIMW { ...
Rust
0
"""satflow.infer package"""
Python
1
import re import os import requests import html from collections import defaultdict M3U_URL = "http://cdn.pthdtv.top:80/get.php?username=630922725&password=280890306&type=m3u_plus&output=mpegts" grupos_desejados = [ "LANÇAMENTOS 2025", "LANÇAMENTOS 2024", "LANÇAMENTOS 2023", "LANÇAMENTOS 2022", "FILMES | LEGE...
Python
1
1, month=1, day=1, tzinfo=timezone.utc), ) subject.update_run_state( run_id="run-id", summary=state_summary, commands=protocol_commands, run_time_parameters=[], ) result = subject.get_all_commands_as_preserialized_list( run_id="run-id", include_fixit_commands=True...
Python
1
extSemArray: *const cudaExternalSemaphore_t, paramsArray: *const cudaExternalSemaphoreSignalParams, numExtSems: ::std::os::raw::c_uint, stream: cudaStream_t, ) -> cudaError_t; } extern "C" { pub fn cudaWaitExternalSemaphoresAsync( extSemArray: *const cudaExternalSemaphore_t, ...
Rust
0
tuple(padded_type_vectors), 'subtype_vector': padded_subtype_vectors, 'color_identity': padded_color_id_vecs, 'mana_vector': padded_mana_vectors, 'keyword_vector': padded_keyword_vectors, 'power_value': all_power_values, 'toughness_value': all_toughness_values, 's...
Python
1
<Value>().unwrap().unwrap()["x"], 42); assert_eq!(stream.next::<Value>().unwrap().unwrap()["y"], 43); assert!(stream.next::<Value>().is_none()); }); } #[test] fn test_json_array_truncated() { let data = "[{\"x\":40},{\"x\":"; test_stream!(data, |stream| { assert_eq!(stream.next::...
Rust
0
() == my_addr); if let Some(block) = block { let input_tx = block.get_transaction_at(0).unwrap(); let transaction = NormalTransaction::new( vec![TransactionInput::new(input_tx, 0)], vec![TransactionOutput::new(recip...
Rust
0
u32 { do_add = true; } q2 = u32::wrapping_mul(2, q2); r2 = 2 * r2 + 1; } let delta: u32 = d - 1 - r2; if !(p < 64 && (q1 < delta || (q1 == delta && r1 == 0))) { break; } } MU32 { mul_by: q2 + 1, do_a...
Rust
0
: logger.info("--- Fase 2: Análise Estatística ---") if args.phase == 'analyze': data_dir = os.path.join(os.path.dirname(__file__), '../Data') metrics_df = pd.read_csv(os.path.join(data_dir, 'pull_requests_metrics.csv')) analy...
Python
1
UCU\x97\x22\xde\xf6\ \x22\xcb\x943\x93\xd3s\xf3\xf7\xec\xb8\xe3\xceCx\xed\ \xab\x1a\x9bz\xf0ap\x81\x81\x0d0@\xad\xde@\xad\ P%0\xb0\xf9\x18\xd0\xcfx?\xaa\x97?\xf2\x1a\xe3\ \x5c<\x91\xc4\xf5\xc9\xdc\x99Z\xce\x85\xbd.*\xb4p\ p\x01 FP\x86\xd6\xb9\x9a\xd0\x9f\xf1S\x5cM\x99\ \xd7NV\x90\xbcq\x06\xf4V\xb9\x1a|\x1eK#\x13\ \xd0\...
Python
1
@pulumi.getter(name="ipRules") def ip_rules(self) -> pulumi.Output[Optional[Sequence['outputs.IpAccessSettingsIpRule']]]: """ The IP rules of the IP access settings. See IP Rule below. The following arguments are optional: """ return pulumi.get(self, "ip_rules") @_built...
Python
1
if self._is_finished(curr_step, end, check_frequency): return duration def _inference_step(self, precision): """Define the inference process. Args: precision (Precision): precision of model and input data, such as float32, float16. Return:...
Python
1
rLicenseConfigurationInput, ) { if let Some(var_146) = &input.license_configuration_arn { object.key("LicenseConfigurationArn").string(var_146); } if let Some(var_147) = &input.max_results { object.key("MaxResults").number( #[allow(clippy::useless_conversion)] smithy_...
Rust
0
let token = get_spotify_access_token(client).await.unwrap(); println!("{:?}", token); } #[tokio::test] async fn test_spotify_playlist_tracks() { let client = reqwest::Client::new(); let res = get_list_of_spotify_tracks(client, "5I1uPiJpPmphKfQHDjWHFa") .await ...
Rust
0
ffers = 16 # note that everything is in the same clock domain, 2.0 GHz as # specified above system.l1cache = L1_DCache(size="64kB") system.monitor.mem_side_port = system.l1cache.cpu_side system.l2cache = L2Cache(size="512kB", writeback_clean=True) system.l2cache.xbar = L2XBar() system.l1cache.mem_side = system.l2cac...
Python
1
iction.json" ), ) as response: if response.ok: pricing_eviction_data = await response.json() return { cast(Tuple[str, OnDemandOrSpotType], tuple(key)): value for key, value in pricing_eviction_data } print( f"Warning pr...
Python
1
#!/usr/bin/env python """ Purpose: Gets fluid property tables that can be loaded into FluidProperties.cpp Author: Sam Evani - Axiom Space - 2024 Copyright 2025 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. """ # Standard import...
Python
1
from webapp.views.articles import ArticleListView, ArticleDetailView, CreateArticleView, UpdateArticleView, \ DeleteArticleView from webapp.views.comments import CreateCommentView, UpdateCommentView, DeleteCommentView
Python
1
sult<String> { let mut s = String::new(); let clss = i.union.name.pascal(); for (j, m) in i.union.members.iter().enumerate() { let symbol = m.to_symbol(); let pascal = symbol.pascal(); s.push_str(format!(" void set{}( {} value );", pascal, pascal).as_str()); if j <...
Rust
0
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium import webdriver from selenium.webdriver.chrome.service import Service import time chrome_service = Service(r"C:\Users\AKANKSHA\Downloads\c...
Python
1
env.get_static_object_field(class, field) } } /// **get** public static final [NEGATIVE_H](https://developer.android.com/reference/android/icu/text/TimeZoneFormat.GMTOffsetPatternType.html#NEGATIVE_H) /// /// Required feature: android-icu-text-TimeZoneFormat_...
Rust
0
// Trait implemented by types that we can match (as opposed to be part of a match). pub(crate) trait StartMatch: Matchable { fn span(&self) -> Span; fn walk<'tcx, V: intravisit::Visitor<'tcx>>(visitor: &mut V, node: &'tcx Self); fn needs_parenthesis(_parent: Option<&Self>, _child: &Self) -> bool { ...
Rust
0
## Fomula Evaluation, MCS Evaluation, Molecular Weight Evaluation import re import json import numpy as np from tqdm import tqdm from rdkit import Chem from rdkit.Chem import rdFMCS from rdkit import DataStructs from rdkit.Chem import Descriptors from rdkit.Chem.rdMolDescriptors import CalcMolFormula from rdkit impor...
Python
1
import multiprocessing import torch from .io import load_checkpoint def worker_func(model_cls, model_kwargs, checkpoint, dataset, data_func, gpu_id, idx_queue, result_queue): model = model_cls(**model_kwargs) load_checkpoint(model, checkpoint, map_location='cpu') torch.cuda.set_device(gp...
Python
1
lds] qids_train = qids[np.arange( idx_train, idx_vali + qids.size if idx_vali < idx_train else idx_vali ) % qids.size] qids_vali = qids[np.arange( idx_vali, idx_test + qids.size if idx_test < idx_vali else idx_test ...
Python
1
bs = f.abs(); let exponent = if f == 0.0 { 0 } else { abs.log10().floor() as i32 }; if exponent.abs() >= WRITE_PRECISION as i32 { // use scientific notation if exponent is outside of our precision (but strip 0s) write_scientific(output, f,...
Rust
0
import streamlit as st from modules import ttest_two_groups, ztest_population, anova_oneway, anova_twoway, tukey_posthoc def hypothesis_test_menu(df): st.title("📊 Hypothesis Testing") test_type = st.selectbox("Choose the hypothesis test:", [ "T-Test (Two Groups)", "Z-Test (Sample vs Populatio...
Python
1
a { elements_cids }; let rec_data_cid = Value::from(rec_data).write_to_ip_area(&ip_context)?; // write recursive data envelope to ip area let rec_data_envelope = RecursiveDataEnvelope { recursive_data_cid: rec_data_cid, }; ...
Rust
0
impl<'borr,P,I,EV> DynTrait<'borr,P,I,EV> where P:GetPointerKind<Target=()> { /// Constructs an DynTrait from an erased pointer and an extra value. pub fn with_extra_value<OrigPtr,Unerasability>( ptr:OrigPtr, extra_value:EV, )-> DynTrait<'borr,P,I,...
Rust
0
them if the compositor doe snot support them, resizing interactions /// and moving the window. It also provides close/maximize/minimize buttons. /// /// Many interactions still require your input, and are given to you via the /// callback you need to provide. pub fn create_window<F: Frame + 'static...
Rust
0
Context, shape::*, material::*, object::Covered, }; use clay::{ scene::ListScene, view::ProjView, shape::*, material::*, worker::DefaultWorker, background::{GradientBackground as GradBg}, }; use clay_gui::{Window}; // Here we declare our object - a combination of // spherical shape and colored...
Rust
0
/(?P<{}>[^/]+)", p)), PathPart::ParamOpt(p) => regex.push(format!("(/(?P<{}>[^/]+))?", p)), PathPart::ParamRegex(p, r) => regex.push(format!("/(?P<{}>{})", p, r)), PathPart::ParamOptRegex(p, r) => regex.push(format!("(/(?P<{}>{}))?", p, r)), } } ...
Rust
0
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in complia...
Python
1
_ => panic!("Must return error"), } } #[test] fn fails_create_poll_invalid_quorum() { let mut deps = mock_dependencies(&[]); let info = mock_info("voter", &coins(11, VOTING_TOKEN)); let msg = InstantiateMsg { mirror_token: VOTING_TOKEN.to_string(), quorum: Decimal::percent(101), ...
Rust
0
from typing import TYPE_CHECKING, Dict import gradio as gr from llmtuner.extras.constants import METHODS, SUPPORTED_MODELS from llmtuner.extras.template import templates from llmtuner.webui.common import list_checkpoint, get_model_path, get_template, save_config from llmtuner.webui.utils import can_quantize if TYPE_...
Python
1
(); println!( "Format: {}", map_or_variable(&info.format, |x| x.name().to_owned()) ); println!( "Resolution: {}", map_or_variable(&info.resolution, |x| format!("{}×{}", x.width, x.height)) ); println!( "Framerate: {}", map_or_variable(&info.framerate,...
Rust
0
import schedule import threading import time import logging def run_scheduler(db, api_key, limit, schedule_time, daily_scrape_task): """Run the scheduler in a separate thread""" schedule.every().day.at(schedule_time).do( daily_scrape_task, db=db, api_key=api_key, limit=limit ) while True: ...
Python
1
import csv # file=open("favorites.csv","r") # # Do something with file # close(file) with open("favorites.csv","r") as file: # reader = csv.reader(file) # ['Timestamp', 'language', 'problem'],['10/30/2023 13:38:01', 'Python', 'Hello, World'], reader = csv.DictReader(file) # {'Timestamp': '10/30/2023 13:38...
Python
1
ngCollection::from(&mut ss, Some(0), input, false); // Test that the bug is gone assert_ne!(fc.v.len(), 1); //assert_ne!(fc.v[0].s, "+"); } } /// Std imports use std::time::Duration; // External imports // Workspace imports use models::{node::block::PendingBlock, Action}; // Local imports us...
Rust
0
Send + 'static + FnOnce(EventQueue) { let window = WindowBuilder::new() .with_dimensions(width as u32, height as u32) .with_gl(GlRequest::Specific(Api::OpenGl, (3, 1))) .with_title(String::from("BGFX")) .build() ...
Rust
0
current level). pub fn parent(&self, level: usize) -> S2CellId { debug_assert!(self.is_valid()); debug_assert!(level <= self.level()); let lsb = S2CellId::lsb_for_level(level); return S2CellId { id: (self.id & -(lsb as i64) as u64) | lsb }; } /// Return the cell at the prev...
Rust
0
0.100", "node_port": 1, "client_ip": "10.0.0.100", "client_port": 1, "alias":"some", "services": ["SERVICE"], "blskey": "<KEY>", "blskey_pop": "<KEY>"}"#; let res = ledger::build_node_request(IDENTIFIER, DEST, data); assert_eq!(res.unwrap_err(), ErrorCode::CommonInvalidStructure); } ...
Rust
0
_base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py' norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( backbone=dict( norm_cfg=norm_cfg, init_cfg=dict( type='Pretrained', checkpoint='open-mmlab://detectron/resnet50_gn')), neck=dict(norm_cfg=norm_...
Python
1
import os import argparse import random import shutil def main(args): output_images = os.path.join(args.output, 'images') output_labels = os.path.join(args.output, 'labels') os.makedirs(output_images, exist_ok=True) os.makedirs(output_labels, exist_ok=True) os.makedirs(os.path.join(output_images, ...
Python
1
_expiration(mut self, expiration: String) -> Self { self.expiration = expiration; self } pub fn expiration(&self) -> &String { &self.expiration } } // Copyright (c) 2014, 2015 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apac...
Rust
0
entry, instance); let inner = unsafe { extension_loader.create_debug_report_callback(&debug_info, None)? }; Ok(Self { extension_loader, inner, }) } } impl Drop for Debugger { fn drop(&mut self) { unsafe { self.extension_lo...
Rust
0
pub const DESCRIPTION: &str = r#" I'm here to help you make it more standardized and convenient to use Git. "#; /* -------------------------------------------------------------------------- */ /* Constant */ /* -------------------------------------------------------------------------- */ pub const SEPARATOR_SYMBOL: &...
Rust
0
.write_fmt(format_args!(")"))?; Ok(()) } } pub mod actor; pub mod agent_store; pub mod event; pub mod gossip; pub(crate) mod wire; pub use kitsune_p2p_types::dht_arc; #[allow(missing_docs)] pub mod metrics; use self::SeparatorCategory::*; use deunicode::deunicode_char; use slice_group_by::StrGroupBy; use...
Rust
0
import customtkinter as ctk import tkinter from PIL import Image, ImageTk import random import time start_time = None paragraphs = [ "The quick brown fox jumps over the lazy dog. It’s a phrase you’ve probably seen before, but did you ever stop to think about how weird it sounds? Still, it’s a great warm-up for yo...
Python
1
elf.params.insert("AttachStdin", json!(attach)); self.params.insert("OpenStdin", json!(attach)); self } impl_field!( /// Whether to attach to `stdout`. attach_stdout: bool => "AttachStdout"); impl_field!( /// Whether to attach to `stderr`. attach_stderr: bool => "AttachStde...
Rust
0
{ let id = match device.get_alias() { Ok(name) => name, Err(_e) => device.get_id(), }; Some(RuuviDevice { id, acceleration: acc.clone(), }) }) } pub fn ge...
Rust
0
# -*- coding: iso-8859-1 -*- from __future__ import print_function from __future__ import absolute_import import sys # Crear el controlador para la impresora fiscal: if False or '--epson' in sys.argv: from .epsonFiscal import EpsonPrinter print("Usando driver de Epson") model = ["tickeadoras", "epsonlx300...
Python
1
# -*- coding: utf-8 -*- """ =============== Buttons & Text =============== This example shows how to use the UI API. We will demonstrate how to create panel having buttons with callbacks. First, some imports. """ import fury from fury.data import fetch_viz_icons, read_viz_icons #####################################...
Python
1
MAGE = 'FailedOperation.NotSupportedToCreateImage' # 请求正在处理中,请稍后再试。 FAILEDOPERATION_PROCESSING = 'FailedOperation.Processing' # 查询资源标签失败。 FAILEDOPERATION_QUERYBINDINGTAGSFAILED = 'FailedOperation.QueryBindingTagsFailed' # 数据库查询错误。 FAILEDOPERATION_QUERYDATABASEFAIL = 'FailedOperation.QueryDatabaseFail' # 根据标签查询资源失败。...
Python
1
from .unet_model import TransUNet
Python
1
, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x7...
Rust
0
derive(Debug, Clone)] pub struct ClassnameTypeSpecifierChildren<'a, T, V> { pub keyword: Syntax<'a, T, V>, pub left_angle: Syntax<'a, T, V>, pub type_: Syntax<'a, T, V>, pub trailing_comma: Syntax<'a, T, V>, pub right_angle: Syntax<'a, T, V>, } #[derive(Debug, Clone)] pub struct FieldSpecifierChild...
Rust
0
""" @author: cunyue @file: upload.py @time: 2025/6/16 14:13 @description: 定义上传函数 """ from typing import List, Union, Literal from swanlab.log import swanlog from .model import ColumnModel, MediaModel, ScalarModel, FileModel, LogModel from ..client import get_client, sync_error_handler, decode_response from ...error i...
Python
1
tput: with open(args.output, 'w', encoding='utf-8') as f: f.write(json_output) logger.info(f"Results saved to: {args.output}") else: print(json_output) elif args.format == 'table': if tools: print(f"{'Name':<30} {'Type':<10} {'File...
Python
1
y[1].append(float(throughput)) print(y) return y def getPathGS(algo, inputEvents, tthread, NUM_ITEMS, Ratio_of_Multiple_State_Access, key_skewness, overlap_ratio, abort_ratio, txn_length, isCyclic, complexity): return FILE_FOLER + '/GrepSum/{}/threads = {}/totalEvents = {}/{}_{}_{}_{}_{}_{}_{}_{}'...
Python
1
wert }); } Ok(()) } pub(crate) fn split_klammer_argumente( parent: Vec<String>, args: &mut Vec<Argument>, args_ts: TokenStream, ) -> Result<(), SplitArgumenteFehler> { use SplitArgumenteFehler::*; let group = match genau_eines(args_ts.into_iter()) { Ok(TokenTree::Group(group)) if g...
Rust
0
le.read(), Loader=yaml.Loader) <vuln> parent = relative.parent if str(parent) == ".": unique_name = str(relative.stem) else: unique_name = str(parent / relative.stem) blueprint = Blueprint(unique_name, list(documen...
Python
1
pologyFactorResult", "TOPOLOGY_FACTOR_DERIVATION", ] if __name__ == "__main__": # Test the derivation when run directly print("Testing Topological Factor Derivation...") derivation = TopologyFactorDerivation() result = derivation.derive_phi_shell_euler_characteristic() print("SUCCESS: Topolo...
Python
1
import tkinter as tk from gui_resources import config from PIL import Image, ImageTk from resources.user.User import User APPNAME = config.APPNAME VERSION = config.VERSION BG_COLOR = config.BG_COLOR WINDOW_ICON_PATH = config.WINDOW_ICON_PATH LOGIN_ICON_PATH = config.LOGIN_ICON_PATH class LoginGUI: def __init__...
Python
1
"""Modifique o exercício 77 para ter atributos privados para titular, saldo e limite. Implemente getters e setters usando property para esses atributos. Adicione métodos para depositar() e sacar(), que devem alterar o saldo da conta. Garanta que as operações respeitem o limite da conta e que o saldo não se torne negati...
Python
1
ct_dependency_vulnerabilities_only_option, check_direct_dependency_maintenance_issues_only: bool | None = _check_direct_dependency_maintenance_issues_only_option, config_path: Path | None = _config_option, version: bool = _version_option, format_type: OutputFormat | None = _format_option, ) -> None:...
Python
1
32, I32); impl_native_value!(u64, I64); impl_native_value!(f32, F32); impl_native_value!(f64, F64); pub trait IntoLittleEndian { fn into_le(self, buf: &mut [u8]); } pub trait FromLittleEndian { fn from_le(buf: &[u8]) -> Self; } macro_rules! little_endian_conversion { ($type:ty, $size:expr) => { i...
Rust
0
), c1: Fq(FqRepr([ 0x2b19daf4bcc936d1, 0xa1a54e7a56f4299f, 0xb533eee05adeaef1, 0x170c812b84dda0b2, ])), }, // Fq2(u + 1)**(((2q^4) - 2) / 3) Fq2 { c0: Fq(FqRepr([ 0x3350c88e13e80b9c, 0x7dce557cdb5e56b9, ...
Rust
0
=> Reg::YMM29, 0x1E => Reg::YMM30, 0x1F => Reg::YMM31, _ => return None }) } pub fn from_code_zmm(code: u8) -> Option<Reg> { Some(match code { 0x0 => Reg::ZMM0, 0x1 => Reg::ZMM1, 0x2 => Reg::ZMM2, 0x3 => Reg::Z...
Rust
0
is required.".format(tk, vk)) # type: ignore # Determine if we need to upgrade the current game. upgraded_txt = os.path.join(token_dir, "upgraded.txt") if os.path.exists(upgraded_txt): with open(upgraded_txt, "r") as f: upgraded_games = f.read().splitlines() else: upgraded...
Python
1
class Solution: def reverseBits(self, n: int) -> int: val = bin(n)[2:].zfill(32) reverse = val[::-1] return int(reverse,2)
Python
1
l_depth = sum(depths) dpr = [ x.item() for x in torch.linspace(0, cfg['drop_path_rate'], total_depth) ] for i, (block, expect_prob) in enumerate(zip(blocks, dpr)): if expect_prob == 0: assert isinstance(block.drop_path, nn.Identity) ...
Python
1
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 def get_fields(args): """ Retrieves fields from an object using dot notation by leveraging demisto.get(). :param args: dictionary containing the Demisto arguments object. :return: hr_string as a human readable s...
Python
1
real_type -> &mut class.self_type let (from_ty, to_ty): (Type, Type) = create_suitable_types_for_constructor_and_self( self_variant, mc.class, &this_type_for_method.ty, ); let from_ty = ctx .conv_map .find_or_alloc_rust_type(&from_ty, mc.class.src_id); let this_t...
Rust
0
__version__ = "3.8.0"
Python
1
, fc1, "fc2", dim_in=2, dim_out=1) sigm = model.net.Sigmoid(fc2, 'sigm') sq = model.net.SquaredL2Distance([sigm, 'label'], 'sq') loss = model.net.SumElements(sq, 'loss') grad_map = model.AddGradientOperators([loss]) grad_map_for_param = {key: grad_map[key] for key in ['fc1_w',...
Python
1
nd=180 _globals['_SETCONFIGURATIONREQUEST']._serialized_start=182 _globals['_SETCONFIGURATIONREQUEST']._serialized_end=230 _globals['_SETCONFIGURATIONRESPONSE']._serialized_start=232 _globals['_SETCONFIGURATIONRESPONSE']._serialized_end=325 _globals['_GETDEFAULTPOLICYEXPRESSIONREQUEST']._serialized_start=327 ...
Python
1
p = tmp_dir.path().join(format!("f_{}.fasta", i + 1)); let mut reader = fasta::Reader::from_path(&p) .unwrap_or_else(|_| panic!(format!("file {:?} not found", p))); for seq in seqs { let rec = reader.next().expect("Not enough records").unwrap(...
Rust
0
_width: u32, screen_height: u32, hud_scale: f32) -> Self { let hud_scale = 0.35 * hud_scale + 0.65; let ratio = screen_width as f64 / screen_height as f64; let ratio_normalized = ratio / (1920.0 / 1080.0); Self { screen_width, screen_height, hud_scale,...
Rust
0
ord.is_master: raise TypeError("Password is not encrypted") return pickle.dumps(password) def convert_password(password: bytes) -> Password: """ Deserializes a bytes object to a Password instance. Args: password (bytes): The serialized Password instance. Returns: Passwor...
Python
1
import warnings warnings.filterwarnings('ignore') from ultralytics import YOLO if __name__ == '__main__': model = YOLO('E:/gold_yolo/train/canshu/0.5GIoU+0.5NWD/weights/best.pt') model.val(data='E:/SCAM_yolo/ultralytics-main/ultralytics/cfg/datasets/VisDrone.yaml', split='val', ...
Python
1
import numpy as np from jax import numpy as jnp import flax.linen as nn from jaxtyping import Array, Float from typing import Union class FreqEmbedder(nn.Module): """Multi Freqquency Embedder.""" input_dims: int = 3 frequency_num: int = 6 log_sampling: bool = True def setup(self): max_fr...
Python
1
# modules/scheduler.py import asyncio import aiosqlite from datetime import datetime, timedelta import logging from modules.telegram import send_surprise DB_PATH = "db.sqlite3" async def get_users_to_notify(): """Получаем пользователей с установленным временем автосюрприза (UTC) и языком.""" async with aiosq...
Python
1
ist = [p[1] for p in [pointA, pointB, pointC, pointD]] xmin = np.amin(x_list) xmax = np.amax(x_list) ymin = np.amin(y_list) ymax = np.amax(y_list) big_enough_patch = s.read_region((round(xmin),round(ymin)),lvl,((round((xmax-xmin)/d),round((ymax-ymin)/d)))) # Now find the coordinates within the ...
Python
1
panic!("Unsupported argument type"), } } // `self` arguments will never need to be renamed. syn::FnArg::Receiver(..) => (), }); } // Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 pub mod channel; mod channel_state_view; pub mod scripts; pub...
Rust
0
his is the error specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error `EFBIG` for this case"), ENOSPC => panic!("`pathname` was to be created but the device containing `pathname` has no room for the new file"), EPERM => panic!("The `O_NOATIME` flag was specified, but the effective user ID...
Rust
0
2".to_string() ); assert_eq!( strip_comments("/* comment\n*/dialog\ndialog 2 // comment"), "dialog\ndialog 2".to_string() ); assert_eq!( strip_comments("/* comment\ndialog*/\ndialog 2 // comment"), "dialog 2".to_string() ); assert_eq!( strip_comments("/* ...
Rust
0
#region STATES from typing import TYPE_CHECKING, Dict, Callable, Any if TYPE_CHECKING: from Py4GWCoreLib.botting_src.helpers import BottingClass class _STATES: def __init__(self, parent: "BottingClass"): self.parent = parent self._config = parent.config self._helpers = parent.helpers ...
Python
1
hine::*; #[derive(Debug, PartialEq)] pub enum Error { InvalidGraphemeLength(ByteWidth), TokenTooLong, IllegalState, } #[derive(Debug)] pub struct Dims(pub GlyphXCnt, pub GlyphYCnt); impl Dims { pub fn width(&self) -> usize { (self.0).0 } } const BREAKABLE: &str = "-_"; const SPACES: &str...
Rust
0
from django.contrib import admin from .models import Cart, CartItem # Register your models here. class CartAdmin(admin.ModelAdmin): list_display = ["cart_id", "date_added"] class CartItemAdmin(admin.ModelAdmin): list_display = [ "product", "cart", "quantity", "active", ...
Python
1