text
string
label_name
string
labels
int64
(&self) -> Gas { Gas::from(32000usize) } fn force_code_deposit(&self) -> bool { false } fn has_delegate_call(&self) -> bool { true } fn has_static_call(&self) -> bool { false } fn has_revert(&self) -> bool { false } fn has_return_data(&self) -> bool { false } fn has_bitwise_shift(&self) -> bool ...
Rust
0
import torch from jaxtyping import Float, Int64, Shaped from torch import Tensor from ....misc.discrete_probability_distribution import ( gather_discrete_topk, sample_discrete_distribution, ) class DistributionSampler: def sample( self, pdf: Float[Tensor, "*batch bucket"], determi...
Python
1
ields a range representing the row indices. /// Make sure that you invoke this on a normalized range! pub fn rows(&self) -> Range<StableRowIndex> { let norm = self.normalize(); norm.start.y..norm.end.y + 1 } /// Yields a range representing the selected columns for the specified row. ...
Rust
0
eck=check, cwd=cwd, shell=shell, errors='ignore' ) # Apply ANSI stripping if capturing output and not returning the raw process object stdout_content = process_obj.stdout if capture_output and not return_proc and stdout_cont...
Python
1
Option<(Input, Option<PathBuf>)> { RustcDefaultCalls.no_input(a, b, c, d, e, f) } fn build_controller(self: Box<Self>, a: &Session, b: &getopts::Matches) -> CompileController<'a> { let mut result = Box::new(RustcDefaultCalls).build_controller(a, b); result.continue_parse_after_error =...
Rust
0
If the seconds part of `lifetime` is greater than `0xFFFF_FFFF`, /// this function will return an `ErrorKind::InvalidInput` error. pub fn new(lifetime: Duration) -> Result<Self> { let lifetime_seconds = lifetime.as_secs(); track_assert!(lifetime_seconds <= 0xFFFF_FFFF, ErrorKind::InvalidInput);...
Rust
0
.log(pT, e) + pC * math.log(pC, e) + pG * math.log(pG, e))) # elif pT==0: # result = (- (pA * math.log(qA, e) + pC * math.log(qC, e) + pG * math.log(qG, e))) - \ # (- (pA * math.log(pA, e) + pC * math.log(pC, e) + pG * math.log(pG, e))) # elif pC==0: # resu...
Python
1
#!/usr/bin/python3 # SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries # # SPDX-License-Identifier: MIT """ Display quote from the Adafruit quotes API as text scrolling across the matrices. Requires the requests library to be installed. Run like this: $ python quote_scroller.py """ import numpy as np ...
Python
1
Pages, Pagination}; pub struct OsuTrackerMapsetsPagination { msg: Message, pages: Pages, entries: Vec<OsuTrackerMapsetEntry>, mapsets: HashMap<u32, MapsetEntry>, ctx: Arc<Context>, } impl OsuTrackerMapsetsPagination { pub fn new( ctx: Arc<Context>, msg: Message, entries...
Rust
0
psilon = <f64 as AbsDiffEq>::Epsilon; fn default_epsilon() -> Self::Epsilon { f64::default_epsilon() } fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool { f64::abs_diff_eq(&self[0], &other[0], epsilon) && f64::abs_diff_eq(&self[1], &other[1...
Rust
0
travel_log = { "France": ["Paris", "Lille", "Dijon"], "Germany": ["Stuttgart", "Berlin"], } print(travel_log["France"][1]) nested_list = ["A", "B", ["C", "D"]] print(nested_list[2][1]) travel_log1 = { "France": { "cities_visited": ["Paris", "Lille", "Dijon"], "total_visits": 12 }, "Germany...
Python
1
tional[str]: if task["template_id"] == "220": return "<span>负载节点测试路径访问状态码不为{}时,推送告警信息(每日推送{}次后不再推送)<span>".format( task.get("task_data", {}).get("codes", "").replace(",", "|"), task.get("number_rule", {}).get("day_num")) if task["template_id"] == "221": ...
Python
1
// これは 以下のように +構文で行うことができる `&(impl TraitI + TraitII)` //pub fn notify(item: &(impl Summary + Display)) { // +構文はジェネリック型につけたトレイト境界に対しても使える `TraitI + TraitII` //pub fn notify<T: Summary + Display>(item: &T) { // これら2つのトレイト境界(Summary, Display)が指定されていれば、 // notify の中では summarize を呼び出すことと {} を使って item ...
Rust
0
clamp to range [0, 255] static inline uchar4 multiply_and_clamp(const rs_matrix4x4* mat, uchar4 input) { float4 intermediate = convert_float4(input); intermediate = rsMatrixMultiply(mat, intermediate); intermediate = clamp(intermediate, CLAMP_MIN, CLAMP_MAX); return convert_uchar4(intermediate); } // M...
Rust
0
8] = if (null::<c_char>() != json_in) && (json_in_len > 0) { std::slice::from_raw_parts(json_in as *const u8, json_in_len as usize) } else { EMPTY_JSON_INPUT.as_bytes() }; // https://stackoverflow.com/a/32270215/314015 let callback_boxed_pt...
Rust
0
# STM32 BOARD SERIAL CONNECTION SERIAL_PORT = "/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0002-if00-port0" # stm32 BAUD_RATE = 115200 # API DETAILS API_IP = '192.168.27.22' # IP address of laptop API_PORT = 5000 API_PORT_ALGO = 6000 # ROBOT SETTINGS OUTDOOR_BIG_TURN = False
Python
1
ta.ram_scroll = data.ram_scroll.saturating_sub(child.prev_size.0 as _); } } _ => {} } } } struct RamView{ prev_size: (i32,i32), prev_scroll: usize, view: WidgetPod<GuiData,Box<dyn Widget<GuiData>>>, } const W_CELL: f64 = 40.0; const H_CELL: f64 = 24.0; co...
Rust
0
""" Defines the function that waits for a player to choose a valid action. """ from deprecated.v01.structures import Player from ._action_is_valid import action_is_valid def wait_for_player(player: Player, is_under_bet: bool, fold_to_nothing = False): """ Waits for a player to choose a valid action. Once...
Python
1
Root nodes are the entities in the center of the Graph, associated ' 'with some relationship types, to retrieve entities linked to the root entities.\n' 'App: Graphs' ) dependencies = (RootNode,) template_name = 'graphs/bricks/root-nodes.html' target_ctypes = (get_graph_model(),) per...
Python
1
''' Copyright (C) 2021 Gitcoin Core This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This progra...
Python
1
} // Copyright 2022 The Engula 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 applicable law or agreed ...
Rust
0
)] Arrow, #[token("-=")] MinusEq, #[token("-")] Minus, #[token("**=")] StarStarEq, #[token("**")] StarStar, #[token("*=")] StarEq, #[token("*")] Star, #[token("/=")] SlashEq, #[token("/")] Slash, #[token("%=")] PercentEq, #[token("%")] ...
Rust
0
-> fmt::Result { formatter.write_str("a difficulty") } fn visit_str<E>(self, s: &str) -> Result<Self::Value, E> where E: de::Error { let bigui = BigUint::parse_bytes(s.as_bytes(), 10).ok_or_else(|| { de::Error::invalid_value(de::Unexpected::Str(s), &"a value number") })?; Ok(Difficulty { num:...
Rust
0
| (']', Some('[')) => vec.pop(), _ => return false, }; } _ => continue, } } vec.len() == 0 } use crate::contract::{execute, instantiate, query}; use crate::error::ContractError; use crate::mock_querier::mock_dependencies; use cosmwasm_std::tes...
Rust
0
[inline(always)] pub fn exponent(&self) -> isize { self.exponent } #[inline(always)] pub fn powi(&self, exponent: usize) -> Scientific { export_powi(self, exponent) } // This function must not change before 0.5 since scientific-macro depends on it. #[inline(always)] pub fn is_zero(&self) -> bo...
Rust
0
h"], "decision") return trial def _step(self, action): new_trial = False terminated = False truncated = False # rewards reward = 0 gt = self.gt_now # observations if self.in_period("fixation"): if np.sum(action**2) > 0.01: # acti...
Python
1
from enum import Enum class ProtocolTemplate: def __init__(self, retransmit: bool, segment: bool): self.retransmit = retransmit self.segment = segment class TCPProtocol(ProtocolTemplate): def __init__(self): super().__init__(retransmit=True, segment=True) class UDPProtocol(Protocol...
Python
1
_train_acc1.detach().cpu() / num_train_loss_samples}, epoch, 'train') log_metrics(val_logger, {"Loss": total_val_loss.cpu() / num_val_loss_samples.cpu(), "MSE": total_val_mse.cpu() / num_val_loss_samples.cpu(), "MAE": total_val_mae.cpu() / num_va...
Python
1
current_or_report(diagnostics)? { &Token::Ident(span, ref ident) => (span, ident.clone()), tok => return Err(Failure::Match(tok.span())) }; let endspan = loop { parser.advance(); match parser.current_or_report(diagnostics)? { &Token::Iden...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2024 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Python
1
os = "netbsd", ))] { if let Some(dur) = keepalive.interval { set_keepalive_interval(socket, dur)?; } if let Some(retries) = keepalive.retries { set_keepalive_retries(socket, retries)?; } } Ok(()) } fn set_keepalive_time(socket: TcpSocket, time: ...
Rust
0
thdraw_merkel_proof_bytes = BytesBuilder::default() .extend(withdrawal_nft_proof.iter().map(|v| Byte::from(*v))) .build(); let claim_entries = ClaimTransferCompactNFTEntriesBuilder::default() .owned_nft_keys( CompactNFTKeyVecBuilder::default() .set(owned_nft_keys...
Rust
0
'Const', ' # Not a comment ']], 'Comment!' ]) self.assertEqual(parse_predicate_formula( "# Allow owners\nuser.Access == 'owners' # ignored\n# comment ignored"), ['Comment', ['Eq', ['Attr', ['Name', 'user'], 'Access'], ['Const', 'owners']], 'Allow owners' ]) self.as...
Python
1
d_cloud_plots(df, actual_matrix_sizes) # Create effective depth plot for selected kernel available_kernels = sorted(df['kernel_type'].unique()) print(f"Available kernels: {available_kernels}") print(f"Creating Deff plot for selected kernel: {DEFF_SELECT_KERNEL}") create_single_kernel_deff_plot(df,...
Python
1
) -> ::std::os::raw::c_int; } extern "C" { #[doc = " Retrieve extended statistics of an Ethernet device."] #[doc = ""] #[doc = " @param port_id"] #[doc = " The port identifier of the Ethernet device."] #[doc = " @param ids"] #[doc = " A pointer to an ids array passed by application. This ...
Rust
0
e++){ // high_bit # B(255) // coef+=high_bit<<(5+BitDepth-e) // } // } // for(e=0;e<numExtra;e++){ // coef_bit # B(cat_probs[cat][e]) // coef+=coef_bit<<(numExtra-1-e) // } // return coef } // 6.5 Motion vector prediction // 6.5.1 Find mv refs syntax #[a...
Rust
0
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 // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF AN...
Rust
0
pub whoTo: *mut sctp_nets, pub sctp_next: C2RustUnnamed_732, pub sent: int32_t, pub snd_count: uint16_t, pub flags: uint16_t, pub send_size: uint16_t, pub book_size: uint16_t, pub mbcnt: uint16_t, pub auth_keyid: uint16_t, pub holds_key_ref: uint8_t, pub pad_inplace: uint8_t...
Rust
0
Opcode::RETF | // TODO: this is wrong Opcode::RETURN => { 3 } Opcode::LFENCE | Opcode::MFENCE | Opcode::SFENCE | Opcode::NOP | Opcode::WAIT => { 0 } Opcode::CLFLUSH | Opcode::FXSAVE | Opcode::FXRSTOR | Opcode::XSAVE | ...
Rust
0
"""Fast Avro file iteration. Example usage:: # Reading import fastavro with open('some-file.avro', 'rb') as fo: reader = fastavro.reader(fo) schema = reader.schema for record in reader: process_record(record) # Writing from fastavro import writer schema...
Python
1
t, current_node) } else { (current_node, parent_branch.right) } } else if current_key.is_right(height) { (MergeValue::zero(), current_node) } else { (current_node, MergeValue::zero()) ...
Rust
0
size_x / size_y, 5.) cuts = numpy.where(stroke[:, 0] == 1)[0] start = 0 for cut_value in cuts: ax.plot(x[start:cut_value], y[start:cut_value], 'k-', linewidth=3) start = cut_value + 1 ax.axis('equal') ax.axes.get_xaxis().set_visible(False) ax.axes.get_yaxis().se...
Python
1
lowed to inject interrupts to the target VM. /// - 0 on success if no further action is needed. /// - 1 if it was called by the primary VM and the primary VM now needs to wake up or kick /// the target vCPU. pub fn interrupt_inject( &self, target_vm_id: spci_vm_id_t, ta...
Rust
0
1> for gpio::PB6<Alternate<7>> {} impl PinTx<USART2> for gpio::PA2<Alternate<7>> {} impl PinTx<USART2> for gpio::PD5<Alternate<7>> {} impl PinTx<USART3> for gpio::PB10<Alternate<7>> {} impl PinTx<USART3> for gpio::PC10<Alternate<7>> {} impl PinTx<USART3> for gpio::PD8<Alternate<7>> {} impl PinTx<UART4> for gpio::PA0<Al...
Rust
0
oban.size.1 - height - y_range.start + 1..goban.size.1 - y_range.start + 1, options.style, )); } diagram }; let background = element::Rectangle::new() .set("x", 0) .set("y", 0) .set("width", "100%") .set("height", "100%") .set...
Rust
0
e() } /// Returns the value for the `Output` pub fn value(&self) -> u64 { self.value } } #![allow(non_upper_case_globals)] use core::ptr; use digest::generic_array::typenum::U64; use digest::generic_array::GenericArray; use simd::{vec128_storage, AndNot, Machine, Swap64, VZip, Vec2}; const E8...
Rust
0
=> unimplemented!("Mongo decimals."), // Int (MongoDbType::Int, PrismaValue::Int(b)) => Bson::Int32(b as i32), (MongoDbType::Int, PrismaValue::BigInt(b)) => Bson::Int32(b as i32), (MongoDbType::Int, PrismaValue::Float(b)) => Bson::Int32( b.to_i32() ...
Rust
0
not None: _current_indent_level -= 1 yield "\n" + (" " * (_indent * _current_indent_level)) yield "}" if markers is not None: del markers[markerid] def _iterencode(o, _current_indent_level): if isinstance(o, str): yield _encoder(o) el...
Python
1
import time import argparse import os import cv2 import torch import pickle import numpy as np import pandas as pd from glob import glob from PIL import Image # from natsort import natsorted import matplotlib.pyplot as plt import supervision as sv from ultralytics import YOLO from sam2.build_sam import build_sam2 from ...
Python
1
medical_cause = input ("enter your body temprature") if ("you feel well enough"): print ("you are allowed to travel") else: print ("you are not allowed to travel") if ("your body temprature = < 37"): print ("you are not allowed to travel") else: print ("you are allowed to travel")
Python
1
rayon::prelude::*; use rug::{float::Special, integer::Order, ops::Pow, Float, Integer}; use sha3::{Digest, Sha3_256}; /// Result of a simulation. pub struct Result { /// Amount of simulated rounds. pub rounds: u64, /// Number of wins for each validator. pub wins: Vec<u64>, /// Lowest weight winnin...
Rust
0
fn(&parse_quote! { Door }); let left = quote! { pub fn locked() -> Door { Door::Locked(LockedState::FromInit) } pub fn unlocked() -> Door { Door::Unlocked(UnlockedState::FromInit) } }; let mut right = TokenStream:...
Rust
0
from __future__ import print_function from hotbit import Hotbit #from hotbit import Calculator0 from ase import * from ase.build import molecule from hotbit.test.misc import default_param import sys systems=['C2H6','CH3CH2O','H2COH','H2','C2H6CHOH','isobutane'] energies0=[-153.471502365,-232.206844117,-166.801950557,...
Python
1
volume_mounts, commands.as_ref()).await?; // take client let pvs: Api<PersistentVolume> = Api::all(self.kube_cli.take().unwrap()); // create pv for p in pv_paths { let pv = self.get_pv(&p.name, &p.path, &n.host)?; let _ = pvs.create(&Post...
Rust
0
merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 47, 221], OperandSize::Dword) } #[test] fn vcomisd_2() { run_test(&Instruction { mnemonic: Mnemonic::VCOMISD, operand1: Some(Direct(XMM5)), operand2: Some(Indirect(ECX, Some(OperandSize::Qword), None)), operand3: None, operand4: None, lock: ...
Rust
0
FooImpl { value: String, } impl Foo for FooImpl { fn foo(&self) { println!("FooImpl > foo > value = {}", self.value); } } #[test] fn resolving_component_not_registered_without_parameters_should_err() { let mut container = ContainerBuilder::new().build().unwrap(); let foo = container.resol...
Rust
0
the address pointer and length if addr.is_null() || addr_len == 0 { return_errno!(EINVAL, "no address is specified"); } if addr_len > std::mem::size_of::<libc::sockaddr_storage>() { return_errno!( EINVAL, "addr len cannot be greater than sockaddr_storage's size" ...
Rust
0
unt.subscribe(|count| { assert_eq!(*count, 4); println!("Counted 4 left clicks"); }); button.click(MouseButton::Left); } } <filename>build.rs<gh_stars>0 use std::path::PathBuf; fn main() { let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); let repo = Pat...
Rust
0
# print match # name = "Face" # # i=0 # # for i in match: # # if i==True: # # i+=1 # # # if i!=0: # if match: # name=Name[np.argmin(dis)] # cv2.putText(image, name,...
Python
1
from django.db import models from froala_editor.fields import FroalaField from user.models import User from subdread.models import SubDread, Flair # Create your models here. class Post(models.Model): author = models.ForeignKey(User, related_name='posts', on_delete=models.CASCADE) subdread = models.ForeignKey(...
Python
1
vsync: bool, srgb: bool, shared_context: Option<&'a Context>, ) -> ContextBuilder<'a> { // See #33 - specifying a specific OpenGL version // makes winit crash on older Intel drivers, which is why we // don't specify a specific OpenGL version here let mut builder = ContextBuilder::new(); if ...
Rust
0
f) } } pub struct ClassPath { boot_class_path: Option<Box<dyn Entry>>, } impl ClassPath { pub fn new() -> ClassPath { return ClassPath { boot_class_path: None, }; } pub fn parse(jre_option: &String, cp_option: &Vec<String>) -> ClassPath { let mut class_path = ...
Rust
0
\"Win32_Storage_VirtualDiskService\"`*"] pub const VDS_PF_DYNAMIC: VDS_PROVIDER_FLAG = 1i32; #[doc = "*Required features: `\"Win32_Storage_VirtualDiskService\"`*"] pub const VDS_PF_INTERNAL_HARDWARE_PROVIDER: VDS_PROVIDER_FLAG = 2i32; #[doc = "*Required features: `\"Win32_Storage_VirtualDiskService\"`*"] pub const VDS_...
Rust
0
1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable oh l=E0 l=E0, know what I mean, know what I mean? """).encode('ascii') s = io.BytesIO() g = BytesGenerator(s, policy=self.policy.clone(cte_type='7bit', ...
Python
1
# Import libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # Load dataset df = pd.read_csv("enhanced_anxiety_dataset.csv") # Display basic info print(df.info()) print(df.head()) # Check missing values print(df.isnull().sum()) # Fill or drop missing values based o...
Python
1
# Copyright 2020- The Blackjax 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 applicable law or agreed to i...
Python
1
usize, c: T); /// Clears the buffer. /// /// This operates on the inactive buffer, for double-buffer rendering /// modes. fn clear(&mut self); } /// Pallet mode trait, implemented by bitmap modes with pallet lookup pub trait PalletMode<T> { /// Set the pallet index `i` to the colour `c`. ...
Rust
0
str_name = toolGetWord(line, 0, '|') str_mass = toolGetWord(line, 1, '|') str_abdc = toolGetWord(line, 2, '|') list_mass = toolStr2List(str_mass, ',') list_abdc = toolStr2List(str_abdc, ',') self.dp.myINI.DICT0_ELEME...
Python
1
values to config " "file.") cmd_SAVE_EXTRUDER_VALUES_options = {"EXTRUDER": {"type": "string", "default": "extruder"}} def cmd_SAVE_EXTRUDER_VALUES(self, gcmd): """ Macro call to write tool_stn, tool_stn_unload and tool_sensor_after_extruder variables to con...
Python
1
ored = remove_file(&temp_file()); } #[cfg(test)] mod test { use super::*; use std::path::Path; #[test] fn test_clean() { File::create(&temp_file()).unwrap(); let exercise = Exercise { name: String::from("example"), path: PathBuf::from("tests/fixture/state/pendin...
Rust
0
URnUSn[U[5(dU5eURSn[U[5(dU5eUR n[ U5S:a[[US5OSn[XT5nURm...
Python
1
Error::EnvVarError(std::env::VarError::NotPresent); let err_desc = format!("{}", err); let expected_desc = "environment variable not found".to_string(); assert_eq!(expected_desc, err_desc); } #[test] fn test_env_error_source() { let err = Error::EnvVarError(std::env::VarError::NotPresent); l...
Rust
0
t_group_admin; group_id: i64, user_id: i64, set_admin: i32 => i32), /// 设置群头衔 /// /// 头衔为空则删除头衔 /// /// 时间参数似乎没有效果 /// /// # Examples /// ```should_panic /// use coolq_sdk_rust::api::set_group_special_title; /// /// set_group_special_title(123456, 12345, "头衔", -1).expect("设置失...
Rust
0
@sjeZdZdZeddZeddZeddZeddZe Z e ddZ e ddZ       dddZ dS)RangeSetZrangeSetTr%NcCrCr()i1i2i3i4refr7sheet)r+rrrrrr7rr,r,r-r.rbzRangeSet.__init__rc)r1r2r3r4r r...
Python
1
let i2 = 0.7; assert_eq!(&network.apply(&conf).perform(&[i1, i2])[..], &[i1 * w13 + i2 * w23]); } #[test] fn test_apply_network_with_two_arcs_and_two_outputs_should_succeed() { use std::collections::{BTreeSet, HashMap, HashSet}; use super::common::Node; use super::matrix::Matrix; let w12 = 0.4...
Rust
0
xtern fn rust_eh_unwind_resume() { } //! Event identifiers. /// Event id for after render event. pub const AFTER_RENDER: EventId = EventId("piston/after_render"); /// Event id for controller axis event. pub const CONTROLLER_AXIS: EventId = EventId("piston/controller_axis"); /// Event id for cursor event. pub const CU...
Rust
0
functions: // 1. `setup_<circuit>` // 2. `setup_random_<circuit>` macro_rules! impl_setup_mixer_circuit { ( circuit: $circuit_ty:ident, // circuit type params3_fn: $params3_fn:ident, params5_fn: $params5_fn:ident, leaf_setup_fn: $leaf_setup_fn:ident, tree_setup_fn: $tree_setup_fn:ident ) => { paste! { ...
Rust
0
_F_INTERNAL_ERROR => ReconnectionUnavailableOrCommunication(UnavailableOrCommunication(Communication(InternalError))), SCARD_E_INSUFFICIENT_BUFFER => unreachable!("The maximum buffer was provided for both reader_name and answer_to_reset"), SCARD_E_INVALID_PARAMETER => unreachable!("pcchReaderLen o...
Rust
0
import marimo __generated_with = "0.16.0" app = marimo.App(width="compact") @app.cell(hide_code=True) def _(mo): mo.md( r""" # Ising to QUBO Conversion The Ising problems are expressed through spin variables $\{-1, 1\}$, whilst <span style="font-variant: small-caps;">qubo</span> formulations ar...
Python
1
VerError::ParseError(e.to_string())); } assert_eq!("".parse(), parse_error("expected more input")); assert_eq!(" ".parse(), parse_error("expected more input")); assert_eq!("1".parse(), parse_error("expected more input")); assert_eq!("1.2".parse(), parse_error("expected more inp...
Rust
0
from django.db import models class Book(models.Model): title = models.CharField(max_length=200) author = models.CharField(max_length=100) publication_year = models.IntegerField() def __str__(self): return f"{self.title} by {self.author}, {self.publication_year}"
Python
1
from testing_system.one_rep_var_pattern_generator import OneRepVarPatternGenerator from one_rep_var_patterns.match_one_rep_var_pattern import match_one_rep_var_pattern from testing_system.models import PatternCase from testing_system.greedy_algorithm import greedy_matching_algorithm from tqdm import tqdm def usage_ex...
Python
1
import Sofa.Core from sofasurgsim.interfaces.ros_interface import ROSClient from config.base_config import config as cfg class RobotManager(Sofa.Core.Controller): def __init__(self, *args, ros_client: ROSClient, robot_node, **kwargs): super().__init__(*args, **kwargs) self.ros_client = ros_client ...
Python
1
pi).\n\nFor information about available fields see [sw_mux_ctl_pad_gpio_emc_12](sw_mux_ctl_pad_gpio_emc_12) module"] pub type SW_MUX_CTL_PAD_GPIO_EMC_12 = crate::Reg<u32, _SW_MUX_CTL_PAD_GPIO_EMC_12>; #[allow(missing_docs)] #[doc(hidden)] pub struct _SW_MUX_CTL_PAD_GPIO_EMC_12; #[doc = "`read()` method returns [sw_mux_...
Rust
0
CLOSED; // Event const EVENT_SIGNALED = ZX_EVENT_SIGNALED; // EventPair const EVENTPAIR_SIGNALED = ZX_EVENTPAIR_SIGNALED; const EVENTPAIR_CLOSED = ZX_EVENTPAIR_CLOSED; // Task signals (process, thread, job) const TASK_TERMINATED = ZX_TASK_TERMINATED; ...
Rust
0
eZdZeZdS) ValidationErrN)rrrVALIDATION_ERRr!rrrrrAysrAc@s eZdZdZdZdZdZdZdS)UserDataHandlerzBClass giving the operation constants for UserDataHandler.handle().rrrrN)rrrrZ NODE_CLONEDZ N...
Python
1
acceptance_flow_id', string='Distribution Fact By Plan', copy=False) amount_distribution = fields.Monetary(string='Distribution Amount', compute='_compute_amount', copy=True, precompute=True, store=True) amount_distribut...
Python
1
SENT', 'هرزنامه': 'SPAM', 'پیش‌نویس‌ها': 'DRAFT', 'صندوق ورودی': 'INBOX', # ne (52/73) 'ड्राफ्ट': 'DRAFT', 'ताराङ्कित': 'STARRED', 'पठाइएको मेल': 'SENT', 'महत्त्वपूर्ण': 'IMPORTANT', 'रद्दी टोकरी': 'TRASH', 'स्प्याम': 'SPAM', 'इनबक्स': 'INBOX', # mr (53/73) 'तारांकित': 'STARRED', 'पाठवलेले म...
Python
1
::test] async fn router_response_builder() { let mut response = RouterResponse::builder() .header("a", "b") .header("a", "c") .context(Context::new()) .extension("foo", json!({})) .data(json!({})) .build() .unwrap(); ...
Rust
0
l_grammar.js') with open(dest, 'w', encoding='utf-8') as out: out.write('(function($B){\n') out.write('var grammar = $B.grammar = {\n') for token, descr in grammar.items(): ge = GrammarExpression(token) for x in parse(descr): ge = ge.feed(x) ...
Python
1
pub fn intpwm2(&self) -> INTPWM2_R { INTPWM2_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - PWM3 Interrupt Enable"] #[inline(always)] pub fn intpwm3(&self) -> INTPWM3_R { INTPWM3_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 16 - Interrupt Fault 0"] #[i...
Rust
0
to wasm32-unknown-unknown. Add the following to your \ Cargo.toml file:\n\n\ [lib]\n\ crate-type = [\"cdylib\"]" ) } fn get_dependency_version( dependencies: Option<&HashMap<String, CargoDependency>>, dependency: &str, dependencies_section_name: &str, version_suggestion: &str,...
Rust
0
# Copyright (c) Mysten Labs, Inc. # SPDX-License-Identifier: BSD-3-Clause-Clear import lldb # = LLDB Frame Sizes = # # LLDB Utility to print the current backtrace with estimated stack # frame sizes (useful for figuring out which frames are contributing # most to a stack overflow). # # == Usage == # # (lldb) comma...
Python
1
''' https://leetcode.com/problems/minimum-window-substring/ ''' class Solution: def minWindow(self, s: str, t: str) -> str: # Edge case if t == '': return '' # Hash maps to preserve window and target counts window, countT = {}, {} for ch in t: # Initialize count of each char ...
Python
1
from ibm_watsonx_orchestrate.agent_builder.connections import ( get_application_connection_credentials, get_connection_type, BasicAuthCredentials, BearerTokenAuthCredentials, APIKeyAuthCredentials, OAuth2TokenCredentials, KeyValueConnectionCredentials, ConnectionType ) def basic_aut...
Python
1
fn ignores_index(self) -> bool { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self { // GENERATOR-BEGIN: IgnoresIndexTable // ⚠️This was generated by GENERATOR!🦹‍♂️ Code::Bndldx_bnd_mib | Code::Bndstx_mib_bnd => true, // GENERATOR-END: IgnoresIndexTable _ => false, } } #[must_u...
Rust
0
, last_updated FROM notes WHERE id=?;"; static NOTE_DELETE_SQL: &'static str = "DELETE FROM notes WHERE id = ?;"; static NOTE_SEARCH_SQL: &'static str = "SELECT id, name, content, created, last_updated FROM notes WHERE name LIKE ? OR content LIKE ? ORDER BY id;"; pub struct S...
Rust
0
ze(block_number: T::BlockNumber) { // let number: T::BlockNumber = <<T as frame_system::Trait>::BlockNumber as From<_>>::from(110); // if block_number % number == <<T as frame_system::Trait>::BlockNumber as From<_>>::from(0){ // for acc in Self::nft_holders() { // ...
Rust
0
Preimage { senders_multisig_redeemscripts: senders_multisig_redeemscripts.to_vec(), receivers_multisig_redeemscripts: receivers_multisig_redeemscripts.to_vec(), preimage, }), ) .await?; let maker_private_key_handover = if let MakerToTakerMessage::PrivateKe...
Rust
0
import sys import numpy as np from PyQt5 import QtWidgets, QtGui from MiniGame import MinigameFrame, MinigameWindow pattern = { 'Design Master1': np.array([[0, 0, 0, 0], [0, 2, 1, 0], [0, 1, 2, 0], [0, 0, 0, 0]]), '...
Python
1