text
string
label_name
string
labels
int64
self.get_vtbl().get_Prefix)(self.get_abi() as *const _ as *mut _, &mut out); if hr == S_OK { Ok(IInspectable::wrap(out)) } else { err(hr) } }} #[inline] pub fn normalize(&self) -> Result<()> { unsafe { let hr = (self.get_vtbl().Normalize)(self.get_abi() as *const _ as *mut _); if hr == ...
Rust
0
""" 专门测试 UIAutomator2 初始化功能 """ from mcp_android import init_uiautomator2, check_uiautomator2, restart_uiautomator2 def test_init(): """测试初始化过程""" print("\n=== 测试 UIAutomator2 初始化 ===") print("1. 直接调用初始化") try: result = init_uiautomator2() print(f"初始化结果: {result}") except Exce...
Python
1
""" Os alunos de uma turma têm alturas diferentes. Utilize enumeratepara imprimir a altura de cada aluno junto com seu índice. alturas_alunos= [160, 175, 150, 180] """ alturas_alunos = [160, 175, 150, 180] for indice, altura in enumerate(alturas_alunos): print(f"Aluno {indice}: {altura} cm")
Python
1
N)>, D::SetLevel<(D::N, <LN<Three, A, B, C, D> as LProp>::N)>>> ) -> PSemNaive< A::SetLevel<(A::N, <LN<Zero, A, B, C, D> as LProp>::N)>, B::SetLevel<(B::N, <LN<One, A, B, C, D> as LProp>::N)>, C::SetLevel<(C::N, <LN<Two, A, B, C, D> as LProp>::N)>, D::SetLevel<(D::...
Rust
0
ho I was.", "But I'm <NAME>.", "I'm <NAME>.", "And that's who I'm going to be.", "From now on that's who I'm going to be.", "I'm Cosmo!", "Whoa, psychosexual.", "Alright, you know what this is gonna do?", "He's gonna be upset because you didn't call him and we're not gonna get those tickets for Friday n...
Rust
0
city_with_area = str(weather_json['location']['city']) + str(weather_json['location']['region']) return weather, city_with_area def set_conditional_wallpaper(city, time_level, no_weather, walls_dir, file_format): if not no_weather: weather, actual_city = get_current_weather(city) weather_code...
Python
1
; /// Base seconds between liveness probes. static PROBE_BASE_INTERVAL_SECS: u64 = 1; /// Base milliseconds for `ack` timeout on each probe. static PROBE_BASE_TIMEOUT_MILLIS: u64 = 500; /// Maximum local-health multiplier. static PROBE_MAX_HEALTH: u64 = 8; /// Initial local health. static PROBE_INITIAL_HEALTH: u64 ...
Rust
0
2_EARTH }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87A_Y3_EARTH }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87A_Y4_EARTH }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87A_Y5_EARTH } ]; const G_VSOP87A_Z_EARTH: [aavsop87::VSOP87Coefficient2; 6] = ...
Rust
0
nWindow', 'clearing_screen', f'Destroying current screen: {type(self.current_screen_widget).__name__}') self.current_screen_widget.destroy() self.current_screen_widget = None def refresh_current_screen(self): """Refresh the current screen""" if self.current_screen == 'ho...
Python
1
::builder().appender("root").build(log_level))?; log4rs::init_config(log_config)?; Ok(()) } <reponame>misterstrogg/toadisghey #[derive(Debug, PartialEq)] pub enum Op { Increment, Decrement, Output, Right, Left, Input, Jump, JumpBack, Unknown, } pub trait ToOp { fn to_...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Lithuanian Intrastat Declaration', 'version': '1.0', 'category': 'Accounting/Localizations/Reporting', 'description': """ Generates Intrastat XML report for declaration. Adds the possibility to specify...
Python
1
import sys, re import string """Simple script that scans all of the test suite results text fed in through stdin and summarises the total number of failures, test points, and test cases.""" # Read in everything lines = sys.stdin.readlines() found = False for line in lines: if (re.search(r'^--- Summary:', line)):...
Python
1
print("Đang phân loại dữ liệu từ bảng xuly...") # Kiểm tra các cột cần thiết required_features = ["length", "psd_mean", "kurtosis", "skewness","mean", "std_dev", "num_peaks_above_threshold"] if not all(feature in data4.columns for feature in required_features): ...
Python
1
15\xb8\x0f\xb7q23\ 33\x9b\x8e\xac\x8a\xe2e\xdc\xe6\xc9l6.\x06~\ #t\x10ff\x93\x98\x0f\xfc\x09Z<5\xb3\xb9\xcb\ \x86_w\xa1\x16Ok\x81\xcb\x81\x85\x01c\xca\xa36\ TAQBU\x13\x87\xd1\x80l'q\xa6\xc1\x95\x13\ \xf1\xbb3t\x00ffff\x11\xf25\x94\xd9\xec\xbc\ ;t\x00ffg\xe1s\x94Y\xe3TQU\xc0.\ \xe0Y\xe0\xf5\xda\xef\xd9\xa9\xdaQ\xbb\xab5...
Python
1
print(f" Output: {output_path.name}") compress_video(video_path, output_path, quality) size_after = get_file_size_mb(output_path) total_size_after += size_after compression_ratio = ((size_before - size_after) / size_before) * 100 ...
Python
1
ng query task failed: {}", err); None } } } } // Generated by `scripts/generate.js` use std::os::raw::c_char; use std::ops::Deref; use std::ptr; use std::cmp; use std::mem; use utils::c_bindings::*; use utils::vk_convert::*; use utils::vk_null::*; use utils::vk_ptr::*; use utils...
Rust
0
] } } } #[packed] pub struct Texture { name: [i8, ..64], surface_flags: i32, content_flags: i32 } #[packed] pub struct Plane { normal: math::Vec3f, /* Distance the plane is from the origin, along the normal. */ distance: f32 } #[packed] pub struct Node { /* Index of the corresponding plane. */ plane: ...
Rust
0
e\xa9X\x8e1\x9c\x0d\xe8\ 61\xb3\x90\x8e\xf6+O\xa9]\x044,1S\x9d\ \xd8\xf0\x87w\xc9\x17\xd7!\xb0&)\xd4\xf1\xef\xc4e\ (\xa3U\xf0\xb6\xaaN\xe0Q\x9e\x13~,Q\x86Z\ \xea\xaax~\xeb(\xa0.\x19?\xc0\x93\xfc\xbcU\xb6\ \xd8\xdd\xdeX{\x22\xbb\xc2\xb4\xa3;X\x8d\x0a{8\ \xe8\x19\xdfTV\x08\xf0\xbe\xff\xed\xf2^\xdd\xb4iv\ ?\xd1\xcd,\xdf[\...
Python
1
PG_DOZE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPUART3_IPG_DOZE_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "not in doze mode"] #[inline(always)] pub fn lpuart3_ipg_doze_0(self) -> &'a mut W {...
Rust
0
ert_eq!( super::divrem_euclid_isize(-10, 3), (-4, 2) ); assert_eq!( super::divrem_euclid_isize(-10, -3), (4, 2) ); } } use std::fmt; pub type PointI = Point<isize>; pub type PointU = Point<usize>; #[derive(PartialEq, Eq, Hash, Debug, Clone)] ...
Rust
0
#!/usr/bin/env python3 """ 데이터 누출 검증 시스템 CLAUDE.md 3대 금기사항 준수: 데이터누출로 인한 성능 95%이상 방지 """ import numpy as np import pandas as pd import logging from pathlib import Path from sklearn.model_selection import TimeSeriesSplit from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LinearRegression ...
Python
1
header<W>(&self, to: W, de: DataElementHeader) -> Result<usize> where W: Write; /// Encode and write a DICOM sequence item header to the given destination. /* Although item element headers are always a tag and length sequence regardless of TS, the encoding of the length is unknown at this level...
Rust
0
parent_global)) => { if !ready.test(local.parent.id() as usize) { ready.set(local.parent.id() as usize); let elem = (local.parent, *parent_local); update.push_front(elem); ...
Rust
0
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf from tensorflow.keras import layers, models import numpy as np from pathlib import Path import random # ---- Config ---- IMG_SIZE = (224, 224) BATCH_SIZE = 32 EPOCHS = 25 FREEZE_LAYERS_UPTO = 100 # fine-tune upper layers BASE_DIR = Path(__fil...
Python
1
t jni::sys::JNINativeMethod; } pub fn get_yahfa_hook_main_methods_vec() -> (String,Vec<jni::NativeMethod>) { let yahfa_hook_main_methods_ptr = unsafe{ get_yahfa_hook_main_methods() }; let yahfa_hook_main_methods_sys = unsafe{ // length and capacity from module/src/main/cpp/yahfa/include/yahfa.h ...
Rust
0
atchingState::Rejected => (), PathMatchingState::Completed => { let next_base_path = join_path(&base_path, &content_object_info.name); log::trace!(" call callback path={:?}", &next_base_path); continued = callback(&content_object_info, &next_base_path)?; ...
Rust
0
2il.sqlite...') stdout.flush() os.remove('wasa2il.sqlite') stdout.write(' done\n') create_database = True else: create_database = True if create_database: stdout.write('Setting up database (via "migrate"):\n') migrate_result = subprocess.call(['python', os.path.join(os.getcw...
Python
1
from typing import Optional import paddle from paddle import Tensor from paddle_geometric.typing import TensorFrame def mask_select(src: Tensor, dim: int, mask: Tensor) -> Tensor: """Returns a new tensor which masks the src tensor along the dimension dim according to the boolean mask mask.""" assert mas...
Python
1
# Enter your code here. Read input from STDIN. Print output to STDOUT first = int(input()) all_values = [input() for i in range(first * 4)] i = 1 while i <= first * 4: first_set = set(map(int, all_values[i].split())) second_set = set(map(int, all_values[i + 2].split())) print(first_set.issubset(second_set...
Python
1
, Gd, Bd, Ad const DST_COLOR = bgfx_sys::BGFX_STATE_BLEND_DST_COLOR as _; /// 1-Rd, 1-Gd, 1-Bd, 1-Ad const INV_DST_COLOR = bgfx_sys::BGFX_STATE_BLEND_INV_DST_COLOR as _; /// f, f, f, 1; f = min(As, 1-Ad) const SRC_ALPHA_SAT = bgfx_sys::BGFX_STATE_BLEND_SRC_ALPHA_SAT as _; ...
Rust
0
_handle = res_handles.get("times") iteration_handle = res_handles.get("iteration") times_handle.wait_for_values(1) iteration_handle.wait_for_values(1) # Data processing initialization counts_vec = np.zeros(meas_len, int) old_count = 0 # Live plotting fig = plt.figure() interrupt_on_...
Python
1
[(end_old - 3 + s - 30) as usize ..(end_old - 3 + s - 30 + 64) as usize] .to_vec(); //printf("check s=%d, codon %s\n", s, codon); let freq_sum = -(0..61) .into_par_iter() .map(|j| { let j = j as usize; let idx = trinucleotide(&utr[j], &utr[j + 1], ...
Rust
0
from django import template from django.template.defaultfilters import stringfilter import markdown as md register = template.Library() @register.filter() @stringfilter def markdown(value): return md.markdown(value, extensions=['markdown.extensions.fenced_code'])
Python
1
//-- as in borrowing ownership, then giving it back once the function //-- goes out of scope str.len() } //-- Here, str goes out of scope. But because it does not have ownership of what //-- it refers to, nothing happens (no cleanup/dropping) fn change_and_calculate_length_ref(str: &mut String) -> usi...
Rust
0
import os import azure.identity from dotenv import load_dotenv from smolagents import AzureOpenAIServerModel, CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel # Setup the OpenAI client to use either Azure OpenAI or GitHub Models load_dotenv(override=True) API_HOST = os.getenv("API_HOST", "github") if API_HOST == "...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='btc-address-dump', version='0.5.0', author='cig01', url='https://github.com/10gic/btc-address-dump', license='MIT License', description='A utility for dump btc address from mnemonic words or private key or ...
Python
1
#!/usr/bin/env python3 import perf from aiokafka.producer.message_accumulator import BatchBuilder import itertools import random import hashlib import os DEFAULT_BATCH_SIZE = 1600 * 1024 KEY_SIZE = 6 VALUE_SIZE = 60 TIMESTAMP_RANGE = [1505824130000, 1505824140000] # With values above v1 record is 100 bytes, so 10_00...
Python
1
grid = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] # Your task: Use list comprehension to flatten the grid into a 1D list. flat = [num for row in grid for num in row] print(flat) #
Python
1
self.cur += 1; if self.cur == self.len { // this maybe the last; if let Some(end) = self.end.take() { Some(MarkedData::Marked(Some(data), end)) } else { Some(MarkedData::Da...
Rust
0
ones. Returns: Either the latest experiment or the set of latest experiments in case more than one were requested. """ cursor = self._runs.find().sort(attr, DESCENDING).limit(n) experiments = [self._make_experiment(experiment) for experiment in cursor] if len(experi...
Python
1
enabled, 'total_strategies': len(self.strategy_trades), 'attribution_window_days': self.attribution_window_days, 'last_attribution_update': self.last_attribution_update.isoformat() if self.last_attribution_update else None, 'current_attribution': current_a...
Python
1
or i, descriptor in enumerate(X.columns): try: # Use a single descriptor to train the logistic regression model X_single = X_scaled[:, i].reshape(-1, 1) model = LogisticRegression(random_state=42) model.fit(X_single, y) y_pred_proba = model.predict_proba(X_single)[:,...
Python
1
scape(code) + r'(?![A-Za-z0-9])' if re.search(pattern, upper_message): found_stocks.append(code) return list(set(found_stocks)) if __name__ == '__main__': # Test cases print("Testing: 'nvda'") print(key_word_check('nvda')) # Should find NVDA, score depends on keywords print(...
Python
1
ame.pack_forget() self.grid_values_entry_label.pack(side="left") self.grid_values_entry.pack(side="left", fill="x", expand=True) def add_grid_variable(self): param_name = self.grid_param_to_add.get() if not param_name: return param_def = next((p for p in PARAMS_CONFI...
Python
1
!( solve_combined(vec![ Claim::new(1, 1, 3, 4, 4), Claim::new(2, 3, 1, 4, 4), Claim::new(3, 5, 5, 2, 2), ]), (4, 3) ) } #[test] fn test_parse_claim() { assert_eq!( Claim::parse(String::from("#758...
Rust
0
e = {} self._interface = interface if 'version' not in self._interface: self._interface['version'] = SCHEMA_VERSION if self._interface['version'] not in SCHEMA_VERSIONS: msg = '%s is an unsupported version number' raise InvalidInterface('INVALID_VERSION', ms...
Python
1
DB_GROUP = "Dogbone" DB_NAME = "dogbone" COMMAND_ID = "dogboneBtn" UPD_COMMAND_ID = "dogboneUpdateBtn" ACUTE_ANGLE = "acuteAngle" ANGLE_DETECTION_GROUP = "angleDetectionGroup" BENCHMARK = "benchmark" DEPTH_EXTENT = "depthExtent" DOGBONE_TYPE = "dogboneType" EDGE_SELECT = "edgeSelect" FACE_SELECT = "faceSelect" FROM_S...
Python
1
ack() { if inner_ty.is_phantom_data() { walker.skip_current_subtree(); for x in inner_ty.walk() { if let GenericArgKind::Type(ph_ty) = x.unpack() { if let ty::TyKind::Para...
Rust
0
ellow" => color::LightYellow.bg_str().to_string(), _ => { found = false; "".to_owned() } } } if found { return Ok(ansi); } let str_nums: Vec<&str> = str_color.split_ascii_whitespace().collect(); let mut color_values: Vec<u8> = ...
Rust
0
::new(Some("HelloWorld".into()), hello_world) .await .expect("Runtime to run") .websocket_server(server_addr, None) .await .expect("Websocket server to run"); overclock::spawn_task("overclock websocket", ws_client()); runtime.block_on().await.expect("Runtime to shutdown g...
Rust
0
', None, 2399142789), #SHORTCUT_PLGUP (MsgAction, 'PluginDown', 'Plugin Down', None, 2399142790), #SHORTCUT_PLGDN (MsgAction, 'PluginLeft', 'Plugin Left', None, 2399142791), #SHORTCUT_PLGLEFT (MsgAction, 'PluginRight', 'Plugin Right', None, 2399142792), #SHORTCUT_PLGRIGHT (MsgAction, 'PluginPageUp', 'Pl...
Python
1
type Output = Self; #[inline] fn shr(self, rhs: usize) -> Self::Output { match self.0 { Left(v) => Self(Left(v >> rhs)), Right(_) => unreachable!(), } } } impl<T: Integer + Clone + Shr<usize, Output = T>, R: Reducer<T>> Shr<usize> for &Mint<T, R> { type Outpu...
Rust
0
# Please write a program which asks the user for their age. The program should then print out a message based on whether the user is of age or not, using 18 as the age of maturity. # Some examples of expected behaviour: # Sample output # How old are you? 12 # You are not of age! # Sample output # How old are you? 32...
Python
1
let mut layers = Vec::new(); for size in layer_sizes { let end = start + size; let layer = &buffer[start..end]; layers.push(FixedWidthSliceVector::load(layer, num_neighbors)); start = end; } Layers::FixWidth(layers) } } pub fn read_laye...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.payment.tests.common import PaymentCommon class PaymentDemoCommon(PaymentCommon): @classmethod def setUpClass(cls): super().setUpClass() cls.provider = cls._prepare_provider(code='demo') cls...
Python
1
s", "type": "L3" }, "NEW_ACL_TABLE": { "policy_desc": "New ACL Table", "ports": [ "Ethernet1", "Ethernet2" ], "stage": "ingress", ...
Python
1
import string from collections import Counter import matplotlib.pyplot as plt text = open("D:/Data_Scientist/MachineLearningProjects/sentimantalAnalysic(NLP)/Data/read.txt", encoding="utf-8").read() lower_case = text.lower() clean_text = lower_case.translate(str.maketrans("", "", string.punctuation)) tokenized_words ...
Python
1
en(processes)} 个IDE进程仍在运行!") for proc in processes: print_warning(f" {proc}") if options.kill_processes or options.mode == CleanupMode.AGGRESSIVE: print_info("自动终止IDE进程...") success = await self.process_manager.kill_ide_p...
Python
1
import json import numpy as np import matplotlib.pyplot as plt import os import glob from datetime import datetime import matplotlib.font_manager as fm from scipy.ndimage import binary_opening # 노이즈 제거를 위해 임포트 # --- 한글 폰트 설정 --- try: font_path = '/System/Library/Fonts/AppleSDGothicNeo.ttc' font_prop = fm.FontP...
Python
1
force_refresh=True) result2 = self.insp.upweighting_influence_batch(sess, test_indices=test_indices, test_batch_size=_batch_size, ...
Python
1
ersion_info.as_ref()) // .long_version(version_info.as_ref()) .arg( Arg::new("config") .short('C') .long("config") .value_name("FILE") .help("Set the configuration file") .takes_value(true), ) .ar...
Rust
0
.png", "x148": "/assets/globals/missing_avatar/x148.png", "x80": "/assets/globals/missing_avatar/x80.png", "x64": "/assets/globals/missing_avatar/x64.png", "x48": "/assets/globals/missing_avatar/x48.png", "x32": "/assets/globals/missing_ava...
Python
1
T, E> MapHandlerError<T> for Result<T, E> where E: Into<anyhow::Error> + Display, { fn map_err_with_status(self, status_code: StatusCode) -> Result<T, HandlerError> { self.map_err(|err| { trace!(" converting Error to HandlerError: {}", err); HandlerError { status_...
Rust
0
-9]+)@ \2 = \L\1,@' /// ``` #[repr(u32)] #[derive(Copy, Clone, PartialEq, Debug, Primitive)] pub enum NtStatusWindows { STATUS_SUCCESS = 0x00000000u32, STATUS_WAIT_1 = 0x00000001, STATUS_WAIT_2 = 0x00000002, STATUS_WAIT_3 = 0x00000003, STATUS_WAIT_63 = 0x0000003f, STATUS_ABANDONED = 0x0000008...
Rust
0
AssetInfo::Token { contract_addr } => { if deps.api.addr_validate(&msg_info.sender.to_string())? != contract_addr { return Err(UnbondHandlerError::UnsupportedToken {}); } } }; unbond_bluna(deps, cw20_msg.amount) ...
Rust
0
into()) } #[doc = "Forward to CCvySR0"] #[inline(always)] pub fn value1(self) -> &'a mut W { self.variant(E0SR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn value2(self) -> &'a mut W { self.variant(E0SR_A::VALUE2) } #[doc = "Forward to CC8ySR...
Rust
0
, clippy::unseparated_literal_suffix, // TODO: Falsely triggers for async/await: // see https://github.com/rust-lang/rust-clippy/issues/5360 // clippy::used_underscore_binding )] // It is often more clear to show that nothing is being moved. #![allow(clippy::match_ref_pats)] // Subjective style. #![allow( c...
Rust
0
#!/usr/bin/env python3 import sys import re import enum import json RE_LOG = re.compile("\s*[0-9]{4}-[0-9]{2}-[0-9]{2}.+(ERROR|INFO |TRACE|DEBUG|WARN ) ([a-z0-9_::-]+)\s+> (.+)") RE_FAILED_TO_PARSE = re.compile("\[(.+)\] Failed to parse \(non-critical\) z2m bridge message on \[(.+)\]:$") class Mode(enum.Enum): ...
Python
1
# # Copyright (C) 2023, Inria # GRAPHDECO research group, https://team.inria.fr/graphdeco # All rights reserved. # # This software is free for non-commercial, research and evaluation use # under the terms of the LICENSE.md file. # # For inquiries contact george.drettakis@inria.fr # from setuptools import setup from ...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" # https://pypi.python.org/pypi/selenium # pip install selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By # # geckodriver: https://github.com/Mozilla/geckodriver/r...
Python
1
""" Palindromes Next, you are committed to find any peculiarity in the words included in the movie review dataset. A palindrome is a sequence of characters which can be read the same backward as forward, for example: Madam or No lemon, no melon. You realize that there are some funny movie names that can have this chara...
Python
1
#!/usr/bin/env python3 """ RAG 모듈 환경변수 확인 스크립트 """ import os from dotenv import load_dotenv load_dotenv() def check_rag_environment(): """RAG 모듈에 필요한 환경변수들을 확인한다.""" print("🔍 RAG 모듈 환경변수 확인") print("=" * 50) # OpenAI 설정 openai_key = os.getenv("OPENAI_API_KEY") print(f"✅ OPENAI_API_...
Python
1
# --- 最小验证脚本 ,验证模型是否可用--- from ultralytics import YOLO # --- 请修改下面这三行 --- MODEL_PATH = r"runs/segment/train21/weights/best.pt" # 1. 换成您自己训练好的模型的【绝对路径】 IMAGE_PATH = r"C:\tuxiangxuexi\yachi\code\datasets\data\train\images\4f65079a-MOHAMADI_HAMID_2020-07-19190541_jpg.rf.160e7975f8e9f5e990ad1bdbaa922886.jpg" # 2...
Python
1
ha_poly = Polynomial::from_coefficients_vec(domain_h.ifft(&r_alpha_x_evals)); end_timer!(r_alpha_poly_time); let mut r_a_alpha_vals_on_H: BTreeMap<F, F> = BTreeMap::new(); let mut r_b_alpha_vals_on_H: BTreeMap<F, F> = BTreeMap::new(); let mut r_c_alpha_vals_on_H: BTreeMap<F, F> = BTreeM...
Rust
0
).unwrap(); let deserialized: ScalableCuckooFilter<usize> = serde_json::from_str(&serialized).unwrap(); for i in 0..100 { assert!(filter.contains(&i)); assert!(deserialized.contains(&i)); } } } use super::input_getter::{get_bool, get_string, get_uint}; use colour::{cy...
Rust
0
DataType = DataType::Object(Some(T::CLASS_NAME)); #[inline] fn set_zval(self, zv: &mut Zval, _: bool) -> Result<()> { zv.set_object(&mut self.std); Ok(()) } } //! Tests auto-converted from "sass-spec/spec/non_conformant/scss/function-names.hrx" #[test] fn test() { assert_eq!( ...
Rust
0
.help("Number of threads")) .get_matches(); let addr = matches.value_of("bind").unwrap().parse().unwrap(); let threads = matches.value_of("threads").unwrap_or("1").parse().unwrap(); mioco::start_threads(threads, move || { let listener = TcpListener...
Rust
0
stop_at_basement(&input, 2); assert_eq!(answer, 5); } } //! Path summaries that are either child local, or leave the scope and re-enter from the parent. // use std::cmp::Ordering; use std::default::Default; use std::fmt::{Display, Formatter}; use std::fmt::Error; use order::PartialOrder; use progress::{T...
Rust
0
import pandas as pd from typing import List, Dict class KLineProcessor: """K线数据处理类,用于识别K线图中的顶分型和底分型,并确定笔的端点 该类实现了金融技术分析中K线数据的预处理、包含关系处理、分型识别和笔的确定等功能, 是构建技术分析图表的基础工具。 """ def __init__(self, df: pd.DataFrame): """初始化KLineProcessor实例并进行数据验证 Args: df: 包含K线数据的DataFrame,必...
Python
1
VertexState::None | VertexState::Cache(_) => {}, VertexState::Some(ref vs) => { if vs.iter().any(|v| {*v >= text.len()}) && unknown_bytes < queue[last_queue][2] { // There's at least one edge point to last node with lesser unknown_bytes. // Redirect...
Rust
0
# -*- coding: utf_8 -*- """Logger Config.""" from pathlib import Path import njsscan.settings as config from njsscan.logger import init_logger import yaml logger = init_logger(__name__) def get_config(base_path, config_file): options = { 'nodejs_extensions': config.NODEJS_FILE_EXTENSIONS, 'tem...
Python
1
etTestServer::with_hardcoded_response( "127.0.0.1:0".parse().unwrap(), ok_response(jsonrpc::JsonValue::String("foo".into()), Id::Num(99_u64)), ) .await; let uri = to_ws_uri_string(server.local_addr()); let client = WsClientBuilder::default().build(&uri).await.unwrap(); assert!(client.is_connected()); client.r...
Rust
0
#Implementing an insertion sort def insertion_sort(arr): for i in range(1,len(arr)): ins = i curr = arr.pop(i) for j in range(i-1, -1, -1): if arr[j] > curr: ins = j arr.insert(ins, curr) return arr print(insertion_sort([9,4,7,3,5,3,9,0,0,3])) ...
Python
1
D')), ('name', models.CharField(help_text='Name of the study group', max_length=255, verbose_name='name')), ('description', models.TextField(help_text='Detailed description of the group', verbose_name='description')), ('avatar', models.ImageField(blank=True, help_text='Gr...
Python
1
from dataclasses import dataclass from typing import Optional @dataclass class TrainingProgress: """ Dataclass to store the training progress. Attributes: num_seen_steps_current_run (int): Number of seen steps in the current run. num_seen_tokens_current_run (int): Number of seen tokens i...
Python
1
step else: imu_feat = torch.empty(batch_size, 0).to(input_imu.device) # Image feat if self.use_rgbd: img_feat_list = [] _, T, _, _, _ = input_image.shape sliced_depth = input_depth[:, :, 0:1, :, :] input_rgbd = torch.cat((input_image, ...
Python
1
::fprintf( crate::stdlib::stderr, b" - 3 ImageMagick table by <NAME>\n\x00" as *const u8 as *const libc::c_char, ); crate::stdlib::fprintf( crate::stdlib::stderr, b" - 4 Custom, tuned for PSNR-HVS\n\x00" as *const u8 as *con...
Rust
0
e(address.as_bytes()); let location_text = hex::encode(location.as_bytes()); let value_text: String = self .db .query_row( "SELECT value FROM storage WHERE address == ?1 AND slot == ?2", params![address_text.as_str(), location_text.as_str()], ...
Rust
0
Output::new(input.len(), Lexeme::Keyword(Keyword::Match)); let result = parse(input); assert_eq!(result, expected); } #[test] fn ok_keyword_signed_integer_min() { let input = "i8"; let expected = Output::new(input.len(), Lexeme::Keyword(Keyword::new_integer_signed(8))); let result = parse(input); ...
Rust
0
= create_time program._update_time = update_time assert program.create_time() == create_time assert program.update_time() == update_time def test_description_and_labels(): program = NothingProgram([cirq.Circuit()], None) assert not program.description() program.set_description('nothing much')...
Python
1
st.download_button( label="CSV Dados", data=csv_simples, file_name=f"dados_{pd.Timestamp.now().strftime('%H%M')}.csv", mime="text/csv" ) else: st.info("Sem dados ...
Python
1
files { println!(" {}", ffn); } panic!(); } } <filename>src/dom.rs extern crate scraper; use scraper::Html; /// htmlからDOMにしたものを保持します #[derive(Debug, Clone, PartialEq, Eq)] pub struct Dom { pub body: Html, // TODO: scraper非依存にするなら自作の構造で置き換え } impl Dom { pub fn parse_all(html_text: &str) -> Self ...
Rust
0
ksum(qpot[i,d,h]+qgris[i,d,h] for d in W_w[w] for h in Hn) \ + gp.quicksum(Qpot[i,d,b]+Qgris[i,d,b] for d in W_w[w] for b in B) m.addConstr(lhs + sweek[i,w] >= Vmin[tau[i],...
Python
1
#[doc = "Checks if the value of the field is `RETXACKEN1_1`"] #[inline(always)] pub fn is_retxacken1_1(&self) -> bool { *self == RETXACKEN1_A::RETXACKEN1_1 } } #[doc = "Write proxy for field `RETXACKEN1`"] pub struct RETXACKEN1_W<'a> { w: &'a mut W, } impl<'a> RETXACKEN1_W<'a> { #[doc = ...
Rust
0
"""Read BrainVoyager GLM and export Nifti.""" import os import numpy as np import nibabel as nb import bvbabel from pprint import pprint STUDY_PATH = "/mnt/e/WB-MotionQuartet/derivatives/GroupStat" MODELS = ['GLM_model1', 'GLM_model2'] THRESHOLD = 4 for it, model_type in enumerate(MODELS): # Initiate new data ...
Python
1
import tkinter as tk from tkinter import ttk from tkinter import messagebox import mysql.connector import mysql.connector conexion = mysql.connector.connect( user='root', password='', host='localhost', database='gestion_de_transporte_y_reservas', port=3306 ) print(conexion)
Python
1
_equal(result, expected) result = ser.get("Z") assert result is None msg = "Series.__getitem__ treating keys as positions is deprecated" with tm.assert_produces_warning(FutureWarning, match=msg): assert ser.get(4) == ser.iloc[4] with tm.assert_produces_warning(FutureWarning, match=msg): ...
Python
1
Error, match=""): np.subtract.outer(ser, obj) def test_np_matmul(): # GH26650 df1 = pd.DataFrame(data=[[-1, 1, 10]]) df2 = pd.DataFrame(data=[-1, 1, 10]) expected = pd.DataFrame(data=[102]) result = np.matmul(df1, df2) tm.assert_frame_equal(expected, result) def test_array_ufuncs_fo...
Python
1
Yellow::DarkKhaki => write!(f, "#BDB76B"), Yellow::Khaki => write!(f, "#F0E68C"), Yellow::Olive => write!(f, "#808000"), Yellow::Yellow => write!(f, "#FFFF00"), Yellow::YellowGreen => write!(f, "#9ACD32"), } } } impl Yellow { /// Display the he...
Rust
0
2 || neighbor_count == 3 { LifeState::Alive } else { LifeState::Dead } } LifeState::Dead => { if neighbor_count == 3 { LifeState::Alive } else { LifeSt...
Rust
0