text
string
label_name
string
labels
int64
de(with = "serde_str::emp")] //! ip: Option<IpAddr>, //! } //! //! use serde_json::{ //! from_str, //! to_string, //! }; //! # fn main() -> serde_json::Result<()> { //! let with_ip: WithIp = from_str(r#"{"ip": "127.0.0.1"}"#)?; //! assert_eq!(with_ip, WithIp { ip: Some([127, 0, 0, 1].into()) }); //! assert_eq!(to_st...
Rust
0
quence-level tasks /// - `position_ids` preset position ids tensor used in case they are not provided by the user pub struct MobileBertModel { embeddings: MobileBertEmbeddings, encoder: MobileBertEncoder, pooler: Option<MobileBertPooler>, position_ids: Tensor, } impl MobileBertModel { /// Build a n...
Rust
0
plemented_function::native_implemented_function; use lumen_rt_full::binary::to_term::Options; use lumen_rt_full::distribution::external_term_format::{term, version}; macro_rules! maybe_aligned_maybe_binary_try_into_term { ($process:expr, $options:expr, $binary:expr, $ident:expr) => { if $ident.is_binary()...
Rust
0
_euclid //! i128::wrapping_div_euclid //! i128::overflowing_div_euclid //! isize::rem_euclid //! isize::checked_rem_euclid //! isize::wrapping_rem_euclid //! isize::overflowing_rem_euclid //! isize::div_euclid //! isize::checked_div_euclid //! isize::wrapping_div_euclid //! isize::overflowing_div_euclid //! u8::rem_euc...
Rust
0
from __future__ import absolute_import, division, print_function from libtbx.utils import Sorry import sys, os.path, traceback def run(args=""): try: """ utility function for passing keyword arguments more directly to hklview_frame.HKLViewFrame() """ from crys3d.hklviewer import hklview_frame fr...
Python
1
return "⏹️ 已停止" def __repr__(self) -> str: return ( f"GridCoordinator(" f"status={self.get_status_text()}, " f"position={self.tracker.get_current_position()}, " f"errors={self._error_count})" ) # ==================== 价格移动网格专用...
Python
1
always)] pub fn tx(self) -> &'a mut W { self.variant(MODE_A::TX) } #[doc = "Frequency synthesis RX"] #[inline(always)] pub fn fsrx(self) -> &'a mut W { self.variant(MODE_A::FSRX) } #[doc = "Receive continuous"] #[inline(always)] pub fn rxcontinous(self) -> &'a mut W {...
Rust
0
/// use linfa_trees::DecisionTree; /// /// // Load dataset /// let dataset = linfa_datasets::iris(); /// // Fit the tree /// let tree = DecisionTree::params().fit(&dataset).unwrap(); /// // Export to tikz /// let tikz = tree.export_to_tikz().with_legend(); /// let latex_tree = tikz.to_string(); /// // Now you can write...
Rust
0
"192.168.1.3".to_owned(), "common".to_owned()); let entries = http_service.redirect_entries(); entries.add("core".to_owned(), "192.168.1.3".to_owned(), "general".to_owned()); // Shutdown task let http_shutdown = http_service.control(); let mut shutdown = tokio::spawn(async move { let _ = s...
Rust
0
ized() { gtk::init().unwrap(); } let ctx = Context::new(); let s = String::from("blah"); let m: std::collections::HashMap<&str, &dyn AsJsValue> = [("foo", &42 as _), ("bar", &s as _)] .iter() .cloned() .collect(); ...
Rust
0
def main(): time = input("What time is it? ") time= convert(time) if(7<= time <=8): print("breakfast time") if(12<= time <=13): print("lunch time") if(18<= time <=19): print("dinner time") def convert(time): hour, minutes = time.split(":") hour = float(hour) mi...
Python
1
S: SortKey<T>, <S as SortKey<T>>::Key: 'a + Clone + Ord + DeserializeOwned, { fn new( reader: &'a ShardReaderSingle<T, S>, range: Range<<S as SortKey<T>>::Key>, ) -> Result<RangeIter<'a, T, S>, Error> { let shards: Vec<&ShardRecord<_>> = reader .index .ite...
Rust
0
Param: WPARAM, lParam: LPARAM) -> BOOL; pub fn PostMessageW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL; pub fn PostQuitMessage(nExitCode: c_int); pub fn PostThreadMessageA( idThread: DWORD, msg: UINT, wParam: WPARAM, lParam: LPARAM, ) -> BOOL; pub fn PostThreadMessageW( ...
Rust
0
Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + 'static, S::Future: Send + 'static, ReqBody: Send + 'static, ResBody: Send + 'static, { type Response = S::Response; type Error = S::Error; type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>; fn pol...
Rust
0
crate log; #[macro_use] extern crate serde_derive; #[macro_use] extern crate lazy_static; #[macro_use] extern crate lalrpop_util; #[cfg(feature = "c-api")] extern crate simplelog; // Make sure the allocator is always the one from the system, otherwise we can't make sure our memory estimations work use std::alloc:...
Rust
0
{ 'name': "TOTPortal", 'category': 'Hidden', 'depends': ['portal', 'auth_totp'], 'auto_install': True, 'data': [ 'security/security.xml', 'views/templates.xml', ], 'assets': { 'web.assets_frontend': [ 'auth_totp_portal/static/src/**/*', ], ...
Python
1
g or partial blits). /// /// A subregion of the input can be specified with the `begy`×`begx` and /// `leny`×`lenx` fields from `vopts`. /// /// Returns the number of pixels blitted on success. /// /// *C style function: [ncblit_rgba()][c_api::ncblit_rgba].* fn blit_rgba(data: &[u8], lin...
Rust
0
let mut list: Vec<Center> = iterative_clustering( max_allowed, &sampled_points, Center::new, distance, parallel_enabled, ); list.sort_by(|o1, o2| o2.weight().partial_cmp(&o1.weight()).unwrap()); // decreasing order let mut summary_point...
Rust
0
print("we are working on kali to host you can use termux")
Python
1
""" 安全掃描器 此模組提供全面的安全掃描功能,包括漏洞檢測、安全標頭檢查等。 """ import re import json import time from typing import Dict, List, Any, Optional, Tuple from dataclasses import dataclass, field from datetime import datetime import requests from fastapi.testclient import TestClient @dataclass class SecurityIssue: """安全問題資料類""" s...
Python
1
""" #195 Google Let A be an N by M matrix in which every row and every column is sorted. Given i1, j1, i2, and j2, compute the number of elements of M smaller than M[i1, j1] and larger than M[i2, j2]. For example, given the following matrix: [[1, 3, 7, 10, 15, 20], [2, 6, 9, 14, 22, 25], [3, 8, 10, 15, 25, 30], ...
Python
1
g: TestProprietaryReferences._debug("test_parse_property_reference") # create an application app = Application() # test without vendor reference with pytest.raises(ValueError): property_reference = await app.parse_property_reference( "proprietary...
Python
1
from fastapi import APIRouter, Depends, status from fastapi.responses import JSONResponse from gradient_descent.controller.request_form.predict_request_form import PredictRequestForm from gradient_descent.service.gradient_descent_service_impl import GradientDescentServiceImpl gradientDescentRouter = APIRouter() asy...
Python
1
; // First resolve should block per the handler we use. let pkg1_resolve_fut = env.resolve_package(&pkg1_url); // Get the BlockedResponse to make sure we're blocking the above resolve // before we try to resolve the second package. let blocked_response = chan.next().await.unwrap(); // Now await...
Rust
0
r|t dt |d| S|s|s|t dS|td|S|s|j|j}d}nt|jt|j|jd}|j|j|}t|}t|} |dkr:t|jd || j\}} nt|j| jd | \}} | rt|d dkr|d7}n8|j|j} || kr|d dkr|d }|d7}qt |t||}||S) zReturn self / other.Nz...
Python
1
 c@s(ddlZdZejjdZdS(iNs$Id$tDISTUTILS_DEBUG(tost __revision__tenvirontgettDEBUG(((sdebug.pyt<module>s 
Python
1
mskw_ZMMf32_ZMMf32_IMM8_AVX512 = 5816, XED_IFORM_VSHUFF64X2_YMMf64_MASKmskw_YMMf64_MEMf64_IMM8_AVX512 = 5817, XED_IFORM_VSHUFF64X2_YMMf64_MASKmskw_YMMf64_YMMf64_IMM8_AVX512 = 5818, XED_IFORM_VSHUFF64X2_ZMMf64_MASKmskw_ZMMf64_MEMf64_IMM8_AVX512 = 5819, XED_IFORM_VSHUFF64X2_ZMMf64_MASKmskw_ZMMf64_ZMMf64_I...
Rust
0
w(active_enum::Column::Id) .integer() .not_null() .auto_increment() .primary_key(), ) .col(ColumnDef::new(active_enum::Column::Category).string_len(1)) .col(ColumnDef::new(active_enum::Column::Color).integer()) .col( ...
Rust
0
from typing import Optional from django.contrib import messages from allauth.account.adapter import get_adapter as get_account_adapter from allauth.account.internal.flows.reauthentication import ( raise_if_reauthentication_required, ) from allauth.mfa import app_settings, signals from allauth.mfa.models import Au...
Python
1
butions in binary form must reproduce the above copyright notice, this list of conditions and the // following disclaimer in the documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote // p...
Rust
0
""" control_surfaces > event_patterns > event_pattern Contains the definition for IEventPattern, the interface that all event patterns must inherit from. Authors: * Maddy Guthridge [hello@maddyguthridge.com, HDSQ#2154] This code is licensed under the GPL v3 license. Refer to the LICENSE file for more details. """ f...
Python
1
(self.events.iter() .map(|Event { trigger, handler }| DomItem::Event { trigger: trigger, handler: match handler { Handler::Msg(m) => EventHandler::Msg(m), Handler::Event(h) =>...
Rust
0
), ) CloseMessageWindow() SetScenaFlags(ScenaFlag(0x0286, 1, 0x1431)) SetScenaFlags(ScenaFlag(0x0000, 3, 0x3)) def _loc_17BF(): pass label('loc_17BF') Jump('loc_1C9D') def _loc_17C2(): pass label('loc_17C2') If( ( (Expr.TestScenaFlags, ScenaFlag(0x0...
Python
1
impl WorldConfigBuilder { /// Create a new WorldConfigBuilder with default values. pub fn new() -> Self { Self { max_clients: DEFAULT_MAX_CLIENT, chunk_size: DEFAULT_CHUNK_SIZE, min_chunk: DEFAULT_MIN_CHUNK, max_chunk: DEFAULT_MAX_CHUNK, max_...
Rust
0
WHIP; /// <div style="background-color: #FFDAB9; width: 25px; height: 25px"></div> pub const PEACH_PUFF: Color = PEACH_PUFF; /// <div style="background-color: #CD853F; width: 25px; height: 25px"></div> pub const PERU: Color = PERU; /// <div style="background-color: #FFC0CB; width: 25px; height: 25px...
Rust
0
] fn next_u64_test() { let mut xoshiro = Xoshiro256SS::from_seed(0); assert_eq!(xoshiro.next_u64(), 16053376993090331485); } #[test] fn rol_test_0_1() { assert_eq!(rol(0, 1), 0); } } #![allow(dead_code)] extern crate num_bigint; extern crate num_traits; extern crate num_...
Rust
0
ec<u8> { unsafe { from_raw_parts(args_ptr, args_length).to_vec() } } pub fn rpc_response<T: Serialize>(args: T) -> *mut u8 { let bytes = to_vec(&args).unwrap(); let args_len = bytes.len(); let total_len = args_len + size_of::<u32>(); let result_ptr = malloc(total_len); unsafe { let slice = from_raw_par...
Rust
0
i32 != 0 { let ref mut fresh16 = *dest.offset((pos / 2i32) as isize); *fresh16 = (*fresh16 as i32 + 0xfi32) as card8; pos += 1 } else { if destlen < pos / 2i32 + 1i32 { _tt_abort( b"%s: Buffer overflow.\x00" as *const u8 as *const i8, b"CFF...
Rust
0
""" 1. 期货品种的沉淀资金是未平仓的期货合约(持仓量)所占用的保证金. 期货品种的沉淀资金越大说明这个品种非常受资金喜欢. 相反,如果期货品种的沉淀资金越小,说明这个品种越冷门. 2. 期货交易的本质就是资金的重新分配, 品种的沉淀资金越大, 未来有出现较大级别行情的机会就越大. """ import os import re from public_module.tqz_extern.tools.pandas_operator.pandas_operator import pandas from public_module.tqz_extern.tools.file_path_operator.file_path_o...
Python
1
from django.urls import path from chain_stores.views import SupplierCreateView, SupplierListView, SupplierUpdateView, SupplierRetrieveView, \ SupplierDestroyView, ContactsCreateView, ContactsListView, ContactsUpdateView, ProductListView, ProductCreateView, \ ProductUpdateView urlpatterns = [ path('', Suppl...
Python
1
on/outgoing.c\x00" as *const u8 as *const libc::c_char, 382i32); return } if (*selection).window != (*req).owner { _wlr_log(WLR_DEBUG, b"[%s:%d] received selection request with invalid owner\x00" as *const u8 as *const libc::c_char, ...
Rust
0
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # 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 appli...
Python
1
rsal of InChI failed, InChIKey is computed with warning issued sikey = cast( szIKey, c_char_p).value.decode("utf-8") if (calc_xkey==1): sxtra1 = cast( szXtra1, c_char_p).value.decode("utf-8") sxtra2 = cast( szXtra2, c_char_p).value.decode("utf-8") ...
Python
1
rc}; use crate::env; use crate::serializable_traits::Data; use crate::shuffle::*; use futures::future; use hyper::{client::Client, Uri}; use tokio::sync::Mutex; /// Parallel shuffle fetcher. pub(crate) struct ShuffleFetcher; impl ShuffleFetcher { pub async fn fetch<K: Data, V: Data>( shuffle_id: usize, ...
Rust
0
ers.flatten(c) def max_pool(x, filter_height, filter_width, stride_y, stride_x, name, padding='SAME'): return tf.nn.max_pool(x, ksize=[1, filter_height, filter_width, 1], strides = [1, stride_y, stride_x, 1], padding = padding, name=name) def lrn(x, radius, alpha, beta, name, bias=1.0): ...
Python
1
InteractiveRoot, Methods, PartialDebug}; // These are required for now use ::core::ops::*; use ::core::option::Option::*; use ::core::result::Result::*; use ::rusteval::inventory; struct NoDebug; #[derive(Interactive, PartialDebug)] struct ChildStruct { last_sum: f32, no_debug: NoDebug, } #[Methods] impl C...
Rust
0
def evaluate_accuracy_gpu(net, data_iter, device=None): """使用GPU计算模型在数据集上的精度 Defined in :numref:`sec_lenet`""" if isinstance(net, nn.Module): net.eval() # 设置为评估模式 if not device: device = next(iter(net.parameters())).device # 正确预测的数量,总预测的数量 metric = d2l.Accumulator(2) ...
Python
1
wrapping_mul(0x100_0000_01b3); self.0 ^= u64::from(*b); } } fn finish(&self) -> u64 { self.0 } } } // Copyright 2018 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT li...
Rust
0
s us efficiently record iovec buffers. fn is_same_source(&self, other: &ParamSize) -> bool { ((!self.mem_ptr.is_null() && other.mem_ptr == self.mem_ptr) || (self.from_syscall && other.from_syscall)) && (self.read_size == other.read_size) } } /// Modes used to register syscall me...
Rust
0
#!/usr/bin/python # # Copyright 2016 Google Inc. All Rights Reserved. # # 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 b...
Python
1
u32::from_be_bytes([decrypted[4], decrypted[5], decrypted[6], decrypted[7]]); let index; { if let Some(state) = self.get_srtcp_ssrc_state(ssrc) { state.srtcp_index += 1; if state.srtcp_index > MAX_SRTCP_INDEX { state.srtcp_index = 0; ...
Rust
0
::Value(new_prefix.clone())); } self.work .push(IterItem::Node(node.left.as_ref(), prefix.clone())); } } } } } #[allow(dead_code)] pub fn dead_nodes<P>(trie: &TernaryTrie<P>) -> bool where P: Priority, { de...
Rust
0
elf.visualize: origin_lidar = [cav_content['origin_lidar']] # processed lidar dictionary processed_lidar_torch_dict = \ self.pre_processor.collate_batch( [cav_content['processed_lidar']]) # label dictionary label_torch_...
Python
1
""" 分别使用 while和for完成九九乘法表打印 1*1=1 2*1=2 2*2=4 3*1=3 3*2=6 3*3=9 4*1=4 4*2=8 4*3=12 4*4=16 5*1=5 5*2=10 5*3=15 5*4=20 5*5=25 6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36 7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49 8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64 9*1=9 9*2=1...
Python
1
create a list of questions. //! #![cfg_attr(feature = "macros", doc = "```")] #![cfg_attr(not(feature = "macros"), doc = "```ignore")] //! use requestty::{questions, Answers}; //! //! let questions = questions! [ //! Expand { //! name: "toppings", //! message: "What toppings do you want?", //! ...
Rust
0
"Bentley", "Conti GT3 24h", 45, 70, 55, 80, Some("steer. ratio 14:1 (odd)"), ), CarInfo::new("Bentley", "Speed 8", 40, 55, 45, 60, Some("caster 9.1")), CarInfo::new("BMW", "1M Coupe", 45, 55, 50, 65, None), ...
Rust
0
from sentence_transformers import SentenceTransformer _model = None def get_model(): global _model if _model is None: _model = SentenceTransformer("all-mpnet-base-v2") return _model
Python
1
ement, None::<Box<dyn FnOnce(SqlitePrimaryResult, String)>>).unwrap(); /// /// sql.kill(); /// db.close(); /// ``` #[inline] pub fn kill(&self) -> SqlitePrimaryResult { unsafe { SqlitePrimaryResult::from_i8(sqlite3_finalize(self.0) as i8) } } } use std::{convert, fmt, iter, ops}; pu...
Rust
0
_data() { let mut t = new_test_ext(); let (offchain, state) = testing::TestOffchainExt::new(); t.register_extension(OffchainWorkerExt::new(offchain)); // Exists // btcusdt -> 1u8 , 1,2,3,4 // ethusdt -> 2u8 , 2,4, // dotusdt -> 3u8 , 3, // xrpusdt -> 4u8 , 4 t.execute_with(|| {}); } #[test] fn make_bulk_pri...
Rust
0
rIrIrIrJrL rc@seZdZdZdZdS)rAsk for a filename to save asZtk_getSaveFileN)rrrrr*rIrIrIrJr`src@r)rzAsk for a directoryZtk_chooseDirectorycC...
Python
1
let ctx = Context { count: 0 }; let r = router.find(&Method::GET, "/users/1"); assert!(r.is_some()); let (h, p) = r.unwrap(); assert_eq!(h((ctx)), 3); assert_eq!(p, [("user_id", "1")]); let ctx = Context { count: 0 }; let r = router.find(&Method::PATCH, "/users/1...
Rust
0
ror>) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; CResult_InMemorySignerDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } CResult_I...
Rust
0
PersistentVolume) -> Option<CellSpec<'_>> { volume .spec .as_ref() .and_then(|spec| spec.volume_mode.as_ref().map(|mode| mode.as_str().into())) } fn volume_status(volume: &api::PersistentVolume) -> Option<CellSpec<'_>> { volume .status .as_ref() .and_then(|stat| ...
Rust
0
from django.contrib import admin from .models.articles import Article # Register your models here. admin.site.register(Article)
Python
1
from .tableau_connection import TableauConnectionManager from .oracle_connection import OracleConnectionManager from .aws_connection import AWSConnectionManager from .redshift_connection import RedshiftConnectionManager from .config_manager import ConfigManager __all__ = [ "TableauConnectionManager", "OracleCo...
Python
1
res_sset) } fn minus(lhs_zdd: &Zdd, rhs_zdd: &Zdd, lhs_sset: &SSet, rhs_sset: &SSet) -> (Zdd, SSet) { let name = "minus"; // if * lhs_sset != lhs_zdd.to_set() || * rhs_sset != rhs_zdd.to_set() { // panic!("{} | inconsistent inputs", name) // } let res_zdd = lhs_zdd - rhs_zdd; let res_sset = ...
Rust
0
ze)); /* A bit inefficient: we process more data than needed if */ /* resno_decoded < l_tile_comp->minimum_num_resolutions-1, */ /* but we would need to take into account a stride then */ l_samples = (((*res_comp0).x1 - (*res_comp0).x0) as OPJ_SIZE_T) .wrapping_mul(((*res_comp0).y1 - (*res_comp0)....
Rust
0
t = (1,2,3) print(t)
Python
1
println!("Got a ping!"); Handled::Ok } } #[derive(ComponentDefinition)] pub struct GenericComp<A: MessageBounds> { ctx: ComponentContext<Self>, test: Option<A>, } impl<A: MessageBounds> GenericComp<A> { fn new() -> Self { GenericComp { ctx: ComponentContext::uninit...
Rust
0
n", allocation_hob.alloc_descriptor.memory_type as u32, allocation_hob.alloc_descriptor.memory_base_address, allocation_hob.alloc_descriptor.memory_base_address + allocation_hob.alloc_descriptor.memory_length - 1, ); } #[cfg(not(test))] fn dump_fv_hob(fv_hob: & FirmwareVolume) { log!( "FirmwareVo...
Rust
0
"updated_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE ("date") ); -- 创建索引 CREATE INDEX IF NOT EXISTS "idx_midscene_sessions_session_id" ON "midscene_sessions" ("session_id"); CREATE INDEX IF NOT EXISTS "idx_midscene_sessions_user_id" ON "midscene_sessions"...
Python
1
mesh = pyrender.Mesh.from_trimesh(mesh, material=material, smooth=data.get('smooth', True)) else: mesh = trimesh.Trimesh(vert, faces, vertex_colors=data['colors'], process=False) mesh.apply_transform(rot) mesh = pyrender.Mes...
Python
1
ast( smsg ).await; })} } pub struct ConnectionClosed( pub usize ); impl Message for ConnectionClosed { type Return = (); } impl Handler< ConnectionClosed > for Server { fn handle( &mut self, msg: ConnectionClosed ) -> Return<()> { Box::pin( async move { let _ = self.users.remove( &msg.0 ); let smsg = Ser...
Rust
0
} #[test] fn test_flow_control_trottle_deadline() { let engine = TestEngineBuilder::new().build().unwrap(); let config = Config { scheduler_concurrency: 1024, scheduler_worker_pool_size: 1, scheduler_pending_write_threshold: ReadableSize(100 * 1024 * 1024),...
Rust
0
"""Configuration for VeSync tests.""" from __future__ import annotations from unittest.mock import Mock, patch import pytest from pyvesync import VeSync from pyvesync.vesyncbulb import VeSyncBulb from pyvesync.vesyncfan import VeSyncAirBypass from pyvesync.vesyncoutlet import VeSyncOutlet from pyvesync.vesyncswitch ...
Python
1
u8])] = &[ (&[], &hex!("cf83e1357eefb8bd f1542850d66d8007 d620e4050b5715dc 83f4a921d36ce9ce 47d0d13c5d85f2b0 ff8318d2877eec2f 63b931bd47417a81 a538327af927da3e")), (&[0; 111], &hex!("77ddd3a542e530fd 047b8977c657ba6c e72f1492e360b2b2 212cd264e75ec038 82e4ff0525517ab4 207d14c70c2259ba 88d4d335ee0e7e20 543d22102a...
Rust
0
ge(3): nazwisko = input("Podaj nazwisko czytelnika: ") imie = input("Podaj imię czytelnika: ") numer_karty = input("Podaj numer karty bibliotecznej: ") liczba_ksiazek = int(input("Podaj liczbę wypożyczonych książek: ")) Czytelnik(nazwisko, imie, numer_karty, liczba_ksiazek) # Wywołania metod Czytel...
Python
1
=> shuffle_done!($x01, $x23, $x45, 0), 0b01 => shuffle_done!($x01, $x23, $x45, 1), 0b10 => shuffle_done!($x01, $x23, $x45, 2), _ => shuffle_done!($x01, $x23, $x45, 3), } }; } macro_rules! shuffle_x45 { ($x01:expr, $x23:expr) => { ...
Rust
0
(self, path, argd): # 快速进行一次任务,主要用于预览 msnInfo = { "onGet": self._onPreview, "argd": argd, } msnList = [{"path": path}] self.msnID = MissionOCR.addMissionList(msnInfo, msnList) # ========================= 【任务控制器的异步回调】 ========================= def _onSta...
Python
1
BaseEditor Hooks # def setup_proxies(self): _BasePaymentChangeDialog.setup_proxies(self) self._temp_model = _TempDateModel() self._date_proxy = self.add_proxy(self._temp_model, ('due_date', )) def create_model(self, store): model = _BasePaymentChangeDialog.create_model(sel...
Python
1
report]) if args.email_report: send_email_report("OSINT Report", report_str, "recipient@example.com", os.getenv("SMTP_USER"), os.getenv("SMTP_PASS")) if args.slack_report: send_slack_alert(os.getenv("SLACK_WEBHOOK"), report_str) if args.pdf_report: generate_pdf_report(risk_report)...
Python
1
a: null));\n"), "b {\ \n c: from loaded;\ \n}\n" ); } #[test] #[ignore] // unexepected error fn unconfigured() { let runner = runner().with_cwd("unconfigured"); assert_eq!( runner.ok( ...
Rust
0
"""API ViewSet for MaildomainAccess model.""" from django.shortcuts import get_object_or_404 from drf_spectacular.utils import extend_schema from rest_framework import mixins, viewsets from core import models from core.api import permissions as core_permissions from core.api import serializers as core_serializers ...
Python
1
&addresses[1], ActorState::new( ACCOUNT_ACTOR_CODE_ID.clone(), ACCOUNT_ACTOR_CODE_ID.clone(), BigInt::from(55), 1, ), ) .unwrap(); tree.set_actor( &addresses[2], ActorState::new( ACCOUNT_ACTOR_CODE_ID.clone(...
Rust
0
# src/interpretability_shap.py import pandas as pd import shap import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import train_test_split from pathlib import Path import os # Load enriched article data DATA_PATH = Path("data/articles_with_sentiment.csv") df...
Python
1
""" sphinx extension for conditional toc """ import re from sphinx.directives.other import TocTree # adpoted from https://stackoverflow.com/a/46600038 def setup(app): app.add_directive("toctree-filt", TocTreeFilt) return {"version": "1.0.0"} class TocTreeFilt(TocTree): """ Directive to notify Sphi...
Python
1
loat(test_case.get("points", 0)), self.round_digits ) test_verdict = test_case.get("verdict", "RE") test_message = self.result_messages.get( test_verdict, self.result_messages["RE"] ) execution_time = 0 ...
Python
1
a = 1 b = 1.1 c = "Test" d = True e = [] f = () g = {}
Python
1
import sys import h5py import numpy as np from tqdm import tqdm import polars as pl if __name__ == '__main__': #"${proj_dir}/databases/per-protein.h5" original_embs_path = sys.argv[1] ids_path = sys.argv[2] #output_dir+'/emb.prottrans.npy.gz' output_file = sys.argv[3] ids_list = open(ids_path,...
Python
1
} match &focused.0 { Some(v) => { let v: String = (*v).into(); tts.speak(v, true)?; } None => { tts.speak("Everything", true)?; } }; } Ok(()) } fn exploration_focus( mut commands: Comman...
Rust
0
c = "`read()` method returns [imr::R](imr::R) reader structure"] impl crate::Readable for IMR {} #[doc = "`write(|w| ..)` method takes [imr::W](imr::W) writer structure"] impl crate::Writable for IMR {} #[doc = "Interrupt Mask Register"] pub mod imr; #[doc = "Interrupt Status Register\n\nThis register you can [`read`](...
Rust
0
move |input: &str| { let mut rst = vec![]; let mut i = input; // debug!("collect_opt_pair input : {}", i); while let Ok((r, t)) = parser(i) { // debug!("collect_opt_pair i : {}, r: {}", i, r); i = r; match t { (Some(a), Some(b)) => { ...
Rust
0
m image = self.transform.apply_image(image) resize = image.shape[:2] image = self.preprocess(torch.from_numpy(image).permute(2, 0, 1).contiguous()) masks = [] ann = annotations[sampled_ann_id] if len(ann["segmentation"]) == 0 and sampled_sent != "": m = np.ze...
Python
1
# import qgis libs so that ve set the correct sip api version import qgis # pylint: disable=W0611 # NOQA
Python
1
from dspygen.modules.file_name_module import file_name_call from dspygen.modules.gen_keyword_arguments_module import invoke from dspygen.modules.to_elixir_module import to_elixir_call from dspygen.utils.dspy_tools import init_dspy def python_to_elixir(python_code): return to_elixir_call(python_code) # Write t...
Python
1
}",sub); //输出 :你 }<reponame>neri/toe // NEC PC-98 Series Computer Dependent use super::pic::Irq; use crate::io::hid::*; static mut PC98: Pc98 = Pc98::new(); pub struct Pc98 { key_modifier: Modifier, mouse_state: MouseState, } impl Pc98 { const PORT_MOUSE_CTRL: usize = 0x7FDD; const PORT_MOUSE_RE...
Rust
0
tensor at the moment? return output_predictions def get_segmented_image_plot(self): """ Get a coloured plot where the image is segmented and colours assigned based on the class present in each part of the image """ output_predictions = self.update_model() pal...
Python
1
#[derive(Serialize, Deserialize, Clone, Copy)] pub struct RequestOption { /// size for the mpsc channel. #[serde(default = "_default_1")] pub queue_size_hint: usize, } impl Default for RequestOption { fn default() -> Self { Self { queue_size_hint: 1 } } } pub trait ParseRequest: Sized { ...
Rust
0
alue, cls=JobEncoder) expected = [ "a", 1, { "_type": "etree_element", "value": '<root attr="val"><child attr="val"/></root>', }, ] self.assertEqual(json.loads(value_json), expected) def test_decoder_etree(self)...
Python
1
_element_space(mesh) .with_operator(&LaplaceOperator) .with_quadrature_table(&quadrature) .with_u(&u) .build(); let mut a_global = matrix_assembler.assemble(&laplace_assembler)?; // Compare with parallel CSR assembler { let par_a_global = CsrParAssembler::default()....
Rust
0