text
string
label_name
string
labels
int64
0, #[doc = "MCE GPO line 3"] MCEGPO3, #[doc = "MCE GPO line 2"] MCEGPO2, #[doc = "MCE GPO line 1"] MCEGPO1, #[doc = "MCE GPO line 0"] MCEGPO0, #[doc = "CPE GPO line 3"] CPEGPO3, #[doc = "CPE GPO line 2"] CPEGPO2, #[doc = "CPE GPO line 1"] CPEGPO1, #[doc = "CPE...
Rust
0
iter(part_2); } } <reponame>keroro520/useless //! Legacy CKB AppConfig and Miner AppConfig use serde::Deserialize; use std::path::PathBuf; use crate::cli; mod store; mod tx_pool; pub(crate) struct DeprecatedField { pub(crate) path: &'static str, // The first version which doesn't include the field. ...
Rust
0
# assemble IPv6 packet ip6_packet_tx = Ip6Assembler( src=ip6_src, dst=ip6_dst, hop=ip6_hop, carried_packet=carried_packet ) # Check if IP packet can be sent out without fragmentation, # if so send it out. if len(ip6_packet_tx) <= config.TAP_MTU: self.packet_stats_tx.ip6__mtu_ok__se...
Python
1
>::PairMismatch); let (base_amount_excluding_fees, quote_amount, lp_fees, protocol_fees) = Self::do_compute_swap(pool_id, pair, quote_amount, true)?; ensure!( base_amount_excluding_fees >= min_receive, Error::<T>::CannotRespectMinimumRequested ); let pool_account = Self::account_id(&pool_id); ...
Rust
0
.as_i64x8(), b.as_f64x8())) } /// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). /// /// [Intel's documentation](...
Rust
0
import requests import json url = "https://raw.githubusercontent.com/ProbiusOfficial/Hello-CTFtime/main/CN.json" def getNewCompetition(): response = requests.get(url,proxies={'http': None, 'https': None}) data = json.loads(response.text) return data if __name__ == "__main__": print(getNewCompetition()...
Python
1
def metade(n, f): if f is True: print(f'O metade de R${moedas(n)} é R${moedas(n/2)}') else: print(f'O metade de n é {(n / 2)}') def dobro(n, f): if f is True: print(f'O dobro de R${moedas(n)} é R${moedas(n*2)}') else: print(f'O dobro de {n} é {(n * 2)}') def porcen(n, f)...
Python
1
ol, age: (Age, u32), } #[derive(PartialEq, Debug)] enum Transmission { Manual, SemiAuto, Automatic, } #[derive(PartialEq, Debug)] enum Age { New, Old, } fn car_quality(miles: u32) -> (Age, u32) { let quality = (New, miles); quality } fn car_factory(color: String, motor: Transmission,...
Rust
0
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import sys import time from django.conf import settings from django.shortcuts import render from django.v...
Python
1
other.timestamp) } } impl<T> PartialOrd for TimedEvent<T> { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) } } impl<T> PartialEq for TimedEvent<T> { fn eq(&self, other: &Self) -> bool { self.timestamp == other.timestamp } } impl<T> Eq for TimedEven...
Rust
0
reader.read_u32(u16::from(offset)); let message_control = (dword >> 16) as u16; if message_control & Self::MC_PVT_CAPABLE_BIT != 0 { if message_control & Self::MC_64_BIT_ADDR_BIT != 0 { Self::_64BitAddressWithPvm { message_control: dword, ...
Rust
0
# 封装模型对象,模型内部由多个隐藏层构成 if '__file__' in globals(): import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import lezero.layers as L import lezero.functions as F from lezero import utils import numpy as np from lezero.layers import Convolution, Pooling, Relu, Affine, Sigmoid from collecti...
Python
1
_space() { return Err(self.error_unexpected(loc, "Unexpected ':'.")); } // Symbol literal let token = self.get()?; let symbol_loc = self.prev_loc(); let id = match &token.kind { TokenKind::Punct(punct) => self.parse_op_definable(punct)?, TokenK...
Rust
0
from __future__ import unicode_literals, division, absolute_import, print_function __license__ = 'GPL v3' __copyright__ = '2011, Grant Drake' try: from qt.core import QToolButton except ImportError: from PyQt5.Qt import QToolButton try: load_translations() except NameError: pass # load_translations...
Python
1
d self.gno(k_reduced) has shape B*C, 1, H, W, 2) kspace_pred = k_reduced.clone() + (~mask * self.kno(k_reduced)) elif self.skip_method == "add": kspace_pred = k_reduced.clone() + self.kno(k_reduced) elif self.skip_method == "concat": kspace_pred = torch.cat([k_reduced...
Python
1
def full_function(): # Note that this function is not called, it's there just to make the mapping explicit. a = 1 # map to cEll1, line 2 b = 2 # map to cEll1, line 3 c = 3 # map to cEll2, line 2 d = 4 # map to cEll2, line 3 def create_code(): cell1_code = compile(''' # line 1 a = 1 # lin...
Python
1
`DBGEN`"] pub type DBGEN_R = crate::R<bool, DBGEN_A>; impl DBGEN_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DBGEN_A { match self.bits { false => DBGEN_A::_0, true => DBGEN_A::_1, } } #[doc = "Checks if the value of...
Rust
0
mple_one.append(u_max_mag_3) label_sample_one.append(u_max_ang_3) label_sample_one.append(v_max_mag_3) label_sample_one.append(v_max_ang_3) label_sample_one.append(max_du_idx) label_sample_one.append(max_dv_idx) label_sample_one = np.array(label_sample_one) return clip_sample_one,label_...
Python
1
let decls = module.get_decls(); assert_eq!( decls[0].get_type(), Some(FuncType::new_func_type(Some(vec![BasicType::int()]), BasicType::int())) ); } #[test] fn test_funcs_1() { let module = make_module( indoc! {r#" mul x y = x * y m = mul a = m 5 5 ...
Rust
0
therefore has been ///changed to fb_type. #[repr(C)] #[derive(Clone, Debug)] pub struct FixScreeninfo { pub id: [u8; 16], pub smem_start: usize, pub smem_len: u32, pub fb_type: u32, pub type_aux: u32, pub visual: u32, pub xpanstep: u16, pub ypanstep: u16, pub ywrapstep: u16, pub...
Rust
0
feature = "unicode-script", feature = "unicode-segment", ))] fn imp(name: &'static str) -> Result<Option<PropertyValues>> { use unicode_tables::property_values::PROPERTY_VALUES; Ok(PROPERTY_VALUES .binary_search_by_key(&name, |&(n, _)| n) .ok() .map...
Rust
0
ndex, last_log_term, }); } } self.storage.append_log_entries(req.entries)?; let (last_log_index, last_log_term) = self.storage.get_last_log_index_term(); trace!( "Storage appended log entries: last_log_index: {}, last_log_term: {}", last_log_index, last_log_term ); Ok(AppendEntriesRes ...
Rust
0
(|reg| { reg != &stackptr() && reg != &ptr() && reg != &condstackptr() && reg != &condtempholder() && //reg != &stackbaseptr() && reg != &ScoreHolder::new("%phi".into()).unwrap() && !reg.as_ref().contains("%%fixup") && !reg....
Rust
0
ee_bug_13() { // postmortem: failed root hoists were being improperly recovered before the // following free was done on their page, but we treated the written node as // if it were a successful completed root hoist. prop_tree_matches_btreemap( vec![ Set(42, 10), Set(137,...
Rust
0
import random from . import * @dominator_cmd(pattern="sing$") async def _(e): txt = random.choice(SONGS) await eor(e, txt) @dominator_cmd(pattern="hps$") async def _(e): txt = random.choice(HARRY) await eor(e, txt) @dominator_cmd(pattern="gott$") async def _(e): txt = random.choice(GOTT) aw...
Python
1
able std. #[cfg(feature = "serde_derive")] #[allow(unused_imports)] #[macro_use] extern crate serde_derive; #[cfg(feature = "serde_derive")] #[doc(hidden)] pub use serde_derive::*; use std::{collections::HashMap, path::PathBuf}; const LOGGER_FILTER: &str = "warn"; const LOGGER_LOG_TO_CONSOLE: bool = true; const LOGGER...
Rust
0
bool = false; for chr in line.chars() { if opening_brackets.contains(&chr) { work_vec.push(chr); } else { if work_vec.last().unwrap() == &closing_brackets_lookup[&chr] { work_vec.pop(); } else { corru...
Rust
0
<PeerId>, ) { Protocol::request_milestone(tangle, milestone_requester, requested_milestones, MilestoneIndex(0), to) } // MessageRequest pub(crate) async fn request_message<B: Backend>( tangle: &MsTangle<B>, message_requester: &flume::Sender<MessageRequesterWorkerEvent>, ...
Rust
0
); } Ok(()) } #[test] fn test_data_block_nullable() -> Result<()> { test_data_block(true) } #[test] fn test_data_block_not_nullable() -> Result<()> { test_data_block(false) } <filename>src/tests/convolutional.rs use std::fmt; use co::prelude::*; use co::plugin::numeric_helpers::Float; use plugin::{C...
Rust
0
]) points2 = np.array([ (0.1, 1), (0.7, 1.1), (1.8, 1.8), (1.8, 0.2), (0.2, 0.2) ]) points2 = np.roll(points2, -1, axis=0) # Call closest_points() to and plot the results. s1, ...
Python
1
use web3::types::{H160, U256}; #[derive(Debug)] pub struct Convenience<T> where T: web3::Transport, { contract: Contract<T>, } impl<T: web3::Transport> Convenience<T> { pub fn new(web3: &web3::Web3<T>, address: H160) -> Self { let contract = Contract::from_json( web3.eth(), ...
Rust
0
import numpy as np import torch import torch.nn.functional as F from omegaconf import OmegaConf import sys sys.path.append('../') from tracker.config import CONFIG from tracker.model.cutie import CUTIE from tracker.inference.inference_core import InferenceCore from tracker.utils.mask_mapper import MaskMapper from to...
Python
1
import util class test_array: def init(self): for t in util.TYPES.ALL: yield t @util.add_bh107_cmd def test_list(self, dtype): cmd = "res = M.array([1,2,3], dtype=%s)" % dtype return cmd @util.add_bh107_cmd def test_scalar(self, dtype): cmd = "res = M....
Python
1
name: name.to_owned(), } } #[test] fn test_parse_fstring() { let source = String::from("{a}{ b }{{foo}}"); let parse_ast = parse_fstring(&source).unwrap(); assert_eq!( parse_ast, Joined { values: vec![ FormattedV...
Rust
0
counts allocations on the Rust side only let (alloc_stats, _) = count_alloc(|| { let start = Instant::now(); for _ in 0..iterations { // This has no measurable impact on performance (~30ns) let needle = needles.choose(&mut rand::thread_rng()).expect("needles is not empty"); black_box(db.get_by...
Rust
0
header.encode(&mut raw_header); /// assert_eq!(raw_header, expected_raw_header); /// ``` fn encode<Target>(&self, values: &mut Target) where Target: Extend<HeaderValue>, { // Unsafe Justification // // Header values must be valid UTF-8, and since we know that the [`Me...
Rust
0
c.locals_clean(total_var_count, span); c.asm.push(Inst::Return, span); } else { c.locals_pop(total_var_count, span); c.asm.push(Inst::ReturnUnit, span); } Ok(Asm::top(span)) } } <gh_stars>10-100 use crate::assets::image::{ ImageAssetData, Ima...
Rust
0
ffi::{CStr, CString}; use crate::attribute::*; use crate::errors::Result; pub use crate::ffi::{ enums::*, AttributeInfo, BoxInfo, CookOptions, CurveInfo, GeoInfo, InputCurveInfo, PartInfo, Transform, VolumeInfo, VolumeTileInfo, VolumeVisualInfo, }; use crate::material::Material; use crate::node::{HoudiniNode, ...
Rust
0
self } } #[doc = "Bits 3:4 - Conversion Result Resolution"] #[inline] pub fn ressel(&mut self) -> _RESSELW { _RESSELW { w: self } } #[doc = "Bits 8:10 - Window Monitor Mode"] #[inline] pub fn winmode(&mut self) -> _WINMODEW { _WINMODEW { w: self } } #[doc = "Bit ...
Rust
0
ret.flag_aot_link_static = true; } } ret } } impl Default for VMOptions { fn default() -> VMOptions { VMOptions::init("") } } <reponame>robo9k/chip8-rs<gh_stars>1-10 //! Keys and keypad use crate::errors::Chip8Error; use core::convert::TryFrom; use core...
Rust
0
n', 'espaloma', 'manual'), ] # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'espaloma', 'espaloma Documentation', [author], 1) ] # ...
Python
1
seGenerator): """工作流生成器""" def __init__(self, workflow_id: str, **kwargs): super().__init__(**kwargs) self.workflow_id = workflow_id def generate(self, **kwargs) -> Dict[str, Any]: """执行工作流""" return self.coze_client.run_workflow( workflow_id=self.workfl...
Python
1
def checkPalindrome(string): # Returns true if str is palindrome, # else false length = len(string) length -= 1 for i in range(length): if string[i] != string[length]: return False length -= 1 return True def printSolution(partitions): for i in r...
Python
1
"E12": 0.02, "Myra Liddel": 0.02, "E11": 0.02, "Eleanor Nye": 0.01, "Frances Anderson": 0.01, "Pearl Oglethorpe": 0.01, "E4": 0.01, "Charlotte McDowd": 0.01, "E10": 0.01, "Olivia Carleton": 0.01, ...
Python
1
"""Module defining functions for manipulating lobster files.""" from __future__ import annotations import logging from typing import TYPE_CHECKING from atomate2.common.files import copy_files, get_zfile, gunzip_files from atomate2.utils.file_client import FileClient, auto_fileclient from atomate2.utils.path import s...
Python
1
b"HTTP/1.0", b"HTTP/1.1", b"HTTP/2", b"HTTP/3" ) } /// Gets the body len gth from the [`Request::headers`] of `request`. /// /// If [`method_has_request_body`] returns `false` or the header isn't present, it defaults to `0`. #[inline] pub fn get_body_length_request<T>(request: &Request...
Rust
0
,66,66,0 ], &[ 4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12,0 ], ]; #[rustfmt::skip] static G_POW43: [f32; 145] = [ 0.0, -1.0, -2.519_842, -4.326_749, -6.349_604, -8.549_88, -10.902_724, -13.390_518, -16.0, -18.720_755, -21.544_348, -24.463_781, -27.473_1...
Rust
0
( "/google.bigtable.admin.table.v1.BigtableTableService/DeleteColumnFamily", ); self.inner.unary(request.into_request(), path, codec).await } #[doc = " Delete all rows in a table corresponding to a particular prefix"] pub async fn bulk_delete_rows( ...
Rust
0
_code)] #[derive(Serialize, Deserialize, Debug, Copy, Clone)] pub struct Peer { pub id: PeerID, pub peer_type: PeerType, pub addr: SocketAddr, } impl From<peer::Peer> for Peer { fn from(p: peer::Peer) -> Self { Self { id: p.id, peer_type: p.peer_type, addr: p.addr, } } } impl Into<...
Rust
0
inal_scale` corresponds to the reciprocal of the # `scale` passed in this function. scale = ops.reciprocal(scale) sf = ops.divide(ops.divide(dtype_max, amax), 2**margin) sf = ops.where(amax > 0.0, sf, scale) sf = ops.where(ops.isfinite(amax), sf, scale) return ops.reciprocal(sf) @keras_export(...
Python
1
ertConfig.from_pretrained(args.model_name_or_path) decoder_model = BertForMaskedLM(config) model = Model2Model.from_pretrained( args.model_name_or_path, decoder_model=decoder_model ) # Setup logging logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s"...
Python
1
ta.axis['chan'] = empty(n_trl, dtype='O') data.axis['time'] = empty(n_trl, dtype='O') data.data = empty(n_trl, dtype='O') for i, one_begsam, one_endsam in zip(range(n_trl), begsam, endsam): dataset = self.dataset #lg.debug('begsam {0: 6}, endsam {1: 6}'.format(one_begsam...
Python
1
match Domain::new(1 << log2_size) { Some(x) => Ok(x.group_gen), None => Err( ocaml::Error::invalid_argument("caml_tweedle_fp_domain_generator") .err() .unwrap(), ), } } #[ocaml::func] pub fn caml_tweedle_fp_to_bytes(x: ocaml::Pointer<Fp>) -> ...
Rust
0
vc, vd, m[12], m[1], m[14], m[4], m[0], m[6], m[9], m[8], m[5], m[15], m[13], m[10], m[7], m[3], m[2], m[11] ); ROUND!( va, vb, vc, vd, m[13], m[7], m[12], m[3], m[5], m[15], m[8], m[2], m[11], m[14], m[1], m[9], m[0], m[4], m[6], m[10] ); ROUND!( va, vb, vc, vd, m[6], m...
Rust
0
ith(|rng| { let seed_values: &[_] = &[seed]; rng.rng.borrow_mut().reseed(seed_values); }); } pub fn seedable_unit_distribution() -> f32 { thread_seedable_rng().gen_range(0.0, 1.0) } pub fn unit_distribution() -> f32 { thread_rng().gen_range(0.0, 1.0) } pub fn random_in_unit_sphere() -> Ve...
Rust
0
env=env) move_source_tree('.', None, '../osx/include', arch=platform.arch, prefix=platform.prefix, suffix=platform.suffix) move_source_tree('./include', None, '../osx/include', arc...
Python
1
, HashMap<String, NodeIndex>)) -> usize { let (g, hm) = input; let bagidx = hm["shiny gold"]; let res = count_all_containing(g, bagidx); res.len() } fn count_all_contained(g: &Graph<String, usize>, idx: NodeIndex) -> usize { // idea: bags_in_idx = sum_for_neighbours(edge*(1 + count_all_contained(g,...
Rust
0
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import errno def mtime(path): try: return os.stat(path).st_mtime except OSError as e: ...
Python
1
#!/usr/bin/env python3 # Copyright (C) 2019 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys from testrunner import run # For BOARD's with large amount of RAM allocating all chunk...
Python
1
device: Option<String>, spec: &'callback AudioSpec<'callback, T>, fallback: FallbackFlag, ) -> Result<(Self, AudioDeviceProperty)> { let (id, prop) = open(true, device, spec, fallback)?; Ok(( Self { id, _phantom: PhantomData, ...
Rust
0
# Copyright (C) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
Python
1
import yaml def format_metrics(metrics, formatter="{:.6}"): newmetrics = {} for key, val in metrics.items(): newmetrics[key] = formatter.format(val) return newmetrics def save_metrics(path, metrics): with open(path, "w") as yfile: yaml.dump(metrics, yfile) def load_metrics(...
Python
1
MetricType::Counter => "c", MetricType::Gauge => "g", MetricType::Histogram if self.mode == Compatibility::StatsD => "ms", MetricType::Histogram => "h", MetricType::Distribution if self.mode == Compatibility::StatsD => "ms", MetricType::Distribution ...
Rust
0
import pytest from nltk.corpus.reader import CorpusReader @pytest.fixture(autouse=True) def mock_plot(mocker): """Disable matplotlib plotting in test code""" try: import matplotlib.pyplot as plt mocker.patch.object(plt, "gca") mocker.patch.object(plt, "show") except ImportError:...
Python
1
dad Nodo 1", command=verificar_integridad_nodo_1) boton_validar_nodo_1.pack(side=tk.LEFT, padx=5) boton_validar_nodo_2 = ttk.Button(frame_acciones, text="Verificar integridad Nodo 2", command=verificar_integridad_nodo_2) boton_validar_nodo_2.pack(side=tk.LEFT, padx=5) boton_manipular_nodo_2 = ttk.Button(frame_accione...
Python
1
stream in listener.incoming() { let stream = stream; match stream { Ok(stream) => match self.handle(stream) { Ok(_) => {} Err(err) => { println!("{}", err); } } E...
Rust
0
MAGNITUDE_2; const HOUR: usize = MINTUE * TIME_MAGNITUDE_2; pub fn parse_readable_int(size: &str) -> Result<i64, ConfigError> { let (num, unit) = try!(split_property(size)); match &*unit.to_lowercase() { // file size "kb" => Ok((num * (KB as f64)) as i64), "mb" => Ok((num * (MB as f64)...
Rust
0
"name": "NumberInput", "props": {"key": "smtp_port", "required": False, "enablePrint": True}, "title": "smtp_port", "value": "", "valueType": "Number"}, {"id": "field1961537219657", "icon": "el-icon-edit", "name": "TextInput", ...
Python
1
import nltk nltk.download('punkt'); nltk.download('averaged_perceptron_tagger') tokens = nltk.word_tokenize("This is an example.") tags = nltk.pos_tag(tokens) print(tags)
Python
1
# import logging # from modelscope.utils.logger import get_logger # logger = get_logger(log_level=logging.ERROR) import os, sys, re, json, argparse from PreProcess import * from SceneSplitting import * from KeyFrame import * # from OpticalFlow import * from utils import * def video_clean_pipline(videos_dirs,cutsce...
Python
1
# Programmer: limodou # E-mail: limodou@gmail.com # # Copyleft 2006 limodou # # Distributed under the terms of the GPL (GNU Public License) # # UliPad 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 So...
Python
1
== 0 or anchors.shape[0] == 0: labels[:] = 0 else: labels[bg_inds] = 0 labels[anchors_with_max_overlap] = gt_classes[gt_inds_force] bbox_targets = anchors.new_zeros((num_anchors, self.box_coder.code_size)) if len(gt_boxes) > 0 and anchors.sha...
Python
1
5() .event_driven() .resolution(20_000) .build(); recv.event(20, true).unwrap(); /* let mut receiver: Receiver<Rc5, PeriodicPolled, _> = Builder::<Rc5>::new() .periodic_polled() .timer_resolution(20_000) .build(); receiver.poll(); */ } #[test] fn r...
Rust
0
Poly|Init|Ref|XorOut| /// |---|---|---|---|---| /// |0xD0DB|0x8BB7|0x0000|false|0x0000| /// /// ``` /// # extern crate crc_any; /// # use crc_any::CRC; /// let mut crc = CRC::crc16t10_dif(); /// crc.digest(b"123456789"); /// # #[cfg(features = "alloc")] /// assert_eq!("0xD0DB", &...
Rust
0
vec![ { let mut lib_core = opt.repo_root.clone(); lib_core.push("library"); lib_core.push("core"); lib_core }, { let mut lib_alloc = opt.repo_root.clone(); lib_alloc.push("library"); lib_alloc.push("alloc"); ...
Rust
0
libs: self.libs, remappings: self.remappings, } } /// Serialize the config type as a String of TOML. /// /// This serializes to a table with the name of the profile /// /// ```toml /// [default] /// src = "src" /// out = "out" /// libs = ["lib"] ...
Rust
0
), 4); assert_eq!(data, vec![1, 2, 3, 4]); }); } #[test] fn borrow_array_1d_dynamic() { JULIA.with(|j| { let mut jlrs = j.borrow_mut(); let mut data = vec![1u64, 2, 3, 4]; let unboxed = jlrs .dynamic_frame(|_, frame| { let array = Value::borrow_array...
Rust
0
lingAdler32; use byteorder::LittleEndian; use byteorder::ReadBytesExt; use ::misc::*; pub struct AdlerRead <Source: BufRead> { source: Source, adler: RollingAdler32, byte_count: usize, } pub fn adler_verify_hash < Source: BufRead, PrefixFunction: Fn () -> String, > ( prefix_function: PrefixFunction, adler_re...
Rust
0
import win32gui class WindowManager: def get_game_window(self): """Find the Telegram window""" def callback(hwnd, windows): if "Telegram" in win32gui.GetWindowText(hwnd): windows.append(hwnd) return True windows = [] win32gui.EnumWind...
Python
1
bosses_scaling_upper: BossesScalingUpper enemizer_attacks: EnemizerAttacks enemizer_groups: EnemizerGroups shuffle_res_weak_types: ShuffleResWeakType shuffle_enemies_position: ShuffleEnemiesPositions progressive_formations: ProgressiveFormations doom_castle_mode: DoomCastle doom_castle_...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 28 00:25:58 2021 @author: Alexei """ import os working_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),"../../..")) os.chdir(working_dir) ESTIMATE = True if __name__ == '__main__': """ The main test program. """ from ...
Python
1
alse: settings.spamContentInput = True self.ui.spamContentCheckBox.blockSignals(True) self.ui.spamContentCheckBox.setCheckState(Qt.CheckState.Checked) self.ui.spamContentInput.show() self.ui.spamContentCheckBox.blockSignals(False) def ...
Python
1
# 从找到的检查点文件列表中,选择最新的文件 latest = max(chkpts, key=os.path.getctime) return latest, version # def set_resume_parameters(hparams): version = get_latest_version(f"./checkpoints/{hparams.exp_name}") print('utils.py, set_resume_parameters function, the latest_version is ', version) if version is no...
Python
1
!($file_prefix, $field), "` file.", gen_doc!(_see_method; $method) ) }; (see $(; $field: ident )?) => { concat!( "See" $(, " [`Resources.", stringify!($field), "`]", "(struct.Resources.html#structfield.", stringify!($field), ") and" )?, " the kernel's documentation ...
Rust
0
pub use let_recursive::*; pub use module::*; pub use record::*; pub use record_field::*; pub use try_operation::*; pub use type_definition::*; pub use variable::*; pub use variant::*; <gh_stars>0 use dynomite::{ attr_map, dynamodb::{ AttributeDefinition, CreateTableInput, DynamoDb, DynamoDbClient, GetIt...
Rust
0
from dataclasses import dataclass from kubernetes import client from prowler.config.config import output_file_timestamp from prowler.providers.common.models import ProviderOutputOptions @dataclass class KubernetesIdentityInfo: context: str cluster: str user: str @dataclass class KubernetesSession: ...
Python
1
32; 3]; /// # assert_eq!(core::mem::size_of::<Prefix>(), 12); /// # assert_eq!(core::mem::align_of::<Prefix>(), 4); /// type Suffix = [u64; 2]; /// # assert_eq!(core::mem::size_of::<Suffix>(), 16); /// # assert_eq!(core::mem::align_of::<Suffix>(), 8); /// type Alloc = Affix<Chunk<System, 128>, Prefix, Suffix>; /// /// ...
Rust
0
lowed /// /// fragment /// CLOB_LONG_TEXT_NO_QUOTE /// : (CLOB_ESCAPE | CLOB_LONG_TEXT_ALLOWED) /// ; /// Parser of CLOB_SHORT_TEXT_ALLOWED fn take_clob_short_text_allowed(i: &[u8]) -> IonResult<&[u8], &[u8]> { take_while1(is_clob_short_text_allowed)(i) } /// non-control ASCII and not double quote or back...
Rust
0
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # Download and build the da...
Python
1
to an extern "C" type used to invoke a function. pub type Invoke = unsafe extern "C" fn( trampoline: Trampoline, vmctx: *mut vm::Ctx, func: NonNull<vm::Func>, args: *const u64, rets: *mut u64, trap_info: *mut WasmTrapInfo, user_error: *mut Option<Box<dyn Any>>, extra: Option<NonNull<c_v...
Rust
0
ến theo nhu cầu. Nhấp vào liên kết bên phải để bắt đầu', 'For Entity': 'Đối với đơn vị', 'For live help from the Sahana community on using this application, go to': 'Để được giúp đỡ trực tuyến từ cộng đồng Sahana về sử dụng phần mềm ứng dụng, mời đến', 'For more details on the Sahana Eden system, see the': 'Chi tiế...
Python
1
assert_approx(price, unbumped_price, 1e-12); // now bump the yield underlying the equity and price. This // increases the forward, so we expect the call price to increase. let bump = Bump::new_yield("LSE", BumpYield::new_flat_annualised(0.01)); let bumped = mut_data.bump...
Rust
0
ource.to_owned(), Message::ClickEvent(ref msg) => msg.source.to_owned(), Message::ViewEvent(ref msg) => msg.source.to_owned(), Message::QualificationVerifySuccessEvent(ref msg) => msg.source.to_owned(), } } pub fn get_target(&self) -> String { match *self { ...
Rust
0
import torch import os import pandas as pd def load_embeddings(file_path): """ 加载.pt文件中的embeddings :param file_path: .pt文件的路径 :return: embeddings['mean_representations'][33]的内容 """ try: embeddings = torch.load(file_path) return embeddings['mean_representations'][33].numpy() ...
Python
1
ReceiptResult, } #[derive(Clone, Debug)] pub enum ReceiptResult { Transfer { receiver: UserAddress, asset_id: AssetID, before_amount: Balance, after_amount: Balance, }, Approve { spender: ContractAddress, asset_id: AssetID, max: Balan...
Rust
0
read() if not ok: break if USE_TRACK: results = model.track(frame, conf=CONF, iou=IOU, imgsz=IMG_SZ, persist=True, tracker=TRACKER, verbose=False) else: results = model.predict(frame, conf=CONF, iou=IOU, imgsz=IMG_SZ, verbose...
Python
1
f" => { let face = Self::parse_face(part).map_err(|e| format!("line {}: {}", line_num, e))?; faces.push(face); } unknown => { log::warn!(target: "Obj Decoder", "line {}: '{}'. we only know 'v', 'vn' or 'f...
Rust
0
0.5, z: 0.5 } })); world.objects.push(Box::new(Sphere { center: Vec3 { x: 0., y: -1000., z: 0. }, radius: 1000., mat: ground })); for i in -11..11 { for j in -11..11 { let choose_mat: f64 = rng.gen(); let r1: f64 = rng.gen(); let r2: f64 = rng.gen();...
Rust
0
from .jitclass import jitclass
Python
1
; let mut existing_hash: HashMap<String, (i32, i32)> = HashMap::with_capacity((end / LIMIT_MULT_SP) as usize); let worst_score = map_json[map_json.len() - 1].map_data.score; let wr = map_json[0].map_data.score; for rank in map_json.iter() { existing_hash.insert( rank.map_d...
Rust
0