text
string
label_name
string
labels
int64
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from onnx.reference.ops.op_pool_common import CommonPool class AveragePool_1(CommonPool): def _run( # type: ignore self, x, auto_pad=None, ceil_mode=None, kernel_shape=None, pads=Non...
Python
1
afe { cudaMemGetInfo(&mut free as *mut _, &mut total as *mut _) } { cudaSuccess => Ok(MemInfo{free, total}), e => Err(CudaError(e)), } } } #[derive(Debug)] pub struct CudaStream { ptr: cudaStream_t, } unsafe impl Send for CudaStream {} unsafe impl Sync for CudaStream {} impl Drop for CudaStream ...
Rust
0
rs // Std imports use num::traits::{Float, Signed, One}; // local imports use sralgebra::{CommutativeRingPartial}; use srmatrix::api::{Matrix}; use srmatrix::api::{Shape, Extraction, MatrixBuffer, Search}; use srmatrix::api::eo_traits::ECO; use srmatrix::api::SRError; #[doc="Returns the determinant of a matrix. # R...
Rust
0
# Tipos de datos # string, integer, boolean, float, None cadena1 = "Cadena de texto" cadena2 = 'Cadena de texto' numero = 1 decimal = 1.0 vacio = None booleano = True booleano2 = False # Operadores de comparación # == != > < >= <= condicion = False # Es un solo bloque if condicion == True: ...
Python
1
PPED', [ 'NameNode on host {0} not found (namenode adresses = {1})'.format(host_name, ', '.join(nn_addresses))] upgrade_finalized_qry = "{0}://{1}/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo".format(scheme, uri) # start out assuming an OK status label = None result_code = "OK" try: if kerbe...
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 us...
Python
1
import torch # Load the original weights file original_weights = torch.load('/home/xteam/zhaohao/pycharmproject/YTMT/merge_stem_reg_014_00055524.pt') # Create a new weights dictionary # new_weights = {} # # Iterate through the original weights dictionary # for key, value in original_weights.items(): # # Check if...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- '''================================================= # copy and modify from mmcv.runner.hooks.optinizer.py # @Time : 2020/8/10 16:11 # @Author : wuzhihao # @email : 753993117@qq.com # @FileName: optinizer_hook.py # @Software: PyCharm # @github :https://github.com/wuz...
Python
1
#! /usr/bin/env python2 import sys import binascii import struct import getopt import re def print_usage(): sys.stderr.write('Usage:\n') sys.stderr.write('\tconvertleds.py [-d delay] input.led [output.l3d]\n') options, remainder = getopt.getopt(sys.argv[1:], 'd:o:h', ['delay=', 'outdir=', 'help']) delay_arg ...
Python
1
Annotated[ bool, Query( description="Indicates whether only validation of consecutive visit group assignment should be performed" ), ] = False, ) -> list[StudyVisit]: service = StudyVisitService(study_uid=study_uid) return service.assign_visit_consecutive_group( s...
Python
1
parse_ok!(signed, "'0001 1111'b", 0x1F); parse_ok!(signed, "' 01 ff 'h", 0x1FF); parse_ok!(signed, "' 0001 1111 'b", 0x1F); } #[test] fn unsigned_number() { parse_ok!(unsigned::<u8>, "123", 123); parse_fail!(unsigned::<u8>, "-123"); parse_ok!(unsigned, "...
Rust
0
let next_input = other.input_channels(); if !self.stages.is_empty() && !other.stages.is_empty() && prev_output != next_input { return Err(PipelineError::ChannelMismatch(prev_output, next_input)); } self.stages.append(&mut other.stages); self.update_channels(); ...
Rust
0
y: logger.info(f"完整克隆尝试 {retry + 1}/{max_retries} - 分支: {branch}") execute_command("git", ["pull", "origin", branch], cwd=target_dir, timeout=7200) # 2小时超时 logger.info(f"完整克隆成功,分支: {branch}") return True except Exception as...
Python
1
ate.beta_r()).unwrap() - sin).abs() < EPSILON); } /// Test alpha, beta, global phase of RotateAroundSphericalAxis #[test_case( CalculatorFloat::from(0), CalculatorFloat::from(0), CalculatorFloat::from(0), 1.0, 0.0, 0.0, 0.0, 0.0; "theta = 0")] #[test_case( CalculatorFloat::from(PI), CalculatorF...
Rust
0
n_number=opt.pipeline_output_degen_condition_numbers, # dataloader will output normalized images normalize_input_image=False, ) # prepare for SSL training pipeline.freeze_backbone_weights() pipeline.freeze_sdf_decoder_weights() if opt.train_mode == "ssl": ...
Python
1
"""idlelib.idle_test implements test.test_idle, which tests the IDLE application as part of the stdlib test suite. Run IDLE tests alone with "python -m test.test_idle (-v)". This package and its contained modules are subject to change and any direct use is at your own risk. """ from os.path import dirname # test_idle...
Python
1
=labels,bins=bins) print(planes[["Price","Price_category"]].head()) #PRICE CAT BY AIRLINE sns.countplot(data=planes,x="Airline",hue="Price_category") plt.show() #EXERCISE 1 # Create salary labels salary_labels = ["entry", "mid", "senior", "exec"] # Create the salary ranges list salary_ranges = [0, twenty_fifth, salari...
Python
1
nDate': None, 'ModDate': None, 'Creator' : None, 'Producer': None, 'Author': None, 'Version' : None } plt.savefig(f"graphs/{conference_name}.pdf", bbox_inches="tight", metadata=mtadata) plt.savefig(f"graphs/{conference_name}.png", b...
Python
1
from enum import Enum from moto.stepfunctions.parser.asl.antlr.runtime.ASLIntrinsicLexer import ( ASLIntrinsicLexer, ) class StatesFunctionNameType(Enum): Format = ASLIntrinsicLexer.Format StringToJson = ASLIntrinsicLexer.StringToJson JsonToString = ASLIntrinsicLexer.JsonToString Array = ASLIntri...
Python
1
test] fn s3_invalid_from_str_returns_err_not_enough_data() { let s = "S3041234565F"; let r = s.parse::<Record>(); assert_eq!(r, Err(Error::NotEnoughData)); } #[test] fn s5_returns_correct_record() { let s = "S5031234B6"; let r = s.parse::<Record>(); a...
Rust
0
Result<()> { trace!("rename"); inject_with_parent_and_name!(self, RENAME, parent, &name); let mut inode_map = self.inode_map.write().await; let old_path = { let parent_path = inode_map.get_path(parent)?; parent_path.join(&name) }; trace!("get orig...
Rust
0
, ffi::_ND_INS_CLASS::ND_INS_POP => Ok(Mnemonic::Pop), ffi::_ND_INS_CLASS::ND_INS_POPA => Ok(Mnemonic::Popa), ffi::_ND_INS_CLASS::ND_INS_POPAD => Ok(Mnemonic::Popad), ffi::_ND_INS_CLASS::ND_INS_POPCNT => Ok(Mnemonic::Popcnt), ffi::_ND_INS_CLASS::ND_INS_POPF =>...
Rust
0
cfg(all(target_arch = "x86_64", target_feature = "avx2"))] #[test] fn test_gen_random_vec_4_1() { // test correct len for len in START..END { let values = vec_rand::gen_random_vec_4_1(len, 0xBAD5EED); assert_eq!(values.len(), len); } // test reproducibility let step_a = vec_rand::ge...
Rust
0
watts / (v * MASS); if gamma <= 1e-5 { gamma = 0.0; } if (v - 3.0) <= 1e-2 { return -1; } t += DELTA_T; // time step println!("t: {}", t); } (t * 2.0).round() as i32 } fn dotest(v0: i32, slope: i32, d_tot: i32, exp: i32) -> () { a...
Rust
0
super::OsuObject; pub(crate) struct DifficultyObject<'h> { pub(crate) base: &'h OsuObject, pub(crate) prev: Option<(f32, f32)>, // (jump_dist, strain_time) pub(crate) jump_dist: f32, pub(crate) travel_dist: f32, pub(crate) angle: Option<f32>, pub(crate) delta: f32, pub(crate) strain_time:...
Rust
0
ne2 and char1 < char2 if op == '<=': return line1 < line2 or line1 == line2 and char1 <= char2 if op == '>': return line1 > line2 or line1 == line2 and char1 > char2 if op == '>=': return line1 > line2 or line1 == line2 and char1 >= char2 if op == '=='...
Python
1
assert_yaml_eq_json("- |\n val\n\n line2", r#"["val\n\nline2\n"]"#); } #[test] fn yaml_literal_with_empty_line_and_bad_newlines_in_a_list() { assert_yaml_eq_json("- |\r\n val\r\n\r\n line2", r#"["val\n\nline2\n"]"#); } #[test] fn yaml_words_with_space() { assert_yaml_eq_json(" a\nb", r#""a b""#); } #[t...
Rust
0
a folder, but the given path refers to something that isn't a folder. #[serde(rename="not_folder")] NotFolder, /// The file cannot be transferred because the content is restricted. /// For example, sometimes there are legal restrictions due to copyright claims. #[serde(rename="restricted_content")] RestrictedCon...
Rust
0
/ pub struct FlyCameraPlugin; impl Plugin for FlyCameraPlugin { fn build(&self, app: &mut AppBuilder) { app.init_resource::<State>() .add_system(camera_movement_system.system()) .add_system(mouse_motion_system.system()); } } fn main() {} struct Solution; impl Solution { p...
Rust
0
\b\b_n_high elf_f_head_06.nif", 0x0319_1C63, 0x1499_5B5A), (r"meshes\b\b_n_high elf_f_head_04.nif", 0x0319_1C63, 0x1499_5B5B), (r"meshes\b\b_n_high elf_m_head_02.nif", 0x0319_1C63, 0x1499_7758), (r"meshes\b\b_n_high elf_m_head_06.nif", 0x0319_1C63, 0x1499_775A), (r"meshes\b\b_n_high elf_m_head_04.ni...
Rust
0
indexing /// assert_eq!(m[(U1::new(), U1::new())], 4.0); /// // assert_eq!(m[(U2::new(), U2::new())], 1.0); // error /// # } /// ``` /// /// [`prelude`] provides typenum constants (`U0`, `U1`, `U2`, ...), matrix operation traits (e.g., /// [`Determinant`]), and aliases for `Matrix` (e.g., `Matrix2f32`). /// /// Note t...
Rust
0
from pyxdsm.XDSM import ( XDSM, OPT, FUNC, SOLVER ) def generate_xdsm(): xdsm = XDSM() xdsm.add_system('opt', OPT, r'\textbf{Optimizer}') xdsm.add_system('solver', SOLVER, r'\textbf{Newton Solver}') xdsm.add_system('D1', FUNC, [r'\textbf{Discipline 1}', ...
Python
1
let n = points.len(); let k = self.k; for v in 0..n { if u == v { continue; } let dx = points[v].x - points[u].x; let dy = points[v].y - points[u].y; let d = (dx * dx + dy * dy).sqrt().max(self.min_distance); let kd...
Rust
0
from __future__ import absolute_import from __future__ import print_function import pyverilog.vparser.ast as vast from pyverilog.ast_code_generator.codegen import ASTCodeGenerator def main(): # Define 2D array ports (4x4) width = vast.Width(vast.IntConst('3'), vast.IntConst('0')) dim = vast.Dimensions([vas...
Python
1
= io.StringIO("print test\nprint test2") output = io.StringIO() cmd = self.simplecmd(stdin=input, stdout=output) cmd.use_rawinput = False cmd.cmdloop() self.assertMultiLineEqual(output.getvalue(), ("(Cmd) test\n" "(Cmd) test2\n" "(Cmd) ")) ...
Python
1
"""schema with fixed UUID types Revision ID: 0e81cb71a639 Revises: b86de8bb8b46 Create Date: 2025-07-28 21:21:38.237662 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision: str = '0e81cb71a...
Python
1
expected); } Err(err) => { panic!("Case {}. {}", cidr, err) } } } #[rstest] #[case("0.0.0.0/33")] fn cidr_parsing_too_big_prefix(#[case] cidr: &str) { match cidr_string_to_integers(cidr) { Err(CidrStringParsingError::Prefix...
Rust
0
::Error; use std::fmt::{Display, Write}; use super::*; #[derive(Debug)] pub struct CustomError {} impl Display for CustomError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.write_str("CustomError") } } impl std::error::Error for CustomError {}...
Rust
0
_ in 0..10 { if !connections.is_empty() { break; } thread::sleep(Duration::from_millis(500)); connections = fabric.connections(); } if connections.is_empty() { return Err("Cannot contact seed nodes".into()); } f...
Rust
0
= "A repository with the same name already exists")] DuplicateRepository, #[fail(display = "Failed to detect filename from the path")] FileNameNotFound, #[fail( display = "The specified file does not exist, or you don't have enough permission to access it" )] FileUnreachable, #[fail...
Rust
0
ine parameters be sure to have different file names ready for each download data script execution # If a downloaded file cannot be created, the server generated link will appear in the console for you to manually download. # For all statistics jobs, the -outfile parameter is the csv output file that will be created. ...
Python
1
import os os.system('cls') ''' Escrever um algoritmo que leia um peso na Terra e o numero de um planeta e imprima o valor do seu peso nesteplaneta A relação de planetas é dada a seguir juntamente com o valor das gravidades relativas a Terra # Gravidade Relativa Planeta 1 0,37 ...
Python
1
from_u32(n), written_place.into())?; } // Return whether this was a success. this.write_scalar( Scalar::from_i32(if written.is_some() { 1 } else { 0 }), dest, )?; } // Allocation ...
Rust
0
if_true, if_false, } => { if test.execute(n) != 0 { if_true.execute(n) } else { if_false.execute(n) } } } } } impl PartialEq<Self> for Node { fn eq(&self, other: &Self) -> bo...
Rust
0
()); let missing = "missing"; let result = ts .ucmd() .set_stdin(Stdio::null()) .arg(missing) .arg("--retry") .run(); result .stderr_is( "tail: warning: --retry ignored; --retry is useful only when following\n\ tail: cannot open 'm...
Rust
0
try: # Django <=1.9 from django.db.models.loading import get_model except ImportError: # Django 1.10+ from django.apps import apps get_model = apps.get_model from django.utils.encoding import smart_str from django.http import JsonResponse from django.contrib.admin.views.decorators import staff_memb...
Python
1
*; use core::char; use core::ops::Range; use step::{AFTER_SURROGATE, BEFORE_SURROGATE}; use CharRange; const SKIP_LENGTH: u32 = ::step::AFTER_SURROGATE as u32 - ::step::BEFORE_SURROGATE as u32 - 1; #[derive(Clone, Debug)] pub struct Iter(rayon::iter::Map<rayon::range::Iter<u32>, fn(u32) -> char>); impl ParallelItera...
Rust
0
>, arg1: &Option<i64>, ) -> Result<Option<i64>> { // This is a standard Kleene OR used in SQL where // `null OR false == null` and `null OR true == true` Ok(match (arg0, arg1) { (Some(0), Some(0)) => Some(0), (None, None) | (None, Some(0)) | (Some(0), None) =>...
Rust
0
rue,null=True) innodb_row_lock_time_avg = models.FloatField("每次等待所花费平均时间",blank=True,null=True) innodb_buffer_pool_pages_flushed = models.IntegerField("innodb脏页刷新的频率",blank=True,null=True) innodb_data_read = models.FloatField("innodb读取的数据量",blank=True,null=True) innodb_data_written = models.FloatField("...
Python
1
.. } => { assert_eq!(w1, w2); assert_eq!(t1, t2); assert_eq!(c1, c2); assert_eq!(a1, b1); assert_eq!(a2, b2); } other => panic!("Received non User event: {:?}", other), } } #[allow(unused)] struct SomeEventTypeTest3 { ...
Rust
0
# -*- coding: utf-8 -*- """數據品質管理器 此模組提供統一的數據品質檢查、清理和標準化功能,包括: - 數據完整性檢查 - 異常值檢測和處理 - 數據一致性驗證 - 數據標準化和格式化 - 品質評分和報告 主要功能: - 多維度數據品質評估 - 智能異常值檢測 - 自動數據清理和修復 - 品質監控和報告 - 數據標準化處理 Example: >>> manager = DataQualityManager() >>> quality_report = manager.check_data_quality(df) >>> cleaned_data = manager.clean_...
Python
1
malVisitor) } } use std::{error, io}; use serde::Serialize; use crate::bank::Account; #[cfg(test)] mod tests; pub fn write_accounts_to_csv<'a>( writer: &mut impl io::Write, accounts: impl Iterator<Item = &'a Account>, ) -> Result<(), Box<dyn error::Error>> { let mut writer = csv::WriterBuilder::new(...
Rust
0
fs::File; use std::io::prelude::*; use std::os::unix::fs::PermissionsExt; use std::path::PathBuf; use types::{ test_utils::generate_deterministic_keypair, ChainSpec, DepositData, Hash256, Keypair, PublicKey, SecretKey, Signature, }; const VOTING_KEY_PREFIX: &str = "voting"; const WITHDRAWAL_KEY_PREFIX: &str = ...
Rust
0
..])) .collect::<DecodeResult<_>>()?; let mark_filtering_set = if lookup_flags.contains(LookupFlags::USE_MARK_FILTERING_SET) { Some(decode_u16_be(bytes, LookupTableHeader::PACKED_LEN + (header.subtable_count as usize * 2))) ...
Rust
0
# ------------------------------------------------------------------------------ # # Description: Utilities for layer definitions # ------------------------------------------------------------------------------ # from torch import nn import math class FC(nn.Module): def __init__(self, in_size, out_size, dropout_...
Python
1
-tools/create-templates/templates.json"), r#"[ "component-v2/main.cc.tmpl-cpp" ]"#, ); files.insert( Path::new("/out/default/host-tools/create-templates/component-v2/main.cc.tmpl-cpp"), r#"{{PROJECT_NAME}}"#, ); let tree = TemplateTree::from_json_file(...
Rust
0
let buffer = buffer_pool_manager.fetch_page(page_id).await.unwrap(); assert!(buffer.page.read().await.iter().all(|&v| v == N_ITER)); } } #[tokio::test] async fn test_buffer_pool_manager_concurrent() { const N_PAGES: usize = 64; const POOL_SIZE: usize = 4; const...
Rust
0
------- minimum : int Minimum tile coordinate (note: always 0). maximum : int Maximum tile coordinate (2 ** zoom - 1). Raises ------ InvalidZoomError If zoom level is not a positive integer. Examples -------- >>> minmax(1) (0, 1) >>> minmax(-1) Trac...
Python
1
or: Dictionary object ended prematurely."); unsafe { pdf_release_obj(result); } return None; } *self = &p[2..]; Some(result) } fn parse_pdf_literal_string(&mut self) -> Option<*mut pdf_obj> { /* * PDF Literal String */ fn ps_getes...
Rust
0
LETABFT_INIT_LOG_TERM)) .unwrap(); violetabft_state.mut_hard_state().set_commit(12); engines.violetabft.put_msg(&violetabft_state_key, &violetabft_state).unwrap(); assert!(build_causet_storage().is_err()); let log_key = tuplespaceInstanton::violetabft_log_key(1, 20); ...
Rust
0
shift(d,cutoff)), Box::new(t2._shift(d,cutoff))) } } pub fn to_term(self) -> Term { let mut vec = Vec::new(); self._to_term(&mut vec,0) } fn _to_term(self, vec: &mut Vec<char> , c: u32) -> Term { match self { D...
Rust
0
import math import optax import jax.numpy as jnp from functools import partial from jax import lax from jax.sharding import PartitionSpec as PS # Contrastive loss over 2d-mesh with manually designed parallel collective procedures def contrastive_loss_2dm(ss, tt, scale_by_dim=False): import jax._src.mesh as mesh_l...
Python
1
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Interface for Baidu's RT-DETR, a Vision Transformer-based real-time object detector. RT-DETR offers real-time performance and high accuracy, excelling in accelerated backends like CUDA with TensorRT. It features an efficient hybrid encoder and IoU-aware query selection for en...
Python
1
= String::from_utf8(b).unwrap(); assert_eq!("Hello World", body_string); } _ => panic!("Got no result"), } } } #[test] fn post_simple() { let _ = env_logger::init(); let mut r = Router::new(); r.get("/", handle...
Rust
0
置指定类型的值 /// #[pi_js_export(X = type(bool, usize, String))] pub fn set<'a, X: Clone>(x: X) -> Option<X> { Some(x) } /// /// 刷新指定类型的值 /// #[pi_js_export(X = type(bool, usize, String), Y = type(bool, usize, String))] pub fn flush<'a, X, Y>(mut self, x: X, y: &'a X, z...
Rust
0
"""Tests for the sensor provided by the CPU Speed integration.""" from unittest.mock import MagicMock from homeassistant.components.cpuspeed.const import DOMAIN from homeassistant.components.cpuspeed.sensor import ATTR_ARCH, ATTR_BRAND, ATTR_HZ from homeassistant.components.homeassistant import ( DOMAIN as HOME_A...
Python
1
})) .send() .expect("Failed to perform request"); assert_eq!(resp.status(), StatusCode::OK); let resp = Client::new() .get(url) .header( "SplinterProtocolVersion", protocol::AUTHORIZATION_PROTOCOL_VERSION, ) ...
Rust
0
import tkinter import customtkinter from view.fonts.fonts import * class OutputLogFrame(customtkinter.CTkFrame): def __init__(self, parent): """ Creates a 2x1 frame with a text box for outputting log messages. """ super().__init__(parent) # configure grid layout (1x1) ...
Python
1
_base_ = [ '../_base_/models/faster_rcnn_r50_caffe_c4.py', '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] # use caffe img_norm img_norm_cfg = dict( mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False) train_pipeline = [ ...
Python
1
age: u8, } struct Unit; struct Pair(i32, f32); struct Point { x: f32, y: f32 } #[allow(dead_code)] struct Rectangle { top_left: Point, bottom_right: Point } pub fn structures (){ let name="peter"; let age=27; let pete...
Rust
0
import pandas as pd def Squeeze_Momentum_Indicator(data: pd.Series, period: int = 20, MA: pd.Series = None) -> pd.Series: """ Calculates the Squeeze Momentum Indicator from the given data. The Squeeze Momentum Indicator helps identify periods of low volatility and high volatility contraction, which are of...
Python
1
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
1
e # 翻译器可能会自动补个越界的公式标记 if var[vid][-1].get_text() and unicodedata.category(var[vid][-1].get_text()[0]) in ["Lm", "Mn", "Sk"]: # 文字修饰符 mod = var[vid][-1].width else: # 加载文字 ch = new[ptr] fcur_ = None ...
Python
1
') OP_28(0x009B, 0x02, 0x0040) OP_28(0x009B, 0x01, 0x0080) CameraMove(520, 0, 114520, 0) OP_67(0, 8000, -10000, 0) CameraSetDistance(2600, 0) OP_6C(315000, 0) OP_6E(262, 0) ChrSetPos(0x0000, 520, 0, 114520, 135) ChrSetPos(0x0001, 520, 0, 114520, 135) ChrSetPos(0x0002, 520, 0, 11...
Python
1
_llvm_ref(constant, ctx)), LLVMOpcode::LLVMTrunc => Constant::Trunc(Trunc::from_llvm_ref(constant, ctx)), LLVMOpcode::LLVMZExt => Constant::ZExt(ZExt::from_llvm_ref(constant, ctx)), LLVMOpcode::LLVMSExt => Constant::SExt(SExt::from_llvm_ref(constant, ctx)), ...
Rust
0
(keywords) != 0: res_damage += "【" + "+".join(keywords) + "】" if bonus != 0: res_damage += f"+{bonus}" return res_damage def parse_defense_string(defense: str) -> str: """ Parses the defense string, returning the defense value. Note that DEX, INS, MIG, WLP in this case refer to th...
Python
1
"""Test case for adding an overlay component defined in the rxconfig.""" from collections.abc import Generator import pytest from selenium.webdriver.common.by import By from reflex.testing import AppHarness, WebDriver def ExtraOverlay(): import reflex as rx def index(): return rx.vstack( ...
Python
1
N\\Radicioni\\Esercitazione 3\\Centroidi di Rocchio con scelta dei NEG più raffinata (2)-fit_trasform_migliore- i synsets di WN\\c_sci_crypt.txt', 'w') as f: str = json.dumps(c_sci_crypt) f.write(str) with open('C:\\Users\\miky9\\PycharmProjects\\pythonProject\\Progetti TLN\\Radicioni\\Esercitazione 3\\Centroi...
Python
1
pub frame_index: i32, pub mat_frame_index: i32, } #[repr(C)] #[derive(Copy, Clone)] pub struct Sequence { // TODO } #[repr(C)] #[derive(Copy, Clone)] pub struct Trigger { state: u32, pos: f32, } #[repr(C)] #[vtable(TsShapeVtable)] #[inherits(ResourceInstance)] pub struct TsShape { pub nodes: Tool...
Rust
0
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np # 1 df = pd.read_csv("medical_examination.csv") # 2 df["BMI"] = df["weight"]/( df["height"]/100)**2 df["overweight"] = (df["BMI"] > 25).astype("int") df.drop("BMI", axis=1, inplace=True) # 3 df["cholesterol"] = (df["cholestero...
Python
1
_counter() - start_time) / 60} min Epoch Time: {(time.perf_counter() - tmp_time) / 60:.3} min # training Total Loss: {total_losses} RMSDs Loss: {rmsd_losss} Mdntr Loss: {mdntrue_losses} # validation Total Loss: {val_total_losses} RMSDs Loss: {val_rmsd_losses} Mdntr Loss: {val_mdntrue_losses} ''' ...
Python
1
SigmaProp => sigma_prop_nested_expr(depth), _ => todo!("nested expr is not implemented for type: {:?}", tpe), } .boxed() } fn int_non_nested_expr() -> BoxedStrategy<Expr> { prop_oneof![Just(GlobalVars::Height.into()),].boxed() } fn constant(tpe: &SType) -> BoxedStra...
Rust
0
nt += 1 reports = [] if bracketLayer.LSB == mainLayer.LSB: reports.append(u"✅ LSB in sync") else: reports.append(u"⛔️ LSB diverging") if bracketLayer.RSB == mainLayer.RSB: reports.append(u"✅ RSB in sync") else: reports.append(u"⛔️ RSB diverging") if bracketLayer.width == main...
Python
1
ansfer select 24:"] DMA1TSEL_24 = 24, #[doc = "25: DMA channel 1 transfer select 25:"] DMA1TSEL_25 = 25, #[doc = "26: DMA channel 1 transfer select 26:"] DMA1TSEL_26 = 26, #[doc = "27: DMA channel 1 transfer select 27:"] DMA1TSEL_27 = 27, #[doc = "28: DMA channel 1 transfer select 28:"] ...
Rust
0
; let size = match rows { 0 => 0, _ => offsets.at(rows - 1) as usize, }; let inner = ColumnData::load_data::<ArcColumnWrapper, _>(reader, type_name, size, tz)?; Ok(ArrayColumnData { inner, offsets }) } } impl ColumnData for ArrayColumnData { fn sql_type...
Rust
0
chPhase::Ended, _ => unreachable!() }; Some(Event::Touch(Touch { phase: phase, location: (event_data.event_x, event_data.event_y), id: event_data.detail as u64, })) } _...
Rust
0
Event::Key(KeyEvent{code: KeyCode::Char($ch), modifiers: $mod}) }; } const HELP_TEXT: &str = "Controls: wasd : move space : toggle gridpoint e : frame advance f : playback xx : clear qq : quit h : show/hide this help lmb : draw rmb : erase Game of Life rules: minus/equals '-=' : adjust 'li...
Rust
0
#!/usr/bin/env python3 """ 🚀 FLOWSTATE-AI SIMPLE SYSTEM STARTUP ⚡ Get the core AI agents operational immediately 🎯 Mission: Launch Project Manager, Communication Hub, and CRM Pipeline """ import os import sys import subprocess import time import signal from pathlib import Path # Set up the project root PROJECT_ROOT...
Python
1
set_display_mode(display_mode).sdl_error()?; window.set_fullscreen(fullscreen).sdl_error()?; let mut canvas = window.into_canvas().accelerated().present_vsync().build()?; canvas.set_blend_mode(BlendMode::Blend); video.text_input().start(); // video.text_input().set_rect(TODO); ...
Rust
0
import subprocess from wr_ui import print_header, print_info, print_danger, print_success class AutonomousValidationManager: """Manages the autonomous validation of findings using external tools.""" def __init__(self, config: dict): self.config = config # Paths to the external tool submodules ...
Python
1
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Frame_pay.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Frame_pay(object): def setupUi(self, Frame_pay): Frame_pa...
Python
1
p.take with axis=None is not supported") arr_var, indices_var = eqn.invars out_var = eqn.outvars[0] arr_val = ctx.get_value_for_var( arr_var, name_hint=ctx.fresh_name("take_data"), prefer_np_dtype=None ) indices_val = ctx.get_value_for_var( indices_var, ...
Python
1
_ack_delay = Duration::from_millis(0); let now = NoopClock.get_time(); let mut rtt_estimator = RttEstimator::new(max_ack_delay); // Update RTT with the smallest possible sample rtt_estimator.update_rtt( Duration::from_millis(0), Duration::from_nanos(1), ...
Rust
0
import numpy as np import cv2 def seg2bmap(seg, width=None, height=None): """ From a segmentation, compute a binary boundary map with 1 pixel wide boundaries. The boundary pixels are offset by 1/2 pixel towards the origin from the actual segment boundary. Arguments: seg : Segments labeled from 1..k. wi...
Python
1
dgecolor='black') axs[0].set_title('Positive Samples (n={})'.format(len(sum_result_positive))) axs[0].set_ylabel('Frequency') axs[0].grid(alpha=0.3) # Plot 2: Negative Samples axs[1].hist(sum_result_negative, bins=bin_edges, alpha=0.7, color='red', edgecolor='black') axs[1].set_title('Negative ...
Python
1
def brainfuck_interpreter(code, input_data=""): code = list(code) tape = [0] * 30000 tape_ptr = 0 code_ptr = 0 input_ptr = 0 output = [] # Preprocess brackets to find matching brackets for fast jumps bracket_map = {} stack = [] for i, command in enumerate(code): if comm...
Python
1
lf::try_skip_while::TrySkipWhile; cfg_target_has_atomic! { #[cfg(feature = "alloc")] mod try_buffer_unordered; #[cfg(feature = "alloc")] pub use self::try_buffer_unordered::TryBufferUnordered; #[cfg(feature = "alloc")] mod try_for_each_concurrent; #[cfg(feature = "alloc")] pub use self...
Rust
0
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation class ProxyGenericForeignKey(GenericForeignKey): def __init__(self, *args, **kwargs): kwargs['for_concrete_model'] = False super(ProxyGenericForeignKey, self).__init__(*args, **kwargs) class ProxyGenericRelation(Ge...
Python
1
# ***************************************************************************** # Copyright (c) 2019-2020, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions o...
Python
1
��ග වැඩ\u{dd2}වන ප\u{dca}\u{200d}රස\u{dca}ත\u{dcf}රය"), keywords: &[ "ප\u{dca}\u{200d}රස\u{dca}ත\u{dcf}ර සටහන", "ම\u{dd4}දල\u{dca} වර\u{dca}ගය", "යෙන\u{dca} සමග වැඩ\u{dd2}වන ප\u{dca}\u{200d}රස\u{dca}ත\u{dcf}රය", "වර\u{dca}ධනය", ...
Rust
0