text
string
label_name
string
labels
int64
ger.info( "step %d, batch: %d, %s: %f, speed: %.2f step/s" % (step, step, score_name, total_score, args.logging_steps / (time.time() - tic_eval)) ) tic_eval = time.time() if not args.cloze_eval: total_loss = float(total_score) ...
Python
1
ne(always)] pub fn rbb_bw_ctrl_hw(&mut self) -> RBB_BW_CTRL_HW_W { RBB_BW_CTRL_HW_W { w: self } } #[doc = "Bit 12"] #[inline(always)] pub fn kcal_ratio_ctrl_hw(&mut self) -> KCAL_RATIO_CTRL_HW_W { KCAL_RATIO_CTRL_HW_W { w: self } } #[doc = "Bit 9"] #[inline(always)] p...
Rust
0
import sys import os.path, re, StringIO blacklist = [ 'Windows.h', 'mach/clock.h', 'mach/mach.h', 'malloc.h', 'glog/logging.h', 'io/azure_filesys.h', 'io/hdfs_filesys.h', 'io/s3_filesys.h', 'sys/stat.h', 'sys/types.h', 'omp.h', 'execinfo.h', 'packet/sse-inl.h' ] def get_sources(def_file):...
Python
1
from flask import Flask, request, jsonify, send_file import os import cv2 import matplotlib.pyplot as plt from Stage1_ToothSegm import Stage1 from Stage2_Mask2Mask import Stage2_Mask2Mask from Stage3_Mask2Teeth import Stage3_Mask2Teeth from Restore.Restore import Restore import yaml from werkzeug.utils import secure_fi...
Python
1
) use syscalls::syscall::syscall4; use alloc::{ Vec, String }; let mut arguments: Vec<String> = Vec::new(); let mut ptr_list: Vec<*const u8> = Vec::with_capacity(args.len()); for arg in args { use alloc::string::ToString; let mut string_arg = arg.to_string(); string_arg.push(...
Rust
0
erify your email', 'Welcome to web2py!': 'Bun venit la web2py!', 'Which called the function %s located in the file %s': 'Care a apelat funcția %s prezentă în fișierul %s', 'Wiki Example': 'Wiki Example', 'Working...': 'Working...', 'You are successfully running web2py': 'Rulați cu succes web2py', 'You can modify this a...
Python
1
with open('txt/17_6089.txt') as file: data = [int(i) for i in file] maximum = max([i for i in data if str(i)[-1] == '2']) ans = [] for num in data: if num % 3 == 0 and num % 7 != 0 and num % 17 != 0: if maximum % num == 0: ans.append(num) print(len(ans), max(ans))
Python
1
# t = 1 2 3 4 5 6 7 10 def gameOfStones(n): if n % 7 < 2: return "Second" else: return "First" if __name__ == '__main__': t = int(input().strip()) for t_itr in range(t): n = int(input().strip()) result = gameOfStones(n) print(result)
Python
1
def half_diamond_inverted(n): for i in range(n, 0, -1): print(" " * (n - i) + "*" * (2 * i - 1)) n = 5 half_diamond_inverted(n)
Python
1
timeout = remain; } ret }) as usize; Ok(num_events) } fn update_host_file_events(&self, num_events: usize) { if num_events == 0 { return; } // According to the output pollfds, update the states of the corresponding host files ...
Rust
0
has_left_hi(&self) -> bool { true } #[inline] fn has_right_lo(&self) -> bool { match *self { NibSliceAligned::Even(_) => true, NibSliceAligned::Odd(_) => false, } } #[inline] fn iter(&self) -> slice::Iter<u4x2> { match *self { NibSliceAlig...
Rust
0
manager (e.g., systemd, supervisor) to restart the service # For demonstration, we'll just log the steps logger.info("Setting system to maintenance mode...") time.sleep(1) # Simulate work logger.info("Waiting for existing operations to complete...") time.sleep...
Python
1
"Max stuck time without new solution before restarting", "1000"); opts.optopt("r", "restarts", "How many restarts will be done.", "1000"); opts.optopt("i", "init_t", "Initial temp for SA.", "1000"); opts.optopt("c", "cooldown", "Cooling factor for SA.", "0.99"); let matches = match opts....
Rust
0
ond order method trialPriors = [0]*len(priors) for i in range(0, len(priors)): trialPriors[i] = priors[i] + trialStep[i] loss = testTrialPriors(trialPriors, ss) if loss < currentLoss: currentLoss = loss priors = trialPriors continue trialStep = predictStepLogSpace(gradien...
Python
1
t = content.replace("</mark>", "") content = content.strip() # 统一发布时间格式 pubdate = item.get("pubDate", "") if pubdate: pubdate = iso_to_cst(pubdate) # 链接去重 ...
Python
1
= int( os.environ.get("NO_OF_BUTTONS_DISPLAYED_IN_H_ME_CMD", 5)) # specify command handler that should be used for the plugins # this should be a valid "regex" pattern CMD_HNDLR = os.environ.get("CMD_HNDLR", r"\.") SUDO_HNDLR = os.environ.get("SUDO_HNDLR", r"\!") # s...
Python
1
from multiprocessing import cpu_count from os import environ def max_workers(): return cpu_count() bind = '0.0.0.0:' + environ.get('PORT', '8000') max_requests = 1000 worker_class = 'gevent' workers = max_workers() env = { 'DJANGO_SETTINGS_MODULE': 'web_client.settings' } reload = True name = 'Smart snip'...
Python
1
import json import requests import base64 import hashlib from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad def encrypt_time(plain_text: str) -> str: def aes_encrypt(plain_bytes: bytes, aes_key: bytes) -> bytes: return AES.new(aes_key, AES.MODE_ECB).encrypt(pad(plain_bytes, AES.block...
Python
1
"""Card 2 module.""" import asyncio from datetime import datetime import reflex as rx from app.lib.periods import fix_datetime class Card2State(rx.State): # pylint: disable=inherit-non-class """ The card2 state. This could be a chart state. """ base_date: rx.Field[datetime] = rx.field(default...
Python
1
# mode 1 = 15% desconto # mode 2 = 5% desconto # mode 3 = R$ 15,00 desconto print('----- Analise de clientes -----') cliente = input('Digite o seu nome: ') mode = int(print('Digite seu modelo: ')) # preco = float(input('Preço do produto')) if mode == 1: print(f'O cliente {cliente} com 15% de desconto.') elif mode ==...
Python
1
failure === pub fn failure(status: StatusCode) -> impl Handler { let reason = status.canonical_reason().unwrap_or("<unknown status code>"); raw(move |_req| { Response::builder() .status(status) .body(Body::from(reason)) .expect("invalid builder") }) } // === pr...
Rust
0
pub number_of_read_regions: u32, pub transport_request_id: u64, pub cosmos_llsn: u64, pub cosmos_quorum_acked_llsn: Option<u64>, pub session_token: SessionToken, pub charge: f64, pub service_version: String, pub activity_id: uuid::Uuid, pub gateway_version: String, pub date: Date...
Rust
0
print("Welcome to AI Programming")
Python
1
' + q['turns'][0] if args.answer_file: answer_file = args.answer_file else: answer_file = f"data/{args.bench_name}/model_answer/{args.model.split('/')[-1]}.jsonl" print(f"Output to {answer_file}") with concurrent.futures.ThreadPoolExecutor(max_workers=args.parallel) as executor: ...
Python
1
t0.any(): pos_scoremap = gt0 * local_scoremap xAcc = np.sum(pos_scoremap * Xmap) yAcc = np.sum(np.transpose(pos_scoremap) * Ymap) scoreAcc = np.sum(pos_scoremap) new_coord2d.append([xAcc / scoreAcc, yAcc / scoreAcc]) else: ...
Python
1
class Node(object): def __init__ (self, d, n = None, p = None): self.data = d self.next_node = n self.prev_node = p def get_next (self): return self.next_node def set_next (self, n): self.next_node = n def get_prev (self): return self.prev_node def set_prev (self, p): self.prev_node = p de...
Python
1
n<Credentials>) -> Self { let inner = hyper::Client::builder().build(connector); Self { inner, credentials } } #[cfg_attr(feature = "trace", tracing::instrument)] pub fn set_credentials(&mut self, credentials: Option<Credentials>) { self.credentials = credentials; } } <reponame...
Rust
0
MOD_Player(arg1: *mut MOD) -> u32; } extern "C" { pub fn MOD_TriggerNote(arg1: *mut MOD, arg2: s32, arg3: u8, arg4: u16, arg5: u8) -> s32; } extern "C" { pub fn MOD_AllocSFXChannels(arg1: *mut MOD, arg2: s32) -> s32; } extern "C" { pub fn getNote(arg1: *mut MOD, arg2: s32, arg3: s32) -> u16; } extern "C" {...
Rust
0
pping profiler"); PROFILER.lock().unwrap().stop().unwrap(); } #[cfg(feature = "profiler")] fn profiler_start(name: &str) { use std::path::Path; // find first available path to save profiler output let mut n = 0; loop { let path = format!("./{}-{}.profile", name, n); if !Path::new(p...
Rust
0
(vec![1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3], 2), vec![1,2]); } }struct Solution; impl Solution { pub fn xor_operation(n: i32, start: i32) -> i32 { (0..n) .into_iter() .map(|e| start + 2 * e) .fold(0, |acc, x| acc ^ x) } } fn main() {} #[cfg(test)] mod tes...
Rust
0
TTR_VALUE!(SCARD_CLASS_IFD_PROTOCOL, 0x0208); pub const SCARD_ATTR_CURRENT_BWT: DWORD = SCARD_ATTR_VALUE!(SCARD_CLASS_IFD_PROTOCOL, 0x0209); pub const SCARD_ATTR_CURRENT_CWT: DWORD = SCARD_ATTR_VALUE!(SCARD_CLASS_IFD_PROTOCOL, 0x020a); pub const SCARD_ATTR_CURRENT_EBC_ENCODING: DWORD = SCARD_ATTR_VALUE!(SCARD_CLASS_IFD...
Rust
0
iner = op.outputs.fields_container() """ def __init__(self, op: Operator): super().__init__(plastic_strain_XZ._spec().outputs, op) self._fields_container = Output(plastic_strain_XZ._spec().output_pin(0), 0, op) self._outputs.append(self._fields_container) @property def fields_c...
Python
1
F_GPIO1_SRC_DIO_14) } #[doc = "Select DIO\\[15\\] as source"] #[inline(always)] pub fn rf_gpio1_src_dio_15(self) -> &'a mut W { self.variant(GPIO1_A::RF_GPIO1_SRC_DIO_15) } #[doc = "Select constant low as source"] #[inline(always)] pub fn rf_gpio1_src_const_low(self) -> &'a mut W...
Rust
0
options, pos + n as u64, bytes, callback); }, Err(ref e) if e.kind() == ErrorKind::Interrupted => { //重复写 self.write(options, pos, bytes, callback); }, ...
Rust
0
eld. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { Month, } impl PaymentMethodDetailsCardInstallmentsPlanInterval { pub fn as_str(self) -> &'static str { match self { Payme...
Rust
0
, attr: enem_attr!(MEAN, REGENERATE), exp: 350, level: 8, defence: 1, attack: vec![Dice::new(1, 19)], }, EnemyStatus { // Wraith treasure: 0, attr: enem_attr!(), exp: 55, level: 5, def...
Rust
0
# Copyright (C) 2020 Alfiananda P.A # # Licensed under the General Public License, Version 3.0; # you may not use this file except in compliance with the License. # import asyncio import os from asyncio.exceptions import TimeoutError from telethon.errors.rpcerrorlist import YouBlockedUserError from userbot import CM...
Python
1
d_cache() all_channels = OrderedDict() async with aiohttp.ClientSession() as session: tasks = [fetch_channels(session, url, cache) for url in source_urls] fetched_channels_list = await asyncio.gather(*tasks) for fetched_channels in fetched_channels_list: merge_channels(all_channels...
Python
1
nt.recv_message(); let m = message?; trace!("Recv: {:?}", m); use websocket::message::OwnedMessage::*; match m { Text(s) => command_handler.on_text(s)?, Binary(_) => debug!("get binary"), Close(_)...
Rust
0
# LeetCode Problem: 2109-Adding-Spaces-to-a-String # Problem Link: https://leetcode.com/problems/adding-spaces-to-a-string/description/?envType=daily-question&envId=2024-12-03 class Solution: def addSpaces(self, s: str, spaces: List[int]) -> str: temp="" spaces=set(spaces) for i in range(len...
Python
1
ppend(optim_rew) print('*') return fd_list, pd_list ,opt_list def plot_reg(Data_save,color_line,plt,T_range,plt_label): import numpy as np T_range = T_range/100 T_range = np.array(range(int(T_range))) dd = Data_save if (plt == 0): ...
Python
1
s: float: 灰色关联度 """ # 转换为numpy数组 x = np.array(x, dtype=float) y = np.array(y, dtype=float) # 数据标准化处理 max_x = np.max(x) min_x = np.min(x) max_y = np.max(y) min_y = np.min(y) # 防止分母为零 if max_x == min_x: rho_x = np.ones_like(x) else: rho_x =...
Python
1
etag: String, authorization: Option<&str>, channel: Sender<Message>, ) -> SirixResult<SirixResponse<T>> { let mut header_map = HeaderMap::new(); match authorization { Some(authorization) => { header_map.append( "authorization", HeaderValue::from_s...
Rust
0
Gl => unsafe { gleam::gl::GlFns::load_with(|s| gl_window.get_proc_address(s) as *const _) }, glutin::Api::OpenGlEs => unsafe { gleam::gl::GlesFns::load_with(|s| gl_window.get_proc_address(s) as *const _) }, glutin::Api::WebGl => unimplement...
Rust
0
st ITEM_ALGORITHMS: [ItemAlgorithm; 1] = [ItemAlgorithm::HighestGain]; impl Display for MoveAlgorithm { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { MoveAlgorithm::ShortestPath => write!(f, "Shortest Path"), } } } impl Display for ItemAlgorithm { fn f...
Rust
0
T = 3 N = 3 A = [1, 2, 3] B = [3, 2, 1] coins = 0 if T == 0: print('over') while T > 0: max_val = max(B) max_ind = B.index(max_val) if T < A[max_ind]: coins += T * B[max_ind] print(coins) break coins += A[max_ind] * B[max_ind] T -= A[max_ind] A.pop(max_ind) B.p...
Python
1
# Generated by Django 5.1.12 on 2025-10-02 05:45 import authentik.lib.models from django.apps.registry import Apps from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db import migrations, models def migrate_backchannel_logout_uri(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): ...
Python
1
MCOB2 tracks internal MCOA0."] TRACK_MCOA0, } impl CCPB2R { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self...
Rust
0
ds=[dict(type='PGDRegLoss', name='loss_kd_reg_1', temp=temperature, gamma=gamma, delta=delta, ) ] ...
Python
1
from datetime import time, timedelta from decimal import Decimal from uuid import UUID import yaml from django.utils.safestring import SafeString from rest_framework.exceptions import ErrorDetail from rest_framework.renderers import BaseRenderer, JSONRenderer class OpenApiYamlRenderer(BaseRenderer): media_type =...
Python
1
ected = self.tierSelect.selectedItems() if not selected: reply = QMessageBox.critical(self, "Missing information", "Please specify a column to remove.") return self.tiers = [x.text() for x in selected] msgBox = QMessageBox(QMessage...
Python
1
"] pub publish_ch: [PUBLISH_CH; 8], _reserved22: [u8; 296usize], #[doc = "0x300 - Enable or disable interrupt"] pub inten: INTEN, #[doc = "0x304 - Enable interrupt"] pub intenset: INTENSET, #[doc = "0x308 - Disable interrupt"] pub intenclr: INTENCLR, _reserved25: [u8; 244usize], ...
Rust
0
bounds_range = torch.tensor([1.2, 1.2, 0.3]) for i in range(iters): print("Gathering dataset...iteration:", i + 1, "/", iters) s_points = ((torch.rand((1, 10 ** 5, 3)) - bounds_shift) * bounds_range).to( device) for sigma in sigma_levels: prob, x = teacher_net.get_...
Python
1
ET_IPV4_TCP_SYN_RETRIES: i32 = 40; pub const NET_IPV4_IPFRAG_HIGH_THRESH: i32 = 41; pub const NET_IPV4_IPFRAG_LOW_THRESH: i32 = 42; pub const NET_IPV4_IPFRAG_TIME: i32 = 43; pub const NET_IPV4_TCP_MAX_KA_PROBES: i32 = 44; pub const NET_IPV4_TCP_KEEPALIVE_TIME: i32 = 45; pub const NET_IPV4_TCP_KEEPALIVE_PROBES: i32 = 46...
Rust
0
import pandas as pd import tensorflow as tf import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, LabelEncoder import joblib # Read data from file data = pd.read_csv("6 class csv.csv") # Split evidence from labels evidence = data.drop(['Star type', 'S...
Python
1
self.wait_for_initial_sync() self.plm.finalize() state = self.plm.status() if state["state"] == PLM.State.FINALIZING: if not fast: self.wait_for_state(PLM.State.FINALIZED) def wait_for_state(self, state: PLM.State): """Wait for the PLM servic...
Python
1
rmat(" ")), Hand::Pair(a) => write!(fmt, "[Pair {}]", a.iter().format(" ")) } } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum StraightDrawType { Complete, OpenEnded, Inside } // Either a potential hand, or an actual formed hand #[derive(Debug, Clone, Part...
Rust
0
0xCC | 0x1CC => { ::codegen::gen_move_registers_from_locals_to_memory(ctx); ::codegen::gen_fn0_const(ctx.builder, "instr_CC"); *instr_flags |= ::jit::JIT_INSTR_BLOCK_BOUNDARY_FLAG; ::codegen::gen_move_registers_from_memory_to_locals(ctx); }, 0xCD | 0x1CD => { ::codege...
Rust
0
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 the License, or # (at your op...
Python
1
/// /// If present, parameters for the rpc call MUST be provided as a Structured value. /// Either by-position through an Array or by-name through an Object. #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Params { /// Array of values Array(Vec<Value>), /// Map of...
Rust
0
""" .. _slider_bar_widget_example: Slider Bar Widget ~~~~~~~~~~~~~~~~~ The slider widget can be enabled and disabled by the :func:`pyvista.Plotter.add_slider_widget` and :func:`pyvista.Plotter.clear_slider_widgets` methods respectively. This is one of the most versatile widgets as it can control a value that can be u...
Python
1
s, last_federation_update_ts, last_user_sync_ts, status_msg, currently_active in rows ] def take_presence_startup_info(self) -> List[UserPresenceState]: active_on_startup = self._presence_on_startup self._presence_on_startup = [] return active_on_startup def process_replication...
Python
1
from typing import Optional from vyper.venom.analysis.analysis import IRAnalysesCache, IRAnalysis from vyper.venom.analysis.liveness import LivenessAnalysis from vyper.venom.basicblock import IRInstruction, IRVariable from vyper.venom.function import IRFunction class DFGAnalysis(IRAnalysis): _dfg_inputs: dict[IR...
Python
1
ene_sys::GRAPHENE_EULER_ORDER_RYXZ, EulerOrder::Rzxz => graphene_sys::GRAPHENE_EULER_ORDER_RZXZ, EulerOrder::Rxyz => graphene_sys::GRAPHENE_EULER_ORDER_RXYZ, EulerOrder::Rzyz => graphene_sys::GRAPHENE_EULER_ORDER_RZYZ, EulerOrder::__Unknown(value) => value, } ...
Rust
0
to: refracted}, attenuation)) } } else { Some((Ray{from: record.point, to: reflected}, attenuation)) } } } /// Описывает закон отражения луча от поверхности. fn reflect(vec: Vec3, normal: Vec3) -> Vec3 { vec - 2.0 * dot(vec, normal) * normal } /// Описывает закон прело...
Rust
0
'frame_idx':frame_idx, 'instance_id': int(instance_id), 'text_query': text_annotation, 'exist_queries': exist_text_queries, '...
Python
1
# ------------------------------------------------------------------------ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # # This file incorporates work covered by th...
Python
1
ccuracy1(black_box(300.0), black_box(101325.0))) }); } criterion_group!(benches, mixing_ratio_benchmark); criterion_main!(benches); extern crate libc; extern crate numbat; use std::fs::File; use std::io::Read; use std::path::Path; use shelby; pub struct Uptime<'a> { emitter: numbat::Emitter<'a> } impl<'a> Upt...
Rust
0
import jax import typing from ..utils.dataclasses import dataclass_wrapper @dataclass_wrapper class SparseGrid: temporal: jax.Array spatial: typing.Iterable[jax.Array] def __init__(self, temporal, *spatial) -> 'SparseGrid': self.temporal = temporal self.spatial = spatial @property ...
Python
1
src_fps = cap.get(cv2.CAP_PROP_FPS) or 0.0 tgt_fps = min(fps_limit or (src_fps if src_fps>0 else 25.0), 25.0) period = 1.0/max(1e-6,tgt_fps) t_next = time.perf_counter() t0 = t_next while True: if (should_abort and should_abort()): break if max_seconds...
Python
1
from .web_scrapping import extract_text_and_links __all__ = ['extract_text_and_links']
Python
1
""" Crie um programa que gerencia o aproveitamento de um jogador de futebol. O programa vai ler: NOME DO JOGADOR QUANTAS PARTIDAS ELE JOGOU QUANTIDADE DE GOLS FEITOS EM CADA PARTIDA No final, tudo isso será quardado em um dicionário, incluindo o TOTAL DE GOLS feitos durante o campeonato """ # dados = {} # lista_gols...
Python
1
_array(Some(&Mmatrix), false, &mov_matrix); // Draw the triangle gl.draw_elements_with_i32( WebGlRenderingContext::TRIANGLES, 3 as i32, WebGlRenderingContext::UNSIGNED_SHORT, 0, ); Ok(()) } #[allow(non_snake_case)] fn get_projection(angle: f32, a: f32, zMin: f32, zMax: f3...
Rust
0
L = 467, /// `ROL r/m64, CL` /// /// `o64 D3 /0` /// /// `X64` /// /// `64-bit` Rol_rm64_CL = 468, /// `ROR r/m16, CL` /// /// `o16 D3 /1` /// /// `8086+` /// /// `16/32/64-bit` Ror_rm16_CL = 469, /// `ROR r/m32, CL` /// /// `o32 D3 /1` /// /// `386+` /// /// `16/32/64-bit` Ror_rm32_CL = 470, /...
Rust
0
?Sized, D: From<T::Diff>, { match left.borrow().diff(right.borrow()) { edit::Edit::Copy(_) => edit::Edit::Copy(left), edit::Edit::Change(diff) => edit::Edit::Change(diff.into()), } } macro_rules! borrow_impl { ($($typ:ident),*) => { $( impl<'a, T: Diffable<'a> + ?Si...
Rust
0
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'lora_simplified.ui' ## ## Created by: Qt User Interface Compiler version 6.9.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###########...
Python
1
{ pub ThreadId: u32, pub ExceptionPointers: *mut EXCEPTION_POINTERS, pub ClientPointers: super::super::super::Foundation::BOOL, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Kernel"))] impl ::core::marker::Copy for MINIDUMP_EXCEPTION_INFORMATION {} #[cfg(all(feature = "Win32_Foundation"...
Rust
0
if not line.startswith('-'): label = 'Anomalous' self.block2label[str(block_idx)] = label block_idx += 1 i += self.window_size pbar.update(1) ...
Python
1
import paramiko import telnetlib def SSHLogin(host,port,username,password): try: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host,port=port,username=username,password=password); ssh_session = ssh.get_transport().open_session(...
Python
1
in # OUTPUT_FOLDER/tracker_name/OUTPUT_SUB_FOLDER OUTPUT_SUB_FOLDER='', # Names of trackers to display # (if None: TRACKERS_TO_EVAL) TRACKER_DISPLAY_NAMES=None, # Where seqmaps are found # (if None: GT_FOLDER/seqmaps) SEQMAP...
Python
1
hard_conns: Vec<ConnectionKeeper>, }, } // Works in the background to detect ShardInfo changes and keep node connections updated struct NodeWorker { node_conns: Arc<AsyncRwLock<NodeConnections>>, node_addr: SocketAddr, connection_config: ConnectionConfig, shard_info_sender: ShardInfoSender, sh...
Rust
0
t) # NOTE # x_mask_neighborhoods = x_vis.reshape(b * g1, -1)[~idxs[i], :].reshape(b, g2, k2, -1) # 取 masked tokens from the previous layer # visible_index bool_vis_pos = ~(bool_masked_pos[i]) batch_size, seq_len, C = group_input_tokens.si...
Python
1
nMut(SsoString) -> Fut, Fut: Future<Output = Result<Vec<u8>, E>>, E: std::error::Error + 'static, { let key = ImageKey { index: image.index(), srgb, }; let entry = match images.entry(key) { Entry::Occupied(handle) => return Ok(handle.get().clone()), Entry::Vacant(v) ...
Rust
0
ize, Clone)] #[serde(rename_all = "lowercase")] pub enum DType { Boolean, Int, Float, Long, Double, String, Age, Name, City, Phone, Date, DateTime, Latitude, Longitude, //TODO - For now, let's stick to basic types // Date, Array, Map, Nullable (union/n...
Rust
0
#!/usr/bin/env python3 import argparse import binascii import hashlib import os import struct def create_header(key, version, iv, random, size): header = struct.pack('32s32s32s32s32s', key, version, iv, random, size) return header def create_output(args): in_st = os.stat(args.input_file) in_size = in_st.st_size...
Python
1
_graph( pos, lengths, angles, num_atoms, edge_index, to_jimages, num_bonds) idx_s, idx_t = edge_index # Calculate triplet angles cosφ_cab = inner_product_normalized(V_st[id3_ca], V_st[id3_ba]) rad_cbf3, cbf3 = self.cbf_basis3(D_st, cosφ_cab, id3_ca) rbf ...
Python
1
factor': jnp.zeros_like(pressure), } @override def compute_planck_sources( self, pressure: Array, temperature: Array, *args, sfc_temperature: Array | None = None, ) -> dict[str, Array]: """Compute the Planck sources used in the longwave problem. The computation is based...
Python
1
m[(i, 0)] = src[i].x; m[(i, 1)] = src[i].y; m[(i, 2)] = 1f32; m[(i, 3)] = 0f32; m[(n + i, 0)] = src[i].y; m[(n + i, 1)] = -src[i].x; m[(n + i, 2)] = 0f32; m[(n + i, 3)] = 1f32; } match Affine2D::solve_affine(...
Rust
0
import re from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import pandas as pd def clean_text(text): # Удаление HTML-тегов text = re.sub(r'<.*?>', '', text) # Удаление лишних пробелов text = re.sub(r'\s+', ' ', text) # Приведение текста к нижнему регистру text = text...
Python
1
no_mangle] pub unsafe extern "C" fn rumpuser_sp_raise(_arg: *mut c_void, _signo: c_int) { unreachable!("rumpuser_sp_raise"); } mod round_trip; pub fn setup_logger() { let _ = env_logger::builder().is_test(true).try_init(); } /* Copyright 2019 Supercomputing Systems AG Licensed under the Apache License, ...
Rust
0
# myapp/urls.py from django.urls import path from django.views.generic import TemplateView from .views import PersonCreateView urlpatterns = [ path('add/', PersonCreateView.as_view(), name='add_person'), path('success/', TemplateView.as_view(template_name='success.html'), name='person_success'), ]
Python
1
def check(): import output.main #output.main.main(1 , "Запускаю запуск проверки данных") with open("kernel/run/anal.py", 'r', encoding='utf-8') as file: exec(file.read()) check()
Python
1
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
Python
1
# Utility to run all regtests. # This is intended to be used on docker images where `make regtest` does not work. # Run this script in the src/ directory. # # May need to set LD_LIBRARY_PATH in docker first # export LD_LIBRARY_PATH=$COMPASS_FOSS_PATH/lib import sys, os, glob # Exclude tags for DsendsCompassBasePkg tag...
Python
1
impl FromStr for TokenStream { type Err = LexError; fn from_str(src: &str) -> Result<TokenStream, LexError> { __internal::with_parse_sess(|sess| { let src = src.to_string(); let name = "<proc-macro source code>".to_string(); let tts = try!(parse::parse_tts_from_sourc...
Rust
0
SR识别异常: {e}") return "识别失败" finally: transcriber.shutdown() # ============ TTS 合成新语音 ============ class TTSProcessor: def __init__(self, output_path): self.output_path = output_path self.audio_data = b'' def on_data(self, data, *args): """接收合成的音频数据""" self....
Python
1
} Region::Unused0xF => { *cycles += 1; self.bad_read(32, addr, "unused region 0x0F"); self.last_code_read } } } fn read_data_halfword(&mut self, addr: u32, seq: bool, cycles: &mut u32) -> u16 { let addr = addr &...
Rust
0
if len < data.len() { data.truncate(len) } else { while len > data.len() { data.push(0); } } Ok(0) } fn close(&self, id: usize) -> Result<usize> { self.handles.write().remove(&id).ok_or(Error::new(EBADF)).and(Ok(0)) ...
Rust
0
k mode switch.""" toggle_switch = AnimatedToggle() toggle_switch.setFixedSize(toggle_switch.sizeHint()) toggle_switch.setChecked(self.config.dark_mode) toggle_switch.stateChanged.connect(self.controller.on_toggle_theme) return toggle_switch def _create_input_field(self, plac...
Python
1
}; f_foldl( env, &|_, x, y| match (x, y) { (&Expr::Int(x), &Expr::Int(y)) => Ok(kint(expr!(x $op y))), (&Expr::Float(x), &Expr::Int(y)) => Ok(kfloat(expr!(x $op (y as Kfloat)))), (&Expr::Int(x), &Expr::Float(y)) => O...
Rust
0