text
string
label_name
string
labels
int64
(_, 0) => (two + 1, three), _ => (two + 1, three + 1), } }); println!("Checksum: {}", two * three); let possible_box_ids: Vec<_> = box_ids .iter() .magic() .filter_map(|(iter, id)| { let possible_box_ids: Vec<_> = iter .filter_map(|oth...
Rust
0
{ pub fn crocksdb_sst_file_meta_data_largestkey( arg1: *const rocksdb_SstFileMetaData, arg2: *mut rocksdb_Slice, ); } extern "C" { pub fn crocksdb_compaction_options_init(arg1: *mut rocksdb_CompactionOptions); } extern "C" { pub fn crocksdb_compact_files_cf( arg1: *mut rocksdb_D...
Rust
0
ase("white ♔g3 ♖d2 ♚g1 ♙c2 ♙d3", PRUNER_L0, GameEvaluationMatcher::MoveToPlay(Move::from_code("d2-d1"), MoveEvaluationMatcher::EngineCheckMatesIn(0))), case("white ♔f3 ♖d2 ♚h1 ♙c2 ♙d3", PRUNER_L2, GameEvaluationMatcher::MoveToPlay(Move::from_code("f3-g3"), MoveEvaluationMatcher::EngineCheckMatesIn(1))), case("w...
Rust
0
nd(y) return feat_list @manager.BACKBONES.add_component def ShuffleNetV2_x0_25(**kwargs): model = ShuffleNet(scale=0.25, **kwargs) return model @manager.BACKBONES.add_component def ShuffleNetV2_x0_33(**kwargs): model = ShuffleNet(scale=0.33, **kwargs) return model @manager.BACKBONES.add_co...
Python
1
ock.close() else: self._accept_futures[sock.fileno()] = f f.add_done_callback(loop) self.call_soon(loop) def _process_events(self, event_list): # Events are processed in the IocpProactor._poll() method pass def _stop_accept_futures(self): ...
Python
1
st _ as *mut _, &mut out); if hr == S_OK { Ok(HString::wrap(out)) } else { err(hr) } }} #[inline] pub fn get_rsa_sign_pkcs1_sha256(&self) -> Result<HString> { unsafe { let mut out = null_mut(); let hr = ((*self.lpVtbl).get_RsaSignPkcs1Sha256)(self as *const _ as *mut _, &mut out); ...
Rust
0
''' Calculo do segundo dígito do CPF CPF: 746.824.890-70 Colete a soma dos 9 primeiros dígitos do CPF, MAIS O PRIMEIRO DIGITO, multiplicando cada um dos valores por uma contagem regressiva começando de 11 Ex.: 746.824.890-70 (7468248907) 11 10 9 8 7 6 5 4 3 2 * 7 4 6 8 2 4 8 9 0 7 <-- PRIMEIRO D...
Python
1
ute = match absolute { true => 1, false => 0, }; unsafe { let success = SetConsoleWindowInfo(output_handle, absolute, rect); is_true(success) } } pub fn set_console_screen_buffer_size(size: COORD) -> bool { let output_handle = get_output_handle(); unsafe { le...
Rust
0
_precedence(self, mock_custom_rules_file): """Test that environment variable takes precedence over file.""" # Set environment variable with patch.dict( os.environ, {"DIVE_CUSTOM_RULES_CONTENT": "Env rules have precedence"} ): # Initialize with custom rules path ...
Python
1
om::Symbol(ref x) => x.clone(), Atom::Terminal(ref x) => x.clone()}; let mut curr_value = curr_lex.value.clone(); let mut cut_count: Vec<u32> = Vec::new(); let mut _table_items = None; let mut state = 0u32; // let mut state_stack_mark: StateStackMark = StateStackMark(&mut HashSet::new...
Rust
0
_R { REG_GPIO_17_FUNC_SEL_R::new(((self.bits >> 24) & 0x0f) as u8) } #[doc = "Bit 21 - Pull Down Resistor for GPIO17."] #[inline(always)] pub fn reg_gpio_17_pd(&self) -> REG_GPIO_17_PD_R { REG_GPIO_17_PD_R::new(((self.bits >> 21) & 0x01) != 0) } #[doc = "Bit 20 - Pull Up Resistor...
Rust
0
grouped by species. hist_penguins_filt = ( ggplot(df_hist_penguins_filt, aes(x='body_mass_g', fill='species')) + geom_density(alpha=0.2) + theme_light() ) # Return the "hist_penguins" histogram. return hist_penguins_filt # endregion (Data Umbrella, 2...
Python
1
pe::create_function`]: #method.create_function pub fn create_function_mut<'lua, A, R, F>(&'lua self, func: F) -> Result<Function<'lua>> where A: FromLuaMulti<'lua>, R: ToLuaMulti<'lua>, F: 'scope + FnMut(&'lua Lua, A) -> Result<R>, { let func = RefCell::new(func); sel...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2022 Google LLC. 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 requir...
Python
1
on (US)`: OZ_PER_GAL_US, "OZ-PER-GAL_US", /// `Ounce (avoirdupois) Per Hour`: OZ_PER_HR, "OZ-PER-HR", /// `Ounce (avoirdupois) Per Minute`: OZ_PER_MIN, "OZ-PER-MIN", /// `Ounce (avoirdupois) Per Second`: OZ_PER_SEC, "OZ-PER-SEC", /// `Ounce (avoirdupois) Per Cubic Yard`: OZ_PER_...
Rust
0
dir() { println!("Can't process directories yet"); exit(1); } else { let mut input = File::open(filename).context(format!("Can't open input file {}", filename))?; process_single_file(&mut input, &mut output, options)?; } }, ...
Rust
0
ialize, Deserialize, Default)] pub struct PublicIpPrefixPropertiesFormat { #[doc = "IP address version."] #[serde(rename = "publicIPAddressVersion", default, skip_serializing_if = "Option::is_none")] pub public_ip_address_version: Option<IpVersion>, #[doc = "The list of tags associated with the public I...
Rust
0
from operator import itemgetter # Liste de tuples (nom, âge, taille en cm) personnes = [ ("Alice", 25, 165), ("Bob", 30, 180), ("Charlie", 22, 175), ("David", 35, 170), ("Eve", 28, 160) ] # Tri par âge en utilisant lambda tri_age_lambda = sorted(personnes, key=lambda x: x[1]) # Tri par âge en uti...
Python
1
"name": "Nika", "description": "Nika was a proficient assassin schooled in her youth at Shing Jea Monastery. She served Cantha as a member of the Obsidian Flame.", "type": "Specialist Hero", "stats": { "offense": 3, "defense": 2, "speed": 4 }, "overlay": "http...
Rust
0
and y to {}.", 10, dot_product, mag_x, mag_y ); } fn sqrt(v: Value) -> Value { v.0.sqrt().into() } //! `μfmt` macros #![deny(warnings)] extern crate proc_macro; use core::mem; use proc_macro::TokenStream; use std::borrow::Cow; use proc_macro2::{Literal, Span}; use proc_macro_hack::proc_macro_hack;...
Rust
0
kResponse returns values that preserves the order with keys in request, thus the // kvpair result should be produced by zipping the keys in request and the values in respponse. impl Merge<ResponseWithShard<kvrpcpb::PessimisticLockResponse, Vec<kvrpcpb::Mutation>>> for CollectWithShard { type Out = Vec<KvPair>; ...
Rust
0
""" Example sentences to test spaCy and its language models. >>> from spacy.lang.sr.examples import sentences >>> docs = nlp.pipe(sentences) """ sentences = [ # Translations from English "Apple планира куповину америчког стартапа за $1 милијарду.", "Беспилотни аутомобили пребацују одговорност осигурања н...
Python
1
) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value ...
Rust
0
::{AppLauncher, WindowDesc, Widget, PlatformError, Data, Lens, Size, WidgetExt, Color, Selector, MenuDesc, MenuItem, LocalizedString, DelegateCtx, Target, Command, KeyCode}; use druid::widget::prelude::*; use druid::widget::{Flex, Button, MainAxisAlignment, Slider, Label, Controller}; use druid::{ContextMen...
Rust
0
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import unittest import onnx import onnx_ir as ir from packaging import version import onnxscript import onnxscript.optimizer import onnxscript.rewriter.testing from onnxscript import FLOAT, script from onnxscript.rewriter.rules.fusion._gqa impo...
Python
1
t.moslqo def main(): args = get_parser().parse_args() stoi_scores = [] nb_pesq_scores = [] wb_pesq_scores = [] if not args.output_result_path.exists(): args.output_result_path.mkdir(parents=True) with open(f"{args.output_result_path}/pesq_scores.txt","w") as p, open(f"{args.output_resul...
Python
1
from typing import Any, Dict, List import numpy as np from pydantic import BaseModel, Field Embedding = List[float] | List[List[float]] | np.ndarray class DocumentChunk(BaseModel): """Represents a chunk stored in VectorStore""" document_id: str # external_id of parent document content: str embeddi...
Python
1
turn cropped_frames, cropped_frame_ids def _test_crop_center(): test_frames = np.ones((2, 10, 10, 1)) test_frames[:, 2:8, 2:8] = 0 assert np.sum(test_frames) == 2 * (100 - 36) cropped_frames = crop_center(test_frames, target_shape=(6, 6)) assert np.all(cropped_frames == 0) cropped_frames =...
Python
1
Client`. The `Client` will /// check each `Proxy` in the order it was added. This could mean that a /// `Proxy` added first with eager intercept rules, such as `Proxy::all`, /// would prevent a `Proxy` later in the list from ever working, so take care. #[derive(Clone, Debug)] pub struct Proxy { pub(crate) inner: Hy...
Rust
0
the number // of bytes in the input file was not evenly divisible by // `num_chunks`, we don't leave any bytes behind. let mut buf = vec![0u8; chunk_size]; for writer in writers.iter_mut().take(num_chunks - 1) { reader.read_exact(&mut buf)?; writer.write_all(&buf...
Rust
0
) -> cudaError_t; pub fn cudaIpcOpenMemHandle( devPtr: *mut *mut ::std::os::raw::c_void, handle: cudaIpcMemHandle_t, flags: ::std::os::raw::c_uint, ) -> cudaError_t; pub fn cudaIpcCloseMemHandle(devPtr: *mut ::std::os::raw::c_void) -> cudaError_t; pub fn cudaThreadExit() -> cu...
Rust
0
# RUN: %PYTHON %s | FileCheck %s from buddy_mlir.dialects import arith, func, rvv from buddy_mlir import ir from buddy_mlir.passmanager import PassManager def run(f): print("\nTEST:", f.__name__) f() return f # CHECK-LABEL: TEST: testRVVLegalizeForLLVM @run def testRVVLegalizeForLLVM(): with ir.Con...
Python
1
an>> { let request = Request::from_route(&Route::GetBans { guild_id: self.guild_id.get(), }); self.http.request(request) } } use anyhow::Result; use config::{Config, File}; use std::path::Path; use structopt::StructOpt; use youtrack_commander::{run, Configuration, Opts}; fn mai...
Rust
0
}; let ov = unsafe { std::slice::from_raw_parts(raw_data, size) }; let seq = dtab.beam_search(&ov, size, beam_size, beam_cut_threshold); let c_seq = CString::new(seq).unwrap(); c_seq.into_raw() } impl DecoderTab { fn new( tab0: Array<f32, Ix2>, tab1: Array<f32, Ix2>, ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A specialized version of the Map class representing a map of Oceania. This class inherits from the generic Map class and provides geographical data specific to Oceania. It allows for rendering and customizing the appearance of Oceanian countries, including setting spec...
Python
1
from_bytes(private_doc.as_ref()) } } } impl Hash for PrivateKey { fn hash<H: Hasher>(&self, state: &mut H) { self.keypair.secret.as_bytes().hash(state) } } impl PartialEq for PrivateKey { fn eq(&self, other: &Self) -> bool { self.keypair.secret.as_bytes() == other.keypair.secre...
Rust
0
let mp_s_p = llvm.ptr_t(llvm_structs.mp_struct); let mut args = [mp_s_p, mp_s_p, mp_s_p]; let ret = llvm.i32_t(); let func_type = llvm.mk_func_type(ret, &mut args); llvm.mk_func("mp_add", func_type) } pub fn export_mp_to_radix(llvm: &mut LLVM, llvm_structs: &LLVMStructs) -> LLVMValueRef { let m...
Rust
0
chieves this but // causes 100% CPU usage, apparently because glib likes to call us back very quickly. let state = Arc::clone(state); glib::timeout_add(16, move || run_idle(&state)); } glib::source::Continue(false) } fn make_gdk_cursor(cursor: &Cursor, gdk_window: &gdk::Window) -> Optio...
Rust
0
# -*- coding: utf-8 -*- import os import subprocess from .utils import * class KeystoreInfo: def __init__(self): self.keystore_path = None self.store_pass = None self.keystore_type = None def get_keystore_info(self): print_blue("\n--- Gathering Keystore Information ---") ...
Python
1
self, cur: Pos) -> Pos { match self { East => (cur.0 + 1, cur.1), SouthEast => (cur.0, cur.1 - 1), SouthWest => (cur.0 - 1, cur.1 - 1), West => (cur.0 - 1, cur.1), NorthWest => (cur.0, cur.1 + 1), NorthEast => (cur.0 + 1, cur.1 + 1), ...
Rust
0
. //! //! The thread where [`fn@init`] was called is considered the main thread. OS X has //! its own notion of the main thread and [`fn@init`] must be called on that thread. //! After successful initialization, calling any [`gtk`](mod@crate) or [`mod@gdk`] functions //! (including [`fn@init`]) from other threads will ...
Rust
0
import os # 根据环境变量获取当前环境 env = os.getenv("ENV", "prod") # 配置不同环境的 Nacos 服务地址和命名空间 CONFIG = { "dev": { "SERVER_ADDRESS": "http://127.0.0.1:8848", "NAMESPACE": "16c3a2e3-a9c2-43d2-b4eb-d51ac0e167a4", "USERNAME": "nacos", "PASSWORD": "123456" }, "prod": { "SERVER_ADDRE...
Python
1
import streamlit as st import requests from PIL import Image import io # Define API endpoint api_urls = [ "https://carbotrackapi-qoz5nlx2ga-ew.a.run.app/predict" ] # Define app title and description st.markdown("# Welcome to the Carbotrack app! #") st.markdown(''' Please be aware that our app and our models are s...
Python
1
").unwrap(); assert_eq!( "MacAddress(\"12:34:56:ab:cd:ef\")".to_owned(), format!("{:?}", mac) ); } #[test] fn test_fmt() { let mac = MacAddress::parse_str("0x123456ABCDEF").unwrap(); match MacAddress::get_display_format() { MacAddressForma...
Rust
0
((EDGE_X1 + CELL_SIZE, CELL_SIZE), ParentType::L1, V2 {x: 0.0, y: CELL_SIZE }, color, back_color),Cell::new((EDGE_X1 + CELL_SIZE, CELL_SIZE*2.0), ParentType::L1, V2 {x: 0.0, y: CELL_SIZE*2.0 }, color, back_color)], piece: piece_type, moved_down: false }, ParentType::L2 => Piece { pos: V2 {x: EDGE_X3 - (CELL...
Rust
0
_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] struct Statistics { counts: pack::data::output::count::from_objects_iter::Outcome, entries: pack::data::output::entry::from_counts_iter::Outcome, } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level d...
Rust
0
res = check_res(res_point) table_res[i] = None if res == -1 else res undo() if table_res[i] == max_depth[0]: return table_res[i] else: move(res_point) res = check_res(res_point) table_res[i] = None if res == -1 else res ...
Python
1
env.step(); assert_eq!(env.pop().unwrap(), "@test: thats not a number I understand"); env.push("!give foo 101"); env.step(); assert_eq!(env.pop().unwrap(), "@test: you only have 100 credits."); env.push("!give foo 50"); env.step(); assert_eq!( ...
Rust
0
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
1
await self.profile_handler.check_profile_query_allowed(user, requester_user) avatar_url = await self.profile_handler.get_avatar_url(user) ret = {} if avatar_url is not None: ret["avatar_url"] = avatar_url return 200, ret async def on_PUT( self, request: Sy...
Python
1
_HF_BYPR::_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> BB_LDO_HF_BYPR { match value { false => BB_LDO_HF_BYPR::_0, true => BB_LDO_HF_BYPR::_1, } } #[doc = "Checks if the value of the field is `_0`...
Rust
0
l<'a, C> Plugin<'a, C> for CharacterLimiter where C: PixelColor, { fn new_line(&mut self) { self.last_line = self.measured > self.characters; } fn next_token( &mut self, mut next_token: impl FnMut() -> Option<Token<'a, C>>, ) -> Option<Token<'a, C>> { if self.last_li...
Rust
0
ection = &pe.sections[symbol.section_number as usize - 1]; if symbol.storage_class == goblin::pe::symbol::IMAGE_SYM_CLASS_STATIC || symbol.storage_class == goblin::pe::symbol::IMAGE_SYM_CLASS_EXTERNAL || symbol.storage_class == goblin::pe::symbol::IMAGE_SYM_CLASS...
Rust
0
ABS_MARGIN_RIGHT; // Create form wrapper gen_widget_container!( master, container_id: config.advanced_form_wrapper, color: color::TRANSPARENT, width: parent_size.0 - tabs_total_width, height: parent_size.1, positions: top_left_with_margins_on[ config....
Rust
0
nytimes article_cursor = db.articles.find({ 'pub_date': {'$gte': start, '$lt': end}, }, no_cursor_timeout=True).batch_size(128) for article in tqdm(article_cursor): parse_article(article, nlp, db) def main(): args = docopt(__doc__, version='0.0.1') args = validate(args) if a...
Python
1
"""Game logic module"""
Python
1
sociated_with_assessment(application_id) if associated_tags: serialiser = JoinedTagAssociationSchema() serialised_associated_tags = [serialiser.dump(r) for r in associated_tags] return serialised_associated_tags return [] @assessment_tag_bp.get("/application/<application_id>/tags") def...
Python
1
ata shape for DPM-Solver sampling is {size}, sampling steps {S}') device = self.model.betas.device if x_T is None: img = torch.randn(size, device=device) else: img = x_T ns = NoiseScheduleVP('discrete', alphas_cumprod=self.alphas_cumprod) model_fn = mod...
Python
1
icon = PLATFORM_ICONS.get(platform, "") name = group.get("name", "Unknown Group") url = group.get("url", "#") commercial = ( " (Commercial)" if group.get("commercial", False) else "" ) ...
Python
1
#!/usr/bin/env python3 # add headers to .h, .cpp, .c and .ino files automatically. # the script will first list the files missing headers, then # prompt for confirmation. The modification is made inplace. # # usage: # add-headers.py <header file> <root dir> # # The script will first read the header template in <head...
Python
1
ParserError(url::ParseError); Json(serde_json::Error); TimestampError(std::time::SystemTimeError); } } use std::collections::{BinaryHeap, HashMap}; use std::cmp::{PartialOrd, Eq, PartialEq, Ord, Ordering, Reverse}; use wasm_bindgen::prelude::*; use serde::{Deserialize, Serialize}; use smallvec::{S...
Rust
0
z: f64, zx: f64, zy: f64) -> Matrix { let mut m = MATRIX_IDENTITY; m.set(0, 1, xy); m.set(0, 2, xz); m.set(1, 0, yx); m.set(1, 2, yz); m.set(2, 0, zx); m.set(2, 1, zy); m } #[cfg(test)] mod tests { use super::*; use crate::tuple::Tuple; #[test] fn multiplying_by_a_trans...
Rust
0
grey8(100); ctx.blurred_rect(modal_rect, 5.0, &blur_color); modal.paint(ctx, data, env); } } } fn is_user_input(event: &Event) -> bool { matches!( event, Event::MouseUp(_) | Event::MouseDown(_) | Event::MouseMove(_) | Event::Ke...
Rust
0
o not modify the original video player_dict = tracks['players'][frame_num] referee_dict = tracks['referees'][frame_num] ball_dict = tracks['ball'][frame_num] # draw player trackers for track_id, player in player_dict.items(): color = player.g...
Python
1
odel.generate( input_ids=input_ids, images=videos, attention_mask=attention_masks, use_cache=self.use_cache, stopping_criteria=[stopping_criteria], do_sample=True if gen_kwargs["temperature"] > 0 else...
Python
1
<!--foo-->bar"), Extra(Partial::new((), 10))); assert_eq!(parse_raw("<!----->"), DoubleHyphen(4)); assert_eq!(parse_raw("<!------>"), DoubleHyphen(4)); assert_eq!(parse_raw("<!------->"), DoubleHyphen(4)); assert_eq!(parse_raw("<!--foo--bar-->"), DoubleHyphen(7)); assert_eq!(par...
Rust
0
>> { let (index, byte_range) = self.create_index_from_link( &secrets, |items, level| config.branch_sealed(items, level), link, )?; let state = StreamBuilderState::new(byte_range.end, secrets, config); Ok(StreamBuilder::new_from_index(Some(index), state...
Rust
0
# Copyright (c) 2021 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
''' Ideas for automating the work of parallelising a network * Given a network object net, work through each of the objects adapting them all for the expansion of some parameter. This is nice because it doesn't require the user to write any new code just add in an extra auto-parallelisation line. The difficult...
Python
1
rofile.is_null() || proflen < 128i32 { return 0 as *mut pdf_obj; } p = profile as *const u8; intent = (*p.offset(64) as i32) << 24i32 | (*p.offset(65) as i32) << 16i32 | (*p.offset(66) as i32) << 8i32 | *p.offset(67) as i32; match intent >> 16i32 & 0xffi32 { 2 => ...
Rust
0
# -*- coding: utf-8 -*- # Created on 2018-08-15 # author: 欧度智能,https://www.odooai.cn # email: 300883@qq.com # resource of odooai # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # Odoo在线中文用户手册(长期更新) # https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html # Odoo10离线中文用户手册下载 # https://www.odooa...
Python
1
ffer); let size = buffer.len() as u32; buffer.advance(44); let base_offset = buffer.get_u32_le(); buffer.seek(base_offset, size); // maybe NULL ! let model_str_ptr = buffer.get_u32_le(); buffer.advance(4); let time_max = buffer.get_u32_le(); b...
Rust
0
() eig_vals[::-1].sort() eig_vecs = eig_vecs[:, sort_perm] print(eig_vecs) eig_matrix = eig_vecs.reshape((27, 3, 3, 3)) f, ax = plt.subplots(eig_matrix.shape[0], 1, figsize=(1, eig_matrix.shape[0])) for i in range(eig_matrix.shape[0]): img = eig_matrix[i] ...
Python
1
.list_all() return {vault.id: vault.title async for vault in vaults} def get_expiry_string(days: int) -> str: """Convert number of days to expiry string format.""" expiry_map = {1: "OneDay", 7: "SevenDays", 14: "FourteenDays", 30: "ThirtyDays"} return expiry_map.get(days, "ThirtyDays") async def mai...
Python
1
- PIN is good! You really are {}", name); } if FULL { let mut pxcid = None; if PERMITS { pxcid = Some(&xcid[..]) }; mpin::hash_all(sha, &hcid, &xid, pxcid, &sec, &y, &z, &t, &mut h); mpin::client_key(sha, &g1, &g2, pin, &r, &x, &h, &t, &mut ck); pri...
Rust
0
fn test_reorder2(#[values(true, false)] no_mmap: bool, #[values(r"\s+")] hck_delim: &str) { let tmp = TempDir::new().unwrap(); let input_file = tmp.path().join("input.txt"); let output_file = tmp.path().join("output.txt"); // 4-5 should not be repeated at the end and only written onc...
Rust
0
.build_server(false) .compile_with_config( config, &[ "./gnmi/gnmi.proto", "./gnmi/gnmi_ext.proto"], &["./gnmi","./googleapis/"] ).unwrap(); }<reponame>yannleretaille/rust-regex-cache // Copyright 2017 1aim GmbH // // Permission is here...
Rust
0
id` /// has exited, including if it has already exited. Does *not* reap the /// child itself. /// /// The returned handle is guaranteed to be non-zero. /// /// Panics if `pid` doesn't exist. pub fn watch(&self, pid: Pid, callback: impl Send + FnOnce(Pid) + 'static) -> WatchHandle { l...
Rust
0
ed() } } fn configure_pins(&self, gpio: &rza1::gpio::RegisterBlock); fn enable_clock(&self, cpg: &rza1::cpg::RegisterBlock); #[inline] fn configure_uart(&self, baud_rate: u32) { self.scr.write(|w| { w.tie() .clear_bit() .rie() .c...
Rust
0
arker].kill() self.fav = {} def exit_screen(self): self.clear_page() self.clear_cat_buttons() def on_use(self): self.loading_screen_on_use(self.start_patrol_thread, self.open_patrol_event_screen, (700, 500)) self.loading_screen_on_use(self.proceed_patrol_thread...
Python
1
data = self.main(ua=headers["user-agent"]) proxy = http_form_data(data=get_proxies()) res = requests.get(url="http://localhost:6666/fetch?url=" + url, data={ "method": "POST", "header": http_form_data(data=headers), "cookie": '', ...
Python
1
, milliseconds: u32, interaction_id: *mut ::std::os::raw::c_char, ) -> SPXHR; } extern "C" { pub fn dialog_service_connector_start_keyword_recognition( h_connector: SPXRECOHANDLE, h_keyword: SPXKEYWORDHANDLE, ) -> SPXHR; } extern "C" { pub fn dialog_service_connector_star...
Rust
0
seed = 5 runner_class_name = "OnPolicyRunner" # DWLOnPolicyRunner class policy: init_noise_std = 1.0 actor_hidden_dims = [512, 256, 128] critic_hidden_dims = [768, 256, 128] class algorithm(LeggedRobotCfgPPO.algorithm): entropy_coef = 0.001 learning_rate = 1e-5 ...
Python
1
tlib functions gv.set_axes_limits_and_ticks( ax0, xlim=(-3, 3), xticks=np.linspace(-3, 3, 7), xticklabels=["Jan₋₁", "Jul₋₁", "Jan₀", "Jul₀", "Jan₊₁", "Jul₊₁", "Jan₊₂"], yticks=np.linspace(0, 46, 46), yticklabels=left_y_ticks, ) ax0.spines['right'].set_visible(False) gv.set_axes_limits_and_ticks...
Python
1
# -*- coding: utf-8 -*- import unittest from tcms.core.templatetags.extra_filters import markdown2html class TestMarkdownExtraFilters(unittest.TestCase): def test_markdown2html_convert_paragraphs(self): self.assertEqual( markdown2html("__*hello!*__"), "<p><strong><em>hello!</em></strong></p>"...
Python
1
1); quote!( for (voter_index, target_index) in self.#name { #assignments.push(_npos::Assignment { who: voter_at(voter_index).or_invalid_index()?, distribution: vec![ (target_at(target_index).or_invalid_index()?, #per_thing::one()) ], }) } ) }; let into_impl_rest = (2..=count) ...
Rust
0
import json from pathlib import Path from .. import __rootdir__ # agents list in Arknights agent_list = json.loads(Path(f"{__rootdir__}/data/agent.json").read_text("utf-8")) agent_profession = json.loads( Path(f"{__rootdir__}/data/agent_profession.json").read_text("utf-8") ) workshop_formula = json.loads( Pa...
Python
1
(processReferences) for process in processes: if 'processType' in process['properties'] and getProperty(process, 'processType') in processTypes: if 'isSoftwareComponentOfPgi' in process['toRelationships']: sc_count = len(process['toRelationships'][...
Python
1
# ml_models/train_model.py # type: ignore import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split import joblib def train_model(): # Load features features = pd.read_csv('features.csv') # Simulate labels (in real scenarios, you'd have ac...
Python
1
; let storage_sop_instance_uid = &meta.media_storage_sop_instance_uid; let transfer_syntax_uid = &meta.transfer_syntax.trim_end_matches('\0'); let ts = TransferSyntaxRegistry .get(transfer_syntax_uid) .ok_or("Unsupported file transfer syntax")?; Ok(DicomFile { file: file.to_path_...
Rust
0
ident) => { <$module>::load($bot, $config.$config_ident).await? }; } #[async_trait] pub trait Module: 'static + Send + Sync + Sized { const KIND: ModuleKind; const ID: &'static str; const NAME: &'static str; type ModuleConfig: Clone + Deserialize<'static> + Serialize + std::fmt::Debug; ...
Rust
0
# coding=utf8 import tensorflow as tf; INPUT_NODE = 784; OUTPUT_NODE = 10; IMAGE_SIZE = 28; NUM_CHANNELS = 1; NUM_LABELS = 10; # FIRST CONVOLUTION LAYER CONV1_DEEP = 32; CONV1_SIZE = 5; #SECOND CONVOLUTION LAYER CONV2_DEEP = 64; CONV2_SIZE = 5; #FULL CONNECTION LAYER NODE NUMBER FC_SIZE = 512; def inference(inpu...
Python
1
mean((f_df["value"] - f_df["mean"]) ** 2 )) ** 0.5 coverage = sum((f_df["value"] <= f_df["upper"]) & (f_df["value"] >= f_df["lower"])) / len(f_df) metrics = {"mape": mape, "rmse": rmse, "coverage": coverage} with mlflow.start_run(run_name = labe...
Python
1
new(), sum.links().map(|a| a.as_str()), ) .unwrap() } pub fn dep(name: &str) -> Dependency { dep_req(name, "*") } pub fn dep_req(name: &str, req: &str) -> Dependency { Dependency::parse(name, Some(req), registry_loc()).unwrap() } pub fn dep_req_kind(name: &str, req: &str, kind: DepKind, public:...
Rust
0
.get_ticks() - event.last_click_time < 500: for _ in range(random.randint(1, 20)): if boids: boids.pop() else: for _ in range(random.randint(1, 10)): ...
Python
1
Computes the contact manifold between a triangle-mesh and a shape. pub fn contact_manifolds_trimesh_shape<ManifoldData, ContactData>( dispatcher: &dyn PersistentQueryDispatcher<ManifoldData, ContactData>, pos12: &Isometry<Real>, trimesh1: &TriMesh, shape2: &dyn Shape, prediction: Real, manifolds...
Rust
0
"""Functionalities for setting the default sampler.""" from contextlib import ContextDecorator from threading import local from typing import Optional from .interface import ISampler from .interpolator import LinearInterpolator _DEFAULT_SAMPLER: Optional[ISampler] = None _DEFAULT_SAMPLER_CONTEXT_STACK = local() _DEF...
Python
1
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from webdriver_manager.chrome import ChromeDriverManager options = webdriver.ChromeOptions() options.add_experimental_option('detach', True) driver = webdriver.Chrome(service=Service(Chrome...
Python
1
.uri()).await.expect_status_ok(); Ok(()) })); assert!(timeout.is_err()) } #[async_std::test] async fn should_not_timeout_with_global_delay_of_2_seconds() { let cfg = Config { global_delay: Some(2000), ..Default::default() }; let srv = Stubr::start_with("tests/stubs/ping.json", cfg).await; l...
Rust
0
ch.dict(syslog_ng.__salt__, _SALT_VAR_WITH_MODULE_METHODS): with patch.dict(syslog_ng_module.__salt__, {"cmd.run_all": mock_func}): got = syslog_ng.started(user="joe", group="users", enable_core=True) command = got["changes"]["new"] self.assertTrue( ...
Python
1