text
string
label_name
string
labels
int64
()` method returns [kkpr::R](R) reader structure"] impl crate::Readable for KKPR_SPEC { type Reader = R; } #[doc = "`reset()` method sets KKPR to value 0"] impl crate::Resettable for KKPR_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } <reponame>septum/pushin_boxes use uuid::Uuid; ...
Rust
0
input_secrets, output_values_and_blindings, fee, true, rng, ) } /// Verify. /// /// # Arguments /// * `message` - The signed message. /// * `rings` - One or more rings of one-time addresses and amount /// commitments. /// ...
Rust
0
) { let len = (num_frames * num_channels) as usize; for i in 0..len { buffer[i] = 0.0; } } } pub struct SAppImpl { callbacks: Box<SApp>, desc: SAppDesc, } impl SAppImpl { fn new<S: SApp + 'static>(callbacks: S, desc: SAppDesc) -> SAppImpl { SAppImpl { ...
Rust
0
# ' 버스', '버스' ] for pattern in patterns_to_remove: normalized = re.sub(pattern, '', normalized) # 공백 제거 return normalized.strip() # 2. 수정할 함수 (route_image_webhook) @app.post("/webhook/route_image", tags=["카카오톡"]) async def route_image_webhook(req: Request): """노선 우회 경로 이미지 전송 (...
Python
1
.value def count_bytes(array): '''Count the number of bits in a byte ``array``. It uses the Hamming weight popcount algorithm ''' # this algorithm can be rewritten as # for i in array: # count += sum(b=='1' for b in bin(i)[2:]) # but this version is almost 2 times faster count = 0...
Python
1
ef main(): """Main entry point for the NDR GUI application.""" app = QApplication(sys.argv) # Set application style app.setStyle('Fusion') # Set application information app.setApplicationName("Network Detection & Response") app.setApplicationVersion("1.0.0") app.setOrganization...
Python
1
al notation. "], pub decimal<Span, Literal>, map_res!( call!(decimal_digit), decimal_mapper ) ); #[inline] fn decimal_mapper(span: Span) -> StdResult<Literal, ParseFloatError> { i64::from_str(span.as_slice()) .and_then( | decimal| { Ok(Literal::In...
Rust
0
from solution import * from solution import ListNode, reverse_linked_list def create_linked_list(values): if not values: return None head = ListNode(values[0]) current = head for value in values[1:]: current.next = ListNode(value) current = current.next return head def lin...
Python
1
index(&self, receiver: u16) -> &Self::Output { &self.column[usize::from(receiver)] } } #[cfg(test)] mod tests { use rand::rngs::StdRng; use rand::SeedableRng; use super::*; #[test] fn same_seed_produces_same_table() { let rng = StdRng::seed_from_u64(1234); let params ...
Rust
0
(|pat| format!("{pat:?}")) .collect::<Vec<_>>() .join(", "); writeln!(f, "{scrutinee}")?; writeln!(f)?; for row in &self.rows { writeln!(f, "{row:?}")?; } Ok(()) } }<filename>src/key.rs // Bitcoin secp256k1 bindings // Written in 2014 by // <NAME> // <NAME> // // To the...
Rust
0
is bit is 1 if the Rx FIFO is at least half full. RXRIS OFFSET(2) NUMBITS(1) [], /// This bit is 1 if the Tx FIFO is at least half empty. TXRIS OFFSET(3) NUMBITS(1) [] ], MIS [ /// This bit is 1 if another frame was completely received while the RxFIFO was full RORMIS OFFSET(0) NUMBITS(1) [], //...
Rust
0
FN2_SLC1_TOHOST_BIT1_INT_ENA_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA_R { type Target = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA` ...
Rust
0
% X.shape[2]] = np.interp( time_stamps, distorted_time_stamps, X[i // X.shape[2], :, i % X.shape[2]] ) return X_transformed def time_warp_transform_low_cost(X, sigma=0.2, num_knots=4, num_splines=150): """ Stretching and warping the time-series (low cost) """ time_stamps = np....
Python
1
ct LinkNode { val: Option<i32>, next: Option<Box<LinkNode>>, } impl LinkNode { fn new(val: i32) -> Self { LinkNode { val: Some(val), next: None, } } // 返回最底层节点 fn get_last_mut(&mut self) -> &mut Self { match self.next { Some(ref mut b...
Rust
0
: // not { exists<T, U> { Vec<T> = Vec<U>, T: Bar, U: Baz } } // fn disjoint(&self, lhs: &ImplDatum, rhs: &ImplDatum) -> bool { debug_heading!("overlaps(lhs={:#?}, rhs={:#?})", lhs, rhs); let lhs_len = lhs.binders.len(); // Join the two impls' binders together let mut ...
Rust
0
c=[ f"{anno_root_it}/video/reasoning/clevrer_mc/train.json", "your_data_path/clevrer/video_train", "video" ], vqa_ego_qa=[ f"{anno_root_it}/video/vqa/ego_qa/train.json", "your_data_path/EgoQA/split_videos", "video" ], vqa_tgif_frame_qa=[ f"{anno...
Python
1
ed(), font)); Ok(sprite) } /// Renders a text sprite at the specified point pub fn render_text( renderer: &mut Renderer, sprite: &Sprite, point: (i32, i32), ) -> Result<(), Box<Error>> { let (x, y) = point; let (w, h) = sprite.size(); sprite.render(renderer, Rect::new(x, y, w, h)) } <gh_st...
Rust
0
/// Tagging rooms. pub mod tag { endpoint!( /// Create a tag on a room. [r0, tag], create_tag ); endpoint!( /// Delete a tag on a room. [r0, tag], delete_tag ); endpoint!( /// Get the user's...
Rust
0
't try and use build directory /// at the same time. build_lock: BuildLock, } impl<IO> LspProjectCompiler<IO> where IO: CommandExecutor + FileSystemIO + Clone, { pub fn new(config: PackageConfig, io: IO) -> Result<Self> { // TODO: different telemetry that doesn't write to stdout let tel...
Rust
0
let lock = self.BufWriteLock().Lock(task); return QUring::RingFileWrite(task, fd, queue, ringBuf, srcs, Arc::new(self.clone()), lock) } let fops = self.lock().fileOps.clone(); let res = fops.WriteAt(task, f, srcs, offset, blocking); return res; } fn Append(&self, ta...
Rust
0
roto_len = [0u8; 4]; proto_len[1] = protocol.into(); NetworkEndian::write_u16(&mut proto_len[2..4], length as u16); combine(&[ data(&src_addr.octets()), data(&dst_addr.octets()), data(&proto_len[..]), ]) } } pub enum Protocol { HopByHop, ...
Rust
0
wlr_xwayland_surface, mut state: int32_t) { let mut xwm: *mut wlr_xwm = (*xsurface).xwm; let mut property: [uint32_t; 2] = [0; 2]; property[0] = state as uint32_t; property[1] = XCB_WINDOW_NONE as libc::c_int as uint32_t; xcb_change_property((*xwm).xcb_con...
Rust
0
ppend( dwarf::RBP, rbp ); } } let result = dwarf_unwind( nth_frame, memory, &mut state.ctx_cache, &mut state.unwind_cache, regs, &mut state.new_regs )?; *initial_address = Some( result.initial_address ); *ra_address = result.ra_address; let cfa = result.cfa?; ...
Rust
0
pub fn new(protocol: LdapProto, connector: TlsConnector, do_handshake: bool, hostname: &str) -> TlsClient { TlsClient { inner: protocol, connector: connector, do_handshake: do_handshake, hostname: hostname.to_string...
Rust
0
ish() } } #[doc = "Programmable IO block"] pub use pio0 as pio1; #[doc = "Single-cycle IO block Provides core-local and inter-core hardware for the two processors, with single-cycle access."] pub struct SIO { _marker: PhantomData<*const ()>, } unsafe impl Send for SIO {} impl SIO { #[doc = r"Pointer to t...
Rust
0
#!/usr/bin/env python3 '''define a async_generator function ''' import random import asyncio from typing import Generator async def async_generator() -> Generator[float, None, None]: '''it defines a coroutine generator function that yield a random number between 0 and 10''' for x in range(0, 10): ...
Python
1
: usize, needles: Vec<&str>| { let haystack = HAYSTACK_SHERLOCK; b.bytes = haystack.len() as u64; let mut nfa = NFA::from_dictionary(needles); nfa.ignore_prefixes(); let ddfa = nfa .powerset_construction() .into_dfa() .unwrap() .in...
Rust
0
output_index: txid, transaction_id: txptr.into(), value: i.value.into(), })) } } } } impl From<Input> for TransactionInput { fn from(i: Input) -> TransactionInput { match i.to_enum() { InputEnum::Accoun...
Rust
0
tValue, ZeroReward, ZeroCreditsAndReturnZero, ZeroCreditsAndReturnCurrent, } impl From<SkippedReason> for InflationPointCalculationEvent { fn from(reason: SkippedReason) -> Self { InflationPointCalculationEvent::Skipped(reason) } } #[derive(Debug)] pub enum InflationPointCalculationEvent {...
Rust
0
#!/usr/bin/env python3 import cv2 import numpy as np import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge,CvBridgeError import time a = 150 # a = distance from the center of the foci of the lemnicate t = 0 # parameter for lemniscate curve delta_t = 0.05 # increment for parameter t ball_rad...
Python
1
import unittest from selenium import webdriver from selenium.webdriver.common.by import By class RegisterNewUser(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() driver =self.driver driver.implicitly_wait(30) driver.maximize_window() driver.get('ht...
Python
1
import logging import os from collections import defaultdict import numpy as np from nlm_utils.model_client import EncoderClient class DeDuplicateEngine: def __init__(self, settings, threshold=0.9): self.logger = logging.getLogger(self.__class__.__name__) self.logger.setLevel(logging.INFO) ...
Python
1
anId, XSpanIdString, Has, AuthData}; use {Api, GetCrumbResponse, DeletePipelineQueueItemResponse, GetAuthenticatedUserResponse, GetClassesResponse, GetJsonWebKeyResponse, GetJsonWebTokenResponse, GetOrganisationResponse, GetOrganisationsResponse, GetPipelineResponse, G...
Rust
0
_acc = accuracy_score(y_train_subset, train_pred) train_pre = precision_score(y_train_subset, train_pred, average='weighted') train_rec = recall_score(y_train_subset, train_pred, average='weighted') train_cm = confusion_matrix(y_train_subset, train_pred) ...
Python
1
Id.to_base64_string(), value: "MDc2NmQ0ZTFjMDkxMjRhZjlhZWI0YTdlZDk5ZDgxNjU0YTg0NDczZjEzMzk0OGNlYTA1MGRhYTE3ZmYwZTdmZg==".to_owned(), }], }], }, DeliverTx { ...
Rust
0
import requests from flickrapi import FlickrAPI from urllib.request import urlretrieve from pprint import pprint import os, time, sys, json # set keyword KEYWORD = "ramen" # get env FLICKR_KEY = os.environ.get('FLICKR_KEY', None) FLICKR_SECRET = os.environ.get('FLICKR_SECRET', None) WAIT_TIME = 0.5 # 商用利用可能なライセンスIDを...
Python
1
, None)).unwrap(); } Ok(_) => {} Err(e) => { tx_msg_in .send(Task::new( 0, MsgIn::External(ExternalMsg::LogError(e.to_string())), ...
Rust
0
class Solution: def longestRepeatingSubstring(self, s: str) -> int: for i in range(len(s) -1, -1, -1): for j in range(0, len(s) - i + 1): if s[j : i + j] in s[j + 1:]: return i return 0
Python
1
.collect::<Vec<_>>(); Some(( enums[0].0.clone(), enums.iter().map(|x| x.1.clone()).collect::<Vec<_>>(), enums.iter().map(|x| x.2.clone()).collect::<Vec<_>>().join("") + "Union", )) } } // -----------------------------------------------------------------...
Rust
0
from baconian.test.tests.set_up.setup import TestWithAll from baconian.algo.dynamics.reward_func.reward_func import CostFunc from baconian.envs.gym_env import make import numpy as np from baconian.core.core import EnvSpec from baconian.algo.dynamics.dynamics_model import GlobalDynamicsModel from baconian.algo.policy.il...
Python
1
import sys import binascii import random import string import hashlib from random import randint from flag import flag N = 8 rol = lambda val, r_bits, max_bits: \ (val << r_bits%max_bits) & (2**max_bits-1) | \ ((val & (2**max_bits-1)) >> (max_bits-(r_bits%max_bits))) def p(...
Python
1
from django import forms class TreshForm(forms.Form): confidence_threshold = forms.IntegerField(min_value=0, max_value=100) labelmode = forms.ChoiceField( choices=(('full', 'Labels'), ('func', 'Functional Groups'))) class CmTestForm(forms.Form): nlabels = forms.IntegerField(min_value=0, max_...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 2018年9月9日 @author: Irony @site: https://pyqt.site , https://github.com/PyQt5 @email: 892768447@qq.com @file: Notification @description: """ import base64 try: from PyQt5.QtCore import Qt, QRectF, QSize, pyqtSignal, QTimer from PyQt5.QtGui import QP...
Python
1
"INTEGRATOR mode!" ) elif inst.acquire.mode == AcquireMode.RAW: raise ValueError( "Invalid acquire mode! The live hardware doesn't support " "RAW acquire mode!" ...
Python
1
# plt.axis('off') print(lklk) ##################################### Change the target directory according to the user ######################### target_directory = './augment_test_test/' + t10_org.wnids[t10_org.class_to_idx[class_name]] ###############################...
Python
1
&(*(::std::ptr::null::<CUDA_ARRAY3D_DESCRIPTOR_st>())).Depth as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(CUDA_ARRAY3D_DESCRIPTOR_st), "::", stringify!(Depth) ) ); assert_eq!( unsafe { ...
Rust
0
print("Hello Machine Learning World!")
Python
1
f", "FIBONACCI", 1, 64), ]) def test_lfsr_descramble(request, lfsr_width, lfsr_poly, lfsr_init, lfsr_config, reverse, data_width, style): dut = "lfsr_descramble" module = os.path.splitext(os.path.basename(__file__))[0] toplevel = dut verilog_sources = [ os.path.join(rtl_dir, f"{dut}.v")...
Python
1
e_speed = 30 timeout = 3 else: move_speed = 10 timeout = 5 mc.send_coords(target, move_speed, move_mode) forces = read_force_sensors() current = mc.get_coords() while not scanning_active: forces = read_force_sensors() ...
Python
1
crate::string_ext::FromUtf8NulTruncating; use crate::Client; use chrono::offset::TimeZone; use chrono::{DateTime, Utc}; use derive_more::{From, Into}; use enum_primitive_derive::Primitive; use futures::Stream; use genawaiter::sync::Gen; use num_traits::FromPrimitive; use std::collections::BTreeMap; use std::convert::T...
Rust
0
mut [Buffer]); let src_a = g.add_node(NodeData::new2(BoxedNode::new(src_node_ptr))); let src_b = g.add_node(NodeData::new2(BoxedNode::new(src_node_ptr))); let src_c = g.add_node(NodeData::new2(BoxedNode::new(src_node_ptr))); let sum_a_b = g.add_node(NodeData::new2(BoxedNode::new(node::Sum))); let su...
Rust
0
nexthop: Option<ip::Addr>, id: u16, offset: u16, ) -> Result<(), Box<dyn Error>> { let dgram = dgram::Dgram { version_header_length: (ip::VERSION << 4) | (ip::dgram::HEADER_LEN >> 2), type_of_service: 0, len: ip::dgram::HEADER_LEN as u16 + buf.0.len() as ...
Rust
0
nder_lib::widgets::{self, GlyphGrid, ModalHost, RootWindowController, Sidebar}; use runebender_lib::{menus, theme, Delegate}; fn main() { let state = get_initial_state(); let main_window = WindowDesc::new(make_ui()) .title(LocalizedString::new("Runebender")) .menu(menus::make_menu(&state)) ...
Rust
0
enumerate(rankings[:3], 1): print(f" {i}. {ranking['strategy_name']}") print(f" Type: {ranking['strategy_type']}") print(f" Performance Score: {ranking['performance_score']:.3f}") print(f" Confidence: {ranking['confidence_score']:.2f}") print() # Compar...
Python
1
SQLScalarColumnTransformer(sql='`Culmen Length MM`*/', target_column='transformed_Culmen Length MM'), '?transformed_Culmen Length MM'), ('sql_scalar_column_transformer', SQLScalarColumnTransformer(sql...
Python
1
::new() } fn descriptor_static(_: ::std::option::Option<AclEntryProto>) -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0...
Rust
0
).parse().ok()) .unwrap_or(x), }) .unwrap_or_else(|| match action { Action::ListDir => mime::TEXT_HTML_UTF_8, Action::DownloadFile => mime::TEXT_PLAIN_UTF_8, Action::DownloadZip => mime::APPLICATION_OCTET_STREAM, }) ...
Rust
0
ModBot.py" -s 998', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8').split('\n') if timelines[-7].split()[1] != "5" or timelines[-6].split()[1] != "4" or timelines[-5].split()[1] != "3" or timelines[-4].split()[1] != "2" or timelines[-3].split()[1] != "1" or timelines[-2] != "1 2 3 4 ": print('Ti...
Python
1
input(0xb, true ); }, Event::KeyUp { keycode: Some(Keycode::B), .. } => { self.set_input(0xb, false); }, Event::KeyDown { keycode: Some(Keycode::C), .. } => { self.set_input(0xc, true ); }, Event::KeyUp { keycode: Some(Keycode::C), .. } => { self.set_input(0x...
Rust
0
1 split control register pub mod OTG_HCSPLT1 { pub use super::OTG_HCSPLT0::COMPLSPLT; pub use super::OTG_HCSPLT0::HUBADDR; pub use super::OTG_HCSPLT0::PRTADDR; pub use super::OTG_HCSPLT0::SPLITEN; pub use super::OTG_HCSPLT0::XACTPOS; } /// This register indicates the status of a channel with respe...
Rust
0
import subprocess from multiprocessing import Pool import sys import os from config import * madStatsCommand= 'python MAD.py %s' fingerprintCommand = 'python finger_print.py %s %s' def call_fingerprint(args): process = subprocess.Popen((fingerprintCommand % (args, param_json)), stdout=subprocess.PIPE, shell=True...
Python
1
rror": msg["content"] = self.get_part("content", msg["content"], msg_list) msg["content"]["ename"] = "ExecutionError" msg["content"]["evalue"] = "Execution error" msg["content"]["traceback"] = [self.kernel_manager.traceback_replacement_message] ...
Python
1
n state reset_completion_engine() # Mock CompletionEngine to fail on first initialization with patch("agentspec.cli.completion.CompletionEngine") as mock_engine_class: mock_engine_class.side_effect = [ Exception("First init fails"), CompletionEngine()...
Python
1
ure_workload_container { use super::*; #[doc = "Workload type for which registration was sent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum WorkloadType { Invalid, #[serde(rename = "VM")] Vm, FileFolder, AzureSqlDb, #[serde(rename ...
Rust
0
""" Specific test to cover lines 44-45 and 58 in conftest.py. """ import sys from types import ModuleType def test_cover_keyerror_exception_handler(): """Test that specifically aims to cover the KeyError exception handler.""" # This test is designed to make sure the reset_environment fixture # executes i...
Python
1
ln!("select a file to execute or 1 option from the ones below:"); println!(" \"-h\": show help"); println!(" \"-v\": show version"); } fn version() { println!("rcwt"); println!(" a toy virtual machine"); println!(""); println!(" version = \"0.1.0\""); println!(" authors = [\"sKyrBBit <<EMAIL>>\"]");...
Rust
0
u_pred V_pred[:,snap:snap+1] = v_pred P_pred[:,snap:snap+1] = p_pred # Error error_c = relative_error(c_pred, c_test) error_u = relative_error(u_pred, u_test) error_v = relative_error(v_pred, v_test) error_p = relative_error(p_pred - np.mean(p_pred, axis=0, ...
Python
1
import gradio as gr import tkinter as tk import threading import tensorflow as tf from KGCN.layer import SumAggregator custom_objects = {'SumAggregator': SumAggregator} def get_top_five_name(item_id): file_name_list= [] with open("../data/ds/ml-1m/movies.dat", "r") as file: for line in file: ...
Python
1
import os import importlib import numpy as np from libertem.udf import UDF from libertem.io.dataset.memory import MemoryDataSet # A bit of gymnastics to import the test utilities from outside the package basedir = os.path.dirname(__file__) location = os.path.join(basedir, "../../tests/utils.py") spec = importlib.uti...
Python
1
= "sancov_value_profile", feature = "sancov_cmplog"))] { println!("cargo:rerun-if-changed=src/sancov_cmp.c"); let mut sancov_cmp = cc::Build::new(); #[cfg(feature = "sancov_value_profile")] { sancov_cmp.define("SANCOV_VALUE_PROFILE", "1"); println!("cargo:r...
Rust
0
x<Core>, i: Box<Core>, v: Box<Core> }, If { cond: Box<Core>, if_true: Box<Core>, if_false: Box<Core> }, // e1: T // e2: T // ------- // e1 = e2 : Bool Eq { e1: Box<Core>, e2: Box<Core> }, } #[derive(Debug, Clone, PartialEq)] enum CoreType { Void, Boolean, I8, I16, I32, I64, M(Box<CoreT...
Rust
0
if content != original_content: full_path.write_text(content, encoding='utf-8') print(f" ✅ {file_path}") self.fixes_applied.append(file_path) except Exception as e: print(f" ❌ Erro em {file_pat...
Python
1
from cronjob.task_scheduler import delete_cronjob_task delete_cronjob_task("trackmazon_update_task") """ FOR THE DEV TEAM: Remember to run this file to erase the cron-job after testing! - Eva """
Python
1
meshes\b\b_n_khajiit_f_knee.nif", 0x6418_1F0B, 0x3FD8_0571), (r"meshes\b\b_n_khajiit_m_neck.nif", 0x6418_1F0B, 0x6E41_DC01), (r"meshes\b\b_n_khajiit_f_neck.nif", 0x6418_1F0B, 0x6EF1_DC01), (r"meshes\b\b_n_nord_m_hair03.nif", 0x641F_1A0B, 0x7238_7100), (r"meshes\b\b_n_nord_m_hair02.nif", 0x641F_1A0B,...
Rust
0
#!/usr/bin/python3 # coding=utf8 import sys sys.path.append('/home/pi/') import time import signal import HiwonderSDK.mecanum as mecanum if sys.version_info.major == 2: print('Please run this program with python3!') sys.exit(0) print(''' Tips: * 按下Ctrl+C可关闭此次程序运行,若失败请多次尝试! Press Ctrl+C to exit the progr...
Python
1
show_data_quality_monitoring() # 應該不會拋出異常,而是顯示友善的錯誤訊息 except Exception as e: pytest.fail(f"錯誤處理失敗: {e}") def test_module_info_function(self): """測試模組資訊函數""" from src.ui.pages.data_management import get_module_info info = get_modu...
Python
1
import sys N = int(sys.stdin.readline()) words = [sys.stdin.readline().strip() for _ in range(N)] words = list(set(words)) words.sort(key=lambda x: (len(x), x)) print(*words, sep='\n')
Python
1
// intended answers for this intrinsic. Instead, we just always return // 'unknown', as this is valid behavior according to the LLVM spec. let arg1 = state.operand_to_bv(&call.get_arguments()[1].0)?; let width = layout::size(&call.get_type()); let zero = state.zero(width as u32); let minusone =...
Rust
0
match value { serde_yaml::Value::Number(n) => match n.as_i64() { Some(n) if n < i64::from(i32::min_value()) => Err("Large integer"), Some(n) if n <= i64::from(i32::max_value()) => { Ok(SoundCoreParamValue::I32(n as i32)) } ...
Rust
0
from attpc_engine.detector import ( DetectorParams, ElectronicsParams, PadParams, Config, ) from attpc_engine.detector.simulator import simulate from attpc_engine import nuclear_map from spyral_utils.nuclear.target import GasTarget import numpy as np gas = GasTarget([(1, 2, 2)], 300.0, nuclear_map) d...
Python
1
str = "1.3.6.1.4.1.311.3.3.1"; pub const szOID_RSA_SMIMEalg: &'static str = "1.2.840.113549.1.9.16.3"; pub const szOID_RSA_SMIMEalgESDH: &'static str = "1.2.840.113549.1.9.16.3.5"; pub const szOID_RSA_SMIMEalgCMS3DESwrap: &'static str = "1.2.840.113549.1.9.16.3.6"; pub const szOID_RSA_SMIMEalgCMSRC2wrap: &'static str ...
Rust
0
/Erase Protection Register"] pub mod flctl_bank0_main_weprot; #[doc = "FLCTL_BANK1_INFO_WEPROT register accessor: an alias for `Reg<FLCTL_BANK1_INFO_WEPROT_SPEC>`"] pub type FLCTL_BANK1_INFO_WEPROT = crate::Reg<flctl_bank1_info_weprot::FLCTL_BANK1_INFO_WEPROT_SPEC>; #[doc = "Information Memory Bank1 Write/Erase Pro...
Rust
0
tV2/Train/Annotation" seq_root = '/share/wuweijia/MyBenchMark/MMVText/BOVTextV2/Train/Frames' label_root = '/share/wuweijia/Data/VideoText/MOTR/BOVText/labels_with_ids/train' mkdirs(label_root) # seqs = [s for s in os.listdir(seq_root)] seqs = [] for cls in os.listdir(seq_root): for vid_name in os.listdir(os.path...
Python
1
from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer from jose import JWTError, jwt from qfaas.core.config import settings from qfaas.database.dbUser import retrieve_users from qfaas.models.auth import TokenData from qfaas.models.user import UserSchema from qfaas.utils.a...
Python
1
ard = self.check_win_condition() team_reward += win_team_reward done = done or team_win self.agent_rewards = self._merge_rewards(self.agent_rewards, team_reward) if self.t == self.max_time_steps - 1: truncated = True else: self.t += 1 return ( ...
Python
1
# -*- encoding: utf-8 -*- ############################################################################## # # # OpenERP, Open Source Management Solution. # # ...
Python
1
# Copyright (C) 2018 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Field Service - Sales", "version": "17.0.1.3.0", "summary": "Sell field services.", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA...
Python
1
# src/i2c/tools/neurosymbolic/graph/impact_analyzer.py from typing import Dict, List, Set from collections import deque def analyze_impact(graph, file_path: str, change_type: str) -> Dict[str, List[str]]: """Analyze potential impact of code modifications using BFS traversal""" visited: Set[str] = set() que...
Python
1
import json import webapp2 from generate_key import * class KeysHandler(webapp2.RequestHandler): def __init__(self, request, response): # Set self.request, self.response and self.app. self.initialize(request, response) self._key_matrix = read_key_file(open('master-key.txt')) def _gen_json(self, ksv, key, is_s...
Python
1
cmds.push(Command::ADDJOB); } if Some(idx) == compare(value.as_bytes(), GETJOB) { cmds.push(Command::GETJOB); } if Some(idx) == compare(value.as_bytes(), ACKJOB) { cmds.push(Command::ACKJOB); } if Some(idx) == compare(value.as_bytes(), ...
Rust
0
from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import PromptTemplate, ChatPromptTemplate from langchain.chains import SimpleSequentialChain, LLMChain from langchain_core.messages import HumanMessage, SystemMessage from langchain_google_genai import ChatGoogleGenerativeAI from lang...
Python
1
fixed_distance_matrix_list # mobile_distance_matrix = mobile_distance_matrix_list[iteration] task_list = task_by_time_list # print_to_console("task_list[0]", task_list[0]) # 初始化边缘节点数量 node_num = settings.RSU_NUM_10 # fixed_node_num = settings.BASE_STATION_NUM + settings.RSU_NUM # mobile_node...
Python
1
x1c, 0x68, 0xd0, 0x4f, 0x1d, 0xad, 0x96, 0x31, 0x4f, 0xf0, 0x9e, 0x6b, 0x3d, 0xe9, 0x6a, 0xee, 0xe3, 0x00, 0xd1, 0xf6, 0x8b, 0xf1, 0xbc, 0xa9, 0xfc, 0x58, 0xe4, 0x03, 0x23, 0x36, 0xcd, 0x81, 0x9a, 0xaf, 0x57, 0x87, 0x44, 0xe5, 0x0d, 0x13, 0x57, 0xa0, 0xe4, 0x28, 0x67, 0x04, 0xd3, 0x41, 0xaa, 0x0a, 0x33, 0x7...
Rust
0
> { let _version = buf.read_int()?; let req_id = buf.read_int()?; Ok(( Response::AccountSummaryEndMsg(AccountSummaryEndMsg { req_id }), req_id, )) } //////////////////////////////////////////////////////////////////////////////////// pub fn encode_req_managed_accts( ctx: &mut Contex...
Rust
0
Rg11Unorm, wgpu::TextureFormat::EacRg11Snorm, ]; // needs TEXTURE_COMPRESSION_ASTC_LDR use wgpu::{AstcBlock, AstcChannel}; static TEXTURE_FORMATS_ASTC: &[wgpu::TextureFormat] = &[ wgpu::TextureFormat::Astc { block: AstcBlock::B4x4, channel: AstcChannel::Unorm, }, wgpu::TextureFormat::As...
Rust
0
t = T::B(5, 10); let v = irmatch!(t; T::B(..) => (), T::A(..) => ()); assert_eq!((), v); } #[test] #[should_panic] fn multi_pattern_fail() { let t = T::B(5, 10); let v = irmatch!(t; T::D => (), T::A(..) => ()); assert_eq!((), v); } } <reponame>danthompson4...
Rust
0
dynamic_finding=True, date=vuln.get("vulnerableSince"), ) # build references refs = "" for ref in vuln.get("refs", {}): if ref.startswith("BID"): refs += f" * [{vuln['refs'][ref]}](https://www.securityfocus.com/bi...
Python
1
import pygame from random import randrange as rnd WIDTH, HEIGHT = 1200, 800 pygame.display.set_caption('Arkanoid') fps = 60 # paddle settings paddle_w = 330 paddle_h = 35 paddle_speed = 15 paddle = pygame.Rect(WIDTH // 2 - paddle_w // 2, HEIGHT - paddle_h - 10, paddle_w, paddle_h,) # ball settings ball_radius = 20 bal...
Python
1
class Solution: """ 458.可怜的小猪 利用信息编码"通过实验得出的编码(a,b)恰好就是那个预先分配给有毒桶的编码"正是因为我们的实验设计就是以这种唯一映射为基础,确保有毒桶的"信息输出"能够直接反映到猪死亡的时序上,从而还原出桶的编码. """ def poorPigs(self,buckets:int,minutesToDie:int,minutesToTest:int)->int: """ (R+1)^p>=buckets ,通过数学推导求出p,这里不要用math.log会产生错误 Args: ...
Python
1
ast_name'] class MessageSerializer(serializers.ModelSerializer): user = UserMessageSerializer() typeM = serializers.SerializerMethodField() class Meta: model = Message fields = '__all__' def get_typeM(self, obj): request = self.context.get('request') if request and re...
Python
1