text
string
label_name
string
labels
int64
user_pepito.pcap" eth="eth0" src_hosts="192.168.2.19,192.168.2.130" dst_hosts="192.168.2.19,192.168.2.130" src_nets="192.168.2.0/24" dst_nets="192.168.2.0/24" id="pepito" timeout="60" transaction="1234"' # command = 'control action="net_scan" scan_name="net_scan_user_pepito.pcap" eth="eth0" src_hosts="ANY" dst_h...
Python
1
.chars()).enumerate() { if a != b { eprintln!("char difference at index {}: '{}' != '{}'", index, a, b); } } for (index, (a, b)) in actual.bytes().zip(expected.bytes()).enumerate() { if a != b { eprintln!("byte difference at index {}: b...
Rust
0
test_io!([8] => [3, 9, 7, 9, 10, 9, 4, 9, 99,-1, 8], [0]); test_io!([9] => [3, 9, 7, 9, 10, 9, 4, 9, 99,-1, 8], [0]); // input non-zero (positional) test_io!([0] => [3, 12, 6, 12, 15, 1, 13, 14, 13, 4, 13, 99,-1, 0, 1, 9], [0]); test_io!([1] => [3, 12, 6, 12, 15, 1, 13, 14, 13,...
Rust
0
b) while for G3 it is (b,a)") a, b = "A", "B" G2 = nx.Graph() G2.add_nodes_from((a, b)) G2.add_edges_from([(a, b)]) G3 = nx.Graph() G3.add_nodes_from((b, a)) G3.add_edges_from([(a, a)]) for G in (G2, G3): for n in G: G.nodes[n]...
Python
1
# Copyright 2023 Tecnativa - Carlos Roca # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models class StockPickingType(models.Model): _inherit = "stock.picking.type" force_set_number_of_packages = fields.Boolean() report_number_of_packages = fields.Many2one( ...
Python
1
i)?; let (i, _) = opt(is_a(WHITESPACE))(i)?; let (i, right) = add_expr(i)?; Ok((i, (op, right))) } fn add_expr<'a>(i: &'a str) -> IResult<&'a str, Expr, VerboseError<&'a str>> { let (i, left) = mult_expr(i)?; let left2 = left.clone(); alt(( map(add_expr_inner, move |(op, right)| Expr::b...
Rust
0
ain.insert(i, value) i += 1 i += 1 domains.append(new_domain) return domains # private stuff ################################################################ def _handle_blacklist(blacklist, dirnames, filenames): """remove files/directories in the black list d...
Python
1
#!/usr/bin/env python3 """Teste modernizado para orm.""" import sys import os import unittest from pathlib import Path # Adicionar diretório do projeto ao path project_root = Path(__file__).parent.parent.absolute() sys.path.insert(0, str(project_root)) from ORM.dialetecs.psql import PsqlConnection from ORM.models.mo...
Python
1
column=2) button7 = Button(tk, text=' ', font='Times 20 bold', bg='#4b7fa4', fg='#fcfcec', height=4, width=8, command=lambda: btnClick(button7)) button7.grid(row=5, column=0) button8 = Button(tk, text=' ', font='Times 20 bold', bg='#4b7fa4', fg='#fcfcec', height=4, width=8, command=lambda: btnClick(button8)) button8...
Python
1
.start) .take(right_context.len() - right_dots.len()) .collect::<String>(), right_dots, ); (conditioned_line, offset, marker_size) } /// A suggestion for certain offending span. #[derive(Clone, Hash, PartialEq, Eq)] pub struct Suggestion<'s> { /// Which checker suggested the...
Rust
0
ile_height as f32; tile.corners[rotation.ne()].y -= tile_height as f32; tile.corners[rotation.sw()].y -= tile_height as f32; tile.corners[rotation.se()].y -= tile_height as f32; } tile.apply_slope(tile_slope, rotation, self.tile_height.into()); let mut tile_...
Rust
0
; loop { let w1: WCHAR = *id1.0.offset(offset); let w2: WCHAR = *id2.0.offset(offset); if w1 == 0 && w2 == 0 {return true} if w1 != w2 {return false} offset += 1; } } } } impl Eq for Device { } impl Clo...
Rust
0
// the current context and, if it is valid, pushes it onto our // options. Unrolling this loops lets us avoid dynamic calls through // function pointers and, furthermore, each call site can be branch // predicted and even inlined. This saved us about 30% of time in // t...
Rust
0
import pyaudio audio = pyaudio.PyAudio() for i in range(audio.get_device_count()): device_info = audio.get_device_info_by_index(i) print(f"Index {i}: {device_info['name']} (Input Channels: {device_info['maxInputChannels']})")
Python
1
one if event.key == pygame.K_RETURN: if selected and key is not None: if valid(board, key, selected): board[selected[0]][selected[1]] = key key = None if event.key == pygame.K_UP: ...
Python
1
import pytest import os pytest_plugins = ["dbt.tests.fixtures.project"] def pytest_addoption(parser): parser.addoption("--profile", action="store", default="postgres", type=str) # Using @pytest.mark.skip_profile('postgres') uses the 'skip_by_profile_type' # autouse fixture below def pytest_configure(config): ...
Python
1
HUA_BOLIVIA' : 0x046b, 'TT_MS_LANGID_QUECHUA_ECUADOR' : 0x086b, 'TT_MS_LANGID_QUECHUA_PERU' : 0x0c6b, 'TT_MS_LANGID_SEPEDI_SOUTH_AFRICA' : 0x046c, 'TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA' : 0x046c, 'TT_MS_LANGID_IGBO_NIGE...
Python
1
from collections import deque import cv2 import matplotlib.pyplot as plt import numpy as np from pathlib import PurePath class EpisodeVisualizer: def __init__(self,steps_per,state_dims,video_name,output_path,visualize_rate=100): self.video_name=video_name self.output_path=output_path ...
Python
1
eys(): modules = key.split('.') split = '.' cell_name.append(split.join(modules[:-1])) return list(set(cell_name)) def _create_module_dict(key, val, dropout): """create lora module dict by cell name and rank/alpha""" key_lst = key.split('.') rank, alpha = val key_num = len(...
Python
1
bobox(root, width=47, values=[f"{opt} - {desc}" for opt, desc in [ ("-sS -v", "SYN scan (default), verbose output"), ("-sT -v", "TCP connect scan, verbose output"), ("-sU -v", "UDP scan, verbose output"), ("-sA -v", "ACK scan to determine firewall rules, verbose output"), ("-sP", "Ping scan, no port...
Python
1
::UnexpectedEof.into(), )))), )); return Poll::Ready(event); } }, SubstreamState::ReportError { error, .. } => { let event = ProtocolsHandlerEve...
Rust
0
# Copyright 2020 The TensorFlow 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 applicab...
Python
1
, 5)) losses.update(loss.item(), images.size(0)) top1.update(acc1[0], images.size(0)) top5.update(acc5[0], images.size(0)) # measure elapsed time batch_time.update(time.time() - end) end = time.time() if i % args.print_freq == 0: ...
Python
1
# uncompyle6 version 2.11.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41) # [GCC 9.3.0] # Embedded file name: Exploits\pagelinesExploit.py import requests from Exploits import printModule from Tools import wsoShellUploaderModule r = '\x1b[31m' g = '\x1b[32m' y = '\x1b[...
Python
1
# Generated by Django 5.0.3 on 2024-03-15 19:46 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('job_scraper_app', '0008_alter_user_options_rename_avatar_user_user_avatar_and_more'), ] operations = [ migr...
Python
1
et_status() == "draw": deltas = [0.5, 0.5] elif game.get_status() == "win": deltas = [1, 0] else: raise ValueError("Game status not allowed") for i, state in enumerate(reversed(game.get_state_history())): self.update_no...
Python
1
, splits.next()) { (Some(Ok(a)), Some(Ok(b))) => Ok(Some((a, b))), (Some(Err(e)), _) | (_, Some(Err(e))) => Err(e), _ => Ok(None), }?; } // TODO" => float errors don't work on stable ...
Rust
0
css = ''' <style> .chat-message { padding: 1.5rem; border-radius: 0.5rem; margin-bottom: 1rem; display: flex } .chat-message.user { background-color: #2b313e } .chat-message.bot { background-color: #475063 } .chat-message .avatar { width: 20%; } .chat-message .avatar img { max-width: 78px; max-height:...
Python
1
{ text_document, position, } = text_document_position; let url = text_document.uri; let graphql_sources = match graphql_source_cache.get(&url) { Some(sources) => sources, // If we have no sources for this file, do nothing None => return None, }; info!( ...
Rust
0
v = self.0 as i128; let w = (v / 100000) * 100000; let w = if v - w >= 50000 { w + 100000 } else if w - v >= 50000 { w - 100000 } else { w }; Decimal(w as i64) } /// round to 2 digits /// /// # Example /// ``` ...
Rust
0
# 자료형 dic = dict() # 빈 사전자료 구조 생성, dict 함수 dic['사과'] = 'Apple'#키, 값을 가지는 사전 자료구조 dic['바나나'] = 'Banana'#키, 값을 추가 선언하면 자동 추가됨 dic['코코넛'] = 'Coconut' dic2 = {'a':123123, (1,1):654321, 1:'banana'} # 한번에 여러 데이터 타입의 사전 선언, 대괄호 사용 print(dic) # 값 전체 출력, 참고 : 인덱싱 사용 X print(dic2) # 값 전체 출력 print(type(dic)) # 딕셔너리, 사전 if '사과'...
Python
1
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is...
Python
1
d::os::raw::c_uint, pub __ebx: ::std::os::raw::c_uint, pub __ecx: ::std::os::raw::c_uint, pub __edx: ::std::os::raw::c_uint, pub __edi: ::std::os::raw::c_uint, pub __esi: ::std::os::raw::c_uint, pub __ebp: ::std::os::raw::c_uint, pub __esp: ::std::os::raw::c_uint, pub __ss: ::std::os::ra...
Rust
0
pub fn MFCreateSequencerSegmentOffset(dwid: u32, hnsoffset: i64, pvarsegmentoffset: *mut super::super::System::Com::StructuredStorage::PROPVARIANT) -> ::windows_sys::core::HRESULT; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub fn MFCreateSequencerSource(preserved: ::windows_sys::core::IUnkno...
Rust
0
{00ab}', '\u{00bb}', '\u{2591}', '\u{2592}', '\u{2593}', '\u{2502}', '\u{2524}', '\u{2561}', '\u{2562}', '\u{2556}', '\u{2555}', '\u{2563}', '\u{2551}', '\u{2557}', '\u{255d}', '\u{255c}', '\u{255b}', '\u{2510}', '\u{2514}', '\u{2534}', '\u{252c}', '\u{251c}', '\u{2500}', '\u{253c}', '\u{255e}', '\u{255f}',...
Rust
0
nfft stft = np.concatenate((stft, np.zeros((1, stft_cols))), axis=0) indices = np.floor(times).astype(np.int) alpha = np.expand_dims(times - np.floor(times), axis=1) mag = (1. - alpha) * np.absolute(stft[indices, :]) + alpha * np.absolute(stft[indices + 1, :]) dphi = np.angle(stft[indices + 1, :])...
Python
1
serde_json::json!({ "stateToken": authn.state_token.as_ref().unwrap(), }) .to_string(), ) .send() .await .map_err(|err| { error!("Error while creating keyring: {}", err); () })?; let text = res.text().await.map_...
Rust
0
().by() and get value where value is Vec<Traverser> (i.e., AccumKind is TO_LIST) pub fn try_downcast_group_by_value(obj: &Object) -> Option<Vec<Traverser>> { if let Some(group_count_pair) = try_downcast_group_by_pair(obj) { let value = group_count_pair.clone().inner.1; Some(value) } else { ...
Rust
0
default="best_gomoku_model.pth", help="Path to your model checkpoint") parser.add_argument("--device", type=str, default="cuda" if torch.cuda.is_available() else "cpu", help="Device to use for inference") parser.add_argument("--iterations", type=int, default=100,...
Python
1
6Q\x0d\xc4\x01q\xb0\ r\xbe&\xd9\x97>\x80\xeb!6\x16\xf0\x1e 6\xe0\ \xefz;`\x16\x9b\x01m\x81\x03\xf2\x80< \x0f\x86\ q\x19\xc6=u\x18\x97\xe2\xc2$\x19\xf4h\xbf\x1e\x1d\ 6\x00\x04{\x7f\xb0\x19\x06g\x18\x9c\xed\xb4=6\x87\ _\xe0\x17\x0f)\xb7\xb3\xc0\xcb1\xbc\x1c2\x00!\xd8\ \xdad \xee\x14\xa8O\xd7~\x015\xdb\x05s=\xe2\ g\xe5<\x...
Python
1
lder._issuer_name = None # Unicode issuer name cert = cert_builder.issuer_name( x509.Name( [x509.NameAttribute(x509.NameOID.COMMON_NAME, "Vertrauenswürdig Autorität")] ) ).sign(issuer_private_key, hashes.SHA256(), default_backend()) assert issuer(cert) == "VertrauenswurdigAut...
Python
1
""" Sources http://www.swharden.com/blog/2013-05-09-realtime-fft-audio-visualization-with-python/ http://julip.co/2012/05/arduino-python-soundlight-spectrum/ """ import ui_plot import sys import numpy from PyQt4 import QtCore, QtGui import PyQt4.Qwt5 as Qwt from recorder import * from time import perf_counter try: ...
Python
1
= AudioManager::<MockBackend>::new(Default::default()).unwrap(); let clock = manager.add_clock(ClockSpeed::TicksPerSecond(1.0)).unwrap(); let data = StaticSoundData { sample_rate: 1, frames: Arc::new((0..100).map(|i| Frame::from_mono(i as f32)).collect()), settings: StaticSoundSettings::new(), }; let (mut so...
Rust
0
x_type, csrf.value(), ); let token = jsonwebtoken::encode( &Header::default(), &claims, &EncodingKey::from_secret(key_value.as_bytes()), ) .map_err(DriverError::Jsonwebtoken)?; Ok((token, claims.exp)) } /// Safely deco...
Rust
0
<S> for mpsc::Synclightlikeer<VioletaBftCommand<S>> { fn lightlike(&self, cmd: VioletaBftCommand<S>) -> std::result::Result<(), TrylightlikeError<VioletaBftCommand<S>>> { match self.try_lightlike(cmd) { Ok(()) => Ok(()), Err(mpsc::TrylightlikeError::Disconnected(cmd)) => Err(Trylight...
Rust
0
"face_enhance": False, "fp32": False, "gpu_id": 0 } }, "esrgan": { "2x": { "model": "ESRGAN_x2.pth", "scale": 2, "denoise_level": 0 }, "4x": { "model": "ESRGAN_x4.pth", "scale": 4, ...
Python
1
tate_root) ); // 1. Convert to PartialBeaconState and store that in the DB. let partial_state = PartialBeaconState::from_state_forgetful(state); partial_state.db_put(&self.cold_db, state_root)?; // 2. Store updated vector entries. let db = &self.cold_db; store_u...
Rust
0
repr object. :param excinfo: The exception info. Use in conftest plugins ======================= Any conftest plugin can implement this hook. """ def pytest_keyboard_interrupt( excinfo: ExceptionInfo[KeyboardInterrupt | Exit], ) -> None: """Called for keyboard interrupt. :param exc...
Python
1
// // 更新from账户对应的balance余额 // self.balances.insert(from, from_balance - value); // // let to_balance = self.balance_of(to); // // 更新to账户对应的balance余额 // self.balances.insert(to, to_balance + value); // // // 发送事件 // self...
Rust
0
from typing import Any, Dict, List, Set import torch # refer to https://github.com/facebookresearch/detectron2/blob/master/detectron2/solver/build.py def param_groups(model: torch.nn.Module, base_lr=1e-3, weight_decay=1e-4, norm_weight_decay=0.0, bias_lr_factor=1.0, bias_weight_decay=1e-4): norm...
Python
1
y of inference """ corrects = 0 auroc_calc = torchmetrics.AUROC(task="multiclass", num_classes=len(args.classes_to_use)) # calibration_calc = torchmetrics.CalibrationError(task='multiclass', num_classes=len(args.classes_to_use)) logits_arr, preds_arr, labels_arr = [], [], [] n_datapoin...
Python
1
()); } lazy_static! { pub static ref SOCKET_ACTIVITY: Condvar = Condvar::new(); } #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] pub fn init(dtb: usize) { device_tree::init(dtb); } #[cfg(target_arch = "x86_64")] pub fn init() { bus::pci::init(); } lazy_static! { // Write only once at ...
Rust
0
unsafe { self.body.use_ }), _ => panic!("Wrong tag: {}", self.tag), } } } impl RtValue for RtSexp { type Native = Sexp; fn size_align() -> (usize, usize) { (size_of::<Self>(), align_of::<Self>()) } fn into_native(self) -> Self::Native { match self.into_view() {...
Rust
0
[instance_index].sleep_cycles = delay as usize; let mut dp:Option<(usize, isize, isize)> = None; if let Some(p) = data.instances[instance_index].position { if let Some(action) = &data.instances[instance_index].action { if action.direction == PlayerDirection::North { dp = Som...
Rust
0
Store.subscribe(); const Header = styled.div`color: red` const StyledFactory1 = styled('div')`color: hotpink` const StyledFactory2 = styled('div')({ color: 'hotpink' }) const StyledFactory3 = styled(A)({ color: 'hotpink' }) const FunnyFactory = funny.factory``; let Alias1 = A; let Alias...
Rust
0
feature_vec = np.empty((num_samples, 0)) else: feature_vec = data.db[split]['ratings'][:, self.selected_attr_idx] noise = self.get_noise_mat(num_samples, ds_gender) return (betas, noise), feature_vec def get_loo_data(self, data): input = self.create_input_fe...
Python
1
=0, qualityToggle=True, autoSmea=False, sm=False, sm_dyn=False, dynamic_thresholding=False, controlnet_strength=1.0, legacy=False, add_original_image=True, cfg_rescale=0.0, noise_schedule=NoiseSchedul...
Python
1
from typing import Dict, Optional import unittest from pyspark.sql import SparkSession from .log import log, LogLevel g_spark: Optional[SparkSession] = None def get_spark(args) -> SparkSession: spark_config = args["spark"] global g_spark if g_spark is None: log(f"creating spark session with co...
Python
1
# ********************************************************************************************************************** # Copyright 2025 David Briant, https://github.com/coppertop-bones. Licensed under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance with the License. Y...
Python
1
one, # compatibility to old serialization routines, deprecated **kwargs) -> 'SequencePulseTemplate': subtemplates = kwargs['subtemplates'] del kwargs['subtemplates'] if serializer: # compatibility to old serialization routines, deprecated subtemplates = [seriali...
Python
1
xf2\x93\x9d\x8d,\xbe\x12\xfb\xf2\xb3\x91\xbaI\xe2{\ \xa6P\xbf,\xe7S\x0d6\xe5DZ\xednC\xf0\xfe\ \x98\xd4{\xd6\x1b)\x85\x81M\x80\xc5_\x81\xbf\x1e%\ \xdc\xfb\x1f\xf55\x93\xf1|\xf0\xbc\x0bBI\xd0\x8b\xf6\ yx\x94\xf9\xa6\x1dN \xc3i\xb5\xf3\x8cQ\xdb\x92\ .=~H\xee\x8cj\x05\xcc\xd4\xf7\x5cK\xf9*=\ \xe8\xe6T\x99\xa0\x96\xd1(\xd4\...
Python
1
::var("ALGOD_TOKEN")?.as_ref()) .build_v2()?; let res = algod.metrics().await; println!("{:#?}", res); assert!(res.is_ok()); Ok(()) } #[test] async fn test_account_information_endpoint() -> Result<(), Box<dyn Error>> { // load variables in .env dotenv().ok(); let algod = AlgodBu...
Rust
0
8), } impl Command { fn encode(self) -> Either<[u8; 1], [u8; 2]> { use either::Either::*; match self { Self::SetColumnAddress(addr) => { assert!(addr < 128); Right([addr & 0xF, 0x10 | ((addr & 0x70) >> 4)]) } Self::SetAddressMode(m...
Rust
0
got: args.len(), })? } else { Ok((self.proc)(args)) } } pub fn get_name(&self) -> String { self.name.to_string() } pub fn get_arg_num(&self) -> usize { self.min_arg_num } } impl PartialEq for Procedure { fn eq(&self, other: &Self) -> ...
Rust
0
.quickcheck(prop as fn(std::vec::Vec<(u32, u32)>, std::vec::Vec<u32>) -> bool); } #[test] fn prop_avl_height() { test_env::setup_free(); fn prop(insert: Vec<(u32, u32)>, remove: Vec<u32>) -> bool { let map = avl(&insert, &remove); height(&map) <= max_tree_height(map...
Rust
0
score_text = score_font.render(str(score), True, (128, 128, 128)) text_rect = score_text.get_rect() text_rect.topleft = [10, 10] screen.blit(score_text, text_rect) # 更新屏幕 pygame.display.update() for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit...
Python
1
POWER_CHARGE1, bits).map_err(Error::I2c)?; Ok(()) } /// Enables or disables certain ADC functions of AXP173. pub fn set_adc_settings(&mut self, adc_settings: &AdcSettings) -> OperationResult<E> { // Set the contents of ADC enable/disable register. let mut bits = self.read_u8(POWER_...
Rust
0
ey(ref k): &Key) -> bool { unsafe { $verify_name(tag, m.as_ptr(), m.len() as c_ulonglong, k) == 0 } } #[cfg(test)] mod test_m { use crate::randombytes::randombytes; use super::*; #[test] fn test_auth_verify() { for ...
Rust
0
{ let index = create_test_index().unwrap(); let reader = index.reader().unwrap(); let searcher = reader.searcher(); let opts_json_str = r#" { "field": "country", "term": "japon", "distance": 1, "transpositio...
Rust
0
}] from {address}: {freed_data}") else: print(f"[{datetime.datetime.now()}] from {address}: Invalid packet") except KeyboardInterrupt: print("\n### FreeD Receiver stopped ###") except Exception as e: print(f"Error: {e}") finally: s.close()...
Python
1
emb_list = emb[key] break else: # try to stringify a content field emb_list = emb.get("content") if isinstance(emb.get("content"), (list, tuple)) else [] elif isinstance(emb, (list, tuple)): emb_list = emb else: # Try to coerce t...
Python
1
with open("log.txt") as f: lines = f.readlines() lineno = 1 for line in lines: if("python" in line): print(f"Yes python is present. Line no: {lineno}") break lineno += 1 else: print("No Python is not present")
Python
1
ta)| { let mut map = Map::new(); map.insert("query".to_owned(), Json::String(query)); map.insert("data".to_owned(), data); Json::Object(map) }) .collect(); let payloads = Json::Array(payloads); JsValue::from_serde(&payloads).unwrap() } fn conve...
Rust
0
expect("Old state doesn't exist"); // can only be called by this same contract (it's called from fn upgrade()) assert_eq!( &env::predecessor_account_id(), &env::current_account_id(), "Can only be called by this contract" ); // uncomment when state mi...
Rust
0
n(os.path.join(args.serialization_dir, "best_hyperparameters.json"), "w+") as f: best_hp = df.reset_index().iloc[df.reset_index().dev_f1.idxmax()].to_dict() for k,v in best_hp.items(): if isinstance(v, np.int64): best_hp[k] = int(v) if isinstance(v, str) and "[" i...
Python
1
er_obj)) for result in results ] # If we changed the prefix (expanding the $ symbol) we now need to change it back. if tweaked_txt != txt: results = [(txt + result[len(tweaked_txt):], value) for result, value in results] # pylint:disable=unidiomatic-typecheck results.sort(key=lambda r: ...
Python
1
############################################################################### # # Copyright (c) 2017 University of Oxford # Authors: # Geoff Pascoe (gmp@robots.ox.ac.uk) # # This work is licensed under the Creative Commons # Attribution-NonCommercial-ShareAlike 4.0 International License. # To view a copy of this lic...
Python
1
import numpy as np def plot_sphere(ax, font_size=12, K=1.0, num_u=160, num_v=240, axis="z"): """ Plot sphere (radius model, K>0) as a smooth surface. Parameters ---------- ax : mpl_toolkits.mplot3d.Axes3D K : float (positive curvature) num_u, num_v : resoluti...
Python
1
u>())) .naive_rem(__p2(__polynomial << (8*size_of::<__u>()-__width))) .0 as __u; i += 1; } rem_table }; // small inverse div/rem tables for iterating backwards #[cfg(__if(__small_table || __small_table_barret))] const INVERSE_DIV_TABLE: [u8; 1...
Rust
0
o| acc + *o.amount()) } /// Updates the Bech32 human readable part. #[doc(hidden)] pub fn set_bech32_hrp(&mut self, hrp: String) { self.address.bech32_hrp = hrp.to_string(); for output in self.outputs.iter_mut() { output.address.bech32_hrp = hrp.to_string(); } }...
Rust
0
def euler_sieve(n): pri = [] not_prime = [False] * (n + 1) for i in range(2, n + 1): if not not_prime[i]: pri.append(i) for pri_j in pri: if i * pri_j > n: break not_prime[i * pri_j] = True if i % pri_j == 0: bre...
Python
1
e), AccountMeta::new_readonly(keypairs[2].pubkey(), true), ], data: memo.to_vec(), }], Some(&payer.pubkey()), ); transaction.sign(&[&payer, &keypairs[0], &keypairs[2]], recent_blockhash); assert_eq!( banks_client .process_transactio...
Rust
0
GraphMap, }; use super::graph::IndexType; use graphmap::NodeTrait; use std::collections::HashMap; /// `Dot` implements output to graphviz .dot format for a graph. /// /// Formatting and options are rather simple, this is mostly intended /// for debugging. Exact output may change. pub struct Dot<'a, G: 'a> { grap...
Rust
0
_tray_icon<'a>( hwnd: &'a WindowHandle, id: u32, callback_id: u32, tooltip: &str, module_hande: &ModuleHandle, ) -> Result<TrayIcon<'a>, ErrorCode> { let icon = unsafe { winapi::um::winuser::LoadIconW(module_hande.0.as_ptr(), 1usize as *const u16) }; if icon.is_null() { let code = unsafe { w...
Rust
0
(); local_hour.ge(&self.open_hour.into()) && local_hour.le(&self.close_hour.into()) } } pub struct Car<'a> { pub code: &'a str, pub plate: &'a str, pub enter_date: DateTime<Utc>, pub leave_date: Option<DateTime<Utc>>, pub parked: bool, } impl<'a> Car<'a> { pub fn new(code: &'a str, plate: &'a ...
Rust
0
### # Change the default schema of a user (possible). # Change the default schema of a user to an unexisting schema (not possible). # Change the default schema for an unexisting user (not possible). # Drop a user that owns a schema (not possible). ### import os, sys try: from MonetDBtesting import process except I...
Python
1
from flask import render_template, Blueprint contact = Blueprint('contact', __name__) @contact.route('/contact') def contact_home(): return render_template('contact.html', title='contact')
Python
1
ata['token_type'] + ' ' + auth_data['access_token'] def request_auth_api(api, method, params, enable_retry=True): """ A wrapper for request_api which includes an access token in the head. @param api: same to request_api @param method: same to request_api @param params: same to request_api @par...
Python
1
# Copyright (c) 2024, Manfred Moitzi # License: MIT License from pathlib import Path import ezdxf from ezdxf import bbox, select CWD = Path("~/Desktop/Now/ezdxf/select").expanduser() if not CWD.exists(): CWD = Path(".") BASE = "base.dxf" def select_inside_window(): print("\nselect inside window:") doc =...
Python
1
device)): pred_trans_1 = motif_mask[...,None]* pred_trans_1+(1-motif_mask[...,None])*batch['trans_fix'] pred_rotmats_1 = motif_mask[...,None,None]*pred_rotmats_1+(1-motif_mask[...,None,None])*batch['rotmats_fix'] clean_traj.append( (pred_trans_1.detach(), pr...
Python
1
f=JPEG?w=708&h=500", "arrivalStationContactName": "江西百洋", "arrivalStationContactTel": "18525647850", "arrivalStationProvince": "云南省", "arrivalStationCity": "昆明市", "arrivalStationArea": "安宁市", "extendSix": "云南省昆明市安宁市八街街道八街村",...
Python
1
row; use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_visit::{noop_visit_type, FoldWith, Node, Visit, VisitMutWith, VisitWith}; /// Circular imports are hard to handle. /// /// We use some dedicated method to handle circular dependencies. impl<L, R> Bundler<'_, L, R> where L: Load, R: Resolve, { ...
Rust
0
pre_link_args_crt.get(&flavor) { if options.crt_static() { cmd.args(args); } } if let Some(ref args) = options.debugging_opts.pre_link_args { cmd.args(args); } cmd.args(&options.debugging_opts.pre_link_arg); if options.target.options.is_like_fuchsia { let...
Rust
0
{ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, "{}", if self.speed_up { "speed_up" } else { "original_speed" } ) } } <reponame>holochain/lair use super::*; /// Initiat...
Rust
0
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pytest import torch from torch.fx import symbolic_trace from colossalai.fx.passes import column_shard_linear_pass from colossalai.initialize import launch from colossalai.legacy.core import global_context as gpc from colossalai.logging import disable_existing_log...
Python
1
rch's VNC list!", warning=True) print if len(self.openblock) > 0: print "The following IPs are within Openblock:" for ip in self.openblock: print helpers.color(ip) else: print helpers.color("No loaded IPs are within Openblock!", warning=True) ...
Python
1
tr) -> impl Iterator<Item = (&'a str, bool)> + 'a { let parts = input.split(DELIMITERS); let outside_hypernet = vec![true, false].into_iter().cycle(); parts.zip(outside_hypernet) } fn supports_tls(input: &str) -> bool { let mut has_one_abba = false; for (part, outside_hypernet) in ip_chunks(input...
Rust
0
""" @author: cunyue @file: test_local.py @time: 2025/5/18 17:24 @description: 测试本地回调器 """ import os.path from freezegun import freeze_time from nanoid import generate import tutils as T from swanlab.data.callbacker.local import LocalRunCallback from swanlab.log.type import LogData from tutils.setup import UseMockRun...
Python
1
.work_forest() .batch::<_, ()>(|forest| { for i in 0..n { forest.insert(&Item(i), &hasher); } Ok(()) }) .expect("cannot fail") .normalize(&hasher); // update the proofs let proofs1 = (0..n) .map(|i| { ...
Rust
0
safe { Box::from_raw(x) }; } #[no_mangle] pub extern "C" fn zexe_tweedle_fp_proof_evaluations_make( w: *const Vec<Fp>, za: *const Vec<Fp>, zb: *const Vec<Fp>, h1: *const Vec<Fp>, g1: *const Vec<Fp>, h2: *const Vec<Fp>, g2: *const Vec<Fp>, h3: *const Vec<Fp>, g3: *const Vec<Fp>, ...
Rust
0