text
string
label_name
string
labels
int64
idx_ptr: u32, ptr: u32, ptr_next: u32, repeat_count: u16, repeat_bound: u16, write: bool, dims: u8, done: bool, indir: bool, accessed: bool, } /// A representation of a DMA backend's state. #[derive(Default)] #[repr(C)] pub struct DmaState { src: u64, dst: u64, src_s...
Rust
0
the version control system the dependency uses")) .arg(Arg::with_name("name") .takes_value(true) .required(true) .help("the name of the dependency (also folder name in target directory)")) .arg(Arg::with_name("url") .takes_value(tru...
Rust
0
import logging import pytest from httpx import Request from httpx._auth import FunctionAuth from pytest_httpx import HTTPXMock from genai import Client, Credentials from genai.schema import TextGenerationLimitRetrieveEndpoint from tests.helpers import match_endpoint logger = logging.getLogger(__name__) @pytest.mar...
Python
1
fn new( named: &'x [(impl Borrow<str>, GrammarNode)], start: &str, pnroot: &'x mut ParseNode, ) -> Result<Self, LinkError> { Ok(MatchCursor { g: LinkTreeCursor::new(named, start)?, m: TreeCursorMut::new(pnroot), }) } fn zero(&mut self) { ...
Rust
0
Is") print(" • Personalidades configurables") print("="*60) def main(): """Función principal de instalación""" print("🚀 Instalador de LucIA Pro - IA del Metaverso") print("=" * 50) # Instalar dependencias install_dependencies() # Crear directorios create_directories() ...
Python
1
context("Failed to get current channel")?; let channel_indices = get_channel_indices(&fdr).context("Channel indices not available")?; if !is_channel_in_allowlist(&channel_indices, &current_channel) { return Err(format_err!("Not in forced FDR allowlist")); } let channel_index = get_channel_ind...
Rust
0
ne_iters"] - 1 if (self.online_iter + 1) % self.var["eval_interval"] == 0 or is_last_iter: current_delay, current_eps = self.evaluate(augment_traj=False) if current_delay < online_min_delay: online_min_delay = current_delay online_min_e...
Python
1
: custom.separator_color, spacing: custom.spacing, padding: custom.padding, block_title: custom.block_title, abbreviation: custom.abbreviation, } } } /// This is the struct which stores the CustomThemes which is serialized from a json file. /// ## Example the...
Rust
0
return { "title": self.title, "link": self.link, "source": self.source } # Example usage if __name__ == "__main__": # Get all news articles articles = get_news_from_motley_fool() # Or filter by ticker # articles = get_news_from_motley_fool("AAPL") if...
Python
1
region[2] - region[1] gc_for_normalization.append(float(gc)) hap_cn = float(region[3].split("hapcn")[1]) if region_length is None or hap_cn is None: raise Exception("Problem with region definition. Length not specified.") count_sum = sum(l...
Python
1
import numpy as np import gym from keras.models import Sequential, Model from keras.layers import Dense, Activation, Flatten, Input, Concatenate from keras.optimizers import Adam from rl.agents import DDPGAgent from rl.memory import SequentialMemory from rl.random import OrnsteinUhlenbeckProcess # Import a few other ...
Python
1
"_si", "uch", "gen_", "ent", "e_d", "il", "hen", "ier", "_und", "ne_", "tz", "eb", "kt", "go", "eg", "us", "ite", "it_", "nen", "n_s", "_er", "ut", "uf", "end", "na", "la", "gle", "io", "sp", "oo", "ha", "ac", "_go", "nen_", "_â_", "_â", "nte"...
Rust
0
} } #![deny(unsafe_code)] #![no_main] #![no_std] #[allow(unused_imports)] use aux14::{entry, iprint, iprintln, prelude::*}; use aux14::i2c1::RegisterBlock; // slave address const MAGNETOMETER: u16 = 0b0011_1100; // magnetometer's registers const WHO_AM_I_M: u8 = 0x4F; const CFG_REG_A_M: u8 = 0x60; const OUT_X_L_REG_...
Rust
0
x = 1 y = 1.0 z = "1" if x == y: print("one") if y == int(z): print("two") elif x == y: print("three") else: print("four")
Python
1
// are multiple source lanes! let road = map.get_parent(group[0].id.src); let src = if turn_type == TurnType::Right { group .iter() .max_by_key(|t| road.dir_and_offset(t.id.src).1) .unwrap() .id .src } el...
Rust
0
EcoreInputStructUnnamed6 { pub device: c_int, pub radius: c_double, pub radius_x: c_double, pub radius_y: c_double, pub pressure: c_double, pub angle: c_double, pub x: c_double, pub y: c_double, pub root: EcoreInputStructUnnamed7, } #[repr(C)] pub struct EcoreInputStructUnnamed7 { ...
Rust
0
flags to a single tensor concat_anchor_list = [] for i in range(len(anchor_list)): concat_anchor_list.append(torch.cat(anchor_list[i])) all_anchor_list = videos_to_levels(concat_anchor_list, num_level_anchors) losses_cls, losses_se...
Python
1
from collections import deque from copy import deepcopy def valid_move(state, from_tube, to_tube): if not state[from_tube] or (state[to_tube] and state[to_tube][-1] != state[from_tube][-1]): return False if len(state[to_tube]) == 8: return False return True def make_move(state, from_tube,...
Python
1
= tempfile::tempdir().expect("create temp dir to sled db"); let db_path = t.path().join("test-tmp.db"); let mut disk_db = DB::new_disk_db(db_path, true)?; disk_db.deserialize(&data)?; check_initial_data(&mut disk_db)?; Ok(()) } #[test] fn test_dump_sql() -> Result<()> { let mut mem_db = DB::n...
Rust
0
_MMXq = 1122, XED_IFORM_PAVGB_XMMdq_MEMdq = 1123, XED_IFORM_PAVGB_XMMdq_XMMdq = 1124, XED_IFORM_PAVGUSB_MMXq_MEMq = 1125, XED_IFORM_PAVGUSB_MMXq_MMXq = 1126, XED_IFORM_PAVGW_MMXq_MEMq = 1127, XED_IFORM_PAVGW_MMXq_MMXq = 1128, XED_IFORM_PAVGW_XMMdq_MEMdq = 1129, XED_IFORM_PAVGW_XMMdq_XMMd...
Rust
0
(ball_x<=14) and (int(ball_y) in list(range(int(paddle1_y), int(paddle1_y+141)))): s = mixer.Sound('pong.ogg') mixer.Sound.play(s) ball_dx = 0.3 if (ball_x>=760) and (int(ball_y) in list(range(int(paddle2_y), int(paddle2_y+141)))): e = mixer.Sound('pong....
Python
1
letions, in reverse order from what you get with regular polling. New clients // should update to the new polling endpoints ASAP. pub from_message_server_id: Option<i64>, pub from_deletion_server_id: Option<i64>, } #[derive(Debug, Serialize)] pub struct CompactPollResponseBody { #[serde(rename = "room...
Rust
0
`(e: EditorLayoutInfo) => void` #[wasm_bindgen(method, js_class = "ICodeEditor", js_name = "onDidLayoutChange")] pub fn on_did_layout_change(this: &ICodeEditor, listener: &Function) -> IDisposable; /// An event emitted when the content width or content height in the editor /// has changed. @event /...
Rust
0
"""Runs calibration on acceleration data. Args: acceleration: the accelerometer data containing x,y,z axis data and time stamps. return_input_on_error: If true, will return the input acceleration data if calibration fails. If false, will raise an exce...
Python
1
oder, Encoder}; use neqo_crypto::Epoch; use crate::stream_id::{StreamId, StreamIndex}; use crate::{AppError, TransportError}; use crate::{ConnectionError, Error, Res}; use std::cmp::min; use std::convert::TryFrom; #[allow(clippy::module_name_repetitions)] pub type FrameType = u64; const FRAME_TYPE_PADDING: FrameTyp...
Rust
0
{ Self { listeners } } } impl Listener for MemoryListener { fn init(&mut self, logger: &Logger, _service_name: &str) -> Box<Future<Item=(), Error=NotificationError> + Send> { info!(logger, "🧠 Creating new MemoryListener"); warn!(logger, "🚨 This listener will list...
Rust
0
ndex: c_int, } impl Default for xcb_record_client_spec_iterator_t { fn default() -> Self { unsafe { std::mem::MaybeUninit::zeroed().assume_init() } } } /// The `Record::CS` enum. /// /// This enum has the following variants: /// /// - [`Record::CS::CurrentClients`](XCB_RECORD_CS_CURRENT_CLIENTS) /// -...
Rust
0
self.wrapper_attributes .insert("target".into(), target.into()); self } /// Sets the `overwrite` preference for the generated image. /// /// If `false` the image will only be generated if the chosen output file /// doesn't already exist. /// If `true` the image will...
Rust
0
merged with the active scan command that's // still enqueued, and so should not issue another request to MLME let scan_cmd = DiscoveryScan::new(40, fidl_common::ScanType::Active); assert!(sched.enqueue_scan_to_discover(scan_cmd).is_none()); // Report scan result and scan end sc...
Rust
0
ERVE PER MACOS APP try: mode = None for arg in args: if arg.lower() == "systray": mode = "systray" break elif arg.lower() == "window": mode = "window" break elif arg.lower() == "info": ...
Python
1
let mut set = MemorySet::new(); for ph in elf.program_iter() { if ph.get_type() != Ok(Type::Load) { continue; } let (virt_addr, mem_size, flags) = match ph { ProgramHeader::Ph32(ph) => (ph.virtual_addr as usize, ph.mem_size as usize, ph.flags), Program...
Rust
0
l Default for StackMachine { fn default() -> StackMachine { StackMachine { st: StackMachineState::default(), trap_handlers: Vec::new(), } } } macro_rules! pop_number_stack { ($variable:ident) => { $variable .st .number_stack ...
Rust
0
indOf, { tensor_index .iter() .map(|&tensor_index| { let inner = self .tensor_inner(tensor_index) .ok_or_else(|| Error::internal_error("invalid tensor index"))?; let tensor_info: TensorInfo = inner.into(); ...
Rust
0
lf.system_probability_f, "system_hri_f": self.system_hri_f, "remarks": self.remarks, "function_1": self.function_1, "function_2": self.function_2, "function_3": self.function_3, "function_4": self.function_4, "function_5": self.function...
Python
1
""" Plugin for ResolveURL Copyright (C) 2016 anxdpanic 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 version. ...
Python
1
/////////////// #[sabi(with_boxed_constructor)] SaysThankYou(RBox<SaysThankYou>) } impl<T> Display for Message<T> where T:Display { fn fmt(&self,f:&mut fmt::Formatter<'_>)->fmt::Result{ match self { Message::__NonExhaustive=>unreachable!(), Message::SaysHello=>writ...
Rust
0
akly connected /// /// :param PyDiGraph graph: The graph to check if it is weakly connected /// /// :returns: Whether the graph is weakly connected or not /// :rtype: bool /// /// :raises NullGraph: If an empty graph is passed in #[pyfunction] #[text_signature = "(graph, /)"] pub fn is_weakly_connected(graph: &digraph:...
Rust
0
pegloadBufferOptions` -> optional arguments /// returns `VipsImage` - Output image pub fn jpegload_buffer_with_opts( buffer: &[u8], jpegload_buffer_options: &JpegloadBufferOptions, ) -> Result<VipsImage> { unsafe { let buffer_in: *mut c_void = buffer.as_ptr() as *mut c_void; let mut out_out:...
Rust
0
"""Flatten Layout.""" # Copyright (C) 2024-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import TYPE_CHECKING, Type, Union, cast from model_api.visualizer.primitive import Label from .layout import Layout if TYPE_CHECKING: import PIL from mode...
Python
1
import re import torch import torch.nn.functional as F class CustomRepetitionPenaltyLogitsProcessorRepeat(): def __init__(self, penalty: float, max_input_ids, past_window): if not isinstance(penalty, float) or not (penalty > 0): raise ValueError(f"`penalty` has to be a strictly positive ...
Python
1
import sys import numpy as np from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout from PyQt5.QtCore import QTimer from threading import Thread class SentenceDisplay(QWidget): def __init__(self): super().__init__() self.sentence_label = QLabel() self.sentence = ""...
Python
1
x0dJ\xea\xdey\x85\xc3\ \xca\xf1>\xc7h\xe6\xce\xd8\x1d\x0b)\x96.\xe9\xe6\x82\ \x0c\xb1\x96 \xb6Yv\xe4\x0a\xb2\x90\xbe\x97{s\xaa\ \xe8\x9b\xae\xed\xaf\xa6k\xdb\xad \x98\xa6\x8aY\xbc\xb3\ \x1d\xc9\xd2\xe4\x91\xc7\xf6}\xcd\xd6\x03K\x10\x91a\x96\ @\xcb,?\xbc\xf3\x02\x92\xe5\xb2\x94oguv\xd7\ OF\xf7\xfcu\xddX\xef\xa1\x89\x9dY...
Python
1
: &str, ) -> Result<EifBuildInfo, String> { let now = SystemTime::now(); let now: DateTime<Utc> = now.into(); let config_file = File::open(img_config_path) .map_err(|e| format!("Failed to open kernel image config file: {}", e))?; let os_string = BufReader::new(config_file) .lines() ...
Rust
0
ertTrue(torch.allclose(eager_results, compiled_results)) # AOTI with tempfile.TemporaryDirectory() as tmpdirname: package_path = f"{tmpdirname}/model.pt2" torch._inductor.aoti_compile_and_package( exported, package_path=package_path ) fn =...
Python
1
from scapy.all import ARP, Ether, srp from argparse import ArgumentParser import pyfiglet from datetime import datetime #pretty title ascii_banner = pyfiglet.figlet_format("arp network scanner") print(ascii_banner) parser = ArgumentParser( prog='Network Scanner', description='This is a basic network scanner us...
Python
1
# Question Answering using SPA # Now we will build the model again, using the spa (semantic pointer # architecture) package built into Nengo 2.0. You will see that using the spa # package considerably simplifies model construction and visualization through # nengo_gui. # Press the play button to run the simulation. #...
Python
1
routes::generate(source) } /// Returns the `Route` instance for the given uri and method. /// # Examples /// ``` /// # use kalgan_router::Router; /// # let router = Router::new("tests/routes.yaml"); /// let route = router.get_route("/", "get").unwrap(); /// ``` pub fn get_rou...
Rust
0
} pub mod msg { use serde::{Deserialize, Serialize}; use crate::version::v0_0_1::fail::{BadRequest, Conditional}; #[derive(Debug, Clone, Serialize, Deserialize)] pub enum Fail { Error(String), BadRequest(BadRequest), Conditional(Conditional), ...
Rust
0
} } } pub async fn get(req: Request) -> Result<Response> { reply(req, Version::default(), false, 200).await } fn is_in(grid: &Vec<Vec<u32>>, i: i32, j: i32) -> bool { if i < 0 || i >= grid.len() as i32 || j < 0 || j >= grid[0].len() as i32 { return false; } return true; } fn update...
Rust
0
", "IPython", "--colors=nocolor"], env=env ) child.timeout = 15 * IPYTHON_TESTING_TIMEOUT_SCALE child.expect("IPython") child.expect("\n") child.expect_exact("In [1]") block = dedent( """ def simple_f(): myvar = 1 print(myvar) 1/0 print(myvar) ...
Python
1
des in each bin. Requires kperp_modes to be supplied. """ kpar = kpar[0] m = kpar > 1e-10 if ps.shape[0] < len(kperp): if log_bins: kperp = np.exp((np.log(kperp[1:]) + np.log(kperp[:-1])) / 2.0) else: kperp = (kperp[1:] + kperp[:-1]) / 2 kpar = kpar[m]...
Python
1
inue tmp = set([]) for band_item in band_items: for x in range( utils.iceil(band_item.start_time, period) - period / 2, utils.ifloor(band_item.end_time, period) + period / 2, period): tmp....
Python
1
hortedges(s :&mut SATModDiff<isize>, edge_short :&[(Bool,Bool)]) -> Result<(), String> { let max_negshorts :usize = { let m = s.solve().map_err(|_| format!("Could not solve."))?; edge_short.iter().map(|(u,d)| if m.sat.value(u) { 0 } else {1 } + if m.sat.value(d) { 0 } e...
Rust
0
except Exception as e: self.logger.error(f"扫描目标 {target} 时出错: {str(e)}") return [{ "check_type": "vulnerability", "vulnerability": "扫描错误", "url": target, "status": "error", "details": f"扫描过程中出错: {str(e)}" ...
Python
1
ET, 0.0), SupportSide::Right => Vector3::new(hmajor - hlegt - mw, TOP_SUPPORT_BOARD_INSET, 0.0), }; center + t } pub fn assemble_aligned(&self) -> ScadObject { scad!(Translate(vec3(0.0, self.board.describe().length, 0.0));{ scad!(Rotate(-90.0, z_axis());{ ...
Rust
0
_exists: logger.debug( f"cache for {self._parent.handle}, type" f" {output_type.value!r} does not exist or" " is stale") return self.create(mime_override) if create else None else: logger....
Python
1
import random class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def describe_restaurant(self): print(f"Название ресторана: {self.restaurant_name}") print(f"Кухня: {self.cuisine_type}") ...
Python
1
(self, other) { (&ExpBTree::Num(s), &ExpBTree::Num(o)) => s == o, ( ExpBTree::Exp { lhs: s_lhs, rhs: s_rhs, op: s_op, }, ExpBTree::Exp { lhs: o_lhs, ...
Rust
0
egrated_encodings.dtype), ) min_pool = torch.min(min_masked_integrated_encodings, 1)[0] mean_pool = torch.sum(integrated_encodings, 1) / torch.sum( text_mask, 1, keepdim=True ) # Self-attentive pooling layer # Run through linear projection. Shape: (batch_size...
Python
1
= Utc::now(); let duration = utc_now.signed_duration_since(last_open_issue_date); if duration.num_days() < 0 { return Err(anyhow!( "time not synched between last commit, {}, and current time, {}", last_open_issue_date, ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
ds_by_sheet.values(): for kw in sheet_keywords: if isinstance(kw, tuple) and len(kw) >= 1: all_file_keywords.add(kw[0].lower()) # 添加高频词 for word in top_words.keys(): all_file_keywords.add(word.lower()) # 计算每个工作表的匹配度 ...
Python
1
elem); quote! { #tp[] } } /// # convert a `syn::Type` rust type to a /// `TokenStream` of typescript type: basically i32 => number etc. /// /// field is the current Field for which we are trying a conversion pub fn type_to_ts(&self, ty: &syn::Type) -> QuoteT { // `type_to_ts` rec...
Rust
0
::iter() .filter(|it| { if cfg!(feature = "latin") { it != &Language::from_str("Latin").unwrap() } else { true } }) .collect() } pub fn all_with_arabic_script() -> HashSet<Language> { ...
Rust
0
ING assert_eq!(EncointerCeremonies::meetup_count((cid, cindex)), 1); let meetup3_1 = EncointerCeremonies::meetup_registry((cid, cindex), 1); // whitepaper III-B Rule 3: no more than 1/4 participants without reputation assert_eq!(meetup3_1.len(), 10); run_to_next_phase(); ...
Rust
0
import random print("WELCOME TO THE ROCK, PAPER, AND SCISSORS GAME! 🎮") options = {1: "🪨 rock", 2: "📜 paper", 3: "✂ scissors"} print(f"\nSelect one of the options to start play.") for key, value in options.items(): print(f"{key}: {value}") is_running = True while is_running: user_guess = input(f"\nEnt...
Python
1
if batch_idx % 10 == 0: print('epoch %d iter %d total training loss = %.3f' %(epoch, batch_idx, total_train_loss/batch_idx)) savefilename = args.savemodel+'/checkpoint_'+str(epoch)+'.tar' if epoch % 50 ==0: torch.save({ 'epoch': epoch, ...
Python
1
part_offset += part_sz; } stream.sync(); self.state.barrier.wait(); GPURingAllreduceWorker{ worker_rank: worker_rank, num_workers: self.num_workers, buf_sz: buf_sz, state: self.state, stopwatch: Stopwatch::new(), //_marker: PhantomData, ...
Rust
0
import sys import loompy from liftover import get_lifter converter = get_lifter('hg19', 'hg38', one_based=True) loom_filename = sys.argv[1] output_file_prefix = sys.argv[2] output_dir = sys.argv[3] output_filename = output_dir + "/" + output_file_prefix + ".coverage_sites_liftover.tsv" vep_input_hg19_filename = outp...
Python
1
what are you secretly craving? (Optional)</p>", unsafe_allow_html=True) search_term = st.text_input("Search Term", label_visibility="collapsed") st.markdown("<p class='input-label'>What's your zip code or neighborhood?</p>", unsafe_allow_html=True) location = ...
Python
1
''' Enunciado del ejercicio: ver enunciado.pdf (PARTE 2). (c) Solución proporcionada por: Germán Leandro Contreras Sagredo, Daniel Vives Santiago de Chile, 04 de Abril de 2019 Universidad Católica de Chile ''' # Librerías a utilizar from scipy.io import loadmat # Lectura de archivos. from skl...
Python
1
WM_CH_CFG_Type { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } extern "C" { pub fn PWM_Channel_Init(chCfg: *mut PWM_CH_CFG_Type) -> BL_Err_Type; } extern "C" { pub fn PWM_Channel_Update(ch: u8, period: u16, threshold1: u16, ...
Rust
0
AL_CRATE), loc.line) } else { (unknown_file_metadata(cx), None) }; let is_local_to_unit = is_node_local_to_unit(cx, def_id); let variable_type = Instance::mono(cx.tcx, def_id).ty(cx.tcx, ty::ParamEnv::reveal_all()); let type_metadata = type_metadata(cx, variable_type, span); let var_nam...
Rust
0
# SPDX-FileCopyrightText: 2024 DJDevon3 # SPDX-License-Identifier: MIT # Coded for Circuit Python 8.2.x """Discord Web Scrape Example""" import os import time import adafruit_connection_manager import wifi import adafruit_requests # Active Logged in User Account Required # WEB SCRAPE authorization key required. Vis...
Python
1
a from frovedis.mllib import Word2Vec as Frovedis_Word2Vec time_start = time.time() frovedis_w2v = Frovedis_Word2Vec(df_train["Review"].to_list(), \ hiddenSize=512, minCount=2, n_iter=100) time_stop = time.time() #### Check time taken by Frovedis frovedis_elapsed_time = time_stop - time_st...
Python
1
Scheme<F, PRG, S, Bgi15<F, PRG, S>>; impl<F, PRG, S> DIF<F> for Bgi15DIF<F, PRG, S> where F: Field, PRG: CryptoRng + RngCore + SeedableRng<Seed = S>, S: Seed, { } /// A node in the DIF tree is composed of a seed, control-bit, and field element corresponding to /// each child node #[derive(Copy, Clone, Def...
Rust
0
glib_none().0, "activate-current", transmute(activate_current_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) } } fn emit_activate_current(&self, force_hide: bool) { let _ = self.emit("activate-current", &[&force_hide]).unwrap(); } fn connect_cancel<F: Fn(&Se...
Rust
0
assert_eq!(replica.get_hw(), 0); // reading empty replica should return empyt records let slice = replica .read_all_uncommitted_records(FileReplica::PREFER_MAX_LEN) .await .expect("read"); assert!(slice.file_slice.is_none()); // write batche...
Rust
0
lling-for-Webinars).<br><br> * **Scopes:** `report:read:admin`<br> * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br> * **Prerequisites:**<br> * * Pro or a higher plan with Webinar add-on enabled. * * **Parameters:** ...
Rust
0
] )?; interp.def_rb_source_file( b"rubygems/dependency.rb", &include_bytes!(concat!(env!("OUT_DIR"), "/src/generated/rubygems/dependency.rb"))[..] )?; interp.def_rb_source_file( b"rubygems/deprecate.rb", &include_bytes!(concat!(env!("OUT_DIR"), "/src/generated/r...
Rust
0
_t!(matches, "num_accounts", usize).unwrap_or(10_000); let iterations = value_t!(matches, "iterations", usize).unwrap_or(20); let clean = matches.is_present("clean"); println!("clean: {:?}", clean); let path = PathBuf::from(env::var("FARF_DIR").unwrap_or_else(|_| "farf".to_owned())) .join("acco...
Rust
0
) def _sort_candidate_groups(self, hash_map): ''' Responsible for returning an ordered dict of how to order the groups Default implementation will just sort by the fuzzy key of our candidates ''' skeys = sorted(hash_map.keys()) return OrderedDict([(key, hash_map[key]...
Python
1
=> "Kos", "1DXG-GR-SDL" => "Leros", "1DXG-GR-SDP" => "Patmos", "1DXG-GR-SDR" => "Rhodes", "1DXG-GR-SF" => "Ionian Islands", "1DXG-GR-SFC" => "Corfu", "1DXG-GR-SFF" => "Paxos", "1DXG-GR-SFK" => "Cephalonia / Kefalonia", "1DXG-GR-SFL" => "Lefkada", "1DXG-GR-SFP" => "Ithaca", "1DXG...
Rust
0
self.theme.text_brush.as_ref().unwrap(), D2D1_DRAW_TEXT_OPTIONS::D2D1_DRAW_TEXT_OPTIONS_NONE ); } Ok(()) } fn draw_caret(&self, column_offset: f32, text_document: &mut TextDocument, text_layout: &IDWriteTextLayout) -> Result<()> { if let So...
Rust
0
s_dic[cve] = ('P',td) td = 0 continue else: res_vec += [(sig_name,cnt,t1)] print('%s has %d matches, taking %.2f s' % res_vec[-1]) if len(tks) > 1: if not cve in res_dic and applicable: res_dic[cve] = ('N',td) ...
Python
1
/// let triangles = vec![ /// (0, 1, 4).into(), // 0 /// (4, 3, 0).into(), // 1 /// (1, 2, 5).into(), // 2 /// (5, 4, 1).into(), // 3 /// ]; /// /// let mesh = NavMesh::new(vertices, triangles).unwrap(); /// let path = mesh.find_path_triangles(1, 2).unwrap().0; /...
Rust
0
", "pyspark-shell") jars_args = "--jars %s" % protobuf_jar os.environ["PYSPARK_SUBMIT_ARGS"] = " ".join([jars_args, existing_args]) import doctest from pyspark.sql import SparkSession import pyspark.sql.protobuf.functions globs = pyspark.sql.protobuf.functions.__dict__.copy() spark...
Python
1
EngineState, stack: &mut Stack, ) { if config_path.exists() & config_path.is_file() { let config_filename = config_path.to_string_lossy().to_owned(); if let Ok(contents) = std::fs::read(&config_path) { eval_source( engine_state, stack, ...
Rust
0
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt # 加载训练好的模型 model = tf.keras.models.load_model('mnist_binary_mlp_model_2.h5') # 加载 MNIST 数据集 (train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data() # 获取第一个样本并进行预处理 input_image = train_images[0] # 将灰度图像转...
Python
1
(val.cost)); // report metrics let now = Instant::now(); let stats = TaskStats { start_time: val.start, success: val.cost < TIMEOUT.as_millis() as u64, completion_time: now, overhead: now.dura...
Rust
0
Ok(Group::from(&db_obj)) } None => Err(RbacError::NotFound(format!("Group not found {:?}", group))) } } /// Returns all groups for given organization pub fn get_by_org(&self, _ctx: &SecurityContext, organization_id: &str) -> HashMap<String, Group> { ...
Rust
0
up()); } } fn parse_stmts(&mut self, in_if_branch: bool) -> SmallVec<[StmtId; 1]> { let _first_symbols = self.first_symbols.backup(); let old_follow = self.follow_symbols.backup(); if in_if_branch { setup_first! { self : (nt Stmt) (punc Colon) (label) } } else { setup_first! { self...
Rust
0
Error, gen_atoms::BADFUN) } pub fn badfun_val(val: LTerm, hp: &mut Heap) -> DispatchResult { let badfun_tuple = make_badfun(val, hp); DispatchResult::Error(ExceptionType::Error, badfun_tuple) } }// Copyright (C) 2018 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or...
Rust
0
l current_amp global filter_data_1 global filter_data_2 global filter_data_3 global window_size # Setup the subscribers rospy.Subscriber("car_cmd", Twist, car_cmd_callback) rospy.Subscriber("joy", Joy, joy_callback) rospy.Subscriber("velocity_real", Float64, vel_callback) rospy....
Python
1
ly equivalent** problem is formed and /// an auxiliary variable \\( s \\in {\\bf R}^m \\) is introduced for the infeasible start method as follows: /// \\[ /// \\begin{array}{lll} /// {\\rm minimize}\_{x,s} & f^T x \\\\ /// {\\rm subject \\ to} & {\\| G_i x + h_i \\|\_2^2 \\over s_i} \\le s_i & (i = 0, \\ldots, m - 1) ...
Rust
0
import os print("DXG present:", os.path.exists("/dev/dxg")) print( "WSL libcuda present:", all( os.path.exists(p) for p in [ "/usr/lib/wsl/lib/libcuda.so", "/usr/lib/wsl/lib/libcuda.so.1", ] ), ) try: import torch print("Torch:", torch.__version__) ...
Python
1
glib_result_from_gboolean!( gst_video_sys::gst_video_overlay_set_render_rectangle( self.as_ref().to_glib_none().0, x, y, width, height ), "Failed to set render rec...
Rust
0
import os from typing import Optional, List, Tuple, Callable from loguru import logger from .base_instagram_downloader import BaseInstagramDownloader class InstagramPhotoDownloader(BaseInstagramDownloader): """Downloader for Instagram photos""" def download_photo(self, url: str, output_path: Optional[str] = N...
Python
1
ror(e) } } impl From<io::Error> for Error { fn from(e: io::Error) -> Error { Error::IoError(e) } } impl From<storage::Error> for Error { fn from(e: storage::Error) -> Error { Error::StorageError(e) } } impl From<serde_yaml::Error> for Error { fn from(e: serde_yaml::Error) -> Error { Error::YamlError(e) } } ...
Rust
0
lock_dim: (u8, u8), pub(crate) name: Option<Vec<u16>>, } impl fmt::Debug for ImageUnbound { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.write_str("ImageUnbound") } } impl ImageUnbound { pub fn calc_subresource(&self, mip_level: UINT, layer: UINT, plane: UINT) -> UINT { ...
Rust
0