text
string
label_name
string
labels
int64
U5U/UQ70UD6$)Nropenrrr)rr3r4rmrs rEfopenDebugContext.fopenm:zzzBGGLLX6 TTTVTTrDc/# UR(de[[RR UR...
Python
1
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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...
Python
1
(&self) -> u32 { 0 } /// Indication of the player's activity status /// fn active(&self) -> bool { true } /// Generate a collection of all the details of this entry's current state /// fn details(&self) -> EntryDetails { EntryDetails { name: self.tag...
Rust
0
ulang = 10 for i in range(ulang): print(f"Perulangan ke-{i}")
Python
1
0, 0), ymd_hms(1997, 9, 16, 9, 0, 0), ymd_hms(1997, 9, 30, 9, 0, 0), ], ); } #[test] fn weekly_interval_large() { let rrule = RRule { freq: Frequency::Weekly, count: Some(3), by_weekday: vec![NWeekday::Every(Weekday::Tue)], by_hour: vec![9], ...
Rust
0
await ctx.respond(embed=embed) async def __cannot_roll(self, ctx): cannot_roll = self.translation.translate("GAMES.EYE.CANNOT_ROLL") embed = discord.Embed(description=f"**Głos z Eteru:**\n{cannot_roll}") await ctx.respond(embed=embed) def __perform_strong_nine_force_roll(self, dice...
Python
1
cols = st.columns(min(len(images_b64), 4)) for idx, b64_string in enumerate(images_b64): with cols[idx % 4]: st.image( base64.b64decode(b64_string), ...
Python
1
has_agno_guidance else '❌'}") print(f" Knowledge access section: {has_knowledge_access_section} {'✅' if has_knowledge_access_section else '❌'}") # Size comparison if instruction_size < 5000: size_status = "✅ Reasonable" elif instruction_size < 15000: si...
Python
1
be added separately. //! //! [**CookieIdentityPolicy**](struct.CookieIdentityPolicy.html) //! uses cookies as identity storage. //! //! To access current request identity //! [**RequestIdentity**](trait.RequestIdentity.html) should be used. //! *HttpRequest* implements *RequestIdentity* trait. //! //! ```rust //! use ...
Rust
0
m=1))) sw.summ_traj2ds_on_rgb('outputs/trajs_on_rgb', trajs_e[0:1], utils.improc.preprocess_color(rgbs[:,0]), cmap='spring') sw.summ_traj2ds_on_rgb('outputs/trajs_on_black', trajs_e[0:1], utils.improc.preprocess_color(rgbs[:,0]*0), cmap='spring') sw.summ_traj2ds_on_rgb('outputs/trajs_on_white', trajs_e[0:1]...
Python
1
e_effect.clone()).await; /// println!("{:?}",results); /// } /// }, /// Err(e) => println!("{}",e) /// } /// } /// ``` pub async fn async_flame_effect(&self, access_token: String, flame_effect: FlameEffect) -> Result<LiFxResults, reqwest:...
Rust
0
/// Returns the first and all the rest of the elements of the slice, or `None` if it is empty. /// /// # Examples /// /// ``` /// let x = &[0, 1, 2]; /// /// if let Some((first, elements)) = x.split_first() { /// assert_eq!(first, &0); /// assert_eq!(elements, &[1, 2]); ...
Rust
0
x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55, ]; &EMPTY_SUM } #[test] fn empty_sum_sha256_is_empty_hash() { use digest::Digest; use sha2::Sha256; let sum = empty_sum_sha256(); ...
Rust
0
updated_static_feats = self.I.generator.backbone.synthesis(ws, cond_list=None, return_list=True, feat_conditions=triplane_feat_offsets, update_emas=False, noise_mode='const') else: updated_static_feats = static_feats[:-1] + [static_feats[-1] + triplane_feat_offsets] else: updated_st...
Python
1
import tensorflow as tf class Mlp(object): def __init__( self, layer_sizes, output_size = None, activations = None, output_activation = None, use_bias = True, kernel_initializer = None, bias_initializer = tf.zeros_initializer(), kernel_regularizer = None, bias_regularizer = No...
Python
1
: RefCell<Vec<Box<Future<Item=(), Error=()>>>> = RefCell::new(Vec::new()); ); /// Event loop controller /// /// Arbiter controls event loop in its thread. Each arbiter runs in separate /// thread. Arbiter provides several api for event loop access. Each arbiter /// can belongs to specific `System` actor. /// /// By de...
Rust
0
""" Test script to verify WADM is working after SMC fixes """ import asyncio from src.manager import WADMManager from src.logger import get_logger logger = get_logger(__name__) async def test_wadm(): """Test WADM startup""" logger.info("Testing WADM startup...") try: # Create manager ...
Python
1
2])) == schema.browse( c, RefType.TRACK, artist=self.artists[0].uri, ) assert list(map(ref, self.tracks[2:3])) == schema.browse( c, RefType.TRACK, album=self.albums[0].uri, ) a...
Python
1
elapsed_timedelta.total_seconds() / line_timedelta.total_seconds()) * line.planned_amount else: theo_amt = line.planned_amount line.theoretical_amount = theo_amt def _compute_percentage(self): for line in self: if line.theoretica...
Python
1
from allauth.socialaccount import app_settings from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class LinkedInAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get("public-profile-url...
Python
1
import reflex as rx from .. import navigation from ..ui.base import base_page from . import state, model def blog_post_detail_link(child: rx.Component, post: model.BlogPostModel): if post is None: return rx.fragment(child) post_id = post.id if post_id is None: return rx.fragment(child) ...
Python
1
assert_eq!(&prev_schema, logical_plan.schema()); } else { // NOTE: the order is important. Projection pushdown must be before predicate pushdown, // The projection may have aliases that interfere with the predicate expressions. if projection_pushdown { ...
Rust
0
a = 5 b = 10 print("Before swap: a =", a, "b =", b) a, b = b, a print("After swap: a =", a, "b =", b)
Python
1
ge(config.GENES_PER_VARIABLE)), tuple(random() for _ in range(config.GENES_PER_VARIABLE)), tuple(random() for _ in range(config.GENES_PER_VARIABLE)), tuple(random() for _ in range(config.GENES_PER_VARIABLE)), tuple(random() for _ in range(config.GENES_PER_VARIABLE)), tuple(random...
Python
1
(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SlaveQueryPath<SubNodePathT> { pub node_path: SlaveNodePath<SubNodePathT>, pub query_id: QueryId, } impl<SubNodePathT: IntoCTSubNodePath> SlaveQueryPath<SubNodePathT> { pub fn into_ct(self) -> CTQueryPath { CTQueryPath {...
Rust
0
istic: &[ // 13493686787511418881, // 18107087372223867603, // 14622846468717035924, // 11702080941310629006, // 4110145082483, // ], // cofactor: &[1,], // }, // ); //...
Rust
0
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
Python
1
{ world.get_character_mut(id).unwrap().0.x = x + dx; world.get_character_mut(id).unwrap().0.y = y + dy; } } #![allow(dead_code)] extern crate mio; extern crate num_cpus; extern crate uuid; use self::mio::{Poll, Events}; use self::mio::channel::{channel, Sender, Receiver}; use self::mio::tcp::{TcpL...
Rust
0
import os import re from tabulate import tabulate #================================================================= """ database = ["e-prop", "CIFAR10", "CIFAR100", "CIFAR-100", "N-MNIST", "Fashion MNIST", "N-TIDIGIT", "ImageNet", "TinyImageNet", "Tiny-ImageNet"] network = ["ResNet-12", "Re...
Python
1
)); } else { self.sink_dots.insert(tip, pid); } pid } } } #[inline] pub(crate) fn share_link(&mut self, link: &mut Link) -> LinkId { let atom_id = self.do_share_atom(Atom::Link(link.clone())); link.ato...
Rust
0
::CUDA_ERROR_DEINITIALIZED, /// ::CUDA_ERROR_NOT_INITIALIZED, /// ::CUDA_ERROR_INVALID_CONTEXT, /// ::CUDA_ERROR_INVALID_VALUE /// \notefnerr /// \note_memset /// \note_null_stream /// /// \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, /// ::cuArrayDestroy, ::cuAr...
Rust
0
}) .collect(); nodes .par_iter() .flat_map(|src| { nodes .iter() .filter_map(|dst| { if !allow_selfloops_unwrapped && src == dst { return None; ...
Rust
0
OT_CHARTS: plt.plot(t_sample, vals, label="Optimal obj function", color='red'); plt.plot(t_sample, b_vals1, label="b(t)", color='blue'); plt.scatter(t_sample, np.ones(len(t_sample)) * C, s=10, label="Short selling limit", color='gray') plt.scatter(t_sample, np.ones(len(t_sample)) * OVERB...
Python
1
e: 10, suffix: None } ); assert_eq!( file.value::<Integer>("core", None, "integer-no-prefix")?, Integer { value: 10, suffix: None } ); assert_eq!( file.value::<Integer>("core", None, "integer-prefix")?, Integer { ...
Rust
0
# dockerpty. # # Copyright 2014 Chris Corbyn <chris@w3style.co.uk> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
Python
1
} pub fn auth_provider(&self) -> &Arc<AP> { &self.auth_provider } } <reponame>lukehsiao-forks/cocogitto<gh_stars>10-100 pub mod changelog; pub mod commit; pub mod version; use amethyst::ecs::world::Index; use super::component_prelude::*; pub mod prelude { pub use super::HeartsContainer; pub u...
Rust
0
ne name = model.get_bias() assert name is None @tooslow def test_saved_model_creation(self): pass @require_tokenizers @require_tf class TFBlenderbot90MIntegrationTests(unittest.TestCase): src_text = [ "Social anxiety\nWow, I am never shy. Do you have anxiet...
Python
1
_work), "::", stringify!(handler) ) ); assert_eq!( unsafe { &(*(::core::ptr::null::<k_work>())).flags as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(k_work), "::", stringify!(flags) ...
Rust
0
fn buy(origin, owner: T::AccountId, kitty_id: KittyIndexOf<T>, max_price: BalanceOf<T>) { let sender = ensure_signed(origin)?; ensure!(sender != owner, Error::<T>::BuyFromSelf); KittyPrices::<T>::try_mutate_exists(kitty_id, |price| -> DispatchResult { let price = price.take().ok_or(Error::<T>::NotForSal...
Rust
0
} fn handle_disconnect(&mut self, input: &mut Payload) -> RdpResult<Option<Vec<u8>>> { let req = HCardAndDisposition_Call::decode(input)?; debug!("got {:?}", req); self.contexts .get(req.handle.context.value) .ok_or_else(|| invalid_data_error("unknown context I...
Rust
0
with patch("pyudev.Context", side_effect=ImportError), patch( "homeassistant.components.usb.async_get_usb", return_value=[] ), patch("homeassistant.components.usb.comports", return_value=[]), patch.object( hass.config_entries.flow, "async_init" ): assert await async_setup_component(hass...
Python
1
(), http.StatusTeapot) } } func (s *Server) serveSearchErr(w http.ResponseWriter, r *http.Request) error { qvals := r.URL.Query() queryStr := qvals.Get("q") if queryStr == "" { return fmt.Errorf("no query found") } q, err := query.Parse(queryStr) if err != nil { return err } repoOnly := true query.Visi...
Rust
0
while True: # Pedir al usuario un número entero positivo n = int(input("Introduce un número menor que 100 para imprimir los números pares desde 100 hasta ese número: ")) # Verificar que el número ingresado sea menor que 100 if n >= 100: print("Por favor, introduce un número menor que 100.") ...
Python
1
await setup_integration() aioclient_mock.post( f"{SERVER_URL}/stream", exc=aiohttp.ClientError, ) client = await hass_ws_client(hass) await client.send_json( { "id": 2, "type": "camera/web_rtc_offer", "entity_id": "camera.demo_camera", ...
Python
1
// We assume that the `follow_distance` should be sufficient to ensure this never // happens, otherwise it is an error. Err(Error::RemoteNotSynced { next_required_block, remote_highest_block, follow_distance, }) } else { // Return an empty...
Rust
0
es, backoff_delay, utils, ) .expect("request loop failed") }); Ok(handle) } } <reponame>cjhopman/starlark-rust // Copyright 2019 The Starlark in Rust Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not ...
Rust
0
import os from sklearn.model_selection import train_test_split def create_synapse_split_slice_based(): """スライスベース分割(論文再現用)""" # 参照用ディレクトリから読み込み input_file = '../lists/references/Synapse/train.txt' output_dir = '../lists/Synapse_slice_based/' print(f"Reading from: {input_file}") # ファイル...
Python
1
abled = True self.root.ids.btn8.disabled = True self.root.ids.btn9.disabled = True def reset_btn_colors(self): self.root.ids.btn1.color = "green" self.root.ids.btn2.color = "green" self.root.ids.btn3.color = "green" self.root.ids.btn4.color = "green" self...
Python
1
# -*- coding: utf-8 -*- from odoo import fields, models class View(models.Model): _inherit = 'ir.ui.view' type = fields.Selection(selection_add=[('gallery', "Awesome Gallery")])
Python
1
nnector::builder().danger_accept_invalid_certs(true).build().unwrap()); let client = Client::connect(&env::var("DATABASE_URL").unwrap(), connector).unwrap(); rocket().manage(Mutex::new(client)).launch(); } <reponame>brendandburns/akri use k8s_openapi::api::core::v1::{NodeSpec, NodeStatus}; use kube::{ api:...
Rust
0
r route in &mut routes { route.insert(0, coord); } res.extend(routes.into_iter()); } res } } fn total_distance(route: &[&Coord]) -> f64 { let mut sum = 0.0; for i in 1 .. route.len() { sum += dist(route[i], route[i - 1]); } sum } #[derive(StructOpt, Debug)] pub struct Opt...
Rust
0
to_string(&self) -> Option<String> { match self { Self::Int(i) => Some(i.to_string()), Self::Float(f) => Some(f.to_string()), _ => None, } } /// Same as [`to_string`](#method.to_string) but formatted with a precision pub fn to_string_with_precision(&self...
Rust
0
on and '/extdomains/' != request.path[:12] and request.headers.get('referer'): reference_domain = decode_mirror_url(request.headers.get('referer'))['domain'] if reference_domain in isolated_domains: return redirect(encode_mirror_url(parse.remote_path_query, reference_domain), code=307) ...
Python
1
"resource struct" } else if self.is_native { "native struct" } else { "struct" }; if self.is_native { write!( w, "{s:width$}{nominal_name} {name}", s = "", width = indent as u...
Rust
0
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Networking.ServiceDiscovery.Dnssd") try: import winrt.windows.foundation except: pass try: import winrt.windows.foundation.collections exc...
Python
1
_preprocess_obs(self, obs, use_seg=True): rgb = obs['rgb'] depth = obs['depth'] depth = self._preprocess_depth(depth, self.min_depth, self.max_depth) ds = self.env_frame_width // self.frame_width # Downscaling factor if ds != 1: rgb = np.asarray(self.res(rgb.asty...
Python
1
show_graph_with_labels(name, name, value[3]) print("Count: " + str(counts)) def find_best_with_duration(duration): N = max(duration) + 1 # store the start of the columns for checking if graph is valid col_starters = [0] next_col = 0 for gap in range(2, N - 1): next_col += gap ...
Python
1
atility", TickType::OPTION_IMPLIED_VOL => "OptionImpliedVolatility", TickType::OPTION_BID_EXCH => "OptionBidExchStr", TickType::OPTION_ASK_EXCH => "OptionAskExchStr", TickType::OPTION_CALL_OPEN_INTEREST => "OptionCallOpenInterest", TickType::OPTION_PUT_OPEN_IN...
Rust
0
from fastapi import Depends, HTTPException, status from typing import Sequence from app.core.error.teacher_exception import TeachersNotFoundError from app.features.teacher.dependencies import get_teachers_use_case from app.features.teacher.domain.entities.teacher_schema import TeacherDisplay from app.features.teacher....
Python
1
Align16<[f64; 2]> as *const f64; debug_assert!(p as usize % 16 == 0); m128d(unsafe { _mm_load_pd(p) }) } /// Overwrite the upper lane with the new value. #[allow(clippy::trivially_copy_pass_by_ref)] #[inline(always)] pub fn load_high(self, new: &f64) -> m128d { m128d(unsafe { _mm_loadh_pd(self.0...
Rust
0
ed {self.bar_data[i]} and {self.bar_data[j]}.") time.sleep(self.speed.get()) self.bar_data[i + 1], self.bar_data[high] = self.bar_data[high], self.bar_data[i + 1] return i + 1 def quick_sort_recursive(low, high): if low < high: pi = partit...
Python
1
c::{Efer, EferFlags}; use x86_64::registers::rflags::RFlags; use x86_64::structures::DescriptorTablePointer; use crate::arch::segmentation::Segment; use crate::arch::vmm::VcpuAccessGuestState; use crate::arch::{GuestPageTableImmut, GuestRegisters, LinuxContext}; use crate::cell::Cell; use crate::error::HvResult; use c...
Rust
0
, }; let result = vec![ datetime!(2021-06-07 18:00:00 UTC), datetime!(2021-06-10 18:00:00 UTC), ]; assert_eq!(compute_dates(base, &spec), result); } #[test] fn test_compute_dates_3() { let base = datetime!(2021-06-04 13:38:00 UTC); let...
Rust
0
Co(line1, column1), Position::LiCo(line2, column2), ) } } /// A position in a parsed stream. #[derive(Clone, Debug)] pub enum Position { // Byte offset (starting at 0) Offset(usize), // Line-Column position (both starting at 1) LiCo(usize, usize), } impl fmt::Display for Positi...
Rust
0
import os username = os.getenv("DB_USERNAME") password = os.getenv("DB_PASSWORD") hostname = { "dev": os.getenv("DEV_HOSTNAME"), "prod": os.getenv("PROD_HOSTNAME"), "stage": os.getenv("STAGE_HOSTNAME"), "test": os.getenv("TEST_HOSTNAME"), } database = os.getenv("DB_NAME") # as defined in docker compo...
Python
1
with open("6.txt", "r") as f: grid = [[c for c in line.strip()] for line in f.readlines()] def find_guard(grid): for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j] == "^": return (i, j) raise ValueError("couldn't find guard") def print_grid(grid): ...
Python
1
cy decision_a = WorkflowDecision( id='decision_a', decision_type=DecisionType.ARCHITECTURE, decision='Decision A', precedents=['decision_b'] ) decision_b = WorkflowDecision( id='decision_b', decision_type=DecisionTy...
Python
1
tarafın bağlanmasını bekle.") .arg( Arg::new("address") .required(true) .help("Dinlenecek ip adresi. Örneğin localhost:8000 ya da 127.0.0.1:1234") .validator(|s| { s.to_socket_addrs() .map(|_| {}) .map_err(|e| format!("girilen adres geçerli değil: {}", e)) }), ...
Rust
0
ion_final_eps": 0.01, "exploration_fraction": 0.2, "target_update_interval": 1000, "buffer_size": 100_000, "batch_size": 128, }, name="dqn_200k_fifth_run", sync_tensorboard=True, ) env = None try: env = SumoEnvironment( ...
Python
1
import os import datetime import log from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.jobstores.memory import MemoryJobStore from apscheduler.util import undefined from apscheduler.events import ( EVENT_JOB_EXECUTED, E...
Python
1
k, LprunRange::Range200k, LprunRange::Range400k, LprunRange::Range800k, LprunRange::Range1M, ]; const CLKS: [SysClkSrc; 14] = [ SysClkSrc::Hsi, SysClkSrc::Hse(Vos::V1_0), SysClkSrc::Hse(Vos::V1_2), // STLink drops the connection when switching to 100k // works with a different probe...
Rust
0
# Copyright 2019 Pinterest, 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
ion_name, items in functions.items(): function_importance = 0 for value in items.values(): function_importance += value contract_importance += value dapp_importance += value function_list.append({ ...
Python
1
import tkinter def print_winner(): global win if win is False: win = True print("Le joueur", current_player, "a gagné le jeu") def switch_player(): global current_player if current_player == 'X': current_player = '0' else: current_player = 'X' def check_win(clicked...
Python
1
mport ynnd0sudght as ltmqtwcq7bo '# documentation_contrast_horizon -> wait_junctions_buzzer' '# documentation_contrast_horizon -> wait_junctions_buzzer' '# documentation_contrast_horizon -> wait_junctions_buzzer' global dvsmqcu0q91 def o4k4v1z2n2w(): nonlocal se__t00iaob assert False global ...
Python
1
ERTIES: CLUSCTL_NODE_CODES = 67108949i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSCTL_NODE_GET_COMMON_PROPERTIES: CLUSCTL_NODE_CODES = 67108953i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSCTL_NODE_SET_COMMON_PROPERTIES: CLUSCTL_NODE_CODES =...
Rust
0
class Solution: def shortestAlternatingPaths(self, n: int, redEdges: List[List[int]], blueEdges: List[List[int]]) -> List[int]: red = defaultdict(list) blue = defaultdict(list) for a, b in redEdges: red[a].append(b) for u, v in blueEdges: b...
Python
1
) -> Result<T, BehaviourCreationError> { Self::from_relation_instance(Self::new_relation_instance(outbound, inbound)) } fn from_edge_properties( outbound: Arc<ReactiveEntityInstance>, inbound: Arc<ReactiveEntityInstance>, v: EdgeProperties, ) -> Result<T, BehaviourCreatio...
Rust
0
.long, device=text.device, ) if sids is not None: sids = sids.view(1) if lids is not None: lids = lids.view(1) if durations is not None: durations = durations.view(1, 1, -1) # inference if use_teacher_forcing: a...
Python
1
PartialOrd, Ord)] pub struct Utf8Range { /// Start of byte range (inclusive). pub start: u8, /// End of byte range (inclusive). pub end: u8, } impl Utf8Range { fn new(start: u8, end: u8) -> Self { Utf8Range { start: start, end: end } } /// Returns true if and only if the given byt...
Rust
0
e, f), (y, c, d), (x, a, b)) See Also ======== index, reorder, sympy.concrete.summations.Sum.reverse_order, sympy.concrete.products.Product.reverse_order """ var = {limit[0] for limit in expr.limits} limit_x = expr.limits[x] limit_y = expr.limits[y] ...
Python
1
Parameter + Member + AtLeast32BitUnsigned + Codec + Default + Copy + Bounded; type Reserve: Get<BalanceOf<Self>>; type Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>; } // The pallet's runtime storage items. // https://substrate.dev/docs/en/knowledgebase/runtime/storage decl_storage!...
Rust
0
()); } else { s.push(c); } } s } } #[derive(Debug)] pub enum LangError { /// Complex pattern in function argument. /// /// Only basic patterns like `foo: u32` are supported ComplexPatternFnArg, /// Trying to return multiple different typ...
Rust
0
from enum import StrEnum class ObjectTypes(StrEnum): unknown: str = "3d9cf6c43fd54aacb88878f5425f43c4" router: str = "0f53be90b5534091844969585a109ccc" switch: str = "5a3edb2b46dd43a38a62d15263204512" win_server: str = "50eabecb80f345709c55fea37106ff4c" linux_server: str...
Python
1
break frame = cv2.flip(frame, 1) results = hands.process(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)) if results.multi_hand_landmarks: hand_landmarks = results.multi_hand_landmarks[0] index_tip = hand_landmarks.landmark[8] thumb...
Python
1
from bot.config import * headers = { 'Accept': 'application/json', 'Accept-Language': f'{settings.LANGUAGE_CODE},{settings.LANGUAGE_CODE};q=0.9,en-US;q=0.8,en;q=0.7', 'Content-Type': 'application/json', 'Connection': 'keep-alive', 'Origin': 'https://dog-ways.newcoolproject.io', 'Referer': 'http...
Python
1
te a saver to load the network saver = tf.train.Saver([v for v in tf.global_variables() if '-up' not in v.name and '-cr' not in v.name]) if not os.path.exists(pred_masks_path): os.makedirs(pred_masks_path) if not os.path.exists(img_pred_masks_path): os.makedirs(img_pred_masks_path) wit...
Python
1
ffff) as u32) } #[doc = "Bits 0:1 - 1:0\\] Internal. Only to be used through TI provided API."] #[inline(always)] pub fn per(&self) -> PER_R { PER_R::new((self.bits & 0x03) as u8) } } impl W { #[doc = "Bits 2:31 - 31:2\\] Internal. Only to be used through TI provided API."] #[inline(...
Rust
0
#!/usr/bin/env python3 import requests import json from datetime import datetime def test_current_endpoint(): base_url = "http://localhost:8000" # Test authentication first auth_data = { "username": "admin", "password": "admin123" } try: # Get authentication token ...
Python
1
from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field T = TypeVar("T", bound="DocArchiveArgs") @_attrs_define class DocArchiveArgs: """DocArchive args. Attributes: ref_id (str): A generic entity id. ...
Python
1
self.model_nums, \ f"model_parameters should has the same length to " \ f"self.model_nums, " \ f"but got {len(model_parameters)} and {self.model_nums} " \ f"respectively" for model_idx in range(self.model_nums): self.ctx.models...
Python
1
rsion() { let propagator = BinaryPropagator::new(); for (context, data) in from_base64_data() { assert_eq!(propagator.from_base64(&data), context) } for (context, data) in to_base64_data() { assert_eq!(propagator.from_base64(&data), context) } } } <re...
Rust
0
import random from model.data import BaseWords, Buttons, ChangingDictMixin from view.keyboards import DictionaryKeyboard class Dictionary(ChangingDictMixin): def __init__(self, model): """Set dictionary variables.""" self.bot_model = model self.base_dictionary_actions = { But...
Python
1
return i; } } len } } } fn add_raw_line(dst: &mut LineSplit, line: &[u8]) { let mut i = 0; let len = line.len(); while i < len { i += skip_all_escape_code(&line[i..]); let tok_len = skip_token(&line[i..]); dst.append_line(&line[i.....
Rust
0
f testTrailingWhitespaceInPre(self): self.runTestUnmodifiedOutput( [{"type": u"StartTag", "name": u"pre", "data": []}, {"type": u"Characters", "data": u"foo"}, {"type": u"SpaceCharacters", "data": spaceCharacters}, {"type": u"EndTag", "name": u"pre", "data": []...
Python
1
= subprocess.run(command, capture_output=True, text=True, check=True, cwd=os.path.dirname(rpal_exe_location) if rpal_exe_location != "rpal.exe" else None) print(process.stdout, end='') # Print the output of rpal.exe if process.stderr: print("--- rpal.exe stde...
Python
1
_address(&addr_details)); ok_json!(ret, address) } // // Subaccounts // #[no_mangle] pub extern "C" fn GDKRPC_GA_get_subaccounts( sess: *const GA_session, ret: *mut *const GA_json, ) -> i32 { let sm = SESS_MANAGER.lock().unwrap(); let sess = sm.get(sess).unwrap(); let wallet = tryit!(sess.wa...
Rust
0
print(dict(zip(["halwa","aaa"],[2,5])))
Python
1
PE4MFP_R { pub(crate) fn new(bits: u8) -> Self { PE4MFP_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for PE4MFP_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `PE4MFP` writer - PE.4 Mult...
Rust
0
map_err(db::Error::from)?; Ok(warp::reply::with_status("", StatusCode::OK)) } async fn get_state(ctx: super::Context) -> Result<impl warp::Reply, warp::Rejection> { let sensors = ctx.sensors.read().await; #[derive(serde::Serialize)] struct ReplyEntry { state: crate::sensor::SensorState, ...
Rust
0