text
string
label_name
string
labels
int64
t_hash(), initial_plasma_state.root_hash() ); } /// Checks if next_free_id field behaves as expected after some creations and deletions of accounts. #[test] fn test_next_free_id() { let mut rng = XorShiftRng::from_seed([1, 2, 3, 4]); let mut random_addresses = Vec::...
Rust
0
# 正则表达式 import re # 匹配纯数字[0-9] \d+ 是连续匹配 要是中间有个123*456中间有一个非数字 到*这里就不匹配了 匹配到 123 a = re.match(r"\d+", "123*456") print(a) # 匹配数字 字母 下划线 同上匹配准则 ^:匹配开头 $:匹配结尾(要是结尾和开头不符合匹配准则,就没有匹配结果返回None) b = re.match(r"^\w+$", "_23er_") print(b) # 匹配空白字符 c = re.match(r"\s+", " ") print(c) # . 任意字符(\d \s \w) $结尾匹配的准则是和他的上一位匹配准则一...
Python
1
from ....type.rare import Rare from ....type.weap import Catalyst, WeaponStat, WeaponStatType from ....type.weap.tier import Tier class ThrillingTalesofDragonSlayers(Catalyst): name: str = "Thrilling Tales of Dragon Slayers" seco_stat: WeaponStat = WeaponStat(stat_name=WeaponStatType.health_points_perc, stat_...
Python
1
of pages of a linear memory. /// /// # Note /// /// On a 32-bit platform with a page size of 65536 bytes there /// can only be 65536 pages for a total of ~4GB bytes of memory. const MAX_PAGES: Pages = Pages(65536); /// Creates a new memory entity with the given memory type. pub fn new(...
Rust
0
电子数 = 光功率/光子能量/10*光强/100 I = P * 电子数 * sqrt(2*光子能量 - 2*功函数_eV + 2*V) * 1000 电流值.append(I) return 电压范围, 电流值 def 更新光电流图(): global 曲线列表 电压范围, 电流值 = 计算光电流() if 电压范围 is None: return 曲线颜色 = 光束颜色 曲线标签 = f"{当前金属}, {波长}nm, {光强}%" 曲线 = gcurve(graph=图, co...
Python
1
import os import pytest from src.core.deep_research_system import build_lead_agent def test_model_settings_env(monkeypatch): monkeypatch.setenv("MODEL_TEMPERATURE", "0.7") monkeypatch.setenv("MODEL_MAX_TOKENS", "500") monkeypatch.setenv("PARALLEL_TOOL_CALLS", "false") monkeypatch.setenv("OPENAI_API_KEY", "test-k...
Python
1
ptId, border_sw: i32, border_nw: i32, border_ne: i32, border_se: i32, border_usage: i32, water_shape: i32, non_base_terrain_id: TerrainId, base_zone_coverage: i32, base_zone_count: u32, terrain_count: u32, unit_count: u32, } #[derive(Default, Debug)] pub struct BaseZone { ...
Rust
0
at was returned for the sub-field pub fn sub_builder_error(&self) -> &E { &self.1 } /// Decompose the `SubfieldBuildError` into its constituent parts pub fn into_parts(self) -> (&'static str, E) { (self.0, self.1) } } impl<E> fmt::Display for SubfieldBuildError<E> where E: fmt:...
Rust
0
x,y: torch.nn.functional.binary_cross_entropy(x.sigmoid(),torch.clip(y,0,1)), lambda x,y: x.sigmoid().binary_crossentropy(y.clip(0,1))) helper_test_op([(32,10), (32,10)], lambda x,y: torch.nn.functional.binary_cross_entropy_with_logits(x,torch.clip(y,0,1)), lambda x,y: x.binary_crossentropy_logits(y.clip(0,1))) ...
Python
1
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
Python
1
DATASETS_CONFIG[dataset]['name']}") all_results_raw = run_all_eeg_tests(dataset=dataset) # Extrai estatísticas resumidas para cada método (preferindo agregador CSV) all_results = {} for method, stats in all_results_raw.items(): if "error" not in stats: # Mape...
Python
1
queeze(-1) target_scores = target_scores * norm_align_metric return target_labels, target_bboxes, target_scores, fg_mask.bool(), target_gt_idx def get_pos_mask(self, pd_scores, pd_bboxes, gt_labels, gt_bboxes, anc_points, mask_gt): """获取 in_gts 掩码,形状为 (b, max_num_obj, h*w)。""" mask...
Python
1
file_okay=True, dir_okay=False, ), title: Optional[str] = typer.Option( None, help="The title for the documentation page. If not provided, the name of " "the program is used.", ), ) -> None: """ Generate Markdown docs for a Typer app. """ typer_obj = get_typer...
Python
1
import re from typing import ClassVar from dlt.common.typing import REPattern from dlt.common.normalizers.naming.naming import NamingConvention as BaseNamingConvention RE_UNDERSCORES = re.compile("__+") RE_LEADING_DIGITS = re.compile(r"^\d+") RE_ENDING_UNDERSCORES = re.compile(r"_+$") RE_NON_ALPHANUMERIC = re.compil...
Python
1
for (task_id, expires) in tasks { println!("{}\t{}", task_id, expires); } } QueueCmd::Cancel { id } => { let old_status = queue.cancel_job(&id).await?; match old_status { JobStatus::Done => println!("Job was already finishe...
Rust
0
#제목: 연산자와 ofrmat () Review #이름: 최민혁 import datetime # a=int(input("a는 숫자로 입력:")) # a//=2 # a= a//2 # print("a:",a ,type(a)) # a%=3 #a=a % 3 # print("a:",a ,type(a)) now= datetime.datetime.now() print(now.year,"년", now.month, "월",now.day,"일") print("{}년{}월{}일".format(now.year, now.month, now.day)) print(f"{now.year}년 {...
Python
1
#!/usr/bin/env python # # HTMLInspector.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRA...
Python
1
; unsafe { instance.get(Message::new) } } } impl ::protobuf::Clear for Message { fn clear(&mut self) { self.field_type = Message_Type::NETWORK_MESSAGE; self.messageUuid.clear(); self.abstractionId.clear(); self.systemId.clear(); self.networkMe...
Rust
0
let mut index = HeightIndex::new(); let fifteen = Height::from(15); let one_hundred = Height::from(100); index.insert(fifteen, &12); index.insert(one_hundred, &13); let mut expected = Vec::new(); expected.push(13); assert_eq!( &index.lookup(one_hundre...
Rust
0
TVec<Arc<Tensor>>) -> TractResult<TVec<Arc<Tensor>>> { let (a, b) = args_2!(inputs); let c_shape = crate::broadcast::multi_broadcast(&[a.shape(), b.shape()]) .ok_or("Can not compute resulting shape")?; let c_dt = self.result_datum_type(a.datum_type(), b.datum_type())?; let m...
Rust
0
lt("#u8()").check(); TestCase::new().input("#u8{}").result("#u8()").check(); } #[test] fn bytevector_numbers() { TestCase::new() .input("#u8(1 2 3 #e#x3A)") .result("#u8(1 2 3 #e#x3A)") .check(); } #[test] fn bytevector_padded() { TestCase::new() .input("#U8( 1 2 )") ...
Rust
0
_span/src/lib.rs#L1246>. /// Holds the contents of a file together with the origins where the content /// came from. Besides the origin it also holds some information used in error /// reporting. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Source<'a> { /// Origin of the source file. pub(crate) origin: Sou...
Rust
0
// extern { // fn alert(s: &str); // } #[wasm_bindgen] pub fn fibonacci(index: i32) -> i64 { if index <= 1 { index.into() } else { fibonacci(index - 1) + fibonacci(index - 2) } } <gh_stars>1-10 use crate::bootstrap_config::{from_root, temporary_location, unwrap}; use miette::GraphicalR...
Rust
0
import sys from PySide6.QtWidgets import QApplication, QMainWindow, QSplitter, QTextEdit, QVBoxLayout, QWidget # Step 1: Create the main application object app = QApplication(sys.argv) # Step 2: Create the main window (QMainWindow) window = QMainWindow() window.setWindowTitle('QSplitter Example') window.resize(600, 4...
Python
1
""" Doctests for NumPy-specific nose/doctest modifications """ from __future__ import division, absolute_import, print_function #FIXME: None of these tests is run, because 'check' is not a recognized # testing prefix. # try the #random directive on the output line def check_random_directive(): ''' >>> 2+2 ...
Python
1
""" Tests for the following offsets: - Easter """ from __future__ import annotations from datetime import datetime import pytest from pandas.tests.tseries.offsets.common import ( Base, assert_offset_equal, ) from pandas.tseries.offsets import Easter class TestEaster(Base): @pytest.mark.parametrize( ...
Python
1
_idx = positions.len() / 2; let (_, median, _) = positions.select_nth_unstable(median_idx); *median }; // Compute the cost for this target. let total_cost: i32 = positions .iter() .copied() .map(|p| i32::abs(p as i32 - median as i32)) .sum(); println!( ...
Rust
0
corresponding tuple position. event_sequences = list(zip(*events)) if len(event_sequences) != len(self._encoders): raise ValueError( 'Event tuple size must be the same as the number of encoders.') for encoder, event_sequence in zip(self._encoders, event_sequences): input_ +...
Python
1
for filename in os.listdir(directory): if filename.endswith(".java"): filepath = os.path.join(directory, filename) # 读取文件内容 with open(filepath, 'r', encoding='utf-8') as file: content = file.read() # 假设文件中的内容就是 buggy 代码 buggy...
Python
1
mn) { Err(OutOfBoundsError) } else { Ok(Position { row, column }) } } /// Returns the board position's row. pub fn row(&self) -> i16 { self.row } /// Returns the board position's column. pub fn column(&self) -> i16 { self.column } } u...
Rust
0
ub fn new(header: CocoonHeader) -> Self { let mut raw = [0u8; MAX_SIZE]; match header.version() { CocoonVersion::Version1 => { header.serialize_into(&mut raw); } }; FormatPrefix { header, raw } } pub fn serialize(mut self, tag: &[u8; TAG...
Rust
0
final_pc(&self) -> Result<&RelocatableValue, Error> { self.final_pc .as_ref() .ok_or(Error::FunctionEntrypointNotInitialized) } fn initial_pc(&self) -> Result<&RelocatableValue, Error> { self.initial_pc.as_ref().ok_or(Error::StateNotInitialized) } fn initial_ap...
Rust
0
import uuid from neural_recommendation.applications.interfaces.dtos.movie import MoviePublic, MovieSchema from neural_recommendation.domain.models.movie import Movie from neural_recommendation.domain.ports.repositories.movie_repository import MovieRepository class UpdateMovieUseCase: def __init__(self, movie_rep...
Python
1
ong; pub type uintmax_t = cty::c_ulonglong; extern "C" { pub fn USBD_static_malloc(size: u32) -> *mut cty::c_void; } extern "C" { pub fn USBD_static_free(p: *mut cty::c_void); } extern "C" { pub fn USB_power(enabled: cty::c_uchar); } #[repr(C)] #[derive(Default, Copy, Clone)] pub struct usb_setup_req { ...
Rust
0
it. /// /// ## Special cases /// /// There are two cases where the keys do not directly correspond to entity fields: /// /// - `angle`: This allows QuakeEd to write a single value instead of a set of Euler angles. /// The value should be interpreted as the second component of the `angles`...
Rust
0
ble, WGS84}; use crate::{Deg, Error, Utm, UtmConfig, UtmExtra, UtmRelative}; use serde::de::{Error as SErr, SeqAccess, Visitor}; use serde::{Deserialize, Deserializer, Serialize}; use std::fmt::{Display, Formatter}; use std::ops::Deref; use std::str::FromStr; /// EPSG:4326 latitude, longitude coordinate on the WGS84 E...
Rust
0
┛ ", ); let bksp = Key { code: Backspace, mods: NOMOD, }; t.push(vec![LEFT, bksp]); t.assert( " ┃ Tab 1 ┃ ┃ Testing ───────────────────┃ ┃> Hello ┃ ┃ Outputs ───────────────────┃ ┃ ┃ ┃ ...
Rust
0
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.core.validators import RegexValidator from django.utils import timezone from datetime import date # Create your models here. class UserManager(BaseException): def create_user(self, first_name, last_na...
Python
1
import pandas as pd from sklearn.model_selection import train_test_split, cross_val_score from sklearn.tree import DecisionTreeClassifier from sklearn import tree from sklearn.metrics import confusion_matrix, accuracy_score import matplotlib.pyplot as plt import seaborn as sns def main(): # Carregar o conjunto de ...
Python
1
a 0c@s2ddlmZddlmZer&ddlTnddlTdS))absolute_import)PY2)*N) __future__rZ future.utilsr ConfigParser configparserrrn/home/tom/ab/renpy-build-fix/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/moves/configparser.py<module>...
Python
1
) => args, None => { lua.push_integer(FSASYNC::FSASYNC_ERR_FILEOPEN as _); return 1; } }; if sync { let result = match fs::File::create(&path) .map_err(|_| FSASYNC::FSASYNC_ERR_FILEOPEN) .and_then(|mut file| { file.write_all(data) .map_err(|_| FSASYNC::FSASYNC_ERR_FAILURE) }) { Ok(_)...
Rust
0
} true }); // Pass 2: Drop all boxes. // // In this pass, unique-managed boxes may get freed, but not // managed boxes, so we must read the `next` field *after* the // callback, as the original value may have been freed. each_live_alloc(false, |box, uniq| { if !uniq...
Rust
0
from jose import jwt from datetime import datetime, timedelta from app.auth import SECRET_KEY, ALGORITHM import smtplib from email.message import EmailMessage from typing import Optional EMAIL_TOKEN_EXPIRE_MINUTES = 60 * 24 # 1 day # Generate a token for email verification def create_email_token(email: str) -> str: ...
Python
1
r.split(";")]) return cookies def main(argv): global target, headers, cookies, proxies target = f"https://{argv[1]}/owa/" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36", } proxies = { ...
Python
1
orientation has been added. elif d == "nontree" and v not in H[u]: H.add_edge(v, u, nontree=True) else: # Do nothing on 'reverse' edges; we only care about # forward and nontree edges. pass return H, nodes def _build_ch...
Python
1
iveTime; /// # let parse_from_str = NaiveTime::parse_from_str; /// assert_eq!(parse_from_str("08:59:60.123", "%H:%M:%S%.f"), /// Ok(NaiveTime::from_hms_milli(8, 59, 59, 1_123))); /// ``` /// /// Missing seconds are assumed to be zero, /// but out-of-bound times or insufficient fie...
Rust
0
"BROKER").unwrap(); let group = std::env::var("GROUP").unwrap(); let topic = std::env::var("TOPIC").unwrap(); init_tracer(&jaeger_url, "dependencies")?; tokio::spawn(update_cache(redis_url.clone(), broker, group, topic)); let svc = dependencies_server::DependenciesServer::new(DepsService { redis_ur...
Rust
0
{ b } else { return context.throw_type_error("ArrayBuffer constructor returned invalid object"); }; // TODO: Shared Array Buffer // 18. If IsSharedArrayBuffer(new) is true, throw a TypeError exception. // 19. If IsDetachedBuffer(new) is true, throw a Typ...
Rust
0
download link generation if attachment.type == AttachmentType.file: if isinstance(attachment.folder.object, db.m.Event): path = '' elif isinstance(attachment.folder.object, db.m.Session): path = f'{attachment.folder.session.friendly_id}-session' elif isinstance(attach...
Python
1
ht_layout() plt.show() def main(): print("In this programme you can perform a lot of transformations and filters on EMG signals.\n" "Transformation you can use are:\n" " - Continuous Wavelet Transform (Key: CWT)\n" " - Fourier Transform (Key: FT)\n" "Filters you can...
Python
1
ESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. use std::io::Write; const ENCTAB: [u8; 91] = *b"ABCDEFG...
Rust
0
era') unity_bridge.move_object_to_pose('robot', args.base_resolution * goal) pano_image_goal = unity_bridge.get_image('robot/pano_camera') if do_debug_plot: plt.figure(figsize=(8, 6)) plt.subplot(211) plt.imshow(pano_image_start) plt.subplot(212) ...
Python
1
::UnknownFields { &mut self.unknown_fields } fn as_any(&self) -> &dyn (::std::any::Any) { self as &dyn (::std::any::Any) } fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { self as &mut dyn (::std::any::Any) } fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn ...
Rust
0
boost_serializers.ShowtimePricing( id=537354, pricingCode="PCU", amountTaxesIncluded=Decimal("6.0"), title="PASS CULTURE" ) ], attributs=[51, 45, 1, 40], ), boost_serializers...
Python
1
from __future__ import annotations import unittest class stackoverflow_question_60276839_test_case(unittest.TestCase): def test_stackoverflow_question_60276839(self) -> None: """ https://stackoverflow.com/questions/60276839/merge-list-of-nested-dictionaries """ from benedict impor...
Python
1
atch = None if self.factor is not None: factor_batch = _flatten(L, N, factor_batch) value_preds_batch = _flatten(L, N, value_preds_batch) return_batch = _flatten(L, N, return_batch) masks_batch = _flatten(L, N, masks_batch) active_masks_batch =...
Python
1
import dagster as dg import pytest import dagster_and_dbt.completed.lesson_2.defs from dagster_and_dbt.completed.lesson_2.defs.resources import database_resource @pytest.fixture() def defs(): return dg.components.load_defs(dagster_and_dbt.completed.lesson_2.defs) def test_trips_partitioned_assets(defs): as...
Python
1
r foreign key traversal), and AS aliases. pub fn validate_where_column(name: &str) -> Result<(), Error> { lazy_static! { // Rules: // - Starts with a letter (or underscore). // - Only contains letters, numbers, dots, underscores, and parentheses. // - Must not end in a dot (.) or ast...
Rust
0
pub next: *mut hts_opt, } #[repr(C)] #[derive(Copy, Clone)] pub union hts_opt__bindgen_ty_1 { pub i: ::std::os::raw::c_int, pub s: *mut ::std::os::raw::c_char, _bindgen_union_align: u64, } #[test] fn bindgen_test_layout_hts_opt__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<hts_opt__bindge...
Rust
0
pub const HttpHeaderAccept: HTTP_HEADER_ID = 20i32; #[doc = "*Required features: `\"Win32_Networking_HttpServer\"`*"] pub const HttpHeaderAcceptCharset: HTTP_HEADER_ID = 21i32; #[doc = "*Required features: `\"Win32_Networking_HttpServer\"`*"] pub const HttpHeaderAcceptEncoding: HTTP_HEADER_ID = 22i32; #[doc = "*Requir...
Rust
0
import sys from kivy.base import runTouchApp from kivy_garden.mapview import MapMarker, MapView from kivy_garden.mapview.clustered_marker_layer import ClusteredMarkerLayer from kivy_garden.mapview.geojson import GeoJsonMapLayer from kivy_garden.mapview.utils import get_zoom_for_radius, haversine source = sys.argv[1]...
Python
1
, false).unwrap(); cmd_frame.force_extended(); cs.write_frame(&cmd_frame).ok(); prev_state = state; break; State::WaitingForCommand ...
Rust
0
#!/usr/bin/env python3 """ Verify production database data integrity """ import psycopg2 # Database configuration for Azure PostgreSQL DB_CONFIG = { 'host': 'prod-3609ja.postgres.database.azure.com', 'port': 5432, 'database': 'postgres', 'user': 'mubarak', 'password': 'TafawaBalewa123!' } def ver...
Python
1
from selenium import webdriver from selenium.webdriver.chrome.options import Options from bs4 import BeautifulSoup import time import requests from urllib.request import urlopen # driver = webdriver.Chrome() # driver.get("https://www.tiktok.com/@heartdefensor") # #response = requests.get("https://www.tiktok.com/@heart...
Python
1
.name)) if get.name == 'fileinfo': res = public.ExecShell("/www/server/php/{}/bin/php --ri {}".format(get.php_version, get.name)) if res[0] != '' and 'fileinfo' in res[0] and 'enabled' in res[0]: return public.returnResult(True, '已安装!') return public.returnRes...
Python
1
andles missing usage metadata gracefully.""" _, _, mock_embed_func = mock_genai_lib mock_record_usage = mocker.spy(GeminiCostTracker, "record_usage") mock_warnings = mocker.patch("warnings.warn") client = GeminiClient() # Uses defaults # Mock response with valid embedding but no metadata expec...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. import unittest import torch from detectron2.structures.masks import BitMasks, PolygonMasks, polygons_to_bitmask class TestBitMask(unittest.TestCase): def test_get_bounding_box(self): masks = torch.tensor( [ [ ...
Python
1
] } } return templates def generate_fake_data(self): """Генерация поддельных данных""" names = ["Александр", "Мария", "Дмитрий", "Анна", "Михаил", "Елена", "Иван", "Ольга"] companies = ["Сбербанк", "ВТБ", "Альфа-Банк", "Тинькофф", "Газпромбанк"] platf...
Python
1
/// Helper structure that generates a number #[derive(Default)] struct IdGenerator(u32); impl IdGenerator { /// Generates a number that's guaranteed to be unique for this `IdGenerator` fn generate(&mut self) -> u32 { // It's just an increasing number but it does the job let ret = self.0; ...
Rust
0
Model ) -> None: """Test transcribing audios with an unsupported param.""" with pytest.raises(TypeError, match="got an unexpected keyword argument"): transcribe_audios( audios=[resampled_mono_audio_sample, resampled_mono_audio_sample_x2], model=hf_model, unsupported_p...
Python
1
from typing import Any import pydantic def split_keys_string(keys: str | None): if not keys: return [] return list(filter(bool, keys.split(","))) class Settings(pydantic.BaseSettings): PROJECT_NAME: str = "open-assistant inference server" redis_host: str = "localhost" redis_port: int = ...
Python
1
m_cfg=norm_cfg, align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), train_cfg=dict(), test_cfg=dict(mode='whole') ) # optimizer optimizer = dict( _delete_=True, type='AdamW', lr=3e-5, betas=(0.9, 0.999), weight_de...
Python
1
1", "CK145C7NATM" ), ApplePlatformData( "MacBookPro8,1", "W89F9196DH2G" ), ApplePlatformData( "MacBookPro8,2", "C02HL0FGDF8X" ), ApplePlatformData( "MacBookPro8,3", "W88F9CDEDF93" ), ApplePlatformData( "MacBookPro9,1", "C02LW984F1G4" ), ApplePlatformData( "MacBookPro9,2", "C02HA041DTY3" ), ApplePlatformData...
Rust
0
_ => false, } } /// Tests if the variant is `PartialHead`. #[cfg(test)] pub(crate) fn is_partial_head(&self) -> bool { match self { BitDomain::PartialHead(..) => true, _ => false, } } /// Tests if the variant is `PartialTail`. #[cfg(test)] pub(crate) fn is_partial_tail(&self) -> bool { match se...
Rust
0
ain(self.ro_data.iter().flat_map(|(data, label)| { vec![ Command::Label(label.label().clone()), Command::Data(Rc::clone(&data)), ] })) } } pub fn gen_asm(ast: TypedAst) -> Result<Asm, Spanned<CodegenError>> { let mut asm = Asm:...
Rust
0
ip_type, current_time # 记录时间 ] rows.append(new_row) # 写入更新后的CSV文件 if write_csv(output_file, rows): print(f"{Fore.GREEN}{EMOJI['SUCCESS']} 已成功{'更新' if email_exists else '导出'}认证信息到: {output_file}{Style.RESET_ALL}") ...
Python
1
e size of float array."] #[doc = " PDFZoom values:"] #[doc = " - XYZ = 1"] #[doc = " - FITPAGE = 2"] #[doc = " - FITHORZ = 3"] #[doc = " - FITVERT = 4"] #[doc = " - FITRECT = 5"] #[doc = " - FITBBOX = 6"] #[doc = " - FITBHORZ = 7"] ...
Rust
0
( env: JNIEnv, _: JObject, handle: jlong, index: jint, hash: jbyteArray, ) -> jint { match env.convert_byte_array(hash) { Err(_) => 1, Ok(s) => { let mut error = ExternError::success(); let byte_array = ByteArray::from(s); bbs_blind_sign_contex...
Rust
0
enabled(false); self.inh_check.set_enabled(false); self.ign_bpm_check.set_enabled(false); //set visiblity of all flat scaling advanced options self.set_flat_scaling(); self.set_snapping(); } else { //hide all flat scaling advanced options self.flat_sv_scale_check.set_visi...
Rust
0
import os from conan import ConanFile from conan.tools.files import * from conan.tools.layout import basic_layout required_conan_version = ">=2.1" class RapidsCMakeConan(ConanFile): name = "rapids-cmake" description = "A collection of CMake modules that are useful for all CUDA RAPIDS projects" license =...
Python
1
has no MeleeAttackComponent"); return OperationResult::InvalidInput; } if !hp_table.contains(intent.defender) { debug!("defender has no HpComponent"); return OperationResult::InvalidTarget; } let attack_pos = match pos_table.get(intent.attacker) { Some(x) => x, N...
Rust
0
attendance_input = input() has_medical_report = input() attendance_value = int(attendance_input[:-1]) if attendance_value >= 75 or has_medical_report == "Y": print("Allowed to write exam") else: print("Cannot write exam")
Python
1
> &'a mut W { self.variant(SPI0_START_BUSY_AW::SPI0_START) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(fal...
Rust
0
# Copyright (c) 2006-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this ...
Python
1
elCase")] struct ZemuRequest { apdu_hex: String, } #[derive(Deserialize, Debug, Clone)] struct ZemuResponse { data: String, error: Option<String>, } impl TransportZemuHttp { pub fn new(host: &str, port: u16) -> Self { Self { url: format!("http://{}:{}", host, port), } }...
Rust
0
ortError # Use fapws3 if available import fapws._evwsgi as evwsgi from fapws import base evwsgi.start(hostname,str(options.port)) evwsgi.set_base_module(base) evwsgi.wsgi_cb(('', application)) evwsgi.set_debug(0) evwsgi.run() except ImportError: print("Listening...
Python
1
idx = 4; record.base(idx); } #[test] fn test_sequence_read_for_record_trait_method_base_qual_idx_in_range() { let fq: &'static [u8] = b"@id description\nACGT\n+\n!!!!\n"; let mut reader = Reader::new(fq); let mut record = Record::new(); reader.read(&mut record).unwr...
Rust
0
]) elif self.encode_method == 'bert': embeddings = model_output[0][:, 0, :] embeddings = F.normalize(embeddings, p=2, dim=1) all_embeddings.append(embeddings.cpu().numpy()) return np.concatenate(all_embeddings, axis=0) def init_embeddings(self, sents): ...
Python
1
50, accelerator='gpu', devices=num_gpus, strategy=DDPStrategy(find_unused_parameters=False) if num_gpus > 1 else 'auto', callbacks=[checkpoint_callback_stage2], precision="16-mixed", log_every_n_steps=10, accumulate_grad_batches=4 ) print("Starting Stage ...
Python
1
t_val.sh") assert False, "Need to download imagenet_val_25.npz" # modify the default parameters of np.load # https://stackoverflow.com/questions/55890813/how-to-fix-object-arrays-cannot-be-loaded-when-allow-pickle-false-for-imdb-loa np_load_old = np.load np.load = lambda *a,**k: np_load_old(*a,...
Python
1
struct CopyRead<F: FnMut(&mut [u8]) -> Result<(), Error>> { thunk: F, } impl<'de, 'a> Deref for Reference<'de, 'a> { type Target = [u8]; fn deref(&self) -> &[u8] { match *self { Reference::Borrowed(data) => data, Reference::Copied(data) => data, } } } impl<...
Rust
0
.im) } pub fn set_heading_x(&mut self, heading: &Vector2<f32>) { let heading = heading.normalize(); self.rotation = UnitComplex::from_cos_sin_unchecked(heading.x, heading.y); } pub fn heading_y(&self) -> Vector2<f32> { Vector2::new(-self.rotation.im, self.rotation.re) } ...
Rust
0
r i in low..high { if total_size > 0 && total_size >= max_size { break; } let key = keys::raft_log_key(region_id, i); match self.get_value(&key) { Ok(None) => return Err(Error::EntriesCompacted), ...
Rust
0
from odoo import models, fields, api class SaasTagClient(models.TransientModel): _name = 'saas_portal.tag_client' @api.model def _default_categories(self): client = self.env['saas_portal.client'].browse( self.env.context['active_id']) return client.category_ids.ids catego...
Python
1
, Pos2, Rect, SelectableLabel, Sense, Stroke, Ui, Vec2, }; use tpscube_core::{Average, BestSolve, History, ListAverage, Penalty, Solve, SolveList}; const REGION_PADDING: f32 = 16.0; const SESSION_REGION_BORDER: f32 = 8.0; const SESSION_SEPARATOR_SIZE: f32 = 16.0; const SESSION_BEST_PADDING: f32 = 32.0; const BEST_...
Rust
0
import logging import os import torch from tqdm import tqdm from os.path import join import numpy as np from torch.utils.data import DataLoader from torch.utils.data.dataset import Subset def extract_features(model, model_name, pose_dataset, res, bs=32, check_cache=True): pd = pose_dataset DS = pd.name q...
Python
1
ative_flag.bits() | number_of_wheel_rotations; stream.write_u16::<LittleEndian>(flags)?; stream.write_u16::<LittleEndian>(self.x_position)?; stream.write_u16::<LittleEndian>(self.y_position)?; Ok(()) } fn buffer_length(&self) -> usize { 6 } } bitflags!...
Rust
0
from zhipuai import ZhipuAI import os import chainlit as cl client = ZhipuAI(api_key=os.getenv('OPENAI_API_KEY')) # 请填写您自己的APIKey async def glm4_call(req): # 假设我们有一个生成器或者迭代器,它按顺序产生response的chunks response_chunks = client.chat.completions.create(**req) # 初始化一个变量来存储当前的类型 current_type = None tool_ca...
Python
1
} }) } fn to_acts_on(&self, arg_name: &str, include_tasks: bool) -> cage::args::ActOn { let names: Vec<String> = self.values_of(arg_name) .map_or_else(|| vec![], |p| p.collect()) .iter() .map(|p| p.to_string()) .collect(); if ...
Rust
0
else None ), ) ) return success_response(data=quizzes_data) @notes_router.post( "/quiz/submit", response_model=APIResponse[QuizSubmitResponse] ) def submit_quiz( request: Request, submission: QuizAnswerSubmit, current_user: User = Depends(get_current_user),...
Python
1