text
string
label_name
string
labels
int64
ающий': [['Труба ЭСВ Dn 65 (УУТЭ П)', '140 мм', 1], ['Труба ВГП Dn 32', '80 мм', 2]], '50-32 Обратный': [['Труба ЭСВ Dn 65 (УУТЭ О)', '140 мм', 1], ['Труба ВГП Dn 32', '80 мм', 2]], '50-40 Подающий': [['Труба ЭСВ Dn 65 (УУТЭ П)', '140 мм', 1], ['Труба ВГП Dn 40', '90 мм', 2]], '50-40 Обратный': ...
Python
1
# custom_loss.py import numpy as np def exp_weight_rmse_loss(preds, train_data, alpha=None): if alpha == None: alpha = 0.2 y = train_data.get_label() p = preds w = np.exp(alpha * p) d = p - y grad = w*(2*d + alpha*d**2) hess = w*(2 + 2*alpha*d + alpha**2*d**2) return grad, hess ...
Python
1
市辖区"); map.insert("511802", "四川省雅安市雨城区"); map.insert("511821", "四川省名山县"); map.insert("511822", "四川省荥经县"); map.insert("511823", "四川省汉源县"); map.insert("511824", "四川省石棉县"); map.insert("511825", "四川省天全县"); map.insert("511826", "四川省芦山县"); map.insert("511827", "...
Rust
0
and self._multiplier != DEFAULT_MULTIPLIER ): new_value = self._data_point.value * self._multiplier return int(new_value) if self._data_point.hmtype == ParameterType.INTEGER else new_value # Strings and enums with custom device class must be lowercase ...
Python
1
TGCGnnn" def test_bad_multiplex(): wt_basecalls = "GCACCTGTCCCCATAGAAATGGCTATGGAAAGCCTTTGGGTTATTTGCG" epc = EditProposalCreator(wt_basecalls, use_ctrl_trace=False) with pytest.raises(Exception): epc.multiplex_proposal(20, 10, "test1", "test2", dropout=True) def test_wt_proposal(): wt_basecal...
Python
1
t` that is used to represent the effects of several elements with a //! single Jones matrix. This element type is constructed from a user-supplied matrix. //! If you can create the matrix for your custom element, then you can wrap it in a //! `CompositeElement` and use it in a simulation. //! //! ### Beams //! A beam c...
Rust
0
fddlZddlmZeejDcgc]}|j dr|c}ZejdeDdZ dZ dejvrejdejd <yycc}w) N...
Python
1
else: self.last_yaw = 0 # if labset["center_y"] > labset["img_h"]/2: # print("da::",int(now_pitch)) # if int(now_pitch) < int(22): # print("change::", int(now_pitch) + 2) # ...
Python
1
an gyda Bopomofo', 'da': 'han med bopomofo', 'de': 'Han mit Bopomofo', 'dsb': 'chinšćina z bopomofo', 'el': 'Χανμπ', 'el-polyton': 'Χανμπ', 'en': 'Han with Bopomofo', 'es': 'han con bopomofo', 'et': 'hanbi', 'eu': 'idazkera txinatarra bopomofoarekin', 'fa': 'هان با بوموپوفو', 'ff-Adlm': '𞤖𞤢𞥄𞤲 𞤫 𞤄𞤮𞤨𞤮𞤥𞤮𞤬𞤮', ...
Python
1
impl Deref for DBPath { type Target = PathBuf; fn deref(&self) -> &Self::Target { &self.0 } } // Copyright (c) 2014, 2015 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or htt...
Rust
0
import numpy as np from keras_core import backend from keras_core import ops from keras_core import testing from keras_core.optimizers.rmsprop import RMSprop class RMSpropTest(testing.TestCase): def test_config(self): optimizer = RMSprop( learning_rate=0.5, rho=0.8, mo...
Python
1
class Mammoth: pass class Index: pass
Python
1
Command::cargo_bin("pika") .unwrap() .args(&["check", "tests/eff_not_allowed.pk"]) .assert() .stderr(is_match("Effect .* not allowed in this context").unwrap()) .stderr(contains("this context does not allow effects")) .stderr(contains("this context allows effects ")) ...
Rust
0
import mlx.core as mx from mlx_graphs.utils.validators import ( validate_edge_index, validate_edge_index_and_features, ) @validate_edge_index def sort_edge_index(edge_index: mx.array) -> tuple[mx.array, mx.array]: """Sort the edge index. Args: edge_index: A [2, num_edges] array representing ...
Python
1
import sys import re from pyspark import SparkContext,SparkConf def splitDocument(document): """Returns a list of all words in the document""" return re.findall(r"\w+", document[1]) def toPairs(word): """ Creates `(key, value)` pairs where the word is the key and 1 is the value """ return (word, 1) ...
Python
1
`State` type for a dynamic representation of entry state. use crate::Entry; bitfield! { #[derive(Clone, Copy, Eq, Hash, PartialEq)] #[derive(Default)] pub struct SOFT_RESET(u8); impl Debug; u8; pub get, set: 0; } bitfield! { #[derive(Clone, Copy, Eq, Hash, PartialEq)] pub struct I2C_...
Rust
0
tables::*; /// Creates the country function. Meant to be called inside `Country` macro_rules! country { ($func:ident, $code:expr, $value:expr, $alpha2:expr, $alpha3:expr, $long_name:expr) => { country!{ @gen [concat!("Creates a struct for ", $long_name), $func, $code, $value, $alpha2, $alpha3, $long_name]...
Rust
0
img (np.ndarray): The input image to adjust. Returns: np.ndarray: The brightness-adjusted image. """ brightness_factor = np.random.uniform(*self.brightness_range) return img * brightness_factor def _adjust_contrast(self, img): """ A...
Python
1
x = self.conv4(x) x = self.bn4(x) x = self.relu(x) x = self.conv5(x) x = self.bn5(x) x = self.relu(x) return x, low_level_feat def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size...
Python
1
nch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs)) self.add_infotext(p) sampling_cleanup(unet_patcher) return samples def sample(self, p, x, conditioning, unconditiona...
Python
1
re for setting or unsetting hook `hook-name` to command. /// /// # Manual /// /// tmux ^3.0: /// ```text /// tmux set-hook [-agRu] [-t target-session] hook-name command /// ``` /// /// tmux ^2.8: /// ```text /// tmux set-hook [-gRu] [-t target-session] hook-name command /// ``` /// /// tmux ^2.4: /// ```text /// tmux s...
Rust
0
import time from numpy import angle import math import serial import pynmea2 import utm import csv #====== Port conection ============= port1 = "COM28" #port usb that connect rover in your computer for gnss f9p port2 = "COM17" #port usb that connect st...
Python
1
ap(); } #[test] fn test_field_serializer() { let mut serializer = KubewardenLogSerializer::start().unwrap(); let mut field_serializer = serializer.field_serializer(); do_serializer(&mut field_serializer); let data = serializer.end().unwrap(); let mut expected: ser...
Rust
0
AMESPACE_WASM: &[u8] = b"wasm"; const CONTRACT_ATTR: &str = "_contract_addr"; /// Contract Data includes information about contract, equivalent of `ContractInfo` in wasmd /// interface. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct ContractData { /// Identifier of stored contrac...
Rust
0
use gobject_sys; use nm_sys; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib_wrapper! { pub struct SettingWired(Object<nm_sys::NMSettingWired, nm_sys::NMSettingWiredClass, SettingWiredClass>) @extends Setting; match fn { get_type => || nm_sys::nm_setting_wired_get_type(), ...
Rust
0
# This file is auto-generated by build/generate_typehints.py from __future__ import annotations from typing import Literal, TypedDict class 粉色主题Param(TypedDict): primary: str secondary: str background: str text: str border: str class 蓝色主题Param(TypedDict): primary: str secondary: str ...
Python
1
for (i, c) in input.chars().enumerate() { if i % n == 0 { buf.push(c.to_ascii_uppercase()) } else { buf.push(c) } } buf } pub fn nth_lower( input: &mini_template::value::Value, args: Vec<&mini_template::value::V...
Rust
0
note: Windows doesn't report "free" memory so /// [`get_free_memory`](#tymethod.free_memory) returns the same value as this method. /// /// ```no_run /// use sysinfo::{System, SystemExt}; /// /// let s = System::new_all(); /// println!("{} KB", s.available_memory()); /// ``` fn avail...
Rust
0
import logging,requests from bs4 import BeautifulSoup from requests.adapters import HTTPAdapter, Retry from urllib.parse import urljoin def get_soup(url:str, params:dict={}) -> BeautifulSoup|None: s = requests.Session() retries = Retry(total=5, backoff_factor=0.1, status_forcel...
Python
1
import random import torch import torch.nn as nn import numpy as np from scipy.signal import find_peaks def replicate_first_k_frames(x, k, dim): return torch.cat([x.index_select(dim=dim, index=torch.LongTensor([0] * k).to(x.device)), x], dim=dim) def detect_peaks(x, lengths, prominence=0.1, width=None, distance=...
Python
1
import pytest from handlers.messages_handler import WebSocketMessagesHandler from storage.storage_updaters import StorageUserSubscriber @pytest.fixture def subscribe_handler(message_handler: WebSocketMessagesHandler, ws_registered): return lambda subscribe_message: message_handler.handle_subscribe_message(ws_reg...
Python
1
u32, pub writer_epoch: u32, pub detail: MsgDetail, } impl Message { #[inline(always)] pub fn master_timeout(segment_epoch: u32, writer_epoch: u32) -> Self { Self::store_timeout("<MASTER>".into(), segment_epoch, writer_epoch) } #[inline(always)] pub fn store_timeout(target: String, ...
Rust
0
import numpy as np import pandas as pd import sys sys.path.append(".") from metrics import new_compute_metrics, compute_metrics_precision def new_fusion_scores(loaded_matrix_csv, images_matrix, captions_matrix): ti_images_metrics = new_compute_metrics(images_matrix,loaded_matrix_csv) print("Text-to-Image:") ...
Python
1
` but writes the collection database to a file (ie. `collection.db`). pub fn to_file<P: AsRef<Path>>(&self, path: P) -> io::Result<()> { self.to_writer(BufWriter::new(File::create(path)?)) } } /// A single collection. /// Contains a list of beatmap hashes that fall within this collection. #[cfg_attr(fe...
Rust
0
# −*− coding: UTF−8 −*− import os import distutils.ccompiler as dist_ccomp import distutils.command.build as dist_build # from setuptools import setup, Extension from setuptools.command.install import install def rename_files(dirpath, fromsuf, tosuf): for fn in os.listdir(dirpath): if...
Python
1
th_name("ASSUME_PIVOT_IS_FIRST").short("p").long("assume-pivot-is-first") .help("When checking for RAT, only try the first literal as pivot.")) .arg(Arg::with_name("NO_TERMINATING_EMPTY_CLAUSE").long("--no-terminating-empty-clause") .help("Do not add an empty clause at the end of the proof.").hidde...
Rust
0
""" Load function to read IBTrACS. """ import os.path import datetime #import netcdftime import storm_assess def load(fh, calendar=None): # allow users to pass a filename instead of a file handle. if isinstance(fh,str): with open(fh,'r') as fh: fh_lines = fh.readlines() # fo...
Python
1
LVM::FINDITEM.into(), wparam: self.start_index.map_or(-1, |idx| idx as i32) as _, lparam: self.lvfindinfo as *const _ as _, } } } /// [`LVM_GETBKCOLOR`](https://docs.microsoft.com/en-us/windows/win32/controls/lvm-getbkcolor) /// message, which has no parameters. /// /// Return type: `COLORREF`. #[c...
Rust
0
import io import os import time import keyboard import pystray import requests from PIL import Image import pyautogui import autostart_manager # Импортируем функции для управления автозагрузкой # Удалим приветствие: https://stackoverflow.com/questions/51464455/how-to-disable-welcome-message-when-importing-pygame # Из-...
Python
1
ype(int) if len(np.unique(y_pred)) < 2: continue if metric == 'f1_score': score = f1_score(y_val, y_pred, average='binary') elif metric == 'precision': score = precision_scor...
Python
1
import socket # Input IP server dan port server_ip = input("Masukkan IP Server: ") server_port = int(input("Masukkan port server: ")) # Connect to server client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect((server_ip, server_port)) print("Koneksi berhasil") # Send messages while True: messa...
Python
1
""" 音乐MV视频模板 适用于:歌曲MV、音乐视频、节奏剪辑 """ from .base_template import BaseVideoTemplate from typing import Dict, Any class MusicMVTemplate(BaseVideoTemplate): """音乐MV模板""" def get_outline_prompt(self) -> str: return """ 你是一个专业的MV导演。请根据用户的音乐风格和主题,生成一个有视觉冲击力的MV大纲。 大纲应包含: 1. 前奏部分(...
Python
1
*, which: int = WSAIoctls.SIO_BASE_HANDLE, ) -> CData: if hasattr(sock, "fileno"): # pragma: no branch sock = sock.fileno() if which == WSAIoctls.SIO_BSP_HANDLE_SELECT: return _handle(sock + 1) else: return _handle(sock) monkeypatch.setatt...
Python
1
import bpy import math from blender_utils_setup import _ensure_emission, get_dimensions # ───────────────────────────────────────────────────────────────────────────── # THREE‑DISC TRAFFIC‑LIGHT RIG # ───────────────────────────────────────────────────────────────────────────── def _mk_disc(parent, tag, offsets, li...
Python
1
8 => Language::Dutch, 9 => Language::Finnish, 10 => Language::Greek, 11 => Language::Hungarian, 12 => Language::Norwegian, 13 => Language::Polish, 14 => Language::Portuguese, 15 => Language::...
Rust
0
AUDIO_ENABLED = True HELP_ENABLED = True try: from PyQt5.QtCore import (QRectF, Qt, QModelIndex, QItemSelection, pyqtSignal as Signal, pyqtSlot as Slot, QThread,QAbstractTableModel,QAbstractListModel, QSize, QSettings,QP...
Python
1
P6DIR0_W { P6DIR0_W { w: self } } #[doc = "Bit 1 - P6DIR1"] #[inline(always)] pub fn p6dir1(&mut self) -> P6DIR1_W { P6DIR1_W { w: self } } #[doc = "Bit 2 - P6DIR2"] #[inline(always)] pub fn p6dir2(&mut self) -> P6DIR2_W { P6DIR2_W { w: self } } #[doc = "...
Rust
0
information about the desktop display mode."] pub fn SDL_GetDesktopDisplayMode( displayIndex: libc::c_int, mode: *mut SDL_DisplayMode, ) -> libc::c_int; } extern "C" { #[doc = " \\brief Fill in information about the current display mode."] pub fn SDL_GetCurrentDisplayMode( displayIndex: libc::c_int, m...
Rust
0
import regex as re from ..base_op import OPERATORS, Mapper def split_sentence(text): text = re.sub('([.。!!?\?])([^’”])', r'\1\n\2', text) # noqa text = re.sub('(\.{6})([^’”])', r'\1\n\2', text) # noqa text = re.sub('(\…{2})([^’”])', r'\1\n\2', text) # noqa text = re.sub('([.。!!?\?\.{6}\…{2}][’”])(...
Python
1
)) viewport_calib = compute_viewport_calibration(context, vp_w, vp_h) except Exception: viewport_calib = None # -------- 为每个物体导出:UV 示意图(线框轮廓)到 out_dir/uv/ -------- per_object_entries = [] uv_dir = os.path.join(out_dir, "uv") ensure_dir(uv_dir) for...
Python
1
ion_high: r(0), destination_low: r(1), multiplicand1: r(3), multiplicand2: r(2) }, 0xE0F01392 => "smlals r1,r0,r2,r3" => MultiplyLong { condition: Always, signed: true, accumulate: true, set_cpsr: true, destination_high: r(0), destination_low: r(1), multiplicand1: r(3), multiplicand2: r(2) }, // With a ...
Rust
0
4289943843, 47910, 19818, 129, 188, 22, 90, 238, 10, 215, 84); RT_INTERFACE!{interface IEasClientDeviceInformation2(IEasClientDeviceInformation2Vtbl): IInspectable(IInspectableVtbl) [IID_IEasClientDeviceInformation2] { fn get_SystemHardwareVersion(&self, out: *mut HSTRING) -> HRESULT, fn get_SystemFirmwareVers...
Rust
0
5486), (r"meshes\c\artifact_amulet_hheal_01.nif", 0x1C3C_4E49, 0x0DDD_A4F6), (r"meshes\c\artifact_amulet_hfire_01.nif", 0x1C3C_4E49, 0x10C4_62B0), (r"meshes\a\a_art_towershield_eleidon.nif", 0x1C4A_7449, 0xB950_3608), (r"meshes\c\artifact_amulet_hthrum_01.nif", 0x1C5D_4E49, 0xABED_FBF6), (r"mes...
Rust
0
idx_namespace: &'a [u8], // note, we collapse the ik - combining everything under the namespace - and concatenating the pk idx_map: Map<'a, Vec<u8>, u32>, pk_namespace: &'a [u8], phantom: PhantomData<PK>, } impl<'a, IK, T, PK> MultiIndex<'a, IK, T, PK> where T: Serialize + DeserializeOwned + Clone,...
Rust
0
/ A testing data file #[structopt(name = "INPUT", parse(from_os_str))] input: PathBuf, /// A model file #[structopt(name = "MODEL", parse(from_os_str))] model: PathBuf, /// GPU device ID (negative value indicates CPU) #[structopt(long = "device", default_value = "-1")] device: i32, } ma...
Rust
0
import logging from rdkit.Chem import Mol from rdkit.Chem import rdDepictor as _rdDepictor from ..decorators import rdkit_tool from ..types import Smiles, PickledMol from ..utils import encode_mol, decode_mol logger = logging.getLogger(__name__) @rdkit_tool() def Compute2DCoords( p_mol: PickledMol, canonOri...
Python
1
"""Dependencies related to /robot/control endpoints.""" from typing import Annotated from fastapi import status, Depends from opentrons.hardware_control import ThreadManagedHardware from robot_server.errors.error_responses import ApiError from robot_server.errors.robot_errors import ( EstopNotAttached, Estop...
Python
1
tion + half_size; AABB::with_bounds( bvh::Point3::new(min.x as f32, min.y as f32, min.z as f32), bvh::Point3::new(max.x as f32, max.y as f32, max.z as f32), ) } } impl BHShape for Plane { fn set_bh_node_index(&mut self, index: usize) { self.node_index = index; ...
Rust
0
other) } } impl<'a, T> From<(T, &'a JwsHeader)> for Recipient<'a> where T: Into<Secret<'a>>, { fn from(other: (T, &'a JwsHeader)) -> Self { Self::new(other.0).protected(other.1) } } impl<'a, T> From<(T, &'a JwsHeader, &'a JwsHeader)> for Recipient<'a> where T: Into<Secret<'a>>, { fn from(other: (T, &'...
Rust
0
ma", "Magcargo", "Swinub", "Piloswine", "Corsola", "Remoraid", "Octillery", "Delibird", "Mantine", "Skarmory", "Houndour", "Houndoom", "Kingdra", "Phanpy", "Donphan", "Porygon2", "Stantler", "Smeargle", "Tyrogue", "Hitmontop", "Smoochum", ...
Rust
0
INPUT_IS_COMPRESSED, COMPRESS_THE_OUTPUT, CHECK_INPUT_CORRECTNESS, &privkey, &parameters, ) .expect("must contribute with the key"); println!("Finishing writing your contribution to response file..."); // Write the public key pubkey .write(&mut writ...
Rust
0
], range: Range<f64>) { let dut = DeepEx::<f64>::from_str(sut).unwrap(); let n_vars = dut.n_vars(); let step = 1e-4; let mut rng = thread_rng(); let x0s: Vec<f64> = (0..n_vars).map(|_| rng.gen_range(range.clone())).collect(); println!( "test_partial_finite - ...
Rust
0
self.data_dict = {} # config.signals.region_detected.connect(self.renew) # config.signals.add_centerline_curvature.connect(self.add_curvature) # config.signals.remove_centerline_curvature.connect(self.remove_curvature) # global slots signals.add_centerline_graph.connect...
Python
1
t:ident)+>)? { kind: $kind:expr }) => { impl $(<$($t: Blueprinted)+>)? Blueprinted for $any $(<$($t)+>)? { const BLUEPRINT: &'static Blueprint<'static> = &Blueprint { name: RefBox::Ref(stringify!($any)), kind: $kind, }; } }; } macro_rules! for...
Rust
0
use alloc::string::String; use user::console::*; use user::syscall::sys_exec; #[no_mangle] pub fn main() { println!("Rust user shell"); let mut line: String = String::new(); print!(">> "); loop { let c = getchar(); match c { LF | CR => { println!(""); ...
Rust
0
haseOrderVersionCli, _> = ver_res .map(|ver| { let ver_cli: PurchaseOrderVersionCli = PurchaseOrderVersionCli::from(ver); ver_cli }) .map_err(CliError::from); ver_cli_res })); print_formattable_list(&mut *ve...
Rust
0
> } KeySize192 => { let aes_dec = aessafe::AesSafe192Decryptor::new(key); let dec = box CbcDecryptor::new(aes_dec, padding, iv.to_vec()); dec as Box<Decryptor> } KeySize256 => { let aes_dec = aessafe::AesSafe256Decryptor::new(key); ...
Rust
0
color, -1) if visible(lh) and visible(rh): lh_px = to_px(lh, w, h) rh_px = to_px(rh, w, h) cv2.line(frame_bgr, lh_px, rh_px, line_color, line_thk) mid_hip = ((lh_px[0] + rh_px[0]) // 2, (lh_px[1] + rh_px[1]) // 2) cv2.circle(fr...
Python
1
.set_high(); thread::sleep(Duration::from_secs_f64(val)); self.pin.set_low(); ActuationResult::Success } else { ActuationResult::BadRequest { reason: format!( ...
Rust
0
()), last: AtomicU64::new(timer.performance_counter()), current: AtomicU64::new(timer.performance_counter() + 1), }; AnyArc::new(out) } pub fn update(&self, timer: &sdl2::TimerSubsystem) { self.last .store(self.current.load(Ordering::Relaxed), Orderin...
Rust
0
fn condition_check_recipient() { let mail = Mail::parse_fetched( vec![ "Subject: Hehe\r\n", "From: Inconnito <<EMAIL>>\r\n", "To: <EMAIL>\r\n", "\r\n", "Hello world\r\n", "This is some text\r\n", ...
Rust
0
dst.put(item); Ok(()) } } /// Syncronously decode a number from a `Read` pub fn decode<R: Read, T: Default + DecoderHelper>(mut input: R) -> errors::Result<T> { let mut decoder = DecoderState::default(); loop { // We read one at a time to prevent consuming too much of the buffer. ...
Rust
0
-4 Desc=2".parse().unwrap(); } #[test] fn protocol_all_supported_with_single_protocol_and_protocol_set() { let protocols: UnvalidatedProtoEntry = "Link=3-4 Desc=2".parse().unwrap(); let unsupported: Option<UnvalidatedProtoEntry> = protocols.all_supported(); assert_eq!(true, unsupported.is_none()); } #[tes...
Rust
0
# Copyright 2023 Lawrence Livermore National Security, LLC and other # Benchpark Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: Apache-2.0 from spack.package import * class Remhos(MakefilePackage, CudaPackage, ROCmPackage): """Remhos (REMap High-Order Solver) is a ...
Python
1
t_path, pmc_checkpoint_path=pmc_checkpoint_path, enable_endo=True, # Stage 2 uses both branches enable_pmc=True, cross_attn_every_n_layers=4, gradient_checkpointing=use_gradient_checkpointing, use_mixed_precision=use_mixed_precision, d...
Python
1
.help("Set of rays to use"), ) .arg( Arg::with_name("output") .long("output") .short("o") .value_name("MUSTACHE_PATTERN?") .min_values(0) .max_values(1) .help( "Enables o...
Rust
0
ask_cleaned = (labeled_mask == max_area_index).astype(np.uint8) mask_cleaned[mask_cleaned == 1] = 255 # cv2.imwrite(f'{model_path}/mask/sub_mask/{image_name}_cleaned.png', mask_cleaned) # 再过滤一次,让边缘变得光滑 mask_cleaned = mask_filter(mask_cleaned, 15, 0.2) mask_cleaned[mask_cleaned ...
Python
1
V SSKJr SSKJrJrJrJrJrJrJ r J r J r SSK J r SSK Jr SSK Jr SSK Jr SSK Jr SSK Jr 0r\"S 5\S '\ "S 5R(rS r\"5(a\rO\r"S S \ 5r\ "\5r\S R4...
Python
1
ND = "bind" """ 捆绑 """ PATCH_ON = "patch_on" """ 戴上眼罩 """ WHIP = "whip" """ 鞭子 """ NEEDLE = "needle" """ 针 """ GAG_ON = "gag_on" """ 戴上口球 """ MILKING_MACHINE_OFF = "milking_machine_off" """ 取下搾乳机 """ URINE_COLLECTOR_OFF = "urine_collector_off" """ 取下采尿器 """ UNBIND...
Python
1
ite::run(server, "127.0.0.1:8080") .await .unwrap(); } }); let stdin = std::io::stdin(); let lines = stdin.lock().lines(); for line in lines { let line = line.unwrap(); server .call(Message::Broadcast { text: line, ...
Rust
0
try: a = float(input("Nombre 1 : ")) b = float(input("Nombre 2 : ")) result = a / b except ZeroDivisionError: print("Erreur : Division par zéro !") else: print(f"Résultat : {result}")
Python
1
import speech_recognition as sr def get_all_your_mic(): microphones = sr.Microphone.list_microphone_names() print("Available Microphones:") for i, mic in enumerate(microphones): print(f"{i}: {mic}") def rt_stt(microphone_index): recognizer = sr.Recognizer() # get all your mics microph...
Python
1
AValueImpl<Direct, Tuple<'v>> { type StarlarkValue = Tuple<'v>; type ExtraElem = Value<'v>; fn extra_len(&self) -> usize { self.1.len() } fn offset_of_extra() -> usize { Tuple::offset_of_content() } unsafe fn heap_freeze( me: *mut AValueRepr<Self>, freezer...
Rust
0
# Typecasting = the process of converting a variable from one data type to another # str(), int(), float(), bool() name = "Karim" age = 26 gpa = 3.3 is_student = True print(f"'{name}' is: ", type(name), ",", f"'{age}' is: ", type(age), ",", f"'{gpa}' is: ", type(gpa),"\n") int_gpa = int(gpa) print(int_...
Python
1
the setup phase, producing an evaluator for the next stage. pub fn compute_setup<C, RNG>( &self, channel: &mut C, rng: &mut RNG, ) -> Result<(Evaluator<C, RNG, OtReceiver>, Vec<Wire>, Vec<Wire>), Error> where C: AbstractChannel, RNG: CryptoRng + RngCore + SeedableRng...
Rust
0
"output file to write the graph to") .required(true), ) .arg( Arg::new("OSM-PBF") .help("input OSM .pbf file") .required(true) .min_values(1), ); let matches = app.get_matches(); let h3_resolution: u8 = matches...
Rust
0
CanvasElement>().unwrap(); let cummulative_canvas: HtmlCanvasElement = self .cummulative .canvas_ref .cast::<HtmlCanvasElement>() .unwrap(); if first_render { log::trace!("First render of Analysis"); current_canvas.set_width(self.s...
Rust
0
} } } impl From<u64> for OverflowTracker { fn from(n: u64) -> Self { match n { 0 => OverflowTracker::NoOverflow, 1 => OverflowTracker::OneBitOverflow, _ => OverflowTracker::SignificantOverflow(n), } } } impl Add for OverflowTracker { type Output = S...
Rust
0
HDEBR2HjDB LwAAAg/A CsRNyID/Av6qL/AxCLM/AAAAg/A S Np m6754DBEYbpDB cKxK6DBLyLpDBktO5DB35GpDBqxv5DB78MpDB cmup9DBGEqqDBLHO7DBT3IpDBnEF9DBe+spDB ctI0+DBEtFsDBQg89DBDXJrDB5QS+DBU4yrDB c9oqAEBPfLsDBBrv/DBqxmsDBEtOAEBBWfsDB cMoaBEBAAgrDBHv4AEBNeBsDBXPaBEB5lhrDB LwAAAg/A CsRNyI...
Rust
0
access it like # this. note_id = request.POST.get('note_id') # Find the note with the id provided and # also make sure its created by the user # logged in. This way you can't delete a # note that is not yours. note = Note.objects.filter( id = note_i...
Python
1
use quote::quote; use std::collections::HashMap; use syn::punctuated::Punctuated; use syn::Token; use syn::{ parse_quote, AngleBracketedGenericArguments, Attribute, FnArg, ForeignItem, ForeignItemFn, GenericArgument, Ident, Item, ItemEnum, ItemForeignMod, ItemMod, ItemStruct, PatType, Path, PathArguments, ...
Rust
0
liteConnection, id: i32) -> Result<Report> { assert!(id >= 0); reports::table .filter(reports::id.eq(id)) .first::<Report>(conn) .chain_err(|| format!("Failed to get report #{}", id)) } /// Get *all* reports from the database. pub fn get_all(conn: &SqliteConnection) -> Result<Vec<Repor...
Rust
0
rows,goal = map(int, input().split(" ")) contador = 0 for i in range(1,rows+1,1): if (goal%i==0)and(goal<i): contador = contador + 1 print(contador)
Python
1
"); //~ ERROR expects 2 parameters but 3 uri!(has_two: 10); //~ ERROR expects 2 parameters but 1 uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters //~^ HELP unknown parameter: `name` uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters //~^ HELP unknown parameter: `na...
Rust
0
se) { return false; } else { bases.push(base) } } } true && exprs.into_iter().all(no_repeating_bases) } ...
Rust
0
import torch from neural_clbf.systems import ControlAffineSystem def normalize( dynamics_model: ControlAffineSystem, x: torch.Tensor, k: float = 1.0 ) -> torch.Tensor: """Normalize the state input to [-k, k] args: dynamics_model: the dynamics model matching the provided states x: bs x se...
Python
1
self.semW.append(nn.Linear(input_dim, self.mem_dim)) self.fc1 = torch.nn.Linear(self.hidden_size//2, 32) self.fc2 = torch.nn.Linear(32, self.hidden_size//2) self.fc3 = nn.Linear(self.hidden_size//2, self.hidden_size//2) self.fc4 = nn.Linear(self.hidden_size, self.hidden_size//2...
Python
1
# [ doc = r" Proxy" ] pub struct _BkpsramenW<'a> { register: &'a mut W, } impl<'a> _BkpsramenW<'a> { # [ doc = r" Writes raw `bits` to the field" ] pub unsafe fn bits(self, bits: u8) -> &'a mut W { const MASK: u8 = 1; const OFFSET: u8 = 18; self.re...
Rust
0
})); expect!(generators).to(be_equal_to(generators! { "BODY" => { "$.c[2]" => Generator::RandomInt(0, 10) } })); } #[test] fn process_object_with_primitive_json_value() { let json = json!({ "pact:matcher:type": "regex", "regex": "\\w+", "value": "b" }); ...
Rust
0
Supported("const generic without substitution"), ); } #[test] fn const_trait_assoc() { // FIXME: this should evaluate to 0 check_fail( r#" struct U0; trait ToConst { const VAL: usize; } impl ToConst for U0 { const VAL: usize = 0; } const GOAL: usize = U0::VAL...
Rust
0