text
string
label_name
string
labels
int64
programs that explicitly check for [`read_closed`], /// [`write_closed`], or [`error`] readiness should be doing so as an /// **optimization** and always be able to handle an error or close situation /// when performing the actual read operation. /// /// [`readable`]: ./event/struct.Event.html#method.is_readable /// [`...
Rust
0
"""Chapter 22: Online Belief State Planning"""
Python
1
q6::one()); assert_eq!(ans1.pow(Fr::characteristic()), Fq6::one()); assert_eq!(ans2.pow(Fr::characteristic()), Fq6::one()); assert_eq!(ans3.pow(Fr::characteristic()), Fq6::one()); } #[test] #[ignore] fn print_g1_generator() { use crate::fields::sw6::fq::Fq; let x: Fq = "55111638249215858879155905...
Rust
0
on stream /// immediately. /// /// ## Return value /// /// The command returns Err if the format specifiers are invalid /// or the command name does not belong to a known command. pub fn replicate<T: AsRef<str>>( &self, command: T, flags: Option<CallFlag>, arg...
Rust
0
String, seq: &String, qual: &String) -> Seq; /// Make a blank sequence object. fn blank () -> Seq; /// Determine if it is a blank sequence. fn is_blank (&self) -> bool; /// Make a seq object from a String. fn from_string (seq_str: &String) -> Seq; /// sanitize an identifier string fn san...
Rust
0
<DamlVarWithType<'a>>, body: Box<DamlExpr<'a>>, } impl<'a> DamlAbs<'a> { pub fn new(params: Vec<DamlVarWithType<'a>>, body: Box<DamlExpr<'a>>) -> Self { Self { params, body, } } pub fn params(&self) -> &[DamlVarWithType<'a>] { &self.params } pub...
Rust
0
let mut robot_origin = data.current_robot_origin.lock().unwrap(); *robot_origin = json.into_inner(); HttpResponse::Ok().json(&ResultResponse { is_ok: true, reason: "".to_string(), }) } #[options("set_joint_positions")] async fn options_set_joint_positions() -> HttpResponse { HttpRe...
Rust
0
: NormalizedKeyPoint, pub descriptor: BitArray<64>, pub color: [u8; 3], } #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Pair(usize, usize); impl Pair { /// Creates a new pair, cannonicalizing the order of the pair. pub fn new(a: usize, b: usize) -> Self { Self(...
Rust
0
erde_json::Error), #[error(transparent)] SerdeUrl(#[from] serde_urlencoded::ser::Error), // -- endpoint errors #[error("Status code: {}", code)] Generic { code: u16 }, } /// Errors for the [Update an attribute for a SCIM enterprise user](EnterpriseAdmin::update_attribute_for_enterprise_user_asyn...
Rust
0
import torch class TFEmbedding(torch.nn.Embedding): """Position-aware embeddings for Transformer models. Adapted from OpenNMT-py & original `Attention is all you need` paper. """ def __init__(self, num_embeddings, embedding_dim, max_len=1024, dropout=0.1): self.num_embeddings = num_embeddings...
Python
1
key_t=key_t, value=value, mask=mask, ) # TODO: maybe we should use torch.empty_like(query) to allocate storage in-advance, # and pass slices to be mutated, instead of torch.cat()ing the returned slices res = torch.cat([ compute_query_chunk_attn( query=ge...
Python
1
""" Read currency exchange rates. This functionality could be used to display the exchange rate graph, for example. The first (and only) parameter is the name of the GnuCash file to use. If not set, 'test.gnucash' is used. """ # pylint: disable=invalid-name import sys import piecash from piecash import Commodity # Va...
Python
1
bm](https://developer.android.com/reference/android/telephony/SignalStrength.html#getCdmaDbm()) #[deprecated] pub fn getCdmaDbm<'env>(&'env self) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> { // class.path == "android/telephony/SignalStrength"...
Rust
0
{ self.0.events_compare[0].write(|w| w); } #[inline(always)] fn zero() -> Self::Instant { Self::Instant::from_ticks(0) } } pub trait Instance32: core::ops::Deref<Target = timer0::RegisterBlock> {} impl Instance32 for TIMER0 {} impl Instance32 for TIMER1 {} impl Instance32 for TIMER2 {...
Rust
0
{} ms. In / Out sizes: {} / {}", now.elapsed().as_millis(), sdss.entries.len(), not_sdss.entries.len()); // sdss_not.assert_equals(&not_sdss); assert!(sdss_not.equals(&not_sdss)); } fn test_glimpse_not() { let glimpse = load_glimpse().unwrap().to_bmoc(); let not_glimpse = load_not_glimpse().unwrap(...
Rust
0
| | Example: | | This example sets that the reference curves of | the hybShpCircle hybrid shape circle should be | trimmed. | | | ...
Python
1
ShInitialize(); ShFinalize(); } } //! gtk backend use super::Dispatch; use crate::widget::layout::compute_node_layout; use crate::{AttribKey, Backend, Component, Node}; use expanse::geometry::Size; use expanse::number::Number; use gio::{prelude::*, ApplicationFlags}; pub use gtk; use gtk::{ prel...
Rust
0
e_episodes and not year_end: return "" try: seasons = data["props"]["pageProps"]["mainColumnData"]["episodes"]["seasons"] season_count = len(seasons) except (KeyError, TypeError): return "" return season_count def parse_single_title(parent1, parent2, title_id): compani...
Python
1
choice = input("Enter your choice: ") if choice == '1': create_file(username, fernet) elif choice == '2': read_file(username, fernet) elif choice == '3': delete_file(username, role) elif choice == '4': view_audit_log(username, role)...
Python
1
new() }; let string_match = if let Ok(val) = env::var("PSL_STRING_MATCH") { if val == "1" { true } else { false } } else { false }; let (labels, iter) = if string_match { let labels = quote! { match ::core::str::from_utf8(domain) { Ok(domain) => ...
Rust
0
} #[cfg(feature = "runtime-benchmarks")] fn successful_origin() -> O { L::successful_origin() } } /// Ensure that the origin `o` represents a signed extrinsic (i.e. transaction). /// Returns `Ok` with the account that signed the extrinsic or an `Err` otherwise. pub fn ensure_signed<OuterOrigin, AccountId>(o: O...
Rust
0
odel making the predictions that get explained. dataset: The dataset from which the inputs originated. model_outputs: Unused, but reqired by the base class. config: A dictionary containing the key of the feature to explain, and the optional sample size if taking a random sample from the inputs...
Python
1
OWER_STATE, pub WinLogonFlags: u32, pub Spare3: u32, pub DozeS4Timeout: u32, pub BroadcastCapacityResolution: u32, pub DischargePolicy: [SYSTEM_POWER_LEVEL; 4], pub VideoTimeout: u32, pub VideoDimDisplay: super::super::Foundation::BOOLEAN, pub VideoReserved: [u32; 3], pub SpindownTim...
Rust
0
all_your_base") .version(crate_version!()) .author("https://github.com/skovmand/all_your_base") .about("Encoding and decoding of Base64 streams") .after_long_help(HELP) .setting(AppSettings::ArgRequiredElseHelp) .subcommand( App::new("decode") ...
Rust
0
#Class class Auto: marca = "" modelo = 2001 placa = "" taxi = Auto() # Taxi vendría a ser el objeto!! print(taxi.modelo) # class y objetos II class Persona: doctor = "Julieta" #print(Persona.doctor) #---------- Vamos con otro ejercicio class Jugadores_A: j1 = "messi" j2 = "c.ronaldo" j3 ...
Python
1
# Copyright 2016-2021, Pulumi Corporation. # # 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 applicable law or agreed t...
Python
1
str :param VpcName: `VPC`实例名称。 :type VpcName: str :param SubnetId: 子网实例ID。形如:subnet-12345678。 :type SubnetId: str :param SubnetName: 子网实例名称。 :type SubnetName: str :param NetDetectId: 网络探测实例ID。形如:netd-1234567...
Python
1
/// # /// # fn main() { /// # let pipeline_set = finalize_pipeline_set(new_pipeline_set()); /// let mut tree_builder: TreeBuilder = TreeBuilder::new(); /// /// let mut activate_node_builder = NodeBuilder::new("activate", SegmentType::Static); /// /// let mut thing_node_builder = NodeBuilder::new(":thing", Segment...
Rust
0
""" ------------------------------------------------------- Assignment 3, Task 2 ------------------------------------------------------- Author: David Brown ID: 999999999 Email: dbrown@wlu.ca __updated__ = "2023-02-07" ------------------------------------------------------- """ # Imports from Stack_array import...
Python
1
# chaos_continued.complete_build.py """ Continuation build script for EdenOS CHAOS environment. Triggered by chaos_language.complete_build.py This script creates: - EdenOS root under C:\EdenOS_<USERNAME>\ - Storage folder (\99_storage) - Dropbox folder (\000_Eden_Dropbox) - Tutorial modules (10 lessons, guided by Gizz...
Python
1
_rules! loop_through_identifiers { ($callback:tt) => { foreach!( $callback => A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 ); }; } #[doc(hidden)] #[macro_export] macro_rules! __js_raw_asm { ($code:expr, $($token:expr),*) => {{ #[$crate::private::js_raw_attr] fn snippet() { ...
Rust
0
: VecDeque::new(), result: ring, jump_rows, hammerable_groups, }) } } /// This is like the `main` function, except for JavaScript. #[cfg(debug_assertions)] #[wasm_bindgen(start)] pub fn main_js() -> Result<()> { // This provides better error messages in debug mode. ...
Rust
0
where F: Udf + 'static, { Expr::Apply { input: Box::new(self), function: Arc::new(function), output_type, } } /// Shift the values in the array by some period. See [the eager implementation](Series::shift). pub fn shift(self, periods: i32)...
Rust
0
let packed = [0x0bcd]; let frequencies = unpack_u12s(&packed, 1).collect::<Vec<_>>(); assert_eq!(frequencies, [0x0bcd]); let packed = []; let frequencies = unpack_u12s(&packed, 0).collect::<Vec<_>>(); assert!(frequencies.is_empty()); } #[test] fn test_pack_u...
Rust
0
ied metrics while failing at the intended task, " f"potentially affecting {template['category']} counting reliability." ) def _generate_distributional_shift_distractor(self, template: dict, specific_item1: str, specific_item2: str) -> str: """Generate distractor about distributional shi...
Python
1
; pub(crate) const JSONB_ARRAY: Self = Self(PgType::JsonbArray); pub(crate) const JSONPATH: Self = Self(PgType::Jsonpath); pub(crate) const JSONPATH_ARRAY: Self = Self(PgType::JsonpathArray); // // network address types // https://www.postgresql.org/docs/current/datatype-net-types.html // ...
Rust
0
AsMut<[<A as Array>::Item]>> DoubleEndedIterator for ArrayQueueIterator<'a, A> { fn next_back(&mut self) -> Option<Self::Item> { if self.exhausted() { return None; } self.last -= 1; let x = &self.queue.array.as_ref()[self.queue.index(self.last)]; Some(x) ...
Rust
0
bits >> 16) & 0xffff) as u16) } #[doc = "Bit 0"] #[inline(always)] pub fn gpadc_data_rdy(&self) -> GPADC_DATA_RDY_R { GPADC_DATA_RDY_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bits 16:31"] #[inline(always)] pub fn gpadc_reserved(&mut self) -> GPADC_RESERVED_W { ...
Rust
0
choices=['movie', 'person', 'character', 'company', 'keyword']) command_search_parser.add_argument('key', help='title or name of item to search for') command_search_parser.add_argument('-n', type=int, help='number of items to list') command_search_parser.add_argument('--first', action='s...
Python
1
confirmed // Setup: // - create path manger with one path // // Trigger: // - call on_datagram_received with new remote address bit handshake_confirmed false // // Expectation: // - asset on_datagram_received errors // - assert we have one paths fn do_not_add_new_path_if_handshake_not_confirmed() { // Setup: l...
Rust
0
ot touch at the end points if // overlapping is false if overlapping || used_vertices.insert(v.fix()) { let out_edge = v.out_edge().unwrap(); let to = out_edge.to(); used_vertices.insert(to.fix()); let h0 = cdt.insert(v.position());...
Rust
0
"decompressed.txt", "r") as decompressed_file: decompressed_lines = decompressed_file.read() compressed_nums = compressed_lines.split(" ") decompressed_nums = decompressed_lines.split(" ") diffs = 0 for i, num in enumerate(compressed_nums): if num != decompressed_nums[i]: if num == "0" + decompressed...
Python
1
if out_strides is None: warn('For custom return_layers setting out_strides must be specified.') self.return_layers = return_layers[depth_] self.module = create_feature_extractor(self.module, self.return_layers) self.out_channels = out_channels[depth_] if out_channels...
Python
1
import plotly as py import plotly.graph_objs as go # ----------pre def pyplt = py.offline.plot trace0 = go.Scatter( x=[1.5, 3.5], y=[0.75, 2.5], text=['无填充圆', '有填充圆'], mode='text', ) data = [trace0] layout = { 'xaxis': { 'range': [0, 4.5], 'zeroline': False, }, '...
Python
1
name_series(first_filename) serie = FileSeries(filenames=filenames) self.assertEqual(serie.nframes, 10) serie.close() def suite(): loadTests = unittest.defaultTestLoader.loadTestsFromTestCase testsuite = unittest.TestSuite() testsuite.addTest(loadTests(TestRandomSeries)) testsu...
Python
1
4 = 1.04222645593369134254e-01; /* 0x3FBAAE55, 0xD6537C88 */ const V5: f64 = 3.21709242282423911810e-03; /* 0x3F6A5ABB, 0x57D0CF61 */ const S0: f64 = -7.72156649015328655494e-02; /* 0xBFB3C467, 0xE37DB0C8 */ const S1: f64 = 2.14982415960608852501e-01; /* 0x3FCB848B, 0x36E20878 */ const S2: f64 = 3.25778796408930981787e...
Rust
0
from PIL import Image def create_deck(deck, output_path): cols = 10 rows = (len(deck) + cols - 1) // cols card_width, card_height = 300, 400 # 建立空白背景 deck_image = Image.new("RGB", (cols * card_width, rows * card_height), "white") # 排列卡片 for idx, (series, card_id, card_type, _) in enumerat...
Python
1
''' Restricted direct ring-CCD. See also the relevant dicussions in https://github.com/pyscf/pyscf/issues/1149 Ref: Scuseria et al., J. Chem. Phys. 129, 231101 (2008) Ref: Masios et al., Phys. Rev. Lett. 131, 186401 (2023) Original Source: Modified from pyscf/cc/rccsd_slow.py Contact: caochangsu@gmail.com ''' fro...
Python
1
al_step >= self.total_steps: rank_zero_info(f"\nStopping training after completing {self.total_steps} steps (decay phase complete)") trainer.should_stop = True # Factory function to create both callbacks def create_callbacks(base_dir, run_name, backup_every, top_k=3): """ Creates the ne...
Python
1
buf.advance(n); Poll::Ready(Ok(())) } } impl<T> tokio::io::AsyncWrite for TokioAdapter<T> where T: futures::io::AsyncWrite, { fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<io::Result<usize>> { futures::io::AsyncWrite::poll_wri...
Rust
0
WEIGHT_DIR = "./models/weight" ONNX_DIR = "./models/onnx" QUANTIZED_ONNX_DIR = "./models/quantized_onnx" TRACE_FILE_DIR = "./models/trace" TEST_TASK = [ "object_detection", "pose_estimation", "instance_segmentation", ] TEST_MODEL_LIST = { "object_detection": [ "yolov5n", "yolov5s", ...
Python
1
olation. """) block_css = """ #buttons button { min-width: min(120px,100%); } """ def build_demo(embed_mode): textbox = gr.Textbox(show_label=False, placeholder="Enter text and press ENTER", container=False) with gr.Blocks(title="LLaMA-VID", theme=gr.themes.Default(), css=block_css) as demo: sta...
Python
1
plit, _: Entity) -> bool { true } } unsafe impl<'a, E> QueryModifier<'a> for E where E: UnfilteredImmutableQueryElement<'a>, { const IS_PASSTHROUGH: bool = false; type Split = SparseArrayView<'a>; #[inline] fn includes(&self, entity: Entity) -> bool { self.contains(entity) ...
Rust
0
import threading import time # Fonction CPU-intensive def calcul_somme_carres(): total = 0 for i in range(10_000_000): # Calcul lourd total += i * i return total # Version multithreadée def version_multithreading(): threads = [] for _ in range(4): # Lancer 4 threads pour faire le calcul ...
Python
1
_() self.client = client self.content = content self.result = "" def run(self): try: # 构建提示词 prompt = f"""请分析以下茶园环境数据,并给出详细的分析报告: {self.content} 请从以下几个方面进行分析: 1. 数据概览 2. 关键指标分析 3. 异常情况识别 4. 建议和改进措施 请给出详细的分析结果。""" # 调用API进行分析 respon...
Python
1
k_pad, shifts=(-shift_size[-2], -shift_size[-1]), dims=(0, 1)) land_mask_pad_shifted = compute_land_mask_matrix_2d(land_mask_pad_shifted, window_size) land_mask_pad = compute_land_mask_matrix_2d(land_mask_pad, window_size) all_land_mask_pad.append(land_mask_pad) all_land_mask_pad_shifted...
Python
1
is closed or does not exist, it creates a new event loop and sets it as the current event loop. Returns: asyncio.AbstractEventLoop: The current or newly created event loop. """ try: # Try to get the current event loop current_loop = asyncio.get_event_loop() if current_lo...
Python
1
^\rSrSr%Sr/SQr\\S4\S'\ \ \S'\ \S'SS\ S\ \ S\ S S4U4S jjjr SS jrS \R S \R 4S jrS \4SjrSrU=r$)rA+Applies Root Mean Square Layer Normalization over a mini-batch of inputs. This layer...
Python
1
run_exec_test(src, config, false); } #[test] fn terser_issue_1466_same_variable_in_multiple_for_in_sequences_let() { let src = r###"var test = ["a", "b", "c"]; for (let tmp in test) { console.log(tmp); let dd; dd = ["e", "f", "g"]; for (let tmp in test) { console.log(tmp); } }"###;...
Rust
0
?}")] Dot(String), #[error("dot-dot in path: {0:?}")] DotDot(String), #[error("path is absolute: `{}`", _0.display())] Absolute(PathBuf), #[error("non-UTF-8 component in path: `{}`", _0.display())] NotUtf8(PathBuf), } /// Protobuf file relative normalized file path. #[repr(transparent)] #[d...
Rust
0
<T, D> where T: Data, D: Dimension, for<'a> &'a ArrayBase<T, D>: Add<Output = ArrayBase<T, D>>, { type Output = ArrayUnit<T, D>; fn add(self, other: &ArrayUnit<T, D>) -> ArrayUnit<T, D> { if self.unit != other.unit { panic!(); } ArrayUnit { unit: self...
Rust
0
columns=['voiceID', 'meanF0Hz', 'stdevF0Hz', 'HNR', 'localJitter', 'localabsoluteJitter', 'rapJitter', 'ppq5Jitter', 'ddpJitter', 'localShimmer', 'localdbShimmer', 'apq3Shimmer', 'apq5Shimmer', 'apq11Shimmer', 'ddaShimmer']) ...
Python
1
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.> """Unit tests for dilation_utils.py.""" import numpy as np import av2.utils.dilation_utils as dilation_utils from av2.utils.typing import NDArrayByte def test_dilate_by_l2_no_change() -> None: """Test dilate_by_l2() and expect no change. Do ...
Python
1
E) ResetLookingTargetData() for i in range(7, 10): SetChrSubChip(CraftTarget.Self, i) Sleep(32) Yield() LookingTargetAdd(0xFF, "", 0x0) LookingTargetAdd(0xFC, "", 0x0) LookingTarget(100, 20, 30) AS_21(0x1, 0xFF, 150, 2000) Sleep(200) Yield() for i in range(...
Python
1
userid=event.event_data.get("user")) # ipv4和ipv6必须其一 if not self._ipv4 and not self._ipv6: self._ipv4 = True self.__update_config() logger.warn(f"Cloudflare CDN优选未指定ip类型,默认ipv4") err_flag, release_version = self.__check_environment()...
Python
1
) file.write( '''from pyiron_workflow import as_function_node, as_macro_node from typing import Optional @as_macro_node() def ''' + name + '''(self, ''' + var_def + '''): ''') for j in imports: file.write(j + "\n") for i, (k, v) in enumerate(wf.children.items()): rest, n = get_import_pat...
Python
1
import django_filters from django_filters import rest_framework as filters from difunto.models import Difunto from tumba.filters import TumbaFilter from tumba.models import Tumba, Lote from .models import Servicio class ServicioFilter(django_filters.FilterSet): startDate = django_filters.DateFilter(field_name='s...
Python
1
ree to open an issue/PR if you find something! You can also contact me via [Twitter](https://twitter.com/17cupsofcoffee), or find me lurking in the #games-and-graphics channel on the [Rust Community Discord](https://bit.ly/rust-community). #![warn(missing_docs)] pub mod audio; pub mod error; mod fs; pub mod graphics;...
Rust
0
stall_toolchain(RustToolchain::Stable), Step::run("The check", "cargo run -p ci-gen -- --check"), ], ..Default::default() } } fn job(channel: RustToolchain, os: Os, features: Features) -> Job { let mut steps = vec![]; steps.push(checkout_sources()); steps.push(rust_install_t...
Rust
0
class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: ans =[-1 , -1] low , high = 0 , len(nums) - 1 while low <= high: mid = low + (high - low) //2 if nums[mid] == target: ans[0] = mid if nums[mid] ...
Python
1
rate) FillTessellator); // A wrapper providing debug and clone implementations for the glyph cache. pub(crate) struct GlyphCacheWrapper(pub(crate) text::GlyphCache<'static>); /// The vertex and index ranges into a mesh for a particular node. #[derive(Clone, Debug)] struct Ranges { vertices: ops::Range<usize>, ...
Rust
0
_arg_expr(p); m.complete(p, CONST_ARG); } fn type_arg(p: &mut Parser) { let m = p.start(); types::type_(p); m.complete(p, TYPE_ARG); } extern crate sdl2; fn main() -> Result<(), String> { let sdl_context = sdl2::init()?; let game_controller_subsystem = sdl_context.game_controller()?; let ...
Rust
0
32::EPSILON, 6.0 * f64::EPSILON, 7.0 * f32::EPSILON, 8.0 * f64::EPSILON, 9.0 * f32::EPSILON, 10.0 * f64::EPSILON, 11.0 * f32::EPSILON, 12.0 * f64::EPSILON, ); assert_float_eq!(a, c, rmax <= eps); assert_float_eq!(c, a, rmax <= eps); let mut eps0 ...
Rust
0
; fn write_batch( &self, column: &'static str, batch: Vec<(Vec<u8>, Vec<u8>)>, ) -> Result<(), Error>; fn flush(&self) -> Result<usize, Error>; fn find( &self, column: &'static str, mode: BackendIteratorMode, limit: Option<usize>, filter: ...
Rust
0
import unittest from api import ( generate_v1_uuid, generate_v3_uuid, generate_v4_uuid, generate_v5_uuid, generate_timestamp_first_uuid, decode_uuid ) class TestUUIDandGUIDGenAPI(unittest.TestCase): def test_generate_v1_uuid(self): result = generate_v1_uuid(count=3) self.ass...
Python
1
-2.0 // 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 applicable law or agreed to in writing, software // distribut...
Rust
0
if branches.len() > 0 { self.lower_clif_branches(backend, bindex, bb, &branches, &targets)?; self.finish_ir_inst(self.srcloc(branches[0])); } } else { // If no orig block, this must be a pure edge block; // g...
Rust
0
""" Some python code for Markov Chain Monte Carlo and Gibs sampling by Bruce Walsh """ import numpy as np import numpy.linalg as npla def gaussian(x, sigma, sampled=None): """ """ if sampled is None: L = npla.cholesky(sigma) z = np.random.randn(x.shape[0], 1) return np.dot(L, z+...
Python
1
>> ip_proto_id: be_u8 >> sel_length: be_u16 >> start_port: be_u16 >> end_port: be_u16 >> start_addr: apply!(parse_ts_addr,ts_type) >> end_addr: apply!(parse_ts_addr,ts_type) >> ( TrafficSelector{ ts_type: TSType(ts_type), ip_pro...
Rust
0
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 """Tests for background models.""" import numpy as np import pytest from openmcmc.distribution.distribution import Gamma from openmcmc.distribution.location_scale import Normal from op...
Python
1
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.tools import FileSearchTool from langchain_community.tools.file_management.file_search import FileSearchInput # Create a way to dynamically look up deprecated imports. # Used to consoli...
Python
1
lterer.pid_doesnt_pass(1234); filterer.pid_doesnt_pass(3456); filterer.pid_doesnt_pass(4567); filterer.pid_doesnt_pass(34567); filterer.pid_doesnt_pass(0); } #[tokio::test] async fn pid_equals() { let f = filter("process==1234"); assert_eq!(f, filter("pid==1234")); let filterer = filt(&[f]).await; filterer.p...
Rust
0
_base_ = './mask_rcnn_r101_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=8, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), style='pytorch',...
Python
1
3]))?; for depart_time in depart_times { let weekdays = weekday_dates.to_date_restrictions(&depart_time.row_dates); let notes = AnnotationDates::map_to_date_restrictions_by_weekdays(depart_time.row_notes, &weekdays); items.push(ScheduleItem { ...
Rust
0
}) }) } } #[derive(RustcEncodable, RustcDecodable)] pub struct DeltaSetName { name: String, } impl DeltaSetName { pub fn new(name: String) -> DeltaSetName { DeltaSetName{ name: name } } } impl Delta for DeltaSetName { fn apply(&self, doc: &mut Document) { doc....
Rust
0
{}", file).to_owned(); match parse_wad(&fname, &opts) { Ok(new_wad) => match make_maps_from_wad(&fname, &new_wad, &opts) { Ok(_) => { passes += 1; }, Err(e) => { if opts.verbose { println!("make_maps_from_svg: {}", e); ...
Rust
0
x, 1), 5) ax.xaxis.labelpad = 10 ax.yaxis.labelpad = 10 ax.zaxis.labelpad = 10 ax.set_xticks(major_ticks_x) ax.set_yticks(major_ticks_y) ax.set_zticks(major_ticks_z) ax.set_xticks(minor_ticks_x, minor=True) ax.set_yticks(minor_ticks_y, minor=True) ...
Python
1
s app = QApplication(sys.argv) # Create and populate the tableWidget table_widget = QTableWidget(4, 4) table_widget.setItemDelegate(StarDelegate()) table_widget.setEditTriggers(QAbstractItemView.EditTrigger.DoubleClicked | QAbstractItemView.EditTrigger.SelectedClic...
Python
1
# flameMind 🔥, 1.0.0 license """Plotting utils.""" import contextlib import math import os from pathlib import Path import matplotlib import matplotlib.pyplot as plt import torch import numpy as np from utils.general import LOGGER, increment_path # Settings RANK = int(os.getenv("RANK", -1)) matplotlib.rc("font", **...
Python
1
"""Update platform for Sensibo integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from pysensibo.model import SensiboDevice from homeassistant.components.update import ( UpdateDeviceClass, UpdateEntity, UpdateEntityDescription, ) from...
Python
1
: For muting sounds pub struct App<'a> { players: Vec<Option<Player<'a>>>, bots: Vec<Option<Bot<'a>>>, items: Vec<Item<'a>>, cam: Cam, hub_one: PlayerHub<'a>, hub_two: PlayerHub<'a>, muted: bool, glyph: Glyphs, } impl<'a> App<'a> { /// Constructor fn new(players: Vec<Option<Play...
Rust
0
"last_name": "last_name", "email": "email", "role_id": "role", "department": "department", "auth_type": "auth_type", "status": "status", }[col] fields.append(f"{col_db...
Python
1
erion, epoch): lr = adjust_learning_rate(optimizer, epoch-1) for param_group in optimizer.param_groups: param_group["lr"] = lr print("Epoch={}, lr={}".format(epoch, optimizer.param_groups[0]["lr"])) model.train() for iteration, batch in enumerate(training_data_loader, 1): in...
Python
1
p1_turn: true, nth_roll: 0, roll_sum: 0, }; let mut database: HashMap<GameState, GameResult> = HashMap::new(); universe(base_state, &mut database); let result = database[&base_state]; println!("Part 2: {}", result.p1_wins.max(result.p2_wins)); } fn main() -> Result<(), Box<dyn ...
Rust
0
( /// Coin type: 1901 /// /// Symbol: CLC /// /// Coin: Classica [1901], Classica, "Classica", "https://github.com/classica/", CLC, , ), ( /// Coin type: 1919 /// /// Symbol: VIPS /// /// Coin: VIPSTARCOIN [1919]...
Rust
0
# https://leetcode.com/problems/merge-two-sorted-lists/ # Merge two sorted linked lists and return it as a new list. The new list should # be made by splicing together the nodes of the first two lists. # # Example: # Input: 1->2->4, 1->3->4 # Output: 1->1->2->3->4->4 # # Related Topics Linked List class ListNode: ...
Python
1
def add(a, b): return a + b\ndef subtract(a, b): return a - b
Python
1
x = int(input()) dp = [0] * (x + 1) # 연산 횟수 path = [""] * (x + 1) # 경로 path[1] = "1" for i in range(2, x + 1): dp[i] = dp[i - 1] + 1 prev = i - 1 if i % 3 == 0 and dp[i // 3] + 1 < dp[i]: dp[i] = dp[i // 3] + 1 prev = i // 3 if i % 2 == 0 and dp[i // 2] + 1 < dp[i]: dp[i] = dp[i // 2] + 1 prev = i // 2 ...
Python
1
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name="DnaPlotVisualization", author="JaspinXu", description="Introduction to Life Sciences", url="https://github.com/JaspinXu/DnaPlotVisualization", keywords="Introduction to Life Sciences", packages=...
Python
1
let result = get_message_list_by_message_id(&RB,message_id.as_str()).await.unwrap(); for r2 in result.unwrap() { vec.push(ArchiveMailListDTO::from(r2)); } } Ok(vec) } pub async fn list_archive(&self, name: String) -> Result<Vec<ArchiveMailListDTO>> { ...
Rust
0