text
string
label_name
string
labels
int64
import random import pandas as pd import csv import SimpleITK as sitk import scipy.ndimage import torch import torch.utils.data as data_utils import numpy as np import os from PIL import Image, ImageDraw import cv2 #from xpinyin import Pinyin import copy import re import skimage from torchvision import transforms # 定义...
Python
1
of channels, which should be 1, 3, or 4. max_outputs: Optional `int`. At most this many images will be emitted. If more than this many images are provided, the first `max_outputs` many images will be used and the rest silently discarded. display_name: Optional name for this summary in T...
Python
1
.dist_traveled, None); } <filename>src/serde_impls.rs<gh_stars>10-100 //! Serialization and Deserialization for syntax trees. use crate::{ interning::{IntoResolver, Resolver}, GreenNodeBuilder, Language, NodeOrToken, ResolvedNode, SyntaxKind, SyntaxNode, WalkEvent, }; use serde::{ de::{Error, SeqAccess, Vi...
Rust
0
in a single proof validation tx /// /// # Arguments /// /// * `proof_mask_max` - The largest proof mask across all accounts intended for submission /// pub fn validation_account_limit(proof_mask_max: usize) -> u64 { let (ratio, bytes) = get_ratios(); // account_meta_count * (ratio + proof_mask_max) = bytes ...
Rust
0
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import Any, Dict, List import torchvision.transforms as pth_transforms from classy_vision.dataset.transforms import...
Python
1
number_expression<'ast, Z: ZVisitorMut<'ast>>( visitor: &mut Z, u64e: &mut ast::U64NumberExpression<'ast>, ) -> ZVisitorResult { visitor.visit_span(&mut u64e.span) } pub fn walk_underscore<'ast, Z: ZVisitorMut<'ast>>( visitor: &mut Z, u: &mut ast::Underscore<'ast>, ) -> ZVisitorResult { visitor...
Rust
0
Decimal, #[serde(default)] pub pending_aust: Uint128, #[serde(default)] pub pools: Vec<BalancePool>, } pub const SEC_IN_DAY: u64 = 24u64 * 60u64 * 60u64; impl BalancePool { pub fn add_share(&mut self, time: u64, share: Uint128, time_burned: u64) { let new_share = self.share + share; let re...
Rust
0
import os import openai import yaml import re import json import re from utils import generate_sequence_explanation_prompt from utils import generate_fine_motion_control_prompt from utils import generate_sequence_explanation_prompt_json from .llm_config import llm def analyze_fine_moton_control_txt(action): # Ste...
Python
1
ray([colors_dict[symbol] for symbol in atoms.get_chemical_symbols()]) atom_colors[:,:3] += (1 - atom_colors[:,:3])*0.5 atom_colors[1,:3] = aoi_color atoms_rep = atoms.repeat((4,4,1)) atom_colors_rep = np.vstack([atom_colors]*16) povray_figure(atoms_rep,'CN7','-75x,-15y,-3z',[-5,5,45,30],atom_colors_rep) # CN5 db =...
Python
1
!("PAGE {:2}: ", i); for j in 0..PAGE_SIZE { if i >= DATA_PAGES && (i - DATA_PAGES) * PAGE_SIZE + j < commands.len() { let word = format!("{: >4}", commands[(i - DATA_PAGES) * PAGE_SIZE + j]); for b in word.chars() { print!("{: ...
Rust
0
rmation about avaliable fields see [wr_data](wr_data) module"] pub type WR_DATA = crate::Reg<u32, _WR_DATA>; #[allow(missing_docs)] #[doc(hidden)] pub struct _WR_DATA; #[doc = "`write(|w| ..)` method takes [wr_data::W](wr_data::W) writer structure"] impl crate::Writable for WR_DATA {} #[doc = "CRC data register"] pub m...
Rust
0
)) def copy_to_clipboard(self, e: ft.ControlEvent): """It copies the tooltip object/instance to the clipboard.""" o = f", opacity={self.bar_opacity}" s = f", scale={self.bar_scale}" off = f", offset={self.bar_offset}" t = f", tooltip='{self.bar_tooltip}'" bg= f", bgc...
Python
1
lueError: index = self.ASCII.get('?', 0) # Use '?' or null for invalid data # Find character, default to '?' if not found or invalid index char = next((k for k, v in self.ASCII.items() if v == index), '?') # Handle specific non-printable chars if need...
Python
1
<SSKrSSKJr S\S\4SjrS\S\4Sjrg)NArgumentvreturnc[U[R5(a*SURSURSUR S3$[ U5$)< ...
Python
1
_Devices_Tapi'*"] pub const TOT_TAPI: TAPI_OBJECT_TYPE = 1i32; #[doc = "*Required features: 'Win32_Devices_Tapi'*"] pub const TOT_ADDRESS: TAPI_OBJECT_TYPE = 2i32; #[doc = "*Required features: 'Win32_Devices_Tapi'*"] pub const TOT_TERMINAL: TAPI_OBJECT_TYPE = 3i32; #[doc = "*Required features: 'Win32_Devices_Tapi'*"] p...
Rust
0
4(peer.ip()); let local_port = 40000 + (peer.port() % 24000); match UdpSocket::bind(SocketAddrV4::new(local_ip, local_port)).await { Ok(v) => Ok(v), Err(bad_port_error) => match UdpSocket::bind(SocketAddrV4::new(local_ip, 0)).await { Ok(v) => ...
Rust
0
(ty_sup.span, ty_sub.span, main_label_1, span_label_1) } (Some(ret_span), _) => ( ty_sub.span, ret_span, "this parameter and the return type are declared \ with different lifetimes...".to_owned() , ...
Rust
0
seq_vae = LightningPendulum.load_from_checkpoint(ckpt_path, ssm=ssm, cfg=cfg, n_time_bins_enc=n_time_bins_enc, strict=False) _, z_s, stats_s = seq_vae.ssm.to('cpu')(y_test[:, :n_time_bins_enc].to('cpu'), cfg.n_samples, get_P_s=True) z_p =...
Python
1
CARGO_PKG_VERSION")); pub fn spawn(txns: Vec<(Vec<u8>, Vec<u8>)>) -> Server { let listener = net::TcpListener::bind("127.0.0.1:0").unwrap(); let addr = listener.local_addr().unwrap(); thread::spawn( move || for (mut expected, reply) in txns { let (mut socket, _addr) = listener.accept()....
Rust
0
def test_stable_diffusion_inpaint_k_lms(self): vae = AsymmetricAutoencoderKL.from_pretrained( 'cross-attention/asymmetric-autoencoder-kl-x-1-5') pipe = StableDiffusionInpaintPipeline.from_pretrained( 'runwayml/stable-diffusion-inpainting', safety_checker=None) pipe.unet.set_default_attn_proc...
Python
1
scc.orders[u] = scc.order; scc.order += 1; scc.stack.push(u); scc.low_stack.push(u); for &v in &scc.graph[u] { if scc.orders[v] == scc.size() { Self::labeling(scc, v); } else if scc.labels[v] == scc.size() { while scc.orders[*scc.lo...
Rust
0
from nonebot import get_adapter from nonebot.adapters.onebot.v11 import Adapter, Bot, Message from nonebug import App from tests.fake import fake_group_message_event_v11 async def test_fitness(app: App): """测试记录健身""" from src.plugins.check_in.plugins.check_in_fitness import fitness_cmd async with app.te...
Python
1
um, 0.999)) }[optimizer_type] optimizer.add_param_group({"params": pg1, "weight_decay": weight_decay}) optimizer.add_param_group({"params": pg2}) # ---------------------------------------# # ACCR模块优化器, 用于对抗训练 # ---------------------------------------# optACCR = ...
Python
1
const crate::Reg<prince_region0_iv_header1::PRINCE_REGION0_IV_HEADER1_SPEC>) } } #[doc = "0x34 - ."] #[inline(always)] pub fn prince_region0_iv_code1( &self, ) -> &crate::Reg<prince_region0_iv_code1::PRINCE_REGION0_IV_CODE1_SPEC> { unsafe { &*(((self as *const Sel...
Rust
0
{ Some(Self { parts, pools: pools.into(), }) } else { None } } pub fn parts(&self) -> u8 { self.parts } pub fn pools(&self) -> &[(PoolId, u8)] { &self.pools } } #[derive(Clone, PartialEq, E...
Rust
0
import rust_fibonacci import matplotlib.pyplot as plt # Генерируем данные n = 20 fib_seq = rust_fibonacci.fibonacci_sequence(n) # Строим график plt.figure(figsize=(10, 5)) plt.plot(range(n), fib_seq, 'o-', label='Fibonacci') plt.title(f'Первые {n} чисел Фибоначчи (Rust + Python)') plt.xlabel('Номер') plt.ylabel('Знач...
Python
1
# This file is part of wger Workout Manager <https://github.com/wger-project>. # Copyright (C) wger Team # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of...
Python
1
pub fn call_any( &self, proc_key: cap9_std::SysCallProcedureKey, function_name: &str, params: &[ethabi::Token], ) -> web3::types::TransactionReceipt { println!("Using Call-Any"); let file: &[u8] = default_procedures::ACL_ADMIN.abi(); let admin_abi = ethabi::Co...
Rust
0
70d8f61d64e278802f/src/ReflectiveLoader.h#L147 // Which in turn was based on a more recent(?) version of // https://github.com/stephenfewer/ReflectiveDLLInjection/blob/178ba2a6a9feee0a9d9757dcaa65168ced588c12/dll/src/ReflectiveLoader.h#L127 as far as I can tell // See licenses/reflectivedllinjection.LICENSE for the lic...
Rust
0
ofiling from all sources - **🎯 Strategic Resume Architecture Specialist**: Advanced resume optimization with ATS compatibility - **🎤 Master Interview Strategist**: Evidence-based interview preparation and authentic positioning **Advanced Capabilities & Tools:** - **�...
Python
1
ox_feature(imgconv, nodenum, imgpos) # print("ximg") # print(ximg.size()) x1img=ximg[edge_index[0]] # print("x1img") # print(x1img.size()) x2img=ximg[edge_index[1]] ximgpair =torch.cat((x1img,x2img),dim=1) ximgpair = F.relu(self.lin_img(ximgpair)) # ...
Python
1
from common.event_bus import EventBus class EventHandlerRegistry: """Central registry for event handlers with lazy loading to avoid circular imports.""" @classmethod def register_handlers(cls) -> None: """Register all event handlers with the event bus.""" # Lazy import to avoid circular ...
Python
1
import duckdb import os from uk_address_matcher import ( clean_data_using_precomputed_rel_tok_freq, get_linker, ) from uk_address_matcher.post_linkage.analyse_results import ( best_matches_with_distinguishability, ) from uk_address_matcher.post_linkage.identify_distinguishing_tokens import ( improve_pre...
Python
1
import time, pytest, inspect from utils import * from PIL import Image def test_text_overlay_element_connects_successfully(run_brave): ''' Confirms that the 'text' overlay creates a 'textoverlay' element and that it connects successfully. ''' run_brave() elements_before_adding_overlay = get_mixer_...
Python
1
HeaderName, HeaderValue}, uri::Scheme, StatusCode, Uri, }; use hyper::{ body, client::{self, connect::Connect, Builder, HttpConnector}, }; use ipfs_api_prelude::{ApiRequest, Backend, TryFromUri}; use multipart::client::multipart; use serde::Serialize; pub struct HyperBackend<C = HttpConnector> where ...
Rust
0
2),\n" " call.foo(a=3),\n" " call.foo.bar(),\n" " call.foo.bar().baz('fish', cat='dog')]" ) self.assertEqual(str(mock.mock_calls), expected) def test_propertymock(self): p = patch('%s.SomeClass.one' % __name__, new_callable=PropertyMock) mock = ...
Python
1
commit/ab1735950b2108eaa8d51eb63efadcd2e25c35c4 use core::ptr; use crate::rcc::{rec, CoreClocks, ResetEnable}; use crate::stm32; use smoltcp::{ self, phy::{self, DeviceCapabilities}, time::Instant, wire::EthernetAddress, }; use crate::ethernet::StationManagement; // 6 DMAC, 6 SMAC, 4 q tag, 2 ether...
Rust
0
ed_flag=SystemPermissions.PERMIT_ADMIN_USERS) api_add_url_rules( [url_version_prefix + '/admin/groups/', '/admin/groups/'], view_func=_dapi_group_views, methods=['GET', 'POST'] ) api_add_url_rules( [url_version_prefix + '/admin/groups/<int:group_id>/', '/admin/groups/<int:group_id>/'], vie...
Python
1
# === preprocessing.py === # Label Encoding, Scaling, SMOTE + επιστροφή encoders για deploy/inference import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, LabelEncoder from imblearn.over_sampling import SMOTE from collections import Counter def pre...
Python
1
from typing import List from csc27_ML_distributed.server.models.base import BaseModel from csc27_ML_distributed.server.models.ml_models import ( DecisionTreeRegressorModel, LinearRegressorModel, ) from csc27_ML_distributed.server.models.preprocessor import ( HousePricingPreprocessor, MetroPreprocessor,...
Python
1
3)) => { let mut real_indices = vec![ indices[index_1] + 1, indices[index_2] + 1, indices[index_3] + 1, ]; real_indices.sort(); println!("{}", utility::io::format_array(&real_indices)); ...
Rust
0
Aa = Aa.view(B, D, T//2, 2, -1) Xa = Xa.view(B, D, T//2, 2, -1) Xa[:, :, :-1, 1].add_(Aa[:, :, :-1, 1].mul(Xa[:, :, 1:, 0])) Aa[:, :, :-1, 1].mul_(Aa[:, :, 1:, 0]) @staticmethod def forward(ctx, A_in, X_in): """ Applies the parallel scan operation, as...
Python
1
""" =================================================================== Elementwise Scalar Optimization (:mod:`scipy.optimize.elementwise`) =================================================================== .. currentmodule:: scipy.optimize.elementwise This module provides a collection of functions for root finding ...
Python
1
lename.clone().as_str()) { if is_template_file(template_object.filename.clone()) { let caps = svg_regex .captures(template_object.filename.as_str()) .unwrap(); let filename_base = caps.get(1).unwrap().as_str().to_string(); if is_template_file(f...
Rust
0
"""The :py:mod:`gaitmap.stride_segmentation` contains popular algorithms to detect strides in a sensor signal. The stride segmentation module includes all algorithms that are able to find stride candidates in a continuous sensor signal. Some are able to directly detect individual biomechanical events. Other algorithm ...
Python
1
/ np.abs(d) U = np.multiply(q, ph, q) return U def random_block_interferometer(N, top_one=True, real=False): r"""Generates a random interferometer with blocks of at most size 2. Args: N (int): number of modes top_one (bool): if True places a `1\times1` interferometer in the top-left ...
Python
1
dicators or not selected_indicators: df_copy['rsi'] = ta.momentum.RSIIndicator(df_copy['close']).rsi() # 2. MACD - واگرایی و همگرایی میانگین متحرک if 'MACD' in selected_indicators or not selected_indicators: macd = ta.trend.MACD(df_copy['close']) df_copy['macd'] = macd.macd() ...
Python
1
fn empty_url_arg() { Command::cargo_bin(BINARY_NAME) .unwrap() .args(&[""]) .assert() .failure(); } #[test] fn valid_url_arg() { Command::cargo_bin(BINARY_NAME) .unwrap() .args(&["https://google.com/"]) ...
Rust
0
sugar-like pattern ' 'detected'}, { 'smiles': '[C@](NC(=O)[C@@H]1C[C@H](CN1C)CCC)([C@H](C)Cl)([C@]2(O[C@H](SC)[C@@H]([C@H]([C@H]2O)O)OC(CCCCCCCCCCCCCCC)=O)[H])[H]', 'name': 'clindamycin palmitate', ...
Python
1
mod _impl_variable; /// **(internal)** Utility methods for `VariableId`. mod _impl_variable_id; /// **(internal)** A regex string of an identifier which we currently allow to appear /// as a variable or parameter name. const ID_REGEX_STR: &str = r"[a-zA-Z0-9_]+"; lazy_static! { /// A regular expression that match...
Rust
0
, pub(crate) line: usize, } impl<F: SpanFile> std::fmt::Debug for Span<F> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, "{}:{}:{}..{}", self.file.name(), self.line, self.start, self.end )...
Rust
0
3 * (j+(h-i-1)*w) + offset + 2], alpha: 255}; layer.print_point_color_at(2 * j, 2 * i, col); layer.print_point_color_at(2 * j + 1, 2 * i, col); layer.print_point_color_at(2 * j, 2 * i + 1, col); layer.print_point_color_at(2 * j + 1, 2 * i + 1, col); //lay...
Rust
0
use tonic::{self as grpc, Code}; use tracing::{debug, warn}; pub fn layer() -> respond::RespondLayer<NewRespond> { respond::RespondLayer::new(NewRespond(())) } #[derive(Clone, Default)] pub struct Metrics(metrics::Registry<Label>); pub type MetricsLayer = metrics::RecordErrorLayer<LabelError, Label>; /// Error ...
Rust
0
{} for n, d in G.nodes(data=True): if d.get('故障状态', False): continue # 故障节点不计功率 if d.get('type') == '用户': P[n] = d.get('用电功率(kW)', 0.0) elif d.get('type') == '分布式能源' and d.get('开关状态') == '开': P[n] = -d.get('容量(kW)', 0.0) return P SQRT3...
Python
1
'开启' if enabled else '关闭'}") elif key == 'f10': # F10: 切换LOD系统 enabled = performance_optimizer.toggle_lod() print(f"LOD系统: {'开启' if enabled else '关闭'}") elif key == 'f7': # F7: 切换自适应优化 performance_optimizer.adaptive_mode = not performance_optimizer.adaptive_mode print(f"自适应优化: ...
Python
1
inline] pub fn _from(value: u8) -> P1_8R { match value { 0 => P1_8R::GPIO_P1, 1 => P1_8R::ENET_CRS, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `GPIO_P1`"] #[inline] pub fn is_gpio_p1(&self) -> bool { *self == P1_8...
Rust
0
ct(type='str', required=True), hostname=dict(type='str'), host_key_algorithms=dict(type='str', no_log=False), identity_file=dict(type='path'), identities_only=dict(type='bool'), other_options=dict(type='dict'), port=dict(type='str'), pr...
Python
1
diag_automation.button_indicator_mic_diagnostic_automation(lb_port, "mic", fault_type, tdk_stat, count, gui_queue, result_queue) time.sleep(2) def run_script(tdk_port, lb_port, script_list, gui_queue, result_queue, oecon_list): ...
Python
1
IND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use spin::Mutex; use core::ops::Deref; use super::super::qlib::mem::areaset::*; use super::super::qlib::common::*; use super::super::qlib::linux_def::*; use super::super::qlib::rang...
Rust
0
s = train_models_breakdown(X, y) print("\n=== Model Metrics ===") print(metrics) # Save ML outputs df_to_files(metrics, "pm_model_metrics") df_to_postgres(metrics, "pm_model_metrics", if_exists="replace") df_to_files(fi, "pm_feature_importance_rf") df_to_files(coefs, "pm_logreg_coefficient...
Python
1
ষ]্?(হ|ঃ|(হ্‌?))))্?[নণঁঙঞং])|([সশষ]্?((হ|ঃ|(হ্‌?))্?[নণঁঙঞং]))|([সশষ]্?(হ|ঃ|(হ্‌?))্?[নণঁঙঞং]))", rules: &[] }, Pattern { find: "ssh", replace: "(([সশষ]?্?(স|শ|ষ|([সশষ]্?(হ|ঃ|(হ্‌?)))))|([সশষ]্?[সশষ]্?(হ|ঃ|(হ্‌?))))", rules: &[] }, Pattern { find: "t``", replace: "ৎ", rules: &[] }, Pattern { find: "tth", r...
Rust
0
import os # 定义输入文件的路径 input_file = '/root/autodl-tmp/PIDNet_sota_origin/data/list/cocostuff/val.txt' # 定义新文件路径保存的文件名 output_file = '/root/autodl-tmp/PIDNet_sota_origin/data/list/cocostuff/new_val.txt' # 存储新的文件路径 new_lines = [] # 读取txt文件中的每一行 with open(input_file, 'r') as file: lines = file.readlines() # 遍历每一行,...
Python
1
#%% import pandas as pd import plotly.express as px import matplotlib.pyplot as plt import seaborn as sns #%% Load the data drugs_data = pd.read_csv(r'D:\Datavs\drug200 - drug200.csv.csv') #%% Basic data summaries # Get the head, tail, and describe summaries head_data = drugs_data.head() tail_data = drugs_data.tail...
Python
1
DAY_RECORD_INSERT_SQL = """ INSERT INTO day_record ( date, daily_memo ) VALUES ( %s, %s ); """ DAY_RECORD_INSERT_SUMMARY_SQL = """ INSERT INTO day_record_summary ( day_record_id, bleast_feed_time_left, bleast_feed_time_right, formula_count, formula_total_amount, sleep_duration_s...
Python
1
import streamlit as st from arcgis.gis import GIS from skopt import gp_minimize # ArcGIS OAuth 2.0 Credentials client_id = "nyy7ScY1ieQBifwB" client_secret = "41b69f18826f49ba8ca95070f9d877bc" # Authenticate with ArcGIS try: gis = GIS("https://www.arcgis.com", client_id=client_id, client_secret=client_secret) ...
Python
1
if errs.is_empty(){ Ok(()) }else{ Err(errs) } } } ) } declare_tl_discriminants!{ ( U8(u8) , Signed , /// Constructs the variant from an `RSlice<'static,u8>`. from_u8_s...
Rust
0
1301, Vpmovzxwq = 1302, Vpmuldq = 1303, Vpmulhrsw = 1304, Vpmulhuw = 1305, Vpmulhw = 1306, Vpmulld = 1307, Vpmullq = 1308, Vpmullw = 1309, Vpmultishiftqb = 1310, Vpmuludq = 1311, Vpopcntb = 1312, Vpopcntd = 1313, Vpopcntq = 1314, Vpopcntw = 1315, Vpor = 1316, Vpord = 1317, Vporq = 1318, Vpperm = 1319...
Rust
0
nto two arguments, /// but this is cleaner, I think? #[cfg_attr(nightly, unwind(allowed))] #[allow(improper_ctypes)] fn throw_any(data: *mut dyn Any) -> !; #[allow(improper_ctypes)] fn invoke_trampoline( trampoline: unsafe extern "C" fn(*mut vm::Ctx, NonNull<vm::Func>, *const u64, *mut ...
Rust
0
}") print(f"Second attention_mask: {attention_mask[1]}") print(f"Second labels: {results['labels'][1]}") # non_minus_100 = [r for r in results["labels"][0] if r != IGNORE_INDEX] # non_minus_100_text = self.tokenizer.decode(non_minus_100) # print(f"Exam...
Python
1
import pytest from yhaplo.utils.vcf import check_vcf_index def test_check_vcf_index_vcf(tmpdir): vcf_fn = "foo.vcf.gz" vcf_path = tmpdir.join(vcf_fn) vcf_path.write("") with pytest.raises(FileNotFoundError, match="VCF index"): check_vcf_index(str(vcf_path)) tmpdir.join(f"{vcf_fn}.tbi").w...
Python
1
part' PlayTune(aFirstPart) #sleep(2) #print 'Playing second part' #PlayTune(aSecondPart) nW = 1400 nH = 800 canvas = Canvas( width = nW, height = nH, bg = 'white') canvas.pack(expand = YES, fill = BOTH) aBoxes = [] nW = nW * 0.75 nLines = (len(aFirstPart) + 0.0) / nBarsPerLine if int(nLines) <> nLines: nLines =...
Python
1
e_spec, name=None): """Convert a TypeSpec to a representative KerasTensor.""" # Create a specialized KerasTensor that supports instance methods, # operators, and additional value inference if possible keras_tensor_cls = None value_type = type_spec.value_type for tensor_type, cls in keras_tensor_...
Python
1
t: """gets a int integer from user input""" # input loop user_input = None while user_input is None or user_input < min_value or user_input > max_value: raw_input = input(f"{prompt} ({min_value}-{max_value})? ") try: user_input = int(raw_input) if user_input < mi...
Python
1
x81, 0x82, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x58, 0x80, 0x81, 0x82, 0x01, 0x81, 0x78, 0x23, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x49, 0x20, 0x6...
Rust
0
e, 3, stderr, stdout) self.assertIn( '-- Test exited prematurely (TEST_PREMATURE_EXIT_FILE exists) --', stdout, ) def testMakeVariableForDumpbinExecutable(self): if not self.IsWindows(): return self.AddBazelDep('rules_cc') self.ScratchFile( 'BUILD', [ ...
Python
1
, }, wgpu::VertexAttributeDescriptor { format: wgpu::VertexFormat::Float2, offset: 4 * 4, shader_location: 2, }, wgpu::VertexAttributeDescriptor { format: wgpu::VertexFormat::F...
Rust
0
num = int(input()) target = "codeforces" for _ in range(num): strs = input().strip() count = 0 for i in range(len(target)): if strs[i] != target[i]: count += 1 print(count)
Python
1
{ type Target = vk::SemaphoreTypeCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } impl SemaphoreCreateInfoNext for SemaphoreTypeCreateInfoBuilder {} impl PhysicalDeviceExternalSemaphoreInfoNext for SemaphoreTypeCreateInfoBuilder {} impl SemaphoreCreateInfoNext for vk::SemaphoreTypeCrea...
Rust
0
/ base.config.window_length; FragmentsAggregator { base, counters: vec![0; num_bins], mapq_sums: vec![0; num_bins], } } fn put_bam_record(&mut self, record: &bam::Record) { if !self.skip_mapq(record) && !self.skip_flags(record) ...
Rust
0
from pydantic import BaseModel, ConfigDict from typing import Optional, Any, Dict from datetime import datetime class UserBase(BaseModel): telegram_id: int username: Optional[str] = None diet_preferences: Optional[Dict[str, Any]] = None target_metrics: Optional[Dict[str, Any]] = None class UserCreat...
Python
1
import argparse import sys import yt # load the command-line parameters parser = argparse.ArgumentParser( description='Plot the gas slices and projections' ) parser.add_argument( '-p', action='store', required=False, type=str, dest='prefix', help='path prefix [%(default)s]', default='../' ) parse...
Python
1
// We own `Node<T>` so we can pass its ownership to `append_chain` // And we don't drop it unsafe { self.append_chain(ptr, ptr, 1) }; } #[inline] /// Extracts chain and drops itself without dropping it pub fn into_inner(self) -> (usize, *mut Node<T>, *mut Node<T>) { trace!("into...
Rust
0
import os import shutil from pathlib import Path from typing import List, Optional import hashlib class FileHandler: """Handle file operations for the research system.""" def __init__(self, base_dir: str = "data"): self.base_dir = Path(base_dir) self.base_dir.mkdir(exist_ok=True) ...
Python
1
dict1 = { "name" : "krish", "class" : "first", "location" : "bahadurgarh", "school" : "DPS" } x = input("enter key") y = input("enter key value") z = {x : y} dict1.append(z) print(dict1)
Python
1
.cos() * r, theta.sin() * r)); } let mesh = mesh_from_polyline(&path); let shape = { let points = path.iter().map(|v| Point::new(v.x, v.y)).collect(); SharedShape::convex_polyline(points).unwrap() }; let orbit = Orbit::default(); let position = o...
Rust
0
# THIS IS A HELPER SCRIPT ONLY RUN ONCE import modal MODELS_DIR = "/llamas" DEFAULT_NAME = "meta-llama/Meta-Llama-3.1-8B-Instruct" DEFAULT_REVISION = "8c22764a7e3675c50d4c7c9a4edb474456022b16" volume = modal.Volume.from_name("llamas", create_if_missing=True) image = ( modal.Image.debian_slim(python_version="3....
Python
1
32_Globalization\"`*"] pub const U_JG_AIN: UJoiningGroup = 1i32; #[doc = "*Required features: `\"Win32_Globalization\"`*"] pub const U_JG_ALAPH: UJoiningGroup = 2i32; #[doc = "*Required features: `\"Win32_Globalization\"`*"] pub const U_JG_ALEF: UJoiningGroup = 3i32; #[doc = "*Required features: `\"Win32_Globalization\...
Rust
0
import sympy as sp import numpy as np import matplotlib.pyplot as plt from scipy.signal import dlti, dimpulse # Define symbolic variables z, T = sp.symbols('z T') # Define the transfer function components numerator1 = 6 * (1 - sp.exp(-2 * T)) denominator1 = z - sp.exp(-2 * T) G1 = numerator1 / denominator1 numerator...
Python
1
class TestTransformModeHandlerFactory: """Test transform mode handler factory - simple instantiation tests.""" def test_create_case_insensitive(self): """Test that mode is case insensitive.""" mock_engine = MagicMock() handler = TransformModeHandlerFactory.create("replace", mock_engi...
Python
1
Material_{i}") # Labor cost constraints for j in range(n_facilities): model.addCons(labor_cost_vars[j] <= labor_cost[j], f"LaborCost_{j}") # Environmental impact constraints for j in range(n_facilities): model.addCons(environmental_impact_vars[j] <= environmenta...
Python
1
.prepare_data(X, y, sequence_length=48) # 论文中的滑动窗口长度 # 4. 训练模型 trainer.train( epochs=100, batch_size=32, # 论文参数 patience=10, # 论文参数 verbose=True ) # 5. 评估模型 results = trainer.evaluate(plot_results=True) # 6. 保存模型 trainer.save_model('lstm_m...
Python
1
# 提取命令(以 • 开头的行) if line.startswith('•') and current_section == 'commands': # 分离命令名和描述 if ' - ' in line: cmd_part, desc_part = line[1:].strip().split(' - ', 1) commands.append({...
Python
1
# Square Patteren rows=int(input("Enter Rows:")) cols=int(input("Enter Columns:")) num=1 for i in range(rows): for j in range(cols): print(" ",num*num," ",end=" ") num=num+1 print() """ Output:- 1 4 9 16 25 36 49 64 81 """
Python
1
rns. Inputs: pclouds: (numpy array) #point-clouds x points per point-cloud x 3 grid_resolution (int) size of occupancy grid that will be used. """ epsilon = 10e-4 bound = 0.5 + epsilon if abs(np.max(pclouds)) > bound or abs(np.min(pclouds)) > bound: if verbose: wa...
Python
1
{GetDispatchInfo, Pays}, }; use mock::*; use pallet_session::ShouldEndSession; use sp_consensus_babe::AllowedSlots; use sp_core::crypto::Pair; const EMPTY_RANDOMNESS: [u8; 32] = [ 74, 25, 49, 128, 53, 97, 244, 49, 222, 202, 176, 2, 231, 66, 95, 10, 133, 49, 213, 228, 86, 161, 164, 127, 217, 153, 138, 37, 48, 192, ...
Rust
0
"access": { "vlan": "6", }, "trunk": { "allowed_vlans": "10-12", }, }, ], state="overridden", ), ) ex...
Python
1
# -*- coding: utf-8 -*- import json import requests from requests.adapters import HTTPAdapter import ssl import sys import importlib from datetime import date, datetime, timedelta ssl._create_default_https_context = ssl._create_unverified_context importlib.reload(sys) s = requests.Session() requests.adapters.DEFAULT_...
Python
1
e need to save') if model.get_current_metrics()['psnr_l0'] > best_psnr_l0: logger.info('Saving best model for psnr_l0.') model.save(epoch, current_iter, 'best_psnr_l0') best_psnr_l0 = model.get_current_metrics()['psnr_l0'] ...
Python
1
from .base_model import BaseModel class CategoriaModel(BaseModel): def consultrar(self, id_usuario): query = """ SELECT categoria.idcategoria, categoria.descricao, categoria.descricao_extra FROM...
Python
1
p.array([float(ll) for ll in label_source]) keypoints = np.vstack((np.array([0,0,0]), label.reshape(15, 3))) # mlab.clf mlab.figure(bgcolor=(1,1,1),size=(1280,960)) show_hand(keypoints, 'shadow_real') mlab.show() DataFile.close() if __name__ == '__main__': batch_size =...
Python
1