text
string
label_name
string
labels
int64
aiters } pub fn external_messages(&self) -> &MessagesPool { &self.external_messages } pub fn shard_blocks(&self) -> &ShardBlocksPool { &self.shard_blocks } pub fn set_will_validate(&self, will_validate: bool) { self.will_validate.store(will_validate, Ordering::SeqCst);...
Rust
0
0 #[macro_use] mod common; use zmq::Context; test_capability!(test_getset_gssapi_server, "gssapi", { let ctx = Context::new(); let sock = ctx.socket(zmq::REQ).unwrap(); sock.set_gssapi_server(true).unwrap(); assert_eq!(sock.is_gssapi_server().unwrap(), true); }); test_capability!(test_getset_gssapi_p...
Rust
0
io::Seek //! [`Path`]: std::path::Path //! [`File`]: std::fs::File //! [`new`]: RsMerger::new //! [`pad_with`]: RsMerger::pad_with //! [`skip_head`]: RsMerger::skip_head //! [`skip_tail`]: RsMerger::skip_tail //! [`force_ending_newline`]: RsMerger::force_ending_newline //! [`merge_sources_into`]: RsMerger::merge_source...
Rust
0
[derive(Clone, Copy, Encodable, Eq, PartialEq)] pub struct CoexistentTagAllocationAuthorityTemplate<'l> { #[tlv(application, primitive, number = "0xF")] // = 0x4F pub application_identifier: &'l [u8], } impl Default for CoexistentTagAllocationAuthorityTemplate<'static> { fn default() -> Self { Sel...
Rust
0
# Depth First Search (DFS) implementation for a warehouse graph # Sample warehouse graph as an adjacency list warehouse_graph = { 'A': ['B', 'C'], 'B': ['D', 'E'], 'C': ['F'], 'D': [], 'E': ['F'], 'F': [] } # Function to perform DFS def dfs(graph, start, goal, visited=None, path=None): if ...
Python
1
) with pytest.raises(InvalidActivity): ensure_activity_is_valid( { "name": "can-use-numbers", "type": "probe", "provider": { "type": "python", "module": "os.path", "func": "exists", ...
Python
1
ithmeticOperator::Mul => self * rhs, DataValueArithmeticOperator::Div => self / rhs, DataValueArithmeticOperator::Modulo => self % rhs, } } } /* * Copyright (c) 2015-2021, SALT. * This file is part of HashtagBlessedII and is distributed under the 3-clause BSD license. * See LICENS...
Rust
0
None, None, Some(SDIO_0), None, None, None, None, Some(USB1_0), Some(USB1_NEEDCLK_0), Some(HYPERVISOR_0), // 50 Some(SGPIO_INT0_IRQ0_0), Some(SGPIO_INT0_IRQ1_0), Some(PLU_0), Some(SEC_VIO_0), Some(HASH_0), Some(CASPER_0), Some(PUF_0), Some(PQ_0),...
Rust
0
($state:ident, $ident:expr, $tag:ident, $message:expr) => {{ $state.apply(&vsl($tag, $ident, $message)).expect(&format!("expected apply to return Ok after applying: `{}, {:?}, {};`", $ident, $tag, $message)); }}; } macro_rules! apply_last { ($state:ident, $ident:expr, $tag:...
Rust
0
header_text: header_text, } } pub fn click_handler(&mut self, ctx: &mut ggez::Context, point: numeric::Point2f) { let maybe_grid_position = self.title_table_frame.get_grid_position(ctx, point); if let Some(grid_position) = maybe_grid_position { self.last_clicked...
Rust
0
!(dovi_rpu.dovi_profile, 7); let parsed_data = dovi_rpu.write_hevc_unspec62_nalu()?; assert_eq!(&original_data[4..], &parsed_data[2..]); Ok(()) } #[test] fn fix_se_write() -> Result<()> { let (original_data, dovi_rpu) = _parse_file(PathBuf::from("./assets/tests/fix_se_write.bin"))?; assert_eq!(do...
Rust
0
############################################################################ # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
Python
1
import pytest @pytest.mark.parametrize( "word,lemma", [("新しく", "新しい"), ("赤く", "赤い"), ("すごく", "すごい"), ("いただきました", "いただく"), ("なった", "なる")], ) def test_ja_lemmatizer_assigns(ja_tokenizer, word, lemma): test_lemma = ja_tokenizer(word)[0].lemma_ assert test_lemma == lemma @pytest.mark.parametrize( "w...
Python
1
in our own archive", ) })?; if archive_identity != required_script_identity { return Err(std::io::ErrorKind::NotFound.into()); } for entry in tar::Archive::new(&mut &*archive_buf).entries()? { let mut entry = entry?; let path = entry.path()?; if path.to_...
Rust
0
import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))) from backend.embeddings.embedder import Embedder import numpy as np from sklearn.metrics.pairwise import cosine_similarity class QueryRewriter: def __init__(self): self.embedder = Embedder() def re...
Python
1
ULSE_SHAPE_3_TX_COEF11_A::TX_PULSE_SHAPE_3_TX_COEF11_DEFAULT), i => Res(i), } } #[doc = "Checks if the value of the field is `TX_PULSE_SHAPE_3_TX_COEF11_DEFAULT`"] #[inline(always)] pub fn is_tx_pulse_shape_3_tx_coef11_default(&self) -> bool { *self == TX_PULSE_SHAPE_3_TX_COE...
Rust
0
$($extern_fn_body)* } )* } } internal_58e1!(); }; } // This macro replaces 9 lines of code with 5 lines of a lot simpler code. Without it, the // extern function name, the closure type, and the token name have to be repeated twice, and the // hash nam...
Rust
0
", tv.tv_sec, tv.tv_usec) } } fn fmt_timespec(f: &mut fmt::Formatter, tp: u64) -> fmt::Result { if tp == 0 { write!(f, "NULL") } else { let tp = unsafe { core::ptr::read(tp as *const timespec) }; write!(f, "{{tv.sec: {}, tv.tv_nsec: {}}}", tp.tv_sec, tp.tv_nsec) } } #[repr(C)] ...
Rust
0
from pydantic import BaseModel from datetime import datetime class JobResponse(BaseModel): id: int title: str employer: str location: str salary: str content: str url: str time: str created_at: datetime class Config: from_attributes = True
Python
1
"maltese", "\u{2720}"), (b"map", "\u{21A6}"), (b"mapsto", "\u{21A6}"), (b"mapstodown", "\u{21A7}"), (b"mapstoleft", "\u{21A4}"), (b"mapstoup", "\u{21A5}"), (b"marker", "\u{25AE}"), (b"mcomma", "\u{2A29}"), (b"mcy", "\u{043C}"), (b"mdash", "\u{2014}...
Rust
0
"/" + output_filename, EIF_output_dict, EIF_output_names + ["mu_vals", "sigma_vals", "freq_vals"], params, ) # optional shortcuts: mu_vals = EIF_output_dict["mu_vals"] sigma_vals = EIF_output_dict["sigma_vals"] freq_vals = EIF_output_dict["freq...
Python
1
t_1[pc_mat_1[:, 1] > y_msb, 1] = y_msb pc_mat_1[pc_mat_1[:, 2] < z_lsb, 2] = z_lsb pc_mat_1[pc_mat_1[:, 2] > z_msb, 2] = z_msb if last_channel_type == 'confidence': pc_mat_1[pc_mat_1[:, 3] > snr_msb, 3] = snr_msb elif last_channel_type == 'velocity': ...
Python
1
self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write!(f, "sse error") } } impl StdError for SseError { fn description(&self) -> &str { "sse error" } } impl Display for SseField { fn fmt(&self, f: &mut Formatter) -> fmt::...
Rust
0
. And taking the `acos` of it then would // result in NaN. if cos_angle > T::one() { cos_angle = T::one(); } Radians::acos(cos_angle) } /// Clamps `val` into the range `min..=max`. /// /// The trait bound *should* technically be `Ord`, but that's inconvenient when /// dealing with floats. When ...
Rust
0
string_literal_long_single_quote(0, 15) ]) ] }; } #[test] fn iri_test() { parses_to! { parser: TurtleParser, input: "<http://www.example.com>", rule: Rule::iri, tokens: [ iri(0, 24, [ iriref(0, 24) ]) ...
Rust
0
Weekday::Wednesday, 4 => Weekday::Thursday, 5 => Weekday::Friday, 6 => Weekday::Saturday, _ => panic!("why is negative modulus designed so?") } } } #[cfg(test)] #[test] fn weekdays() { assert_eq!(Weekday::calculate(1970, Month::January, 1), Weekday::Thur...
Rust
0
}", value); println!("i {:?}", i); assert!(i == ""); } Err(Err::Error(e)) | Err(Err::Failure(e)) => { println!( "template_parser::<VerboseError>(data):\n{}", convert_error(&line, e) ); ...
Rust
0
def foo[](): pass type ListOrSet[] = list | set
Python
1
, timeout: TimeoutDict, ) -> AsyncSocketStream: connect_timeout = none_as_inf(timeout.get("connect")) exc_map = { trio.TooSlowError: ConnectTimeout, trio.BrokenResourceError: ConnectError, } with map_exceptions(exc_map): with trio.fail_aft...
Python
1
-> Result<Option<u32>, Error> { let inter = self.inter.read().unwrap(); inter.ceiling_offset(ts, upper) } } <reponame>Extrosoph/CITS3003-project mod blob; <reponame>lowitea/hitbox use crate::response::CacheableResponse; use crate::runtime::RuntimeAdapter; use crate::states::cache_polled::{ C...
Rust
0
net_cfg.clone()); let pinger_system = system_from_network_config(net_cfg); let (ponger, ponger_path) = start_big_ponger(&ponger_system, BigPongerAct::new_lazy()); let (pinger, all_pongs_received_future) = start_big_pinger( &pinger_system, BigPingerAct::new_lazy(ponger_path, SMALL_CHUNK_SIZ...
Rust
0
= "in" && (height >= 59 && height <= 76)) } } }, "hcl" => HCL.is_match(value), "ecl" => ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"].contains(&value), "pid" => PID.is_match(value), "cid" => true, _ => panic!("Invalid field"), } } fn f...
Rust
0
.queue.ff_queue.read(&mut buf[..]) { Ok(_len) => { for (idx, b) in buf.iter().enumerate() { if *b == MAGIC_MARKER_BYTES[sbi] { sbi += 1; if sbi >= 3 { let new_pos = from + idx as u64 - 14; ...
Rust
0
* 160 * 3 + x * 3; let v = *v * 85; self.texture_buffer[offset] = v; self.texture_buffer[offset + 1] = v; self.texture_buffer[offset + 2] = v; } if line_index == 143 { self.texture .update(None, &self.texture_buffer, 160 * 3) ...
Rust
0
clone()); } let vk_hash_gadget = IC::CRHGadget::check_evaluation_gadget(&crh_pp_gadget, &committed_vk)?; let vk_hash_bytes_gadget = vk_hash_gadget.to_bytes()?; /* * check input */ let msg_bytes_gadget = msg_gadget.to_bytes()?; let mut committed_inpu...
Rust
0
::periph_signal!(super::tcc::Tcc1, SigWo1); ::bobbin_mcu::periph_signal!(super::tcc::Tcc1, SigWo2); ::bobbin_mcu::periph_signal!(super::tcc::Tcc1, SigWo3); ::bobbin_mcu::periph_signal!(super::tcc::Tcc2, SigWo0); ::bobbin_mcu::periph_signal!(super::tcc::Tcc2, SigWo1); // TC ::bobbin_mcu::channel_signal!(super::tc::Tc3C...
Rust
0
led = False next_c = c[:] next_n = n # // resolution tTab=self._testTab(cs, [nbRun]*len(cs), earlyExit=True, firstConfFail=True, sortOrder=sortOrder) for i in range(n): if self.debug_dd: print (algo_name+": trying", self....
Python
1
# -*- coding: utf-8 -*- from .baserequest import BaseRequest from oandapyV20.types import TradeID, PriceValue from oandapyV20.definitions.orders import TimeInForce, OrderType class TrailingStopLossOrderRequest(BaseRequest): """create a TrailingStopLossOrderRequest. TrailingStopLossOrderRequest is used to bu...
Python
1
ed_pdf.save() generated_to_be_added, generated_to_be_deleted = tasks.difference_local_minio() expected_to_be_added = {'1/pdf_1.pdf', '1/pdf_2.pdf', '1/pdf_3.pdf', '2/pdf_33.pdf', '1/qr/qr_2.svg'} expected_to_be_deleted = {'1/pdf_7.pdf', '1/pdf_8.pdf', '2/pdf_00.pdf', '2/pdf_11.pdf', '2/qr/qr_2....
Python
1
for `Reg<CITER_TCD2_CITER_ELINKNO_SPEC>`"] pub type CITER_TCD2_CITER_ELINKNO = crate::Reg<citer_tcd2_citer_elinkno::CITER_TCD2_CITER_ELINKNO_SPEC>; #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] pub mod citer_tcd2_citer_elinkno; #[doc = "CITER_TCD2_CITER_ELINKYES register acces...
Rust
0
''' Disclaimer: This solution is not scalable for creating a big world. Creating a game like Minecraft requires specialized knowledge and is not as easy to make as it looks. You'll have to do some sort of chunking of the world and generate a combined mesh instead of separate blocks if you want it to run fast. You can ...
Python
1
on, ) -> Result<(), anyhow::Error> { loop { let tcp = TcpListener::bind(listen_addr).await?; let udp = UdpSocket::bind(listen_addr).await?; let mut sf = ServerFuture::new(init_catalog(self.zt.clone()).await?); sf.register_socket(udp); sf.register_...
Rust
0
_query_version_unchecked(&self) -> bool { has_sym!(self, xcb_xevie_query_version_unchecked) } /// Waits for the reply to a `Xevie::QueryVersion` request. #[inline] pub unsafe fn xcb_xevie_query_version_reply( &self, c: *mut xcb_connection_t, cookie: xcb_xevie_query_versi...
Rust
0
#--------------------------HECHO POR---------------------------- # Hector Alejandro Ortega Garcia grupo: 6E2 Registro: 21310248. #-----------------TEORIA---------------------------------------- #--------------- PROGRAMA ------------------------------------ import networkx as nx def hill_climbing(graph, start_no...
Python
1
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-present Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the F...
Python
1
print_cfg; mod run; mod utils; #[cfg(feature = "souper-harvest")] mod souper_harvest; #[cfg(feature = "wasm")] mod wasm; fn handle_debug_flag(debug: bool) { if debug { pretty_env_logger::init(); } else { file_per_thread_logger::initialize(LOG_FILENAME_PREFIX); } } /// Cranelift code gene...
Rust
0
price = request.json.get('price') if not (name and description and price and stock and price): return jsonify(get_error_response('You must provide a name, description, stock and price')) product = Product.query.filter_by(slug=product_slug).first() if product is None: return get_error_...
Python
1
arr: Vec<i32>) -> bool { let mut target = target; let mut arr = arr; target.sort(); arr.sort(); target == arr } #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } use libc; extern "C" { pub type _IO_wide_data; pub type _IO_codecvt; pub type _...
Rust
0
DbConn; use crate::schema::donation_crypto_addresses; use diesel::prelude::*; #[derive(Debug, Identifiable, Serialize, Queryable)] #[table_name = "donation_crypto_addresses"] pub struct DonationCryptoAddress { pub id: i32, pub name: String, pub code: String, pub address: String, pub history: Stri...
Rust
0
// Exact fee amount is okay let (tx, _ledger) = create_test_tx_with_amount(INITIALIZE_LEDGER_AMOUNT - MINIMUM_FEE, MINIMUM_FEE); assert_eq!(validate_transaction_fee(&tx, MINIMUM_FEE), Ok(())); } { // Overpaying fees is okay let f...
Rust
0
self._model.set_memory_index, mem, banks[3], 1) m.assert_called_once_with(mem) def test_set_memory_index_bad_index(self): mem = chirp_common.Memory() mem.number = 5 banks = self._model.get_mappings() with mock.patch.object(self._model, 'get_memory_mapp...
Python
1
import telebot from telebot import types # Создание бота по YouTube token = '7182378741:AAGWDWoMASuM7MbXqTt_NM1ShAf1jzLo-Jo' my_id = 6948762704 bot = telebot.TeleBot(token) @bot.message_handler(commands=['start']) def start(message): keyboard = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True) b...
Python
1
#Write a python function to find the sum of xor of all pairs of numbers in the given list. def pair_xor_Sum(arr,n) : ans = 0 for i in range(0,n) : for j in range(i + 1,n) : ans = ans + (arr[i] ^ arr[j]) return ans
Python
1
ty: IType::Array(Box::new(IType::F64)), }]; let f64_type_outputs = vec![IType::Array(Box::new(IType::F64))]; let f64_type_sign = fluence_faas::FaaSFunctionSignature { name: Rc::new(String::from("f64_type")), arguments: Rc::new(f64_type_arguments), outputs: Rc::new(f64_type_o...
Rust
0
reponame>devins2518/maqi use super::{ flags::Flags, response::ImapResponse, scanner::{Scan, Scanner}, Response, }; use crate::imap::{error::ImapResult, tag::Tag}; pub struct ListReponse { tag: Tag, inner: Vec<ListInner>, response: ImapResponse, } #[derive(Debug, PartialEq, Eq)] pub struct ...
Rust
0
addr as usize), // the matching pages within the acq region pages: (cut.excluded.end - cut.excluded.start)/PAGE_SIZE, }; trace!("matching_acq={:016x?}", matching_acq); if let Some(ref before) = cut.before { let acq_before = AcquiredMa...
Rust
0
rror: self.app.inform.emit('[WARNING] %s' % _("Permission denied, saving not possible.\n" "Most likely another app is holding the file open and not accessible.")) return # Just for adding it to the recen...
Python
1
acc']:.5f}") logger.info(f"Cohen's Kappa: {model_metrics['avg_kappa']:.5f} \u00B1 {model_metrics['std_kappa']:.5f}") logger.info(f"Geometric Mean Score (weighted): {model_metrics['avg_geom_mean']:.5f} \u00B1 {model_metrics['std_geom_mean']:.5f}") logger.info(f"Sensitivity Score (weighted): {mode...
Python
1
ies and functions. # Note we run this twice since, while constructing the view the first time # there can be side effects of creating variables. _ = _SaveableView(checkpoint_graph_view) saveable_view = _SaveableView(checkpoint_graph_view) # TODO(allenl): Factor out some subset of SavedModelBuilder which is 2...
Python
1
pub fn is_negative(self) -> bool { if let Some(fixnum) = self.to_fixnum() { fixnum < 0 } else { unsafe { ruby::rb_big_sign(self.raw()) == 0 } } } /// Returns whether `self` is a variable-width integer. #[inline] pub const fn is_bignum(self) -> bool { ...
Rust
0
from pyrogram import Client from Emilia import custom_filter from Emilia.helper.chat_status import CheckAllAdminsStuffs from Emilia.mongo.welcome_mongo import GetCleanService, SetCleanService from Emilia.pyro.connection.connection import connection from Emilia.utils.decorators import * CLEAN_SERVICE_TRUE = ["on", "ye...
Python
1
oc.ipath, doc.mimetype) pathismine = True bottle.response.headers['Content-Disposition'] = \ 'attachment; filename="%s"' % os.path.basename(path).encode('utf-8') path = path.encode('utf-8') bottle.response.headers['Content-Length'] = os.stat(path).st_size f = open(path, 'r') if pathi...
Python
1
1).to_number(context)?; // 3. Return ! Number::exponentiate(base, exponent). Ok(x.powf(y).into()) } /// Generate a random floating-point number between `0` and `1`. /// /// More information: /// - [ECMAScript reference][spec] /// - [MDN documentation][mdn] /// /// [sp...
Rust
0
eficiencia_geral: float tendencia_performance: str variabilidade_performance: float total_registros: int registros_baixados: int registros_pendentes: int @dataclass class AnaliseErros: """Análise otimizada e detalhada de erros""" tipos_erro: Dict[str, int] distribuicao_erro_temporal: D...
Python
1
method""" obj = self.CLS() assert obj.is_built_in_admin() is False @pytest.mark.parametrize('sso_groups,rbac_enabled,expected_result', [ ([], True, False), (['validgroup', True, False]), (['validgroup', 'invalidgroup'], True, False), # Passing (['siteadmingr...
Python
1
sing with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` /// property can be either `"quantitative"` (for using a linear bin scale) or [`"ordinal"` /// (for using an ordinal bin /// scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin). /// - When using with [`timeUnit`]...
Rust
0
"SynResultatStruktur" => true, "KoeretoejBlokeringAarsagListeStruktur" => true, "KoeretoejBlokeringAarsagListe" => true, "KoeretoejBlokeringAarsag" => true, "KoeretoejUdstyrSamlingStruktur" => true, "KoeretoejUdstyrSamling" => true, "KoeretoejUdstyrStruktur" => tr...
Rust
0
s); let warn_final = warn + &warn_additional; // Pick a bunch of f flags let num_f_flags = rng.gen_range(0, FLAGS_F.len()) as u64; let f = get_random_n_from_list_into_string(&mut rng, FLAGS_F, num_f_flags); // Pick a bunch of architecture flags. let num_arch_flags = rng.gen_range(0, FLAGS_ARCH...
Rust
0
fo; mod apiv1; use crate::apiv1::*; use crate::vminfo::VMInfo; use std::time::Duration; use rpassword::read_password; extern crate rand; use rand::Rng; use rand::distributions::Alphanumeric; use std::{thread, time}; use std::sync::{Arc, Mutex}; use std::process::Command; use rocket::{response::content, State}; ...
Rust
0
// 0x070 /// ARM7 autoload list hook RAM address? pub arm7_autoload: u32, // 0x074 /// Secure area disable. /// /// By encrypted "NmMdOnly", usually zero. pub secure_area_disable: u64, // 0x078 /// Total ROM size. /// /// Remaining/Unused bytes usually `0xFF` padded. pub rom_s...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import datetime import re from bs4 import BeautifulSoup import scrape_common as sc def strip_value(value): if value: return re.sub(r'[^0-9]', '', value) return None base_url = 'https://www.vs.ch' url = f'{base_url}/web/coronavirus/statistiques' content...
Python
1
n(|e| ui_texts.get_mut(e)) { if let Some(name) = found_name { t.text = format!("{}", name); } else { t.text = "".to_string(); } } } } } } /// The main stat...
Rust
0
edArray<'a0, u32> { js!( @{self}.clearBufferuiv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); ); } pub fn clear_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { js!( @{self}.clearColor(@{red}, @{green}, @{blue}, @{alpha}); ); ...
Rust
0
import os from localPath.configLoader import configOpener def checkWorkflows(repoPath): #Check if any GitHub Actions workflow files exist. workflowsPath = os.path.join(repoPath, ".github", "workflows") config=configOpener() if not os.path.exists(workflowsPath): if not config.get("allowFail...
Python
1
; if oxygen.len() <= 1 { break } } let mut co2 = binaries.clone(); for i in 0..binaries[0].len() { let n_rows = co2.len(); let bit_least = { let sum_of_col = sum_one_column(co2.to_vec(), i); let to_compare_to = n_rows / 2; l...
Rust
0
import time import requests import re import hashlib import json import uuid nonce = "C7DC5CAD-31CF-4431-8635-B415B75BF4F3" device_token = str(uuid.uuid4()).upper() SALT = "FN_Q29XHVmfV3mYX" headers = { 'Host': 'api.sfacg.com', 'accept-charset': 'UTF-8', 'authorization': 'Basic YW5kcm9pZHVzZXI6MWEjJDUxLXl0N...
Python
1
#!/usr/bin/python # # BAD CHARS: \x00\x0a\x0d import time, struct, sys import socket as so try: server = sys.argv[1] port = 5555 except IndexError: print "[+] Usage %s host" % sys.argv[0] sys.exit() badchars = ( "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\...
Python
1
ackApiError as e: self._handel_error(e) return SLACK_ERROR_CODE['API'] return 0 def _send_file(self, file_path, title='', reply_broadcast=False): """can be multithread target""" try: sc = WebClient(self.token) sc.files_upload(title=tit...
Python
1
import sys import unittest from PyQt4 import QtGui import pilasengine class TestIniciar(unittest.TestCase): app = QtGui.QApplication(sys.argv) def setUp(self): self.pilas = pilasengine.iniciar() def testIniciaronTodosLosModulos(self): self.assertTrue(self.pilas.actores, "Existe el modul...
Python
1
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
1
find_best(root).0; MyIterData { best_cost } } } type MyRunner = egg::Runner<Cad, Meta, MyIterData>; sz_param!(PRE_EXTRACT: bool); fn main() { let _ = env_logger::builder().is_test(false).try_init(); let args: Vec<String> = std::env::args().collect(); if args.len() != 3 { panic!("Usage...
Rust
0
e::reflect::rt::v2::make_option_get_ref_simpler_accessor::<_, _>( "syntax", |m: &FileDescriptorProto| { &m.syntax }, |m: &mut FileDescriptorProto| { &mut m.syntax }, FileDescriptorProto::syntax, )); crate::reflect::GeneratedMessageDescriptorData::new_2::<F...
Rust
0
import numpy as np from collections import defaultdict from sklearn import metrics def purity_score(y_true, y_pred): print(f"Shape of y_true: {y_true.shape}") print(f"Shape of y_pred: {y_pred.shape}") # compute contingency matrix (also called confusion matrix) contingency_matrix = metrics.cluster.con...
Python
1
extracted = match.group(0).strip() modules['realtime.rs'].append(f"// {desc}\n{extracted}\n") content = content[:match.start()] + content[match.end():] print(f" 提取了 {desc}") # 提取测试代码 print("提取测试代码...") test_patterns = [ (r'#\[cfg\(t...
Python
1
.map(AtomicRefCell::borrow) } pub fn borrow_mut(&self, resource_type_id: &TypeId) -> Option<AtomicRefMut<ResourceCell>> { self.resources .get(resource_type_id) .map(AtomicRefCell::borrow_mut) } } use core::time::Duration; use core::arch; use super::{bootstrap,time}; /// 中断标...
Rust
0
or. pub fn structure(error: NbtStructureError) -> Self { NbtReprError::Structure(Box::new(error)) } /// Creates a `NbtReprError` from the given error. If the given error is a [`NbtStructureError`], /// then the resulting representation error is of the `Structure` variant. If the error is a ...
Rust
0
pub fn inb(&self) -> u8 { unsafe { inport_b(self.port) } } } /// Implementation of Write for the Serial port. impl ::core::fmt::Write for Serial { fn write_str(&mut self, src: &str) -> ::core::fmt::Result { for byte in src.bytes() { self.outb(byte); } Ok(()) } } /// Externally defined...
Rust
0
U, E> Iterator for AndThen<I, F> where I: Iterator<Item = Result<T, E>>, F: FnMut(T) -> Result<U, E>, { type Item = Result<U, E>; fn next(&mut self) -> Option<Self::Item> { self.iter.next().map(|v| v.and_then(&mut self.f)) } fn size_hint(&self) -> (usize, Option<usize>) { self...
Rust
0
()> { match VerifyKey::new(&bytes) { Ok(v) => Ok(Secp256k1Point { purpose: "random", ge: v, }), Err(_) => Err(()), } } fn to_vec(&self) -> Vec<u8> { // unwrap() is safe because self has been validated on creation ...
Rust
0
>; #[allow(missing_docs)] #[doc(hidden)] pub struct _USBHS_HSTPIPIFR_ISO_MODE; #[doc = "`write(|w| ..)` method takes [usbhs_hstpipifr_iso_mode::W](usbhs_hstpipifr_iso_mode::W) writer structure"] impl crate::Writable for USBHS_HSTPIPIFR_ISO_MODE {} #[doc = "Host Pipe Set Register"] pub mod usbhs_hstpipifr_iso_mode; #[do...
Rust
0
cfpdvek-503[rvdeg] krxqjijamxdb-ljwmh-bcxajpn-849[jxabm] ajmrxjlcren-ljwmh-vjwjpnvnwc-407[yemcd] ahngzyzqcntr-rbzudmfdq-gtms-btrsnldq-rdquhbd-755[dqrbn] rzvkjiduzy-ezggtwzvi-hvmfzodib-291[yuzaf] bwx-amkzmb-ntwemz-aitma-408[mabtw] wihmogyl-aluxy-vumeyn-mufym-812[wymtu] xjmmjndqz-nxvqzibzm-cpi...
Rust
0
}", ident); if ident != IDENT { Err(HeaderError::InvalidIdent)? } let version = read!(HeaderError::ReadVersion); if version != 8 { Err(HeaderError::InvalidVersion)? } Ok(Header { ident, version, skinwidth: rea...
Rust
0
of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, ...
Rust
0
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
_hover: bool, pub documentation: Option<HoverDocFormat>, } impl HoverConfig { fn markdown(&self) -> bool { matches!(self.documentation, Some(HoverDocFormat::Markdown)) } } #[derive(Clone, Debug, PartialEq, Eq)] pub enum HoverDocFormat { Markdown, PlainText, } #[derive(Debug, Clone)] pub e...
Rust
0
'); } pretty_output += "fn"; if let Some(name) = info.map(|info| info.0) { pretty_output.push(' '); pretty_output += name.value; } pretty_output.push('('); match info.map(|info| info.1) { None => { let mut inputs = inputs.iter(); if let Some(input) = inputs.ne...
Rust
0
if res.is_err() { return Err(core::fmt::Error); } } Ok(()) } } <filename>src/v3_10/powerpc64/netlink.rs /* automatically generated by rust-bindgen 0.59.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [...
Rust
0
pe3 = mesh.ElemType(elemCode=DC3D4, elemLibrary=STANDARD) p = mdb.models['Model-1'].parts['Support'] cells = p.cells[:] p.setElementType(regions=(cells,), elemTypes=(elemType1, elemType2, elemType3)) def Job10(): # Define Field Outputs & Create Job a = mdb.models['Model-1'] # Field Outputs # f...
Python
1
30.0), City::new(6974, "Mozambique", "Chibuto", -24.6866667, 33.5305557, 107.0), City::new(6975, "Mozambique", "Ilha de Mocambique", -15.0341667, 40.7358322, 1.0), City::new(6976, "Mozambique", "Mutuali", -14.8705556, 37.0044441, 577.0), City::new(6977, "Mozambique", "Mocimboa", -11.3166667, 40.3499985, 1.0), Cit...
Rust
0
from dataclasses import dataclass, field, asdict from typing import List, Dict, Any from src.common.enums.domain_source import DomainSource from src.common.enums.domain_source_type import DomainSourceType from src.common.enums.env import Env from src.common.enums.etl_layers import ETLLayer from dataclasses import datac...
Python
1