text
string
label_name
string
labels
int64
/// Only run specified sorting algorithm #[clap(long, possible_values = &get_algorithms().keys().cloned().sorted().collect::<Vec<_>>()[..])] pub algorithm: Option<String>, /// The width of the output image #[clap(long, default_value = "400")] pub width: usize, /// The height of the output...
Rust
0
# Copyright (c) 2024 PaddlePaddle 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 appli...
Python
1
(self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); self.w } } impl W { #[doc = "Bit 0 - Output Selection Clear for PWMH output of the channel 0"] #[inline(always)] pub fn osch0(&mut self) -> OSCH0_W { OSCH0_W { w: self } } #[doc = "Bit 1 - Output Selection Clear fo...
Rust
0
def infer(model, df, ycol='0', ignore_categoricals=False, classify=False, prefix=''): if type(model) == str: with open(model, 'rb') as f: model = pickle.load(f) cat_cols = df.select_dtypes(['object']).columns if ignore_categoricals: df[cat_cols] = 0 else: df[cat_c...
Python
1
ng has no effect. /// /// ```rust /// use yansi::Style; /// /// let masked = Style::new().mask(); /// /// // "Whoops! " will only print when coloring is enabled. /// println!("{}Something happened.", masked.paint("Whoops! ")); /// ``` #[inline] pub fn mask(mut self) -> Style ...
Rust
0
costs(&grm, &[1, 1, 1]); assert_eq!(scores[usize::from(grm.rule_idx(&"A").unwrap())], 0); assert_eq!(scores[usize::from(grm.rule_idx(&"B").unwrap())], 1); assert_eq!(scores[usize::from(grm.rule_idx(&"C").unwrap())], 1); assert_eq!(scores[usize::from(grm.rule_idx(&"D").unwrap())], 2); ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2025/6/18 14:44 # @File : create_model.py.py # @Author: johnson # @Contact : github: johnson7788 # @Desc : import os import litellm from google.adk.models.lite_llm import LiteLlm from dotenv import load_dotenv litellm._turn_on_debug() load_dotenv() def create_...
Python
1
ents with between {min_claims} and {max_claims} " "claims per patient." ) for _ in range(random.randint(min_claims, max_claims)): clm_from_dt_min = "2018-01-01" claim = gen_claim(bene_sk=pt_bene_sk, min_date=clm_from_dt_min, max_date=max_date) CLM....
Python
1
player), (GameStateWrapper::OnMission(inner), Action::Play { card }) => { inner.handle_card(player, card) } (GameStateWrapper::OnMission(inner), Action::QuestingBeast) => { inner.handle_questing_beast(player) } (GameStateWrapper...
Rust
0
COLUMN_ACCOUNT_SMT_LEAF, COLUMN_ACCOUNT_SMT_BRANCH, self); let tree = SMT::new(root, mem_smt_store); Ok(MemStateTree::new(tree, account_count)) } pub fn get_mem_block_account_smt_root(&self) -> Result<Option<H256>, Error> { match self.get(COLUMN_META, META_MEM_SMT_ROOT_KEY) { ...
Rust
0
_FLAGS = u32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS = 0u32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTUR...
Rust
0
# coding=utf-8 # Copyright 2023-present the HuggingFace Inc. team. # # 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 ap...
Python
1
assert!(num > 0); let mut pow = 0; while (1 << (pow + 1)) <= num { pow += 1; } pow } #[test] fn test_log2_floor() { assert_eq!(log2_floor(1), 0); assert_eq!(log2_floor(2), 1); assert_eq!(log2_floor(3), 1); assert_eq!(log2_fl...
Rust
0
// Include this point so we can get all of the midpoints (see below). boundary_points.push((1.0, start + velocity)); // Translate the point up and down as it travels over floor voxels. let mut height_delta = 0; let mut last_good_point = start; for ((_, p1), (_, p2)) in boundary_points.iter().tuple...
Rust
0
"""Constants for VeSync Component.""" DOMAIN = "vesync" VS_DISCOVERY = "vesync_discovery_{}" SERVICE_UPDATE_DEVS = "update_devices" VS_SWITCHES = "switches" VS_FANS = "fans" VS_LIGHTS = "lights" VS_SENSORS = "sensors" VS_MANAGER = "manager" DEV_TYPE_TO_HA = { "wifi-switch-1.3": "outlet", "ESW03-USA": "outlet...
Python
1
# app/utils/opensearch_operations.py from opensearchpy import OpenSearch, RequestsHttpConnection from app.config import Config opensearch_client = OpenSearch( [Config.OPENSEARCH_URL], use_ssl=True, verify_certs=True, connection_class=RequestsHttpConnection, timeout=60, # Increase the timeout to 30...
Python
1
the average precision, given the recall and precision curves # Arguments recall: The recall curve (list) precision: The precision curve (list) # Returns Average precision, precision curve, recall curve """ # Append sentinel values to beginning and end mrec = np.concatena...
Python
1
import os import sys import numpy as np import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) import ML_lib.gaussian as gau plt.figure() XPlot = np.linspace(-8, 12, 1000).reshape(1, 1000) m = np.ones((1,1)) * 1.0 C = np.ones((1,1)) * 2.0 plt.pl...
Python
1
# TODO Import Class Bills to test food shopping expense from bills import Bills # TODO take and show bill name # TODO show total food shopping bills inc name and cost food_shopping = [] def create_bill(): index = 0 while True: user_company_name = input("Please can you provide the name for the bill: ") ...
Python
1
pub struct BlastDamageData { #[serde(flatten)] pub base: ConditionDamageDataBase, pub blast_damage: f32, pub preset_type: u32, } } rsz_enum! { #[rsz(u32)] #[derive(Debug, Serialize)] pub enum UseDataType { Common = 0, Unique = 1, } } rsz_struct! ...
Rust
0
gs(0x000E, 0x0080) ChrClearFlags(0x000F, 0x0080) ChrClearFlags(0x0010, 0x0080) ChrClearFlags(0x000D, 0x0080) CameraMove(880, 0, 8980, 2000) OP_70(0x0001, 100) OP_73(0x0001) Sleep(500) PlaySE(176, 0x00, 0x64) @scena.Lambda('lambda_5842') def lambda_5842(): ChrWalkTo(0x00...
Python
1
} model.compact().with_context(|| format!("after pass {:?}", p))?; } } pub fn run_one_pass_inner( &mut self, i: usize, p: &mut dyn TypedPass, model: &mut TypedModel, ) -> TractResult<()> { p.reset()?; if let Some(steps) = self.optimiz...
Rust
0
import os import platform from pip._vendor.rich import inspect from pip._vendor.rich.console import Console, get_windows_console_features from pip._vendor.rich.panel import Panel from pip._vendor.rich.pretty import Pretty def report() -> None: # pragma: no cover """Print a report to the terminal with debugging ...
Python
1
("file:")) { self.url.value = format!("file:{}", path); }; } _ => { let mut url = Url::parse(&self.url.value).unwrap(); let mut params: BTreeMap<String, String> = url.query_pairs().map(|(k, v)| (k.to_string(...
Rust
0
equal to \\(x\\), i.e. \\(F(x) = P(X /// \leq x)\\). /// /// # Examples /// ``` /// # use rstat::{Distribution, Probability, univariate}; /// # use std::f64; /// let dist = univariate::normal::Normal::standard(); /// /// assert_eq!(dist.cdf(&f64::NEG_INFINITY), Probability::zero());...
Rust
0
""" IndexIds module """ from ...serialize import Serializer class IndexIds: """ Stores index ids when content is disabled. """ def __init__(self, embeddings, ids=None): """ Creates an IndexIds instance. Args: embeddings: embeddings instance ids: ids t...
Python
1
State::new(AppState::new_from_env().unwrap()), handlers::remove_server_response_header, ConnId::new(), Logger::new().with_formatter(apache_combined( trillium_conn_id::log_formatter::conn_id, "-", )), caching_headers(), compression(), ...
Rust
0
Allocator { fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { let mut inner = self.inner.borrow_mut(); let ptr = if layout.size() <= MAX_SMALL_ALLOCATION as _ { inner.allocate_small(layout) } else { inner.allocate_large(layout) }; ...
Rust
0
t_possible_containers(NEEDLE_COLOR), NEEDLE_COLOR, ), Part::Two => format!( "{} bag must contain {} other bags", NEEDLE_COLOR, graph.count_children_bags(NEEDLE_COLOR), ), } } } <gh_stars>0 use aoc_2021::input...
Rust
0
first_item = int(input("What is the price of the first item: ")) second_item = int(input("What is the price of the second item: ")) third_item = int(input("What is the price of the third item: ")) user_payment = int(input("\nEnter your payment here: ")) total_price = first_item + second_item + third_item if total_pr...
Python
1
import logging from homeassistant.components.switch import SwitchEntity from .const import DOMAIN _LOGGER = logging.getLogger(__name__) """ Configure the """ async def async_setup_entry(hass, config_entry, async_add_entities): ws_manager = hass.data[DOMAIN]["ws_manager"] switches = await ws_manager.getSwitch...
Python
1
andidates.entry(candidate_hash).or_insert(false); } } candidates } fn update_blocks_at_finalized_height( subsystem: &AvailabilityStoreSubsystem, db_transaction: &mut DBTransaction, candidates: impl IntoIterator<Item = (CandidateHash, bool)>, block_number: BlockNumber, now: Duration, ) -> Result<(), Error> { ...
Rust
0
// Keyboard map for Azerty with AltR pub const MAP_AZERTY_ALTR: MapResultLUT = [ R::Up, // P2 Nav and function keys R::Left, // P5 R::Click, // PC R::Right, // P6 R::F1, // P3 R::Shift, // P4 R::Down, // P9 R::F3, // P7 R::F4, // P8 R::C('...
Rust
0
fn~()>(y); //~ ERROR expected ~ closure, found @ closure take::<pure fn~()>(z); //~ ERROR expected ~ closure, found @ closure take::<unsafe fn~()>(x); //~ ERROR expected ~ closure, found @ closure take::<unsafe fn~()>(y); //~ ERROR expected ~ closure, found @ closure take::<unsafe fn~()>(z); //~ ERROR...
Rust
0
{ let sb = &self.inner.borrow().sb; let stat = Statvfs { blocks: sb.db_count, bfree: sb.db_count - sb.used_db_count, bavail: sb.db_count - sb.used_db_count, files: sb.inode_count, ffree: sb.inode_count - sb.used_inode_count, bsize:...
Rust
0
): src = """ #{append-selector(".foo, .bar", ".baz")} { color: red; } .example { #{elements-of-type(block)} { border: 1px solid #777777; margin: 1em 3em; } #{elements-of-type(inline)} {...
Python
1
:new(PROGRAM) .version(CLIENT_VERSION) .author("by Cohomology, 2020") .setting(clap::AppSettings::SubcommandRequiredElseHelp) .arg( clap::Arg::with_name("config") .short("c") .long("config") .value_name("FILE") ....
Rust
0
eam to it. fn connect(&self) -> BoxFuture<'_, io::Result<Self::Stream>>; } /// TCP socket connector. #[derive(Debug)] pub struct TcpConnector { addr: SocketAddr, } /// Unix domain socket connector. #[cfg(unix)] #[derive(Debug)] pub struct UnixConnector { path: PathBuf, } /// DNS lookup error #[derive(Deb...
Rust
0
from django.db import models from django.utils.timezone import now class Timer(models.Model): tid = models.IntegerField(default=0) TimeStamp = models.DateTimeField(default=now) class Answer(models.Model): user_id = models.IntegerField() TimeStamp = models.DateTimeField() def __str__(self): ...
Python
1
el, index=index_label) return AFS_S1, m_red def AFS_res_mul(m): AFS_S = [] m_isnull = m.loc[~(m == 0).all(axis=1)] if len(m_isnull) == 1: AFS_SN = m_isnull AFS_S.append(AFS_SN) return AFS_S[0] else: AFS_S1, m_red = AFS_res(m) AFS_S.append(AFS_S1) m...
Python
1
# -*- encoding: utf-8 -*- from odoo import api, fields, models, _ from odoo.exceptions import UserError class StockPicking(models.Model): _inherit = 'stock.picking' def button_validate(self): #Obtener almacenes permitidos por usuario allowed_warehouses = self.env.user.warehouse_ids_validate...
Python
1
# Generated by Django 5.2.3 on 2025-07-07 09:37 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fellowship', '0003_alter_fellowship_edit_back_image_and_more'), migrations.swappabl...
Python
1
action="store_true", help="Enable auto-reload for API development" ) return parser.parse_args() def main(): """Main entry point.""" # Parse command line arguments args = parse_args() # Setup environment setup_environment() # Register signal handlers for grac...
Python
1
# You are given an array of integers. Your task is to determine the minimum number of operations # required to sort the array in non-decreasing order. In a single operation, you can remove an element that # is greater than the element immediately following it. def min_operations_to_sort(arr): count = 0 ...
Python
1
_print_features(print_features: c_bool) -> c_bool; } pub const LIBPOSTAL_ADDRESS_NONE: u16 = 0; pub const LIBPOSTAL_ADDRESS_ANY: u16 = (1 << 0); pub const LIBPOSTAL_ADDRESS_NAME: u16 = (1 << 1); pub const LIBPOSTAL_ADDRESS_HOUSE_NUMBER: u16 = (1 << 2); pub const LIBPOSTAL_ADDRESS_STREET: u16 = (1 << 3); pub const LIBP...
Rust
0
= str(uuid.uuid4()) async for chunk in agent.speak(game_state, player): tmp += chunk yield sse_event({ "type": "speak", "id": player.id, "conten...
Python
1
_ = "a" "b" "c" _ = "abc" + "def" _ = "abc" \ "def" _ = ( "abc" + "def" ) _ = ( f"abc" + "def" ) _ = ( b"abc" + b"def" ) _ = ( "abc" "def" ) _ = ( f"abc" "def" ) _ = ( b"abc" b"def" ) _ = """a""" """b""" _ = """a b""" """c d""" _ = f"""a""" f"""b""" _ = f"a" "b" _ = """a""" "b" ...
Python
1
import pytz from .base import TimeZoneBackend, TimeZoneNotFoundError class PYTZBackend(TimeZoneBackend): utc_tzobj = pytz.utc all_tzstrs = pytz.all_timezones base_tzstrs = pytz.common_timezones def is_tzobj(self, value): return value is pytz.UTC or isinstance(value, pytz.tzinfo.BaseTzInfo) ...
Python
1
std::fmt::Result { write!(f, "{}, {}, {:p}", self.id, self.size, self.ptr) } } impl<T> Drop for SHM<T> { fn drop(&mut self) { unsafe { libc::shmctl(self.id, libc::IPC_RMID, std::ptr::null_mut()) }; } } #[derive(Debug)] pub struct SharedMemory { shm_file: File, mmap_ptr: *mut (), ...
Rust
0
path_print(&rev_path?); Ok(()) } #[test] fn random() { let mut groups = Vec::new(); let coordinates = Shape::Circle.area(10); let children: u32 = 10; let radius: u32 = 5; let spread = 5; for (i, c) in coordinates.iter().enumerate() { let mut group = Group::new_simple(c.x * spread, ...
Rust
0
} let r = rna.as_bytes() .chunks(3) .collect::<Vec<_>>() .iter() .map(|x| str::from_utf8(x).unwrap()) .take_while(|&x| x != "UAA" && x != "UAG" && x != "UGA") .map(|x| self.name_for(x)) .collect::<Vec<_>>(); if r.iter(...
Rust
0
ultGen for Cone<N> { fn generate<R: Rng>(rng: &mut R) -> Cone<N> { Cone::new(na::abs(&rng.gen::<N>()), na::abs(&rng.gen::<N>())) } } impl<N: Scalar> DefaultGen for Cylinder<N> { fn generate<R: Rng>(rng: &mut R) -> Cylinder<N> { Cylinder::new(na::abs(&rng.gen::<N>()), na::abs(&rng.gen::<N>()...
Rust
0
n_categorical_features, dtype=np.uint32 ) known_categories = self.bin_thresholds_ known_cat_bitsets = np.zeros( (n_categorical_features, 8), dtype=X_BITSET_INNER_DTYPE ) # TODO: complexity is O(n_categorical_features * 255). Maybe this is # worth cy...
Python
1
"# abc = 123", ]; let actual = comment_block(&CommentingMode::Toggle, "# ", &example); assert_eq!(actual, expected); assert_eq!(comment_block(&CommentingMode::Toggle, "# ", &actual), example); } #[test] fn zero_address_toggles_whole_file_not_individual_lines() { let example = vec![ "a = 1",...
Rust
0
yle { button::Style { background: Some(Background::Color(match self { Button::Primary => BUTTON_PRIMARY_COLOR, Button::Secondary => BUTTON_SECONDARY_COLOR, })), border_radius: 12, shadow_offset: Vector::new(1.0, 1.0), te...
Rust
0
patch(origin_of(account_of(vault))) } pub fn nominate_collateral( vault: [u8; 32], nominator: [u8; 32], amount_collateral: Amount<Runtime>, ) -> DispatchResultWithPostInfo { Call::Nomination(NominationCall::deposit_collateral( account_of(vault), amount_collateral.amount(), )) .d...
Rust
0
fn enabled(&self, metadata: &Metadata) -> bool { metadata.level() <= Level::Debug } fn log(&self, record: &Record) { if self.enabled(record.metadata()) { #[cfg(all(not(target_arch = "wasm32"), not(test)))] println!("[{}] {}", record.level(), record.args()); } ...
Rust
0
''' EJERCICIO: Utilizando tu lenguaje, crea un programa capaz de ejecutar de manera asincrona una función que tardará en finalizar un número concreto de segundos parametrizables. También debes poder asignarle un nombre. La función imprime su nombre, cuándo empieza, el tiempo que durará su ejecución y cuando finaliza. ...
Python
1
ax.grid(True, which="both", linestyle="--", linewidth=0.5) plt.suptitle("") plt.xticks([1, 2, 3], ["Easy", "Medium", "Hard"]) plt.tight_layout() plt.savefig(folder + "land_complexity.png", dpi=300) plt.close() def main(folder: str = "./output/"): """Run the experiments and plot the results.""...
Python
1
|proof| { Ok(proof.get_state().into()) }) } pub async fn get_proof_state(handle: u32) -> VcxResult<u32> { PROOF_MAP.get(handle, |proof| { Ok(proof.get_presentation_status()) }) } pub fn release(handle: u32) -> VcxResult<()> { PROOF_MAP.release(handle).or(Err(VcxError::from(VcxErrorKin...
Rust
0
; use std::cmp::max; use crate::prime::maybe_primenumber; pub fn factors(n: u64) -> HashMap<u64, u64> { let maybe_prime = maybe_primenumber(); let mut fact = HashMap::new(); let mut value = n; for p in maybe_prime.take_while(|x| *x <= n) { if value == 1 { break; } ...
Rust
0
(data.len() / 3), CompressionOptions::default(), ); let split = data.len() / 2; compressor.write_all(&data[..split]).unwrap(); compressor.flush().unwrap(); compressor.flush().unwrap(); { let buf = &mut compressor.def...
Rust
0
= ((Fixed::ONE - f) * out1 + f * out2).0; } } } } <reponame>LI-Mingyu/GraphScope-MY // //! Copyright 2020 Alibaba Group Holding Limited. //! //! Licensed under the Apache License, Version 2.0 (the "License"); //! you may not use this file except in compliance with the License. //! You may obta...
Rust
0
with open(file_path, 'w', encoding='utf-8') as file: file.write(package_declaration + method_code) # **新增** 处理 public static final class 并独立存储 for path, node in tree: if isinstance(node, javalang.tree.ClassDeclaration) and \ "static" in node....
Python
1
}, sike_p434_params, sike_p503_params, sike_p610_params, sike_p751_params, strategy::*, }; pub fn bench_p434_pke_std(c: &mut Criterion) { let params = sike_p434_params(None, None).unwrap(); let msg = Message::from_bytes(vec![0; params.clone().secparam / 8]); let pke = PK...
Rust
0
gs.max_num_ir_based_positives and len(negatives) >= args.max_num_ir_based_negatives ): break qa["ir_negative_ctxs"] = negatives qa["ir_positive_ctxs"] = positives logger.debug( f"{en_q} adding { len(qa['ir_negative_ctxs']) } IR based nega...
Python
1
from django.urls import path from . import views urlpatterns = [ path('login', views.login, name='login'), path('register', views.register, name='register'), path('logout', views.logout, name='logout'), path('dashboard', views.dashboard, name='dashboard'), ]
Python
1
.version(version_string) .about("The Pharo toolchain installer") // VM commands .subcommand(SubCommand::with_name("vm") .about("VM related features") .setting(AppSettings::ArgRequiredElseHelp) .subcommand(SubCommand::with_name("list") .abou...
Rust
0
ng_emb = lang_emb[0] return lang_emb def language_encoder_factory(model: Literal["clip", "bert", "mistral", "llama2", "llama3", "sheared_llama"], device): hf_dict = {"clip": CLIPLangEncoder, "bert": BERTLangEncoder} llm_list = ["mistral", "llama2", "llama3", "sheared_llama"] if model in llm_list...
Python
1
list_separator, single_value ) ), terminated!( whitespace!(opt!(list_separator)), char!(']') ) ) ) ); named!( pub(crate) single_value(CompleteStr) -> Value, alt_complete!( ...
Rust
0
et_mean(self.data) import torch.distributed as dist def get_world_size(): if not dist.is_available(): return 1 if not dist.is_initialized(): return 1 return dist.get_world_size() from collections import defaultdict def reduce_scalar_outputs(scalar_outputs): world_size = get_world_siz...
Python
1
"Rejoignez la salle Raakh avant qu'il n'arrive, vous avez environ le temps de 20 déplacements avant qu'il arrive" "Bonne chance, assassin !") # print(self.player.current_room.get_long_description()) def endgame(self): """Condition for end game """ raakh_room...
Python
1
#!/usr/bin/python # This filter replace all occurences of JIT_PPC_${address} by a # corresponding function name JIT_PPC_${symbol} as defined by a .map file. # TODO, add an option to append the block address (JIT_PPC_${symbol}@${addr}) # Example 1: guest function profiling (excluding host callees) # # $ perf record -t...
Python
1
[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] pub struct Person { pub name: String, pub age: i32, pub membership_ids: Vec<String> } pub const PEOPLE: Map<&[u8], Person> = Map::new("people"); #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] pub struct Group { pub name: String, ...
Rust
0
enderPassEncoder<'a, 'b> { type Target = EncoderCommon<'b>; fn deref(&self) -> &EncoderCommon<'b> { self.inner } } impl<'a, 'b> std::ops::DerefMut for RenderPassEncoder<'a, 'b> { fn deref_mut(&mut self) -> &mut EncoderCommon<'b> { self.inner } } <reponame>jarig/ton-labs-node mod b...
Rust
0
denVehicleTypes = None self.__forbiddenVehicleClasses = None return def stop(self): super(RestrictedVehiclesWatcher, self).stop() self.__forbiddenVehicleClasses = None self.__forbiddenVehicleTypes = None self.__allowedVehicleTypes = None return def _getU...
Python
1
import random, time, threading, urllib.parse, requests BASE = "http://localhost:8080" NORMAL_PATHS = [ "/", "/search?q=toaster", "/search?q=hairdryer", "/login.php?id=2", "/login.php?user=alice" ] MALICIOUS = [ "/login.php?id=1' OR '1'='1", "/search?q=<script>alert('xss')</script>", "/../../etc/p...
Python
1
rtial_cmp(other), IpCidr::V6(_) => Some(Ordering::Greater), } } } impl PartialOrd<IpCidr> for Ipv4Cidr { #[inline] fn partial_cmp(&self, other: &IpCidr) -> Option<Ordering> { match other { IpCidr::V4(cidr) => self.partial_cmp(cidr), IpCidr::V6(_) => Some(...
Rust
0
import nsyspy as nsys from pprint import pprint import pickle # All hyperparameters targets = [ './wccl_experiment_cuda', './wccl_experiment_cuda_useactivesitesinwindow', './wccl_experiment_cuda_neighbourchainlocal' ] windows = [1, 3, 8, 16] # windows = [1, 16] fractions = [0.01, 0.1, 0.5, 0.9] # Fix block...
Python
1
rt_eq!(2 + 2, 4); } } use actix_web::{client::{Client, Connector}}; mod notebook; use notebook::{Notebook, Tree}; struct GithubReastNotebook { client:Client, } impl GithubReastNotebook { } impl Notebook for GithubReastNotebook { pub fn getRootTree(key: str):Tree{ } }use futures::join; use toki...
Rust
0
from .scraping_service import ScrapingService # Instanciando a classe Scraping importacao_service_vinhos_mesa = ScrapingService(url_param='opcao=opt_05') importacao_service_espumantes = ScrapingService(url_param='subopcao=subopt_02&opcao=opt_05') importacao_service_uvas_frescas = ScrapingService(url_param='subopcao=su...
Python
1
lume [{0}: {1}]'.format( response.status_code, response.json)) def main(): argument_spec = scaleway_argument_spec() argument_spec.update(dict( state=dict(default='present', choices=['absent', 'present']), name=dict(required=True), size=dict(type='int'), project=dict...
Python
1
_CONTAINER_FILE_DESCRIPTOR: RawFd = -1; pub struct Dma<T> { pub virt: *mut T, pub phys: usize, } const MAP_HUGE_2MB: i32 = 0x5400_0000; // 21 << 26 impl<T> Dma<T> { /// Allocates dma memory on a huge page. pub fn allocate(size: usize, require_contigous: bool) -> Result<Dma<T>, Box<dyn Error>> { ...
Rust
0
aseConnectionPool, ) -> Result<Vec<models::Message>, Rejection> { let conn = pool.get().map_err(|_| Error::DatabaseFailedInternally)?; let raw_query = format!( "SELECT id, public_key, timestamp, data, signature FROM {} WHERE public_key = (?1) ORDER BY timestamp DESC LIMIT 5", storage::MESSAGES_T...
Rust
0
_global_position().y() as i32 - 10 }) .collect::<Vec<_>>(); // Draw to stdout let max_h = 18; (0..max_h) .map(|h| { let h = max_h - 1 - h; heights_over_time .iter() .enumerate() .map(|(_t, p)| if h == *p { 'o' }...
Rust
0
Integer, name -> Text, description -> Nullable<Text>, address -> Nullable<Text>, city -> Nullable<Text>, region -> Nullable<Text>, postal -> Nullable<Text>, country -> Nullable<Text>, lat -> Double, lng -> Double, uuid -> Binary, cr...
Rust
0
""" 获取合理的阈值,将原始数据的灰度值截断到一定的范围内 减少无关数据的影响 实验记录在下方,综合实验结果,最终选择±350 """ import os import SimpleITK as sitk ct_path = '/home/zcy/Desktop/dataset/multi-organ/test/CT' seg_path = '/home/zcy/Desktop/dataset/multi-organ/test/GT' # 定于阈值 upper = 350 lower = -350 num_point = 0.0 # 属于器官的体素数量 num_inlier = 0.0 # 器官体素中灰度值位于阈值之...
Python
1
<reponame>unrelentingtech/loginw use libc; #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] pub fn make_realtime() -> bool { unsafe { let mut rtp = libc::rtprio { type_: libc::RTP_PRIO_REALTIME, prio: 1, }; libc::rtprio(libc::RTP_SET, libc::getpid(), &mut ...
Rust
0
"example": "you - agency", }, ) noticed_time = fields.Str( data_key="noticed_time", required=False, validate=RFC3339_DATETIME_VALIDATE, metadata={ "description": ( "Problem detection time, precision at least day up to millisecond" ...
Python
1
VEX_Vpslld_ymm_ymm_xmmm128 0x00,// Invalid 0x00,// Invalid // 243 = 0xF3 0x0B,// MandatoryPrefix2_4 0x00,// Invalid 0x0E,// VectorLength 0x2B,// VHW_4 0x4D,// XMM0 0x4D,// XMM0 0x4D,// XMM0 0xB1, 0x13,// VEX_Vpsllq_xmm_xmm_xmmm128 0x2B,// VHW_4 0x6D,// YMM0 0x6D,// YMM0 0x4...
Rust
0
parameter = parameters::indexed_array::IndexedArrayParameter::new(name, index_parameter, parameters); let idx = self.model.add_parameter(Box::new(parameter))?.index(); Ok(idx) } fn add_parameter_threshold_parameter( &mut self, name: &str, parameter_name: &str, th...
Rust
0
> { // Beta_s case Susp(t1,1,0,arena.alloc(vec![RefCell::new(TLpair(t2,0))]),v) }, Susp(t,0,0,[],u) => *t, // r12 (surface clone) Susp(Constant(c),ol,nl,e,u) => Constant(*c), // case r1 Susp(Lvar(s),ol,nl,e,u) => Lvar(*s), // case r2 Susp(Ind(i),ol,nl,e,u) if *i>ol => Ind(*i-ol+nl),...
Rust
0
), gl::FUNC_SUBTRACT => Ok(Equation::Subtract), gl::FUNC_REVERSE_SUBTRACT => Ok(Equation::ReverseSubtract), gl::MIN => Ok(Equation::Min), gl::MAX => Ok(Equation::Max), _ => Err(StateQueryError::UnknownBlendingEquation(data)), } } #[inline] fn from_gl_blending_factor(factor: GLenum) -> Result<Fact...
Rust
0
false)), op_lt_int: "1 < 2" => Ok(Boolean(true)), op_lt_int_eq: "1 < 1" => Ok(Boolean(false)), op_lt_int_not: "2 < 1" => Ok(Boolean(false)), op_lt_int_float: "3 < 3.1" => Ok(Boolean(true)), op_lt_int_float_eq: "3 < 3.00" => Ok(Boolean(false)), op_lt_int_float_not: "3 < 2.99" => Ok(Boolean(false)...
Rust
0
--- ast/cxx_impl.py.orig 2017-10-16 21:39:41 UTC +++ ast/cxx_impl.py @@ -12,7 +12,7 @@ class Printer(object): pass def start_file(self): - print C_LICENSE_COMMENT + '''/** @generated */ + print(C_LICENSE_COMMENT + '''/** @generated */ #include "Ast.h" #include "AstVisitor.h" @@ -20,17 +20,17 @@ clas...
Python
1
available flags are specified by AOM_CODEC_USE_* defines."] pub type aom_codec_flags_t = ::std::os::raw::c_long; #[doc = "Time Stamp Type"] #[doc = ""] #[doc = " An integer, which when multiplied by the stream's time base, provides"] #[doc = " the absolute time of a sample."] pub type aom_codec_pts_t = i64; #[repr(C)]...
Rust
0
unused_macros)] macro_rules! emit_error { ($token:expr, $msg: expr) => { return TokenStream::from(syn::Error::new($token.span(), $msg).to_compile_error()) }; } mod case; mod fmt; #[cfg(feature = "regex")] mod verify_regex; use proc_macro::TokenStream; use quote::ToTokens; use syn::parse::Parse; use s...
Rust
0
print_histogram(tests): test_times = [(t.getFullName(), t.result.elapsed) for t in tests if t.result.elapsed] if test_times: lit.util.printHistogram(test_times, title='Tests') def print_results(tests, elapsed, opts): tests_by_code = {code: [] for code in lit.Test.ResultCode.all_...
Python
1
doc = "Field `rf_tbb_ind_gc7` writer - "] pub struct RF_TBB_IND_GC7_W<'a> { w: &'a mut W, } impl<'a> RF_TBB_IND_GC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32)...
Rust
0
tment_type=sc_util.PERCENT_CHANGE_IN_CAPACITY, min_adjustment_step=2, minimum=0, maximum=10, expected=3)), ('+p-rs', dict(current=1, adjustment=325, adjustment_type=sc_util.PERCENT_CHANGE_IN_CAPACITY, min_adjustment_step...
Python
1