text
string
label_name
string
labels
int64
] ## ---------------------------------------------- ## Connection Setup ## We do this here just so that we get the first timestamp of the txn ## ---------------------------------------------- if line_ctr == 0: ## Conne...
Python
1
#User function Template for python3 class Solution: #Function to count the number of possible triangles. def countTriangles(self, arr): arr.sort() n = len(arr) count = 0 # Fix the largest side of the triangle for k in range(2, n): i, j = 0, k - 1 ...
Python
1
delta to [0,1] dmin, dmax = delta_vals.min(), delta_vals.max() delta_norm = (delta_vals - dmin) / (dmax - dmin) # Compensation fraction = 1 - normalized loss comp_frac = 1 - delta_norm return comp_frac # If bpw-list is provided, compute and print compensation fractions, then exit def handle_list_mo...
Python
1
::BindTarget { buffer: Some(0), texture: None, sampler: None, mutable: false, }, ); binding_map.insert( msl::BindSource { set: 0, binding: 1 }, msl::BindTarget { buffer: Some(1), ...
Rust
0
pon error." ) operation = "verify" operation_past = "verified" operation_progressive = "Verifying" key_class = rsa.PublicKey expected_cli_args = 2 has_output = False def perform_operation( self, indata: bytes, pub_key: rsa.key.AbstractKey, cli_args: Indexable ) -> None: ...
Python
1
_stable_const_fn() { return false; } ccx.tcx.features().const_precise_live_drops } /// Look for live drops in a const context. /// /// This is separate from the rest of the const checking logic because it must run after drop /// elaboration. pub fn check_live_drops(tcx: TyCtxt<'tcx>, body: &mir::Body<...
Rust
0
""" 3 задание Ограничение времени 3 секунды Ограничение памяти 1024 МБ Вам дана последовательность A, изначально состоящая из одного элемента 0 (A=(0)) и строка S длины N, состоящая только из символов «L» и «R». Затем вы проделаете следующую операцию для 1, 2, 3: i=1,2,3,...,N: Если Si=L, то вы вставите число i слева о...
Python
1
import os.path from os2datascanner.engine2.model.core import SourceManager from os2datascanner.engine2.model.file import FilesystemSource from os2datascanner.engine2.conversions import convert from os2datascanner.engine2.conversions.types import OutputType from os2datascanner.engine2.rules.passport import PassportRule...
Python
1
ption_cs = CString::new(e.to_string()).unwrap(); unsafe { *c_err = &*tc_err }; }); } -1 } unsafe extern "C" fn error_description(c_err: *const CErr) -> *const c_char { (*c_err).description_cs.as_bytes() as *const _ as *const c_char } unsafe extern "C" fn flags(parsed_packet: *const Par...
Rust
0
pub mod block; pub mod serialization; pub mod single; use serde::Serialize; use serialization::*; pub const MANUAL_BLOCK_INITIALIZATION_RUNTIME_VERSION: u32 = 159; #[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] #[serde(rename_all = "camelCase")] pub enum CallResult { Output(#[serde(serialize_wi...
Rust
0
n_remaining -= n_copy; } if new_lines.is_empty() { new_invalid_before += n_remaining; } else { new_invalid_after += n_remaining; } old_ix += n_remaining; ...
Rust
0
entrypoint(program_id, keyed_accounts, data, tick_height) } ) ); /// Conveinence trait to covert bincode errors to instruction errors. pub trait State<T> { fn state(&self) -> Result<T, InstructionError>; fn set_state(&mut self, state: &T) -> Result<(), InstructionError>; } impl<T> State<T> for Acc...
Rust
0
ection(wd) def tearDown(self): os.system('ip link set "' + self.bss_hostapd[0].ifname + '" down') os.system('ip link set "' + self.bss_hostapd[1].ifname + '" down') os.system('ip link set "' + self.bss_hostapd[0].ifname + '" up') os.system('ip link set "' + self.bss_hostapd[1].ifnam...
Python
1
)( atom_xchg(&tmp[bucket][8 - counterLocal], (u64)0), atom_xchg(&tmp[bucket][9 - counterLocal], (u64)0), atom_xchg(&tmp[bucket][10 - counterLocal], (u64)0), atom_xchg(&tmp[bucket][11 - counterLocal], (u64)0) ); buffer[idx + 1] = (ulong4)( atom_xchg(&tmp[bucket][12 - counterLocal], (u64)...
Rust
0
o.lock().unwrap().stdout.take() } /// Retrieve the stderr stream from the child if one exist. Will only return something on the /// first call. pub fn stderr(&mut self) -> Option<ChildStderr> { self.io.lock().unwrap().stderr.take() } } <reponame>SmiteWindows/leetcode // https://leetcode-cn....
Rust
0
itudes M<sub>l</sub>, 1 ≤ l ≤ L, measure the spectral envelope of the /// voiced/unvoiced signal spectrum. #[derive(Clone)] pub struct Spectrals(ArrayVec<[f32; MAX_HARMONICS]>); impl Spectrals { /// Create a new `Spectrals` from the given DCT coefficients vector T<sub>l</sub> and /// current/previous frame par...
Rust
0
put; } not_eof = input.next().is_some(); } input } fn many_matches1<'a, F, R>(input: ParseInput<'a>, mut func: F) -> ParseResult<'a, Vec<R>> where F: FnMut(ParseInput<'a>) -> ParseResult<'a, R>, { let (mut input, first) = func(input)?; let mut result = vec![first]; while let O...
Rust
0
essage)s", level=logging.INFO ) # Set higher logging level for httpx to avoid all GET and POST requests being logged logging.getLogger("httpx").setLevel(logging.WARNING) logger = logging.getLogger(__name__) # Define the simulate_echo function, which will be triggered on 'publish_received' def ...
Python
1
""" Copyright (C) 2025 Литовченко Виктор Иванович (filthps) Класс-адаптер нужен в качестве параметра serde для инициализации класса Client pymemcache. Добавление поддержки модуля dill в качестве сериализатора для pymemcache. """ from dill import dumps, loads class DillSerde: @staticmethod def serialize(key, d...
Python
1
for column in columns_lineage[parent_model]: for parent in columns_lineage[parent_model][column]: if parent["dbt_node"] == model: is_root = False break if not is_root: break if not is_ro...
Python
1
# -*- coding: utf-8 -*- """ authlib.oauth2.rfc7636 ~~~~~~~~~~~~~~~~~~~~~~ This module represents a direct implementation of Proof Key for Code Exchange by OAuth Public Clients. https://tools.ietf.org/html/rfc7636 """ from .challenge import CodeChallenge, create_s256_code_challenge __all__ = ['Co...
Python
1
signer of the transaction pub fn assert_gpl_token_mint_authority_is_signer( mint_info: &AccountInfo, mint_authority_info: &AccountInfo, ) -> Result<(), ProgramError> { let mint_authority = get_gpl_token_mint_authority(mint_info)?; if mint_authority.is_none() { return Err(GovernanceError::MintH...
Rust
0
odel_name f["slide_sizes"] = slide_sizes f["donwscaling_factor"] = downscaling_factors if len(np.unique(coords.scn)) != len(slide_sizes): print( "SEMIWARNING, at least for one scene of ", slide_name, ...
Python
1
m Command { COM_SLEEP = 0, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_DEPRECATED_1, COM_STATISTICS, COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, COM_TIME, COM_DELAYED_INSERT, ...
Rust
0
let _ = n.fetch_add(1, Ordering::Relaxed); let mut tick = tick.clone(); async move { tick.send(()).await.expect("Test helper channel works. qed"); } }).fuse() }; let f2 = async move { block.next().await; assert_eq!(n.load(Ordering::Relaxed), 1_usize); block.next().await; assert...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved # ############################################################################ """ Specify the cal_nixu_from_pre.py Author: map(ma...
Python
1
story.deleted): return True else: return False def _raise_col_to_prop(isdest, source_mapper, source_column, dest_mapper, dest_column): if isdest: raise exc.UnmappedColumnError( "Can't execute sync rule for " "destination column '%s'; m...
Python
1
""" This file defines variables for the modelled legislation. A variable is a property of an Entity such as a Person, a Household… See https://openfisca.org/doc/key-concepts/variables.html """ # Import from openfisca-core the Python objects used to code the legislation in OpenFisca from openfisca_core.indexed_enums ...
Python
1
"""This module sets up the paths for the Flask web application.""" import os import utils from flask import Flask, render_template, request, redirect, url_for from note import Note DNOTE = Flask(__name__) HERE = DNOTE.root_path @DNOTE.route('/', methods=['GET']) def index(): """Return the index.html for the main ...
Python
1
rleaved_error_already_set(): with pytest.raises(RuntimeError) as excinfo: m.test_cross_module_interleaved_error_already_set() assert str(excinfo.value) in ( "2nd error.", # Almost all platforms. "RuntimeError: 2nd error.", # Some PyPy builds (seen under macOS). ) def test_error_a...
Python
1
) -> bytes return self.extended2str(x) def m2i(self, pkt, x): # type: (Optional[Any], bytes) -> Optional[int] return self.str2extended(x)[1] def addfield(self, pkt, s, val): # type: (Optional[Packet], bytes, Optional[int]) -> bytes return s + self.i2m(pkt, val) def...
Python
1
r: futures = [] for keyword in image_keywords: futures.append(executor.submit(self.unsplash_client.search_photos, keyword)) for future in as_completed(futures): photos = future.result() if photos...
Python
1
import numpy as np import pandas as pd data = pd.read_csv('enjoysport.csv') concepts = data.iloc[:, :-1].values target = data.iloc[:, -1].values def learn(concepts, target): specific_h = concepts[0].copy() general_h = [['?' for _ in range(len(specific_h))] for _ in range(len(specific_h))] for i, h in enu...
Python
1
stack = [] def push(): element = int(input("Enter the element to push: ")) stack.append(element) def pop(): if not is_empty(): print("Popped element:", stack.pop()) else: print("Stack is empty") def peek(): if not is_empty(): print("Top element:", stack[-1]) else: ...
Python
1
self) -> bool { **self == FIRCDIV2_A::FIRCDIV2_4 } #[doc = "Checks if the value of the field is `FIRCDIV2_5`"] #[inline(always)] pub fn is_fircdiv2_5(&self) -> bool { **self == FIRCDIV2_A::FIRCDIV2_5 } #[doc = "Checks if the value of the field is `FIRCDIV2_6`"] #[inline(alway...
Rust
0
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE from __future__ import annotations import numpy as np import pytest import awkward as ak import awkward._connect.cling import awkward._lookup ROOT = pytest.importorskip("ROOT") ROOT.ROOT.EnableImplicitMT(1) compiler = ROOT.gInterp...
Python
1
"m", # Ḿ -> m "\u1e3f": "m", # ḿ -> m "\u1e40": "m", # Ṁ -> m "\u1e41": "m", # ṁ -> m "\u1e42": "m", # Ṃ -> m "\u1e43": "m", # ṃ -> m "\u1e44": "n", # Ṅ -> n "\u1e45": "n", # ṅ -> n "\u1e46": "n", # Ṇ -> n "\u1e47": "n", # ṇ -> n "\u1e48": "n", # Ṉ -> n "\u1e49": "...
Python
1
import numpy as np from opytimizer.optimizers.social import mvpa from opytimizer.spaces import search from opytimizer.utils import constant def test_mvpa_params(): params = {"n_teams": 4} new_mvpa = mvpa.MVPA(params=params) assert new_mvpa.n_teams == 4 def test_mvpa_params_setter(): new_mvpa = mv...
Python
1
# # Copyright 2014 Quantopian, Inc. # # 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 writin...
Python
1
'''Faça um programa que receba o peso de uma pessoa em quilos, calcule e mostre esse peso em gramas.''' peso_quilo = float(input("Digite o peso em KG:")) peso_gramas = peso_quilo * 1000 print(f"{peso_quilo} em gramas é {peso_gramas}")
Python
1
"""Коды состояния HTTP представляют собой трехзначные целые числа и используются для указания успешности конкретного HTTP запроса. Выделяют пять групп кодов состояния: информация (100-199) успех (200-299) перенаправление (300-399) ошибка клиента (400-499) ошибка сервера (500-599) Реализуйте класс HTTPStatusCodes, опис...
Python
1
d_element_by_name('whiteboard').send_keys(unicode(self.distro_tree)) b.find_element_by_xpath('//button[text()="Submit job"]').click() # we should end up on the job page b.find_element_by_xpath('//h1[contains(string(.), "J:")]') # https://bugzilla.redhat.com/show_bug.cgi?id=722321 def te...
Python
1
0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x30,// vprefetch0 0x0A, 0x76, 0x70, 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x31,// vprefetch1 0x0A, 0x76, 0x70, 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x32,// vprefetch2 0x0D, 0x76, 0x70, 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x6E, 0x74, 0x61,// vprefetchent...
Rust
0
.push(s_laser); vec.push(s_enemy1); vec.push(s_enemy2); vec.push(s_enemy3); vec.push(s_exp0); vec.push(s_exp1); vec.push(s_exp2); vec.push(s_exp3); vec.push(s_exp4); vec.push(s_exp5); vec.push(s_exp6); vec.push(s_exp7); vec.push(s_exp8); vec.push(s_bomb); mq::info...
Rust
0
_feature_detected!("avx2") { impl_avx2($($arg),*) } else if $crate::is_x86_feature_detected!("avx") { impl_avx($($arg),*) } else if $crate::is_x86_feature_detected!("sse4.1") { impl_sse41($($arg),*) } else if $cr...
Rust
0
es = 5 nodes = docstore.get_random_nodes(k=num_nodes) while len(testset['question']) < config.question_generator.test_size: context = '\n'.join(map(lambda x: x.page_content, nodes)) question = llm.invoke(RULE_QUESTION_TMPL.format(data=context, rules=rules), max_tokens=MAX_TOKENS)...
Python
1
#!/usr/bin/python3 import textwrap import pytest STAGE_NAME = "org.osbuild.coreos.platform" def make_fake_platforms_json(json_file_path): json_file_path.write_text(textwrap.dedent("""\ { "only-grub": { "grub_commands": [ "serial --speed=115200" ] }, "azure": { ...
Python
1
.map(|matching_id| insert_type(TypeInfo::Array(matching_id, *count))), TypeInfo::Tuple(fields) => { let mut new_fields = Vec::new(); let mut index = 0; while index < fields.len() { let new_field_id_opt = ...
Rust
0
.], &[ // Mgmt header 0b11000000, 0, // Frame Control 0, 0, // Duration 1, 1, 1, 1, 1, 1, // addr1 2, 2, 2, 2, 2, 2, // addr2 2, 2, 2, 2, 2, 2, // addr3 0x10, 0, // Sequence Control ...
Rust
0
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025) # # 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...
Python
1
"The individual is becoming a distinct personality", "Possession of physical body and questioning mind", "Seeks to understand through rational thinking" ], SELF_EXPRESSION: [ "Emerging identity seeks to express itself", "Will work to discover personal tal...
Python
1
5 0.09090909361839294 # ozonolysis 4 iterations r = MolFromSmiles("[H][C]([H])=[C]([H])[H].[O]=[O][OH]", sanitize = False) i1 = MolFromSmiles("[H][CH]([H])[C]([H])([H])[OH].[O]#[O]", sanitize = False) i2 = MolFromSmiles("[H][C]([H])=[O].[H][C]([H])=[O][OH]", sanitize = False) r = MolFromSmiles("[C](=[C]...
Python
1
# SPDX-License-Identifier: Apache-2.0 # (C) Copyright IBM Corp. 2024. # 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 applicab...
Python
1
import numpy as np import tensorflow as tf import tensorflow.keras.layers as kl import tensorflow_probability as tfp class GaussianPolicy(tf.keras.Model): def __init__(self, action_space, action_bound, lr=3e-4): super(GaussianPolicy, self).__init__() self.action_space = action_space s...
Python
1
fn main() { // l1("data/level1-0.in"); // output: Star1 100 4 90 5 100 1 Star2 100 3 80 1 100 2 // l1("data/level1-1.in"); // l1("data/level1-2.in"); // l1("data/level1-3.in"); // l1("data/level1-4.in"); // l1("data/level1-5.in"); // l2("data/level2-0.in"); // output: Star1 1 1 // l2("data/level1-1.in"...
Rust
0
islandExtent = [startExtent, startExtent+size-1, 0, 0, 0, 0] self.setupIslandLabelmap(islandLabelmap, islandExtent) self.paintEffect.modifySelectedSegmentByLabelmap(islandLabelmap, self.paintEffect.ModificationModeAdd) startExtent += size + 1 self.checkSegmentVoxelCount(0, voxelSizeSum) lay...
Python
1
mut memlayout[8..40]; key_slice.copy_from_slice(key); return Ok(std::mem::transmute_copy(&memlayout)); }; } pub fn dump_key(key: &EphemeralPrivateKey) -> [u8; 32] { let memlayout: [u8; 64] = unsafe { std::mem::transmute_copy(key) }; memlayout[8..40] .try_into() .expect("slic...
Rust
0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from paleo.profilers.base import TimeMeasure class TimeMeasureTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_add(self): ...
Python
1
amount: None, to_account: Some( AccountIdentifier::new(*TEST_NEURON_1_OWNER_PRINCIPAL, None).into(), ), })), }, &Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR), ...
Rust
0
let engine = TestEngineBuilder::new().build().unwrap(); let ctx = Context::default(); let cm = ConcurrencyManager::new(42.into()); // Simulate that min_commit_ts is pushed forward larger than latest_ts must_acquire_pessimistic_lock_impl(&engine, b"key", b"key", 2, 20000, 2, false, 100);...
Rust
0
root_child0.set_min_height(StyleUnit::Auto); root_child0.set_max_height(StyleUnit::Point((200 as f32).into())); root.insert_child(&mut root_child0, 0); let mut root_child1 = Node::new_with_config(&mut config); root_child1.set_margin(Edge::Left, StyleUnit::Point((20 as f32).into())); root_child1.set_margin(Edge::T...
Rust
0
# -*- coding: utf-8 -*- # @Time : 20-6-3 下午5:14 # @Author : zhuying # @Company : Minivision # @File : MultiFTNet.py # @Software : PyCharm from torch import nn import torch.nn.functional as F from src.model_lib.MiniFASNet import MiniFASNetV1,MiniFASNetV2,MiniFASNetV1SE,MiniFASNetV2SE class FTGenerator(nn.Module): ...
Python
1
bootloaders and kernels for //! architectures that support ACPI. The crate is far from feature-complete, but can still be used //! for finding and parsing the static tables, which is enough to set up hardware such as the APIC //! and HPET on x86_64. //! //! The crate is designed for use in conjunction with the `aml` c...
Rust
0
abel.setStyleSheet(f""" QLabel {{ background-color: {color}; color: #000000; /* 设置消息文字为黑色 */ border: 1px solid #ccc; border-radius: 15px; padding: 10px; max-width: 300px; }} """) mes...
Python
1
used to help the AndGroup decide if it needs to look ahead return self.group.contains_any(); } fn name(&self) -> String { return "NotGroup".to_string(); } fn min_matches(&self) -> usize { // this is used to determine how many characters this will take up if it matches ...
Rust
0
y as are_you_okay2; type AreYouOkay1 = iso3::any::Any; type AreYouOkay2 = ::iso4::any::Any; use core::any as are_you_okay3; use ::core::any as are_you_okay4; type AreYouOkay3 = core::any::Any; type AreYouOkay4 = ::core::any::Any; } fn main() {} extern crate gfx_backend_metal as back; extern cr...
Rust
0
import numpy as np import math import cv2 def histogram_rgbLower(RGB_array,height, width): RGB_min = np.min(RGB_array) RGB_max = np.max(RGB_array) # print('RGB_min',RGB_min) # print('RGB_max',RGB_max) RGB__middle = (RGB_max + RGB_min) / 2 # print('RGB__middle', RGB__middle) array_upper_his...
Python
1
], &[&"bytes", &str::from_utf8(bytes).unwrap()]); for byte in bytes { store.insert_with_values(Some(&iter_bytes), None, &[0, 1], &[&format!("{}", byte), &""]); } } CPInfo::MethodHandle { reference_kind, reference_index } => { le...
Rust
0
DFU suffix is shorter than allowed: expected at least {minimum} bytes, got {actual}")] SuffixTooShort { minimum: u8, actual: u8 }, #[error("DFU suffix is longer than file: suffix is {suffix_len} bytes, file is {file_len}")] SuffixTooLong { suffix_len: u8, file_len: u64 }, #[error("bad CRC32 checksum: ...
Rust
0
# coding=utf-8 # Copyright 2025 The Google Research Authors. # # 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 applicab...
Python
1
_small_plot domain = build_pretzel() x,y = domain.coordinates omega = 1.5 alpha = -omega**2 Eex = Tuple(sin(pi*y), sin(pi*x)*cos(pi*y)) f = Tuple(alpha*sin(pi*y) - pi**2*sin(pi*y)*cos(pi*x) + pi**2*sin(pi*y), alpha*sin(pi*x)*cos(pi*y) + pi**2*sin(pi*x)*cos(pi*y...
Python
1
class Hash(): def __init__(self,tamanio): self.tamanio_max = tamanio self.datos = [] for _ in range(tamanio): self.datos.append("*") def insertar(self,clave): if self.datos.count("*") == 0: self.__nuevotamanio() indi = clave % self.tamanio_max ...
Python
1
.create(); let res = surf::post(mockito::server_url()).body_json(&cat)?.await?; m.assert(); assert_eq!(res.status(), 200); Ok(()) } #[async_std::test] async fn get_json() -> Result<(), surf::Exception> { #[derive(serde::Deserialize)] struct Message { message: String, } let m...
Rust
0
=\x222020-03-03T\ 09:50:41-03:00\x22 \ stEvt:softwareAg\ ent=\x22Adobe Photo\ shop 21.0 (Windo\ ws)\x22/> <rdf:li s\ tEvt:action=\x22sav\ ed\x22 stEvt:instan\ ceID=\x22xmp.iid:91\ 245354-5fd1-1846\ -968e-51ad0680fe\ ac\x22 stEvt:when=\x22\ 2020-05-02T17:59\ :26-03:00\x22 stEvt\ :softwareAgent=\x22\ Adobe Photoshop \ 21...
Python
1
()); assert!(file.is_file()); let repo = git2::Repository::open(&dir).unwrap(); // HEAD is 2 commits head of origin/master assert_eq!( repo.revparse_commit("HEAD~2").unwrap().id(), repo.revparse_commit("origin/master").unwrap().id() ); // working tree clean assert!(repo.statu...
Rust
0
mageMSEfromScratch/", "./CTCfromScratch/", "./authorPlusHtrBestCTCMseFromScratch/", "./authorPlusHtrBestFineTuneOnlyCTCnoMSE/", "./authorPlusHtrBestFineTune/", "./htrPreprocessAgain/"][0] htrBaseDir = "/home/aniketag/Documents/phd/TensorFlow-2.x-YOLOv3_sim...
Python
1
(rest, terminator) = take(1usize)(rest)?; let value = parse_var_uint(sequence, terminator[0]); match value.to_usize() { Some(value) => Ok((rest, value)), None => Err(Err::Failure(IonError::from_error_kind( rest, ErrorKind::TooLarge, ))), } } pub(crate) fn pa...
Rust
0
from django.apps import AppConfig class MessageboardConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'messageboard'
Python
1
"; /// /// Cache object for rev reg cache /// #[derive(Serialize, Deserialize, Debug, Default, PartialEq)] pub struct RevRegCache { pub rev_state: Option<RevState>, } /// /// Rev reg delta object. /// #[derive(Serialize, Deserialize, Debug, PartialEq)] pub struct RevState { pub timestamp: u64, pub value: ...
Rust
0
pair, exchange_rate) => EXCHANGE_RATE .get_metric_with_label_values(&[source.as_str(), trading_pair.as_str()]) .map(|m| m.set(exchange_rate.to_num())) .map_err(|e| Error::Custom(e.into()))?, ExchangeRateOracleMetric::ResponseTime(source, t) => RESPONSE_TIME .get_metric_with_label_values(&[source.as...
Rust
0
rm(cfg=CFG, train=True)) dl = DataLoader(ds, batch_size=3, shuffle=False, pin_memory=True, drop_last=True, num_workers=1) data, targets = next(iter(dl)) # print('Data') # for k, v in data.items(): # print(k, v.shape) assert data['series_ids'].shape == torch.Size([3, 5, 3]) assert ...
Python
1
} else { ans2 += 1; } } } } println!("{}\n{}", ans1, ans2); } <filename>lib/runtime-core/src/macros.rs<gh_stars>0 macro_rules! debug { ($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:...
Rust
0
Gb.Devices_by_devicename.get(devicename) if Device: fname_devicename = Device.fname_devicename elif devicename in Gb.inactive_fname_by_devicename: fname_devicename = f"{Gb.inactive_fname_by_devicename[devicename]} (INACTIVE)" else: fna...
Python
1
first_run = run.get('stats', {}).get('rebootCount', 0) == 0 @crawler.router.default_handler async def default_handler(context: BasicCrawlingContext) -> None: context.log.info(f'Processing {context.request.url} ...') # Simulate migration through reboot ...
Python
1
cycle. use core::marker::PhantomData; use core::mem; use crate::stm32::{DBG, TIM1, TIM2, TIM3, TIM4}; use crate::afio::MAPR; use crate::gpio::gpioa::{PA0, PA1, PA15, PA6, PA7, PA8, PA9}; use crate::gpio::gpiob::{PB3, PB4, PB5, PB6, PB7}; use crate::gpio::{Alternate, OpenDrain}; use crate::rcc::{Clocks, APB1}; use c...
Rust
0
t_word_cnt as usize, 0usize); while r_idx < r_stop && rhs.word_buf[r_idx] == 0 { r_idx += 1; } let r_start = r_idx; let r_int_word_cnt = r_stop - r_idx; let carry = match r_int_word_cnt.cmp(&l_int_word_cnt) { Ordering::Greater => Some(1), Ordering::Equal => { let...
Rust
0
ch &mut out { Ok(f) => { let mut wtr = lz4_flex::frame::FrameEncoder::new(f); io::copy(&mut stdin, &mut wtr)?; } Err(stdout) => { let mut wtr = lz4_flex::frame::FrameEncoder::new(stdout); io::...
Rust
0
{ todo!() } // dynamic_programming #[test] #[ignore] fn test1_943() { use leetcode_prelude::vec_string; assert_eq!( shortest_superstring(vec_string!["alex", "loves", "leetcode"]), "alexlovesleetcode".to_string() ); assert_eq!( shortest_superstring(vec_string!["catg", "ctaagt...
Rust
0
0, 0), "000000"); compare!(rgb(1, 2, 3), "010203"); compare!(rgb(255, 255, 255), "FFFFFF"); compare!(rgb(254, 253, 252), "FEFDFC"); compare!(rgb(-20, 275, 125), "00FF7D"); } }mod database; mod internal; mod row; mod server; mod state; use self::internal::InternalState; ...
Rust
0
''' ### CONCATENACIÓN DE LISTAS ### Escribe una función concatListas (L1, L2, L3) que tome tres listas L1, L2 y L3 como parámetros y devuelva la concatenación de las tres listas. Pruebas de verificación: concatListas ([0, 9, 8], [2, 6, 9], [True, False, "abc"]) => [0, 9, 8, 2, 6, 9, True, False, "abc"] concatListas ([...
Python
1
ch_size (int, optional): Number of samples per batch. Defaults to 16. shuffle_train (bool, optional): Whether to shuffle the training data. Defaults to True. Returns: tuple: A tuple containing the training DataLoader and the test DataLoader. """ # Create TensorDatasets f...
Python
1
> { println!("Employee \"{}\" works in the following departments:", employee); for department in search_result_list.iter() { println!("{}", department); } } } } fn add_employee_to_department(directory: &mut HashMap<String, Vec<String>>, department: &String, employee: &String) { let em...
Rust
0
ermissions.IsAuthenticated', ], } SPECTACULAR_SETTINGS = { 'TITLE': 'django_firebase_mcp API', 'DESCRIPTION': 'API documentation for the django_firebase_mcp project.', 'VERSION': '1.0.0', 'COMPONENT_SPLIT_REQUEST': True, 'SCHEMA_PATH_PREFIX': '/api/', } # Django Sites Framework SITE_ID = 1 #...
Python
1
xpected = DataFrame({"A": [1.0], "B": ["a"], "C": [4.0]}) result = df.dropna(subset=np.array(["A", "C"])) tm.assert_frame_equal(result, expected) def test_no_nans_in_frame(self, axis): # GH#41965 df = DataFrame([[1, 2], [3, 4]], columns=pd.RangeIndex(0, 2)) expected = df.cop...
Python
1
"); //! pass.team_identifier("ASDF1234ASDF"); //! //! // Set user specific attributes //! pass.serial_number("1234567890"); //! pass.authentication_token("<PASSWORD>"); //! //! pass.barcode(Barcode::new(BarcodeFormat::PkBarcodeFormatQr, "QR Code", "iso-8859-1")); //! //! let mut store_card = Details::new(); //! //! let...
Rust
0
_dep~exact", ) # Test prefix-based lookups self.assertEqual( repo_mapping.lookup("deps+some_repo", "external_dep"), "external_dep~prefix" ) self.assertEqual( repo_mapping.lookup("test_deps+another_repo", "test_lib"), "test_lib~2.1.0" ) # ...
Python
1
""" Copyright 2019-2025, Johannes Hinrichs This file is part of OptiCore. OptiCore 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. OptiCor...
Python
1
# import smbus2 import time ## Default Bus from i2c_bus import bus ## Registerss LIS3DH_ADDRESS = 0x18 ## Control Registers LIS3DH_REG_CTRL_REG1 = 0x20 LIS3DH_REG_CTRL_REG2 = 0x21 LIS3DH_REG_CTRL_REG3 = 0x22 LIS3DH_REG_CTRL_REG4 = 0x23 #Set scale with this (page 37 of MEMS data sheet) default is +/- 2g LIS3DH_REG_CT...
Python
1
. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option<String>, /// The ISO timestamp when the source first reported the asset. #[serde(rename = "first_seen", skip_serializing_if = "Option::is_none")] pub first_seen: Option<String>, /// The ISO timestamp when the s...
Rust
0
2 = a1.lower_triangle(); let x = DVector::new_random(n); let y = DVector::new_random(n); a1.ger(alpha, &x, &y, beta); a2.syger(alpha, &x, &y, beta); if !relative_eq!(a1.lower_triangle(), a2) { return false; } a1.ger(...
Rust
0