text
string
label_name
string
labels
int64
g().for_each(|(sock, addr)| { let s = MainService::new(&handle); http.bind_connection(&handle, sock, addr, s); Ok(()) }); println!("Doc server running on http://localhost:3000/"); core.run(server).unwrap(); } <reponame>DevinR528/co_queue<filename>src/waker.rs use std::{ ptr, ...
Rust
0
const SCREEN_HEIGHT: i32 = 256; pub const COLORS: [Color; 10] = [ Color { r: 0.156, g: 0.172, b: 0.235, a: 1.0, }, Color { r: 0.450, g: 0.937, b: 0.909, a: 1.0, }, Color { r: 0.258, g: 0.749, b: 0.909, a...
Rust
0
last_access, url_path}; use crate::schema::urls::dsl::urls; use ipnetwork::IpNetwork; #[derive(Message)] #[rtype(result = "QueryResult<Ip>")] pub struct CreateIp { pub ip: IpNetwork, pub access: chrono::NaiveDateTime, pub url_path: String, } #[derive(Message)] #[rtype(result = "QueryResult<Ip>")] pub str...
Rust
0
from pydantic import BaseModel from typing import Optional class LabEquipmentBase(BaseModel): name: str description: Optional[str] = None quantity: int class LabEquipmentCreate(LabEquipmentBase): pass class LabEquipmentUpdate(BaseModel): name: Optional[str] = None description: Optional[str] =...
Python
1
from encryption import keyGeneration print(keyGeneration("Secure99190213u91"))
Python
1
import functools import itertools import operator from pathlib import Path from typing import Final DAY: Final[int] = 7 YEAR: Final[int] = 2024 def main(): solution1, unsuccesful = part1(True) print(f"solution for part1: {solution1}") # aocd.submit(solution1, part="a", day=DAY, year=YEAR) solution2...
Python
1
import factory from factories.partial_orders import PartialOrderFactory from models import ( DetailedOrder, DetailedOrderDelivery, DetailedOrderHistoryItem, DetailedOrderPayment, ) __all__ = ( 'DetailedOrderFactory', 'DetailedOrderDeliveryFactory', 'DetailedOrderPaymentFactory', 'Detai...
Python
1
to_iter(self) -> Self::IntoIter { self.data.into_iter() } } impl PagedReturn<Database> { pub(crate) async fn try_from(response: Response) -> RPResult<Self> { let (_status_code, _headers, pinned_stream) = response.deconstruct(); let body = collect_pinned_stream(pinned_stream).await?; ...
Rust
0
import cv2 import numpy as np import tensorflow as tf import pickle from tensorflow.keras.models import load_model class AutoBill: def __init__(self, model_path): with open(model_path, 'rb') as f: self.model = pickle.load(f) self.cart = [] self.total_price = 0 def detect_...
Python
1
with open('levenshtein.txt') as fin: a = next(fin).strip() b = next(fin).strip() c1, c2, c3 = (int(next(fin)) for _ in range(3)) n = len(a) m = len(b) mat = [[0 for _ in range(m)] for _ in range(n)] preds = [[(0, 0) for _ in range(m)] for _ in range(n)] for j in range(m): mat[0][j] = j * c1 for i in...
Python
1
# Copyright 2023 The Alpaca 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 applicable law or agreed to in writi...
Python
1
f32, f32, f32, f32, f32, f32, ), 8, sys::ImGuiDataType_Float } imgui_drag_scalar! { (f64, f64, f64, f64, f64, f64, f64, f64, ), 8, sys::ImGuiDataType_Double } imgui_drag_scalar! { (u32, u32, u32, u32, u32, u32, u32, u32, ), 8, sys::ImGuiDataType_U32 } imgui_drag_scalar! { (i32, i32, i32, i32, i32, i32, i32, i32, ), 8,...
Rust
0
#!/usr/bin/env python3 # pylint: disable=C0301,C0116,C0103,R0903 """ This script was created by Coopydood as part of the ultimate-macOS-KVM project. https://github.com/user/Coopydood https://github.com/Coopydood/ultimate-macOS-KVM Signature: 4CD28348A3DD016F """ # COOPYDOOD INTERNAL TERMINAL UI BLUEPRINT import ...
Python
1
# SPDX-License-Identifier: GPL-2.0+ # Guillaume Valadon <gvaladon@quarkslab.com> import ctypes import os import os.path import sys # Identify the library path dirname = os.path.dirname(__file__) UTILS_LIB_PATH = None for root, dirs, files in os.walk(dirname): for file in files: if file.startswith("utils_l...
Python
1
re probably running during Py_Initialize() and stdlib modules // may not be in-memory, we need to register and configure additional importers // here, before continuing with Py_Initialize(), otherwise we may not find // the standard library! if state.register_filesystem_importer { // This is wh...
Rust
0
about 500ms to search and then go // back and measure something that should, in theory, take about half that time. let mut n = 100; let mut loops = 0; const TARGET_TIME: Duration = Duration::from_millis(500); let time = loop { let skip_list = SkipListLayer::new(n as ...
Rust
0
ivity_type.name}") print(f"- Happiness Gain: {care_activity.happiness_gain}") print(f"- Stat Gains: {care_activity.stat_gains}") # Get the pet's updated state pet = lodge.get_pet(contract.pet_id) if pet: ...
Python
1
labels) => { if let Some(node_index) = context.node_index { let mut rel = Relationship::new(); rel.set_labels(labels.clone()); rel.set_status(Status::Match); let pattern = context.patterns.last_mut().ok_or(GremlinStateError:...
Rust
0
wire_type, is, &mut self.thumbnail_path)?; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } ::std::result::Result::Ok(()) } // Compute sizes of n...
Rust
0
IncludeZeroFeetAndSuppressZeroInches = 2, IncludeZeroInchesAndSuppressZeroFeet = 3, } } <gh_stars>1-10 use std::ops::Deref; use geometry::ray; use geometry::Interaction; use math::{float::Float, prob::Prob}; use radiometry::color::Color; use rand::Rng; use crate::bsdf::BSDF; use light::{DeltaLight, DiffuseAre...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import random def _noise(img): ''' noise the black area, but a little slower ''' tnx, tny = img.shape for x in range(tnx): for y in range(tny): if img[x, y] == 0: img[x,y] = random.randint(0, 255) return img def _siftM...
Python
1
nerGetChairResponseChair] @router.get( "/chairs", status_code=HTTPStatus.OK, response_model_exclude_none=True, ) def owner_get_chairs( owner: Annotated[Owner, Depends(owner_auth_middleware)], ) -> OwnerGetChairResponse: with engine.begin() as conn: rows = conn.execute( text( ...
Python
1
ePrOverTime_profile.GetXaxis().SetTimeFormat(tdFormat) avgTimePrOverTime_profile.GetYaxis().SetTitle("hours") c.cd() avgTimePrOverTime_profile.Draw("HIST TEXT0") export_images(name="avgTimePrOverTime"+str(i), canvas=c) cAvgTimePrOverTime_hs.Add(avgTimePrOverTime_profile) # cAvgTimePrOverTime.cd...
Python
1
from typing import Optional import numpy as np from marqo.core.inference.api.inference import ModelAuth from marqo.inference.native_inference.embedding_models.abstract_embedding_model import AbstractEmbeddingModel from marqo.inference.native_inference.embedding_models.abstract_preprocessor import AbstractPreprocessor...
Python
1
import numpy as np import mlx.core as mx from ..inference_engine import InferenceEngine from .sharded_model import StatefulShardedModel from .sharded_utils import load_shard from ..shard import Shard from typing import Optional class MLXDynamicShardInferenceEngine(InferenceEngine): def __init__(self): self...
Python
1
types/'): logger.debug(f"Excluding TypeScript types package: {name}") return False # Check for common dev package patterns - but be more specific with @babel dev_patterns = ['webpack-', 'babel-', 'eslint-', '@webpack/'] # Removed @babel/ - too broad if any(patte...
Python
1
) } else { let (token, name) = stream.expect_identifier(); if let Some(args) = call_args(stream, ctx) { // 関数呼び出し if args.len() > 6 { error_tok!(token, "引数が6つを超える関数呼び出しはサポートしていません"); } Node::new(token, NodeKind::Call(name, args)) ...
Rust
0
NAME_REF@15..21 IDENT@15..21 "number" R_PAREN@21..22 ")" WHITESPACE@22..23 " " BLOCK_EXPR@23..66 L_CURLY@23..24 "{" WHITESPACE@24..32 "\n " LET_STMT@32..42 LET_KW@32..35 "let" WHITESPACE@35..36 " " BIN...
Rust
0
ph.displacements = np.reshape(displacements, (2, -1, 3)) energies, forces, _ = evalulate_pypolymlp(polymlp, ph.supercells_with_displacements) ph.supercell_energies = energies ph.forces = forces ph.produce_force_constants(fc_calculator="symfc") # ph.auto_band_structure(write_yaml=True, filename="ba...
Python
1
Chain_SetSourceSize_Decode: DXGI_Message_Id = 235i32; #[doc = "*Required features: 'Win32_Graphics_Dxgi'*"] pub const DXGI_MSG_IDXGISwapChain_SetSourceSize_WidthHeight: DXGI_Message_Id = 236i32; #[doc = "*Required features: 'Win32_Graphics_Dxgi'*"] pub const DXGI_MSG_IDXGISwapChain_GetSourceSize_NullPointers: DXGI_Mess...
Rust
0
ace name for live sniffing") p.add_argument("--filter", dest="bpf", help="BPF filter e.g. 'tcp or udp'", default=None) p.add_argument("--count", type=int, default=0, help="Packet count for sniff (0 = infinite)") p.add_argument("--no_extractor", action="store_true", help="Skip importing feature_extractor for...
Python
1
flag=1 c=chr(ord(c)+32) for i in all: if c in i: return i # -------------------------------------------------- #################################################### #### # ENCRYPT Fun() #### #################################################### def encrypt(s...
Python
1
::walk_materialize(&mut builder, cx, node), None => { cx.parse_sess().span_diagnostic.span_err(DUMMY_SP, "root node `mcu::clock` must be present"); } } Some(builder) } fn walk_mutate(builder: &mut Builder, cx: &mut ExtCtxt, node: &Rc<node::Node>) { let maybe_mut = node....
Rust
0
""" Copyright [2025] [Rosalind Franklin Institute] 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 la...
Python
1
self.0 + other.0); } } impl Add for i54 { type Output = Self; fn add(self, other: Self) -> Self { Self(self.0 + other.0) } } #[cfg(feature = "rusqlite")] impl rusqlite::types::FromSql for i54 { fn column_result(value: rusqlite::types::ValueRef<'_>) -> rusqlite::types::FromSqlResult<Self> ...
Rust
0
ields: &HashSet<Field>) -> DataSetNode { let (border_color, background_color) = if self.origin == server_name { ("#006633".to_string(), "#009900".to_string()) } else { ("#990000".to_string(), "#ff6600".to_string()) }; DataSetNode { id: self.event_id.c...
Rust
0
byte missing decode_utf8_to_utf8(b"a\xC3Z", "a\u{FFFD}Z"); decode_utf8_to_utf8(b"a\xC3", "a\u{FFFD}"); // High BMP with last byte missing decode_utf8_to_utf8(b"a\xE2\x98Z", "a\u{FFFD}Z"); decode_utf8_to_utf8(b"a\xE2\x98", "a\u{FFFD}"); // Astral with last byte missing decode_utf8_to_utf8(b"...
Rust
0
"golden" output file. //! A runt test suite is defined using a `runt.toml` file. //! //! ## Installation //! //! To install the `runt` binary, simply run: //! ``` //! cargo install runt //! ``` //! //! ## Testing Model //! Runt's organizes tests using test suites. //! At the minimum, a test suite needs to be specify t...
Rust
0
from starlette.middleware.cors import CORSMiddleware as CORSMiddleware # noqa
Python
1
import pandas as pd import plotly.express as px from sklearn.datasets import load_wine from dash import Dash, html, dcc, callback from dash.dependencies import Input, Output # Load Data def load_data(): wine = load_wine() wine_df = pd.DataFrame(wine.data, columns=wine.feature_names) wine_df["WineType"] = ...
Python
1
, right} => write!(f, "srem i{} {}, {}", bits, left, right), Binop{op: Mod, typ: Int{bits, signed: false}, left, right} => write!(f, "urem i{} {}, {}", bits, left, right), Binop{op: Mod, typ: float_ty @ Float32, left, right} | Binop{op: Mod, typ: float_ty @ Float64, left, right} => write!(f, "frem {} ...
Rust
0
:GraphicsPipeline::start() .vertex_input_single_buffer::<Vertex>() .vertex_shader(vertex_shader.main_entry_point(), ()) .triangle_strip() .viewports_dynamic_scissors_irrelevant(1) .fragment_shader(fragment_shader.main_entry_point(), ()) .blend_alph...
Rust
0
parent_expr, higher, is_integer_literal, is_refutable, last_path_segment, match_trait_method, match_type, match_var, multispan_sugg, snippet, snippet_opt, snippet_with_applicability, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, SpanlessEq, }; /// **What it does:** Checks for for-loops...
Rust
0
_lt_generics = strip_lifetimes(&async_handler_generics); let (async_handler_impl_bounds, async_handler_ty_param, async_handler_where_bounds) = async_handler_generics.split_for_impl(); let (_, no_lt_ty_param, _) = no_lt_generics.split_for_impl(); let no_lt_turbofish = no_lt_ty_param...
Rust
0
""" Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers. assert square_Sum(2) == 10 """ def square_Sum(n): """ >>> square_Sum(2) 10 >>> square_Sum(3) 20 >>> square_Sum(4) 30 >>> square_Sum(5) 55 >>> square_Sum...
Python
1
context)) } } /// impl Drop for Context { fn drop(&mut self) { if Rc::strong_count(&self.context) == 1 { debug!("Context drop!"); unsafe { LLVMContextDispose(*self.context); } } debug!( "Context drop! to rc({:?})", ...
Rust
0
# # This file is part of LiteSDCard. # # Copyright (c) 2017-2020 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause SD_OK = 0 SD_CRCERROR = 1 SD_TIMEOUT = 2 SD_WRITEERROR = 3 SD_SWITCH_CHECK ...
Python
1
print('---- create and print tuple -----') my_tuple = (101, 'Mostafa', 8000.0, 'Giza') print(my_tuple) print(type(my_tuple)) print('---------- access element in a tuple by index -------------') print(my_tuple[3]) print('------------ un packing tuple ----- ') emp_code, emp_name, emp_salary, emp_adress = my_tupl...
Python
1
tuples.append((w, u)) sampled_tuples = [] # for w in words: # t_w = tuple(w) # while len(sampled_pairs[t_w]) < number_of_comps_per_word: # u = random.choice(words) # if u == w: # continue # if u in sampled_p...
Python
1
BUFFER_START: c_uint = 0x8C84; pub const TRANSFORM_FEEDBACK_BUFFER_START_EXT: c_uint = 0x8C84; pub const TRANSFORM_FEEDBACK_BUFFER_START_NV: c_uint = 0x8C84; pub const TRANSFORM_FEEDBACK_BUFFER_STRIDE: c_uint = 0x934C; pub const TRANSFORM_FEEDBACK_NV: c_uint = 0x8E22; pub const TRANSFORM_FEEDBACK_OV...
Rust
0
consume_subtree_filtered(child_idx)) } } } ////==== delete_bulk() - a more general (and slower) version of the algorithm that allows to traverse nodes without consuming them ==== //impl<'a, T: Item> DeleteRange<'a, T> { // /// The items are returned in order. // pub fn delete_bulk<D: TraversalDriver...
Rust
0
import streamlit as st from tab_num.logics import NumericColumn def display_tab_num_content(file_path=None, df=None): num_col_instance = NumericColumn(file_path=file_path, df=df) num_col_instance.find_num_cols() if not num_col_instance.cols_list: st.write("No numeric columns found.") r...
Python
1
HUGE * HUGE } else { TINY * TINY }; } if ix >= 0x3ff00000 { return if hy > 0 { HUGE * HUGE } else { TINY * TINY }; } } /* over/underflow if x is not close to one */ if ix < 0x3fefffff { return if hy < 0 { s * HUGE...
Rust
0
dden_size) else: self.rnn_cell = CfcCell(self.in_features, self.hidden_size, hparams) self.use_mixed = use_mixed if self.use_mixed: self.lstm = LSTMCell(self.in_features, self.hidden_size) # 这里的全连接层用于将输出从 [64, 168, 12] 转换为 [64, 168, 3] self.fc = nn.Linear(...
Python
1
Vector { x: offset, y: 0 } } else { Vector { x: 0, y: offset } } } impl<'a> MathShaper for HarfbuzzShaper<'a> { fn math_constant(&self, c: MathConstant) -> i32 { unsafe { hb::hb_ot_math_get_constant(self.font.as_raw(), c as _) } } fn get_math_table(&self) -> &[u8] { ...
Rust
0
: usize = E::Fr::NUM_BITS as usize / 2; let upper_bits_len: usize = E::Fr::NUM_BITS as usize - lower_bits_len; let a_lower = AllocatedNum::pack_bits_to_element(cs.namespace(|| "a_lower"), &bits_a[..lower_bits_len])?; let b_lower = AllocatedNum::pack_bits_to_element(cs.namespace(|| "b_lower"...
Rust
0
tonicTooOld, BeforeBackstop, TooCloseToPrevious, } /// The reasons a time source may have failed. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum TimeSourceError { LaunchFailed, StreamFailed, CallFailed, SampleTimeOut, } //! The D-PDU API (Also known as ISO 22900-2) is a standard wa...
Rust
0
import socket import threading class FF_CLIENT: def __init__(self, uid, password): self.uid = uid self.password = password self.sock = None def connect(self, token, ip, port, name, key, iv): print(f"[+] Connecting to {ip}:{port}") try: self.sock = socket.soc...
Python
1
#[table_name="users"] struct NewUser { id: i32, } #[test] fn custom_schemas_are_loaded_by_infer_table_from_schema() { let conn = connection(); insert(&NewUser { id: 1 }).into(users::table) .execute(&conn).unwrap(); let users = users::table.select(users::id) ...
Rust
0
#! /usr/bin/env python3 import logging from letterboxd.letterboxd import Letterboxd from letterboxd.services.member import Member from tests.letterboxd_definitions import * from tests.test_letterboxd import load_user_pass logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) def test_member_watchlist...
Python
1
if class_id or k or top_k: sub_key = str(metric_types.SubKey(class_id, k, top_k)) else: sub_key = "" all_sliced_attributions = {} for sliced_attributions in self.attributions: slice_name = sliced_attributions[0] attributions = sliced_attributions[...
Python
1
error.add_help(&format!("did you mean {}?", name)); true } else { false } } /// If `result` is an `Err`, add the errors to `errors`. /// Otherwise, execute the closure. fn try<F: FnMut(T), T>(mut result: result::Result<T, Vec<Error>>, errors: &mut Vec<Error>, mut fn_using_result: F)...
Rust
0
Xt = est.fit_transform(X) assert_array_equal(X, X_before) Xt_before = Xt.copy() Xinv = est.inverse_transform(Xt) assert_array_equal(Xt, Xt_before) assert_array_equal(Xinv, np.array([[0.5], [1.5], [2.5], [2.5]])) @pytest.mark.parametrize( "strategy, expected_bin_edges", [("quantile", [0, 1...
Python
1
in the kernel page table. /// The sscratch register points here. /// uservec in trampoline.S saves user registers in the trapframe, /// then initializes registers from the trapframe's /// kernel_sp, kernel_hartid, kernel_satp, and jumps to kernel_trap. /// usertrapret() and userret in trampoline.S set up /// the trapf...
Rust
0
f } Compare::Lt => lt(left, right)?, Compare::Le => lte(left, right)?, Compare::Gt => { let mut f = lte(left, right)?; f.reverse(); f } Compare::Ge => { let mut f = lt(left, right)?; ...
Rust
0
code = add_numba_decorator(program=offspring['code'], function_name=function_name) else: code = offspring['code'] n_retry= 1 while self.check_duplicate(pop, offspring['code']): n_retry += 1 if self.debug: ...
Python
1
 d<Xc@`sxddlmZmZmZddlmZmZmZmZm Z m Z m Z m Z dddddd d d gZ d S( i(tabsolute_importtdivisiontprint_functioni(t __author__t __copyright__t __email__t __license__t __summary__t __title__t...
Python
1
], None); assert_eq!(view.len(), 6); } #[test] fn peek_amount_empty() { let empty: [u32; 0] = []; let mut peeking_queue = empty.iter().peekmore(); let view = peeking_queue.peek_amount(3); assert_eq!(view[0], None); assert_eq!(view[0], None); assert_e...
Rust
0
nt. pub k: ConstKind, } impl Constant { /// Returns a unit constant. #[must_use] pub fn unit() -> Self { Self { ety: (Some(Rc::new(ExprKind::Unit)), Rc::new(TyKind::Unit)), k: ConstKind::Unit } } /// Returns a true constant. #[must_use] pub fn itrue() -> Self { Self { ety: (Some(Rc::new(ExprKind::...
Rust
0
ut threshold = 0i16; // read the arguments if args.len() == 0 { return Err(Error::new(ErrorKind::InvalidInput, "Tool run with no paramters.")); } for i in 0..args.len() { let mut arg = args[i].replace("\"", ""); arg = arg.replace("\'", ""); ...
Rust
0
from typing import List from requests import Session from keycloak_scanner.scan_base.mediator import Mediator from keycloak_scanner.scanners.none_sign_scanner import NoneSignScanner from keycloak_scanner.scan_base.types import WellKnown, SecurityConsole, Client, NoneSign, Realm from keycloak_scanner.scan_base.wrap i...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' l10n_bd_corporate_tax_liability = fields.Many2one( related="company_id.l10n_bd_corporate_tax_liability", ...
Python
1
"""Module includes a registry of default parser configurations.""" from langchain_community.document_loaders.base import BaseBlobParser from langchain_community.document_loaders.parsers.generic import MimeTypeBasedParser from langchain_community.document_loaders.parsers.msword import MsWordParser from langchain_commun...
Python
1
""" South introspection rules for django-audit-log """ from django.contrib.auth.models import User from django.conf import settings from south.modelsinspector import add...
Python
1
ite::new("ts1"); ts1.set_timestamp(timestamp); let mut ts2 = TestSuite::new("ts2"); ts2.set_timestamp(timestamp); let test_success = TestCase::success( "good test", Duration::milliseconds(15001), Some("MyClass".to_string()), ); let tes...
Rust
0
# coding=utf-8 # Copyright 2024 Tri Dao, Albert Gu, Technological Innovation Institute and 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...
Python
1
import torch from torch import nn import torch.nn.functional as F class VDNMixer(nn.Module): def __init__(self): super(VDNMixer,self).__init__() def forward(self,q_values): return sum(q_values) class VDNCritic(nn.Module): def __init__(self, args, a...
Python
1
t_speech, return_tensors="pt", padding=True) input_values = inputs.input_values.to(torch_device) with torch.no_grad(): logits = model(input_values).logits predicted_ids = torch.argmax(logits, dim=-1) predicted_trans = processor.batch_decode(predicted_ids) EXPECTED...
Python
1
return Err(TreeError::Resize(ResizeErr::ExpectedNotFloating(container.get_id()))) } match container.get_type() { ContainerType::View | ContainerType::Container => {}, _ => return Err(TreeError::UuidWrongType(container.get_id(), ...
Rust
0
), ("knot", "knots", "nautical_mile / hr", ""), ("click", "clicks", "km", ""), ("NM", "", "nautical_mile", ""), ]; const CURRENCIES: &[UnitTuple] = &[ ("dollar", "dollars", "USD", ""), ("cent", "cents", "0.01 USD", ""), ("US$", "US$", "USD", ""), ("$", "$", "USD", ""), ("euro", "euros",...
Rust
0
# Copyright (C) 2024 qBraid # # This file is part of the qBraid-SDK # # The qBraid-SDK is free software released under the GNU General Public License v3 # or later. You can redistribute and/or modify it under the terms of the GPL v3. # See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.ht...
Python
1
writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ use std::collections::HashMap; pub(crate) typ...
Rust
0
import gi gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") from gi.repository import Gtk, Adw class DuoPreferencesRow(Adw.PreferencesRow): def __init__(self, primary_widget: Gtk.Widget = None, secondary_widget: Gtk.Widget = None, *args, **kwargs): super().__init__(*args, **kwargs) s...
Python
1
timeString = datetime.strptime(thisTimeString[:-3], '%Y-%m-%dT%H:%M:%S.%f').strftime('%Y%m%d%H%M') data['images'][timeString] = np.asarray(var_data.sel(Time=thisTime)) if 'images' not in data.keys(): exit('No data in bounds after file reads.') if len(data['images']) == 0:...
Python
1
ine().decode('utf-8').strip() try: string_num, handle = map(int, data.split(',')) print(f"Received from Arduino: string={string_num}, handle={handle}") string_idx = string_num - 1 fret_offset = sum(base_frets[ch] for ch in p...
Python
1
# ============================================================================== # Copyright (C) 2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # ============================================================================== """Openvino Tensorflow cast operation test """ from __future__ import absolute_...
Python
1
nonce: &[u8], aad: &[u8], ) -> Result<Vec<u8>, VaultFailError> { self.v.aead_aes_gcm_encrypt(context, plaintext, nonce, aad) } /// Decrypt a payload using AES-GCM fn aead_aes_gcm_decrypt( &mut self, context: SecretKeyContext, cipher_text: &[u8], ...
Rust
0
where F: Future + Send + 'static, F::Output: Send + 'static, { let task = smol::spawn(future); JoinHandle(InnerJoinHandle::Smol(task)) } fn spawn_blocking<F, T>(&self, task: F) -> JoinHandle<T> where F: FnOnce() -> T + Send + 'static, T: Send + 'stati...
Rust
0
): return grpc.experimental.unary_unary(request, target, '/bilibili.app.distribution.v1.Distribution/GetUserPreference', bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReq.SerializeToString, bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.G...
Python
1
state updated", id); sender.send(state.clone()).ok(); } }) .drop_err() .spawn(context); receiver.shared() } fn get_scoping(&mut self, meta: &RequestMeta) -> Scoping { match self.state() { Some(state) => state....
Rust
0
_DMA_OUT_PERI_SEL_CH1; #[doc = "`read()` method returns [dma_out_peri_sel_ch1::R](dma_out_peri_sel_ch1::R) reader structure"] impl crate::Readable for DMA_OUT_PERI_SEL_CH1 {} #[doc = "`write(|w| ..)` method takes [dma_out_peri_sel_ch1::W](dma_out_peri_sel_ch1::W) writer structure"] impl crate::Writable for DMA_OUT_PERI...
Rust
0
akPoint::X86usergetfilesizeex as u64), &input); //_worker.write_virt_from(VirtAddr(BreakPoint::X86usergetfilesizeextwo as u64), &input); _worker.write_virt_from(VirtAddr(BreakPoint::End as u64), &input); //_worker.write_virt_from(VirtAddr(BreakPoint::Debug as u64), &input); _worker.write_virt_from( ...
Rust
0
data_dir: str, train_flag: bool, shot_num: int = None, **super_args ): json_path = join(data_dir, 'train.json' if train_flag else 'test.json') with open(json_path, 'r') as j_f: json_config = json.load(j_f) for key in json_config.keys(): ...
Python
1
import streamlit as st from io import StringIO st.set_page_config(page_title="SW-Factory Assistant") st.write("# Test Automation Assistant") input = st.text_input("## Enter a prompt for the requirements/tests ?", value="enter here") st.write(f"## You entered: {input}") with st.form("my_form"): st.write("Inside the...
Python
1
Identifier(String), } #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Variation)] pub enum Number { Literal(i64), DefinedValue(DefinedValue), } impl fmt::Display for Number { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Number::Literal(num) => num.fm...
Rust
0
# -*- coding: utf-8 -*- """ Created on Wed Apr 10 22:41:54 2024 @author: Kayvon Daie """ ci = 12; gi = np.where(stimDist[ci,:] == np.min(stimDist[ci,:]))[0]; ind = np.where(seq==gi+1) stim_trace_for_group = np.zeros((1,Ftrace.shape[1]))[0] stim_trace_for_group[ind[0]] = 1 plt.plot(Ftrace[ci,:]) plt.plot(stim_trace_...
Python
1
#!/usr/bin/env python # -*- coding: UTF8 -*- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms import textwrap, random, string from scriptlets import * class ScriptletGenerator(Scriptlet): ...
Python
1
00BB)), alias: "IsocenterToBeamLimitingDeviceDistance", vr: FL }, E { tag: Single(Tag(0x300A, 0x00BC)), alias: "NumberOfLeafJawPairs", vr: IS }, E { tag: Single(Tag(0x300A, 0x00BE)), alias: "LeafPositionBoundaries", vr: DS }, E { tag: Single(Tag(0x300A, 0x00C0)), alias: "BeamNumber", vr: IS }, E { tag: ...
Rust
0
PHYS_PAGES: ::c_int = 86; pub const _SC_ATEXIT_MAX: ::c_int = 87; pub const _SC_PASS_MAX: ::c_int = 88; pub const _SC_XOPEN_VERSION: ::c_int = 89; pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; pub const _SC_XOPEN_UNIX: ::c_int = 91; pub const _SC_XOPEN_CRYPT: ::c_int = 92; pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; p...
Rust
0
''' Python script for: Anatomy Date: 05JAN2024 By: Shahanawaz Shaikh ''' # Defining Function def function1(): """ This is a docstring to explain the function """ print("test") # Calling Function function1()
Python
1