text
string
label_name
string
labels
int64
n_loc( origin: OriginFor<T>, #[pallet::compact] loc_id: T::LocId, requester_loc_id: T::LocId, ) -> DispatchResultWithPostInfo { T::CreateOrigin::ensure_origin(origin.clone())?; let who = ensure_signed(origin)?; if <LocMap<T>>::contains_key(&loc_id) { Err(Error::<T>::AlreadyExists)? } else { ...
Rust
0
AD}\u{200B}\u{2060}\u{3000}()\u{FF08}\u{FF09}\u{FF3B}\u{FF3D}.[]/~\u{2053}\u{223C}\u{FF5E}")); named!(pub alpha(CompleteStr) -> char, one_of!("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")); // TODO: Extend with Unicode digits. named!(pub digit(CompleteStr) -> char, one_of!("0123456789")); named!(pub plus...
Rust
0
tag = StringUtils.generate_random_str(10) state = self.qb.add_torrent(content=content, download_dir=save_path, is_paused=True, tag=self._torrent_tags + [tag]) if not state: ...
Python
1
metrics = model.train(tag="transfer_value_baseline") # print(f"Base model metrics: {metrics['test_r2']:.4f} R², {metrics['test_rmse']:.2f} RMSE") # 2. Train trajectory model # trajectory_metrics = model.train_value_trajectory_model() # print(f"Trajectory model metrics: {trajectory_metrics['test_r2...
Python
1
""" Write a python function to find the sum of common divisors of two given numbers. assert sum(10,15) == 6 """ def sum(a, b): """ :param a: int :param b: int :return: int """ if a < b: a, b = b, a result = 0 for i in range(1, a + 1): if a % i == 0 and b % i == 0: ...
Python
1
or 'FreeBSD' license", Some("https://opensource.org/licenses/BSD-2-Clause")), OpenSourceLicenses::GPL => License::new("GNU General Public License (GPL)", Some("https://opensource.org/licenses/gpl-license")), OpenSourceLicenses::LGPL => License::new("GNU Library or 'Lesser' General Public Licens...
Rust
0
from pydantic_settings import BaseSettings from typing import List import os from dotenv import load_dotenv # Load environment variables load_dotenv() class Settings(BaseSettings): # Environment ENVIRONMENT: str = "development" # Server settings HOST: str = "0.0.0.0" PORT: int = 8000 ...
Python
1
mac); MacResult::new_from_owned(mac) } /** * Obtain the result of a Mac computation as [u8]. This method should be used very carefully * since incorrect use of the Mac code could result in permitting a timing attack which defeats * the security provided by a Mac function. */ fn...
Rust
0
''' Compass example =============== This example is a demonstration of Hardware class usage. But it has severals drawbacks, like using only the magnetic sensor, and extrapolating values to get the orientation. The compass is absolutely not accurate. The right way would be to get the accelerometer + magnetic, and comp...
Python
1
RRt get_durationRR+R(R-R/((srenpy/audio/music.pyRGys cCsDy#tjjj|}|jSWntjjr;ndSXdS(N(RRRR RR+R(R-R/((srenpy/audio/music.pyR s...
Python
1
lls due to {}. Using default value of 2", e); 2 }); debug!("soc/#address-cells = {:#x}", soc_address_cells); let soc_size_cells = parse_cells("/proc/device-tree/soc/#size-cells").unwrap_or_else(|e| { warn!( "Failed to parse /proc/device-tree/soc/#size-cells due to {}. Us...
Rust
0
import tensorflow as tf import numpy as np from core.config import cfg from utils.tf_ops.sampling.tf_sampling import gather_by_mask class Sampler: """ Sample assigned proposals out according to mask tensor """ def __init__(self, stage_index): if stage_index == 0: self.sampler_cfg =...
Python
1
num_k = int(input()) num_l = int(input()) num_m = int(input()) num_n = int(input()) counter = 0 for num1_1 in range(num_k, 8 + 1): if num1_1 % 2 != 0: continue for num1_2 in range(9, num_l - 1, -1): if num1_2 % 2 == 0: continue for num2_1 in range(num_m, 8 + 1): ...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2017 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
r(program_pubkey_str).unwrap(); let (programdata_pubkey, _) = Pubkey::find_program_address(&[program_pubkey.as_ref()], &bpf_loader_upgradeable::id()); let programdata_account = rpc_client.get_account(&programdata_pubkey).unwrap(); if let UpgradeableLoaderState::ProgramData { slot: _, ...
Rust
0
&self.blur_texture.view, window, &combine_bind_groups, ); // Copy the result to the render texture target let copy_size = screen_texture_view.extent(); let source_copy_view = wgpu::TextureCopyViewBase{ texture: &self.blur_texture.texture, ...
Rust
0
if pretrained: load_url = model_zoo.load_url(model_urls['resnet18']) model.load_state_dict(load_url) return model, load_url return model def resnet_18_sparse(pretrained=False, **kwargs): model = ResNet(SparseResBasicBlock, [2, 2, 2, 2], **kwargs) return model def resnet_50(pretrain...
Python
1
import pygame import random import sys # Initialize pygame.init() WIDTH, HEIGHT = 500, 500 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Catch the Falling Objects") clock = pygame.time.Clock() # Colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) BLUE = (0, 150, 255) # ...
Python
1
from omnigibson.termination_conditions.termination_condition_base import SuccessCondition import omnigibson.utils.transform_utils as T class ReachingGoal(SuccessCondition): """ ReachingGoal (success condition) used for reaching-type tasks Episode terminates if reaching goal is reached within @distance_tol...
Python
1
_transcript.clone()); let mut prover_channel = TranscriptProverChannel::new(&crs, &verification_transcript, &proof); protocol.verify(&mut prover_channel, &statement).unwrap(); } } <filename>attest/ake/src/lib.rs // Copyright (c) 2018-2022 The MobileCoin Foundation //! MobileCoin SGX-Att...
Rust
0
0\xBD \xED\xB2\xA9"); assert_eq!(e(&[0xD800], &[0xDBFF]).bytes, b"\xED\xA0\x80\xED\xAF\xBF"); assert_eq!(e(&[0xD800], &[0xE000]).bytes, b"\xED\xA0\x80\xEE\x80\x80"); assert_eq!(e(&[0xD7FF], &[0xDC00]).bytes, b"\xED\x9F\xBF\xED\xB0\x80"); assert_eq!(e(&[0x61], &[0xDC00]).bytes, b"\x61\xED...
Rust
0
from app.models import db, PetPersona, PersonaTrait, PersonalityTrait, SpeechStyle class PersonaService: @staticmethod def find_by_persona_id(pet_persona_id): """특정 페르소나 ID로 성격 특징 목록 조회""" traits = PersonaTrait.query.filter_by(pet_persona_id=pet_persona_id).all() return [trait.to_dict()...
Python
1
9ed\xbe\x9e\x18F\x00\xe4\x02\x15\xa5z\x1b\ \xfe\xbc\xffc\x9b\xd7)\xa5E:r\xa5\xae\xf8\xc5\x11\ Iv\x18F\x00)6\xc1ha$U\xef\xe9J?\ -@\xe5\xea,IT\x0c%\x00d\xf8i\x94n\xfa\ \x8c\x1cU\xef\xeb\x94\xd2 \x9e>\xaf\xb6\x9aI\xb8`\ (\x01\xa4 G\xc9\x97\xa6)\xfd4\xa1\xb4#e\x92\ ib8\x01 \xe3[P\xcaoJ\x13\xff<\x82\xe7\ \x99\x84\x0b\x5c\x0...
Python
1
rics(self, hours=24): """Get system metrics for the last n hours""" try: conn = self.get_connection() cursor = conn.cursor() cursor.execute(""" SELECT * FROM system_metrics WHERE timestamp >= datetime('now', '-' || ? ||...
Python
1
a mut W { { self.bit(variant.into()) } } #[doc = "RX_OVER interrupt is masked"] #[inline(always)] pub fn enabled(self) -> &'a mut W { self.variant(M_RX_OVER_A::ENABLED) } #[doc = "RX_OVER interrupt is unmasked"] #[inline(always)] pub fn disabled(self) ...
Rust
0
from dash import Dash, html, dcc import dash_bootstrap_components as dbc import pandas as pd import plotly.express as px from dados import receita, despesas_num_positivo, imposto, Bancos, movimentacoes, tipo_movimentacao app = Dash(external_stylesheets=[dbc.themes.QUARTZ]) server = app.server fig1 = px.pie(tipo_movim...
Python
1
yFlying = 43 FactoryReactor = 40 FactoryTechLab = 39 FusionCore = 30 Ghost = 50 GhostAcademy = 26 GhostAlternate = 144 GhostNova = 145 Hellion = 53 Hellbat = 484 KD8Charge = 830 Liberator = 689 LiberatorAG = 734 MULE = 268 Marauder = 51 Marine = 48 Medivac = 54 MissileTurret = 23 Nuk...
Python
1
= 'c', long)] dont_colorize: bool, /// Wheater to get the absolute path instead of shortening the output #[clap(short, long)] absolute: bool, #[clap(short = 't', long, env = "TRASHY_NO_TITLE")] no_title: bool, } /** * [268] Missing Number * * Given an array nums containing n distinct numbe...
Rust
0
import pandas as pd from invest_assist.models import HighLowTrade from invest_assist.trade import Trade from typing import List from .strategy import Strategy class FindHighLow(Strategy): def __init__(self, df: pd.DataFrame, high: int, low: int): self.df = df.copy() self.high = high self....
Python
1
import torch from transformers import AutoModel, AutoTokenizer class E5Model: def __init__(self, model_name: str) -> None: self.device = "cuda" if torch.cuda.is_available() else "cpu" self.tokenizer = AutoTokenizer.from_pretrained(model_name) self.model = AutoModel.from_pretrained(model_na...
Python
1
Manager test: {e}") finally: if os.path.exists(dummy_file_name): os.remove(dummy_file_name) # Test 3: Upload BytesIO object bytes_content = BytesIO(b"This is some binary data from BytesIO.") bytes_object_key = "tests/s3_tes...
Python
1
hash_from_hash, }; use self::rdf_hash_internal_h::{ librdf_free_hash_datum, librdf_hash_close, librdf_hash_datum, librdf_hash_datum_s, librdf_hash_delete, librdf_hash_exists, librdf_hash_factory, librdf_hash_factory_s, librdf_hash_get_all, librdf_hash_keys, librdf_hash_open, librdf_hash_put, librdf_hash_syn...
Rust
0
().unwrap(), runtime_api.availability_cores)); ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await; }; futures::executor::block_on(future::join(subsystem_task, test_task)); } #[test] fn request_babe_epoch() { let (ctx, mut ctx_handle) = test_helpers::make_subsystem_context(TaskExecutor:...
Rust
0
# SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 import pytest from spdx_tools.spdx.model import ExtractedLicensingInfo def test_correct_initialization(): extracted_licensing_info = ExtractedLicensingInfo("id", "text", "name", ["reference"], "comment") assert extracte...
Python
1
self.assertEqual(type(numerator), int) self.assertEqual(type(denominator), int) def test_square(self): # Multiplication makes a special case of multiplying an int with # itself, using a special, faster algorithm. This test is mostly # to ensure that no asserts in the ...
Python
1
)* } #[allow(nonstandard_style, unused_lifetimes)] pub mod query_stored { use super::*; $(pub type $name<$tcx> = <query_storage::$name<$tcx> as QueryStorage>::Stored;)* } #[derive(Default)] pub struct QueryCaches<$tcx> { $($(#[$attr])...
Rust
0
print("gif_path",gif_path) ani.save(gif_path, fps=100) if __name__ == '__main__': #attention_node_path = './projects/MotionExpertST-GCN/STAGCN_att_node_results_epoch0.json' #attention_matrix_path = './projects/MotionExpertST-GCN/STAGCN_att_A_results_epoch0.json' #node_coordinate_path = './dataset...
Python
1
hema for unpacking schema = [ ("int32", 1), # dtype_code ("int32", 1), # num_words ("int32", 1), # signal_length ("uint64", 1), # state ("int32", 1), # num_symbols ("int32", 1), # num_coeffs ("int32", 1), # num_initial ("uint32", len(symbol_coun...
Python
1
) else: t = np.clip( (step - self.config.warmup_steps) / (self.config.max_steps - self.config.warmup_steps), 0, 1 ) lr = np.exp(np.log(lr_init) * (1 - t) + np.log(lr_final) * t) return lr / lr_init # divided by lr_i...
Python
1
!("{}/{}", self.login, DEFAULT_REPOSITORY_NAME); log::info!("creating default repo {} for {}", repository_name, name); let (repository_id,) = sqlx::query_as::<_, (Uuid,)>( r#"insert into repositories (organization_id, name, owner_id, system) values ($1::uuid, ...
Rust
0
().num_seconds() + 1), String::from(media_file.filename()), String::from(media_file.filename()), media_file.media_type().expect("Reaper requires media type specifying"), ) } } impl ReaperTrack { pub fn new( track_id: String, track_name: String, ...
Rust
0
def milespergallon(miles, gallon): quotient = (miles / gallon) return quotient gallon = 0 total = 0 counter = 0 while not gallon == -1: gallon = float(input("Enter the gallons used(-1 to end): ")) if not gallon == -1: miles = int(input("Enter the miles driven: ")) result = milespergallon(miles, gallon) t...
Python
1
from pwn import * from setcontext32 import * context.binary = elf = ELF("./vuln") libc = ELF("./libc.so.6") #conn = process() conn = remote("34.32.226.3", 1337) def alloc(sz, content): conn.sendlineafter(b"> ", b"1") conn.sendlineafter(b"> ", str(sz).encode()) if sz > 0: conn.sendlineafter(b"> ", content) ...
Python
1
::scalar(&cargo_meta.target_directory), ), ].into_iter() .collect(); let cargo_meta = liquid::Value::Object(cargo_obj); object::insert(&mut data, &[], "cargo".to_string(), cargo_meta)?; Ok(data) } fn dump_data(data: &liquid::Object) -> Result<(), failure::Error> { let mut data = se...
Rust
0
if tenant: auth_body['auth']['tenantName'] = tenant with HTTPConnection( self.hostname, port=self.port, proxy=self.proxy, ssl_context=ssl_context ) as conn: conn.timeout = int(self.options.get('tcp-timeout', 20)) conn.send_request( ...
Python
1
ree. pub type NdTree2D = NdTree<Dim2D>; /// 3D grid represented as an octree. pub type NdTree3D = NdTree<Dim3D>; /// 4D grid represented as a tree with branching factor 16. pub type NdTree4D = NdTree<Dim4D>; /// 5D grid represented as a tree with branching factor 32. pub type NdTree5D = NdTree<Dim5D>; /// 6D grid repre...
Rust
0
stars>1000+ use std::env::{current_dir}; use std::io::{stdout, stderr, Write}; use std::path::Path; use std::sync::Arc; use argparse::{ArgumentParser, Store, StoreOption, List}; use super::config::{find_config_or_exit, Config, Settings}; use super::config::command::MainCommand::{Command, Supervise, CapsuleCommand}; u...
Rust
0
to the elements > 9, or 0x00 otherwise let cmpmask1 = u8x16_gt(masked1, nines); let cmpmask2 = u8x16_gt(masked2, nines); // add '0' or the offset depending on the masks let masked1 = u8x16_add(masked1, v128_bitselect(ascii_a, ascii_zero, cmpmask1)); let masked2 = u8x16_add(mask...
Rust
0
os -> ya no son necesarias ''' Variables_eliminar_train = ['PassengerId','Ticket','Cabin','SibSp','CategoricalFare','CategoricalAge','Name'] Variables_eliminar_test = ['PassengerId','Ticket','Cabin','SibSp','Name'] df_train = df_train.drop(Variables_eliminar_train, axis = 1) df_test = df_test.drop(Variables_eliminar_te...
Python
1
import cocotb from cocotb.triggers import Timer, RisingEdge, Event ############################################################################### # The different kind of reset active level # class RESET_ACTIVE_LEVEL: HIGH = 1 LOW = 0 ########################################################################...
Python
1
urns_array = np.array(portfolio_returns) # 計算 VaR var_95 = np.percentile(returns_array, 5) * 100 # 95% VaR var_99 = np.percentile(returns_array, 1) * 100 # 99% VaR self.metrics["var_95"].labels(portfolio=portfolio, period="daily").set( ...
Python
1
use_bias=True, bias_initializer='zeros') avg_pool = GlobalAveragePooling2D()(input_feature) avg_pool = Reshape((1,1,channel))(avg_pool) assert avg_pool.shape[1:] == (1,1,channel) avg_pool = shared_layer_one(avg_pool) assert avg_pool.shape[1:] ==...
Python
1
color as u8)); yoff += 0.01; } xoff += 0.01; } Model::new(pixels) } fn view(app: &App, model: &Model, frame: Frame) { let draw = app.draw(); draw.background().color(WHITE); for (x, y, color) in &model.pixels { let clr = color.clone(); draw .rect() .x_y(x.clone() as f32, y...
Rust
0
children(&child_entities); Some(effect_entity) } else { let root_entity = commands .spawn_bundle(( Effect::new(manual_despawn), Transform::default(), GlobalTransform::default(), Visibility::default(), Compute...
Rust
0
32 = 0; let mut x582: fiat_secp256k1_u1 = 0; fiat_secp256k1_addcarryx_u32(&mut x581, &mut x582, x580, x530, x564); let mut x583: u32 = 0; let mut x584: fiat_secp256k1_u1 = 0; fiat_secp256k1_addcarryx_u32(&mut x583, &mut x584, x582, x532, x566); let mut x585: u32 = 0; let mut x586: fiat_secp256k1_u1 = 0; ...
Rust
0
y if use_locf: data_func = func.locf(avg_func) elif use_interpolate: data_func = func.interpolate(avg_func) else: data_func = avg_func query = ( select( bucket.label(bucket_label), data_func.label(value_label), ) .group_by(bucket) ...
Python
1
from ....type.rare import Rare from ....type.weap import Bow, WeaponStat, WeaponStatType from ....type.weap.tier import Tier class WindblumeOde(Bow): name: str = "Windblume Ode" seco_stat: WeaponStat = WeaponStat(stat_name=WeaponStatType.elemental_mastery, stat_data=36.0) tier: Tier = Tier.Tier_2 rare...
Python
1
" as *const u8 as *const libc::c_char, b"../xwayland/xwm.c\x00" as *const u8 as *const libc::c_char, 479i32, (*xsurface).pid); wlr_signal_emit_safe(&mut (*xsurface).events.set_pid, xsurface as *mut libc::c_void); } unsafe extern "C" fn read_surface_window_type(mut ...
Rust
0
.raw_os_error(), Some(libc::ELOOP), ); assert_eq!( tmpdir .open_file() .read(true) .lookup_flags(LookupFlags::empty()) .open("/link") .unwrap_err() .raw_os_error(), Some(libc::EXDEV), ); assert_eq!...
Rust
0
import argparse import stf_path from trex_stf_lib.trex_client import CTRexClient from pprint import pprint # sample TRex stateful run # assuming server daemon is running. def minimal_stateful_test(server): print('Connecting to %s' % server) trex_client = CTRexClient(server) print('Connected, start TRex')...
Python
1
#[error("cannot cast `{}` into `{}`", .0, .1)] InvalidCast(String, String), #[error("break outside of loop")] BreakOutsideOfLoop, #[error("continue outside of loop")] ContinueOutsideOfLoop, #[error("expected {} arguments, found {}", .0, .1)] ParamCountMismatch(usize, usize), #[error(...
Rust
0
"tweet-provider was interrupted or encountered an error".into(), }))) .await?; break; } }; log::debug!("sending tweet to {}", addr); // send tweets to all clients during de...
Rust
0
rappers::UnboundedReceiverStream, StreamExt}; /// Creates a [`Scope`] using the current tokio runtime and calls the `scope` method with the /// provided future /// /// # Example /// ``` /// #[tokio::main] /// async fn main() { /// let mut v = String::from("Hello"); /// tokio_scoped::scope(|scope| { /// ...
Rust
0
momo = 0 while momo < 10: print('Hi,hisashi') momo = momo + 1 print('momo = ' + str(momo) + '回目')
Python
1
ording to most sources trainers are no longer /// really used however. This means we can just skip over them if they exist. If they exist /// in the rom they're the 512 bytes after the header. pub fn prg_rom_start_offset(&self) -> usize { if self.lower_mapper_bits & 0x04 != 0 { (ROMHeade...
Rust
0
CompleteStr, Vec<String>>, ws!( do_parse!( ws!(tag!("[")) >> contents: take_until_and_consume!("]") >> ( { let mut result: Vec<String> = vec![]; let cloned = contents.to_string(); let split = clo...
Rust
0
import polars as pl import polars_u256_plugin as u256 def test_u256_namespace_ops_small(): df = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}).with_columns( a=u256.from_int(pl.col("a")), b=u256.from_int(pl.col("b")), ) out = df.with_columns( s=(pl.col("a").u256 + pl.col("b")), ...
Python
1
[i - 128] = (2.0 * PI * 440.0 * (i as f32 * (1.0 / 44100.0))).sin() } for i in 256..384 { comp_3[i - 256] = (2.0 * PI * 440.0 * (i as f32 * (1.0 / 44100.0))).sin() } for i in 384..512 { comp_4[i - 384] = (2.0 * PI * 440.0 * (i as f32 * (1.0 / 44100.0))).sin() ...
Rust
0
"ihr", "sie", "dass", "aus", "über", }, "zh": { "的", "了", "和", "是", "在", "我", "有", "这", "个", "们", "中", "来", "上", "大", "为", "和", "国", ...
Python
1
('🛷', '🛷 Sled'), ('🥌', '🥌 Curling'), ('🥰', '🥰 Smiling Face With 3 Hearts'), ('🥵', '🥵 Overheated'), ('🥶', '🥶 Freezing Face'), ('🥴', '🥴 Woozy Face'), ('🥳', '🥳 Party Face'), ('🥺', '🥺 Pleading Face'), ('🦵', '🦵 Leg'), ('🦶', '🦶 Foot'), ('🦷', '🦷 Tooth'), ('🦴', '🦴 Bone'), ('🦸', '🦸 Superhero'), ('🦹', ...
Python
1
t, which is how kevent uses it. #[derive(Clone, Copy, Debug, PartialEq)] pub enum SigevNotify { /// No notification will be delivered SigevNone, /// The signal given by `signal` will be delivered to the process. The /// value in `si_value` will be present in the `si_value` field of the /// `siginfo...
Rust
0
control properties, start video streams and more. pub enum Device<'a> { /// Can be used to wrap your own struct Custom(Box<dyn 'a + DeviceTrait<'a> + Send>), #[cfg(target_os = "linux")] /// Video4Linux2 device handle V4l2(v4l2::device::Handle), #[cfg(feature = "plat-uvc")] /// Universal Vide...
Rust
0
_eval: break x_src = torch.cat([batch_val["dam"],batch_val["ref"]],0).cuda() x_tgt = batch_val["gt"].cuda() B, C, H, W = x_tgt.shape assert B == 1, "Use batch size 1 for eval."...
Python
1
wrap(); } } check_data(&db, ALL_CFS, kvs.as_slice()); delete_all_files_in_range(&db, b"k2", b"k4").unwrap(); check_data(&db, ALL_CFS, kvs_left.as_slice()); } #[test] fn test_delete_range_prefix_bloom_case() { let path = Builder::new() .prefix...
Rust
0
sary if url: urlparse.uses_netloc.append('redis') url = urlparse.urlparse(url) # URL could contains host, port, user, password and db values app.config[key('HOST')] = url.hostname app.config[key('PORT')] = url.port or 6379 app.config[key('...
Python
1
r_with_box(other_dict, learned_dict) plt.savefig(f'{args.save_dir}/learned_vs_{look_up_str.lower()}.png', dpi=600) plt.close() dicts.append(learned_dict) look_up_strs.append('LEARNED_LSP') # Create a DataFrame for each dictionary and merge them dfs = [pd.DataFrame(list(d.items()), colu...
Python
1
g("binary") .arg(&object_path) .arg(&binary_path) .status() .expect("Objcopy failed!") .success())).then(|| panic!("Objcopy failed!")); vec![binary_path] }<filename>src/secure_bit.rs use core::convert::TryFrom; /// How secure does your encryption need to be? #[derive(Debug,...
Rust
0
see [response2](index.html) module"] pub struct RESPONSE2_SPEC; impl crate::RegisterSpec for RESPONSE2_SPEC { type Ux = u32; } #[doc = "`read()` method returns [response2::R](R) reader structure"] impl crate::Readable for RESPONSE2_SPEC { type Reader = R; } #[doc = "`reset()` method sets RESPONSE2 to value 0"]...
Rust
0
{ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for PlayerInfo { fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { ::protobuf::reflect::ReflectValueRef::Message(self) }...
Rust
0
# GMAT Application Programmer's Interface Example # # Build for GMAT R2020a. Updated as needed. # # Coded by D. Conway. Thinking Systems, Inc. # # This file configures the dynamics for the propagation examples. # # BasicForceModel.py provides a more complete example for users looking for # access to GMAT's dynamics ...
Python
1
f" * Logs : {bot._file_log_dir}\n" if isinstance(bot._proxies, dict): if bot._proxies and bot._proxies != {"all": None}: info += f" * Proxy : Yes\n" print(f"{TEELEBOT}{info}{RESET}") if bot._drop_pending_updates == True and pending_update_count != 0: ...
Python
1
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Page>>( "subpages", |m: &Page| { &m.subpages }, |m: &mut Page| { &mut m.subpages }, )); ::protobuf::reflect::MessageDescri...
Rust
0
let addr = r.borrow().address(); ptr::copy(addr.as_ptr(), dest, Address::len_bytes()); }) } #[no_mangle] pub unsafe extern "C" fn ontio_caller_address(dest: *mut u8) { RUNTIME.with(|r| { let caller = r.borrow().caller(); ptr::copy(caller.as_ptr(), de...
Rust
0
-> Self { Self {} } } impl<'a, 'b> CommandTrait<'a, 'b> for ConfigCmd { fn app(&self) -> App<'a, 'b> { App::new(CMD_NAME).about("Manages the configuration") } } #[async_trait] impl<'a, 'b> CommandAsyncTrait<'a, 'b> for ConfigCmd { async fn run( &self, config: &Config, ...
Rust
0
from distutils.core import setup import distutils.spawn as ds import os, sys cwd = os.path.dirname(os.path.realpath(__file__)) if ds.find_executable('cmake') is None: print("CMake is required to build JET Armadillo") print("Please install cmake version >= 2.6 and re-run setup") sys.exit(-1) arma_path =...
Python
1
eply_text await reply_text(choice(extras.REACTIONS)) return @Gojo.on_message(command("weebify")) async def weebify(_, m: Message): if len(m.text.split()) >= 2: args = m.text.split(None, 1)[1] elif m.reply_to_message and len(m.text.split()) == 1: args = m.reply_to_message.text else:...
Python
1
g.edge(f"task_{task_idx}", f"event_{trigger_event_idx}") dot_filename = task_graph_json_filename.replace(".json", ".dot") g.save(dot_filename) print(f"Graph's dot representation saved as {dot_filename}") # Open with xdot if use_xdot: os.system(f"xdot {dot_filena...
Python
1
array: [Ptr<CatchableType>; 0], } /// Describes a type that can catch this exception. #[derive(Copy, Clone, Debug)] #[cfg_attr(feature = "serde", derive(::serde::Serialize))] #[repr(C)] pub struct CatchableType { /// * `0x01`: simple type (can be copied by memmove) /// * `0x02`: can be caught by reference only /// ...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init class RoomDigitalSignageMaterial(object): _types = { "id": str, "name": str, "material_type": int, "url": str, "duration...
Python
1
discord.ChannelType.news, discord.ChannelType.forum, discord.ChannelType.news_thread, discord.ChannelType.public_thread, discord.ChannelType.private_thread, discord.ChannelType.stage_voice ], min_values=1, ...
Python
1
create Client") } <gh_stars>0 // This file is auto-generated by the build script // Please, do not modify it manually use super::test_markdown_html; #[test] fn gfm_table_test_1() { let original = r##"| foo | bar | | --- | --- | | baz | bim | "##; let expected = r##"<table> <thead> <tr> <th>foo</...
Rust
0
from typing import List class Solution: def squareFreeSubsets(self, nums: List[int]) -> int: MOD = 10**9 + 7 # Primes less than 30 primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] # Create a dictionary for prime factor masks def prime_mask(n): mask...
Python
1
0) } #[doc = "Bits 3:13 - The clock counter for time period of flash auto disable."] #[inline(always)] pub fn flsautodiswd(&self) -> FLSAUTODISWD_R { FLSAUTODISWD_R::new(((self.bits >> 3) & 0x07ff) as u16) } #[doc = "Bits 16:19 - The SRAM size for core1 (CM0+)"] #[inline(always)] pub fn core1_srams...
Rust
0
import numpy as np class Checks(object): @classmethod def _is_dict(class_, input_): return isinstance(input_, dict) @classmethod def _is_1D_array(class_, input_): return input_.ndim != 1 @classmethod def _is_integer_or_float(class_, input_): return any((class_._is_int...
Python
1
ناپذیر", "sirinapazir"), ("زیبا", "ziba"), ("اندیشمند", "andishmand"), ("صبور", "saboor"), ("سحرآمیز", "sehramiz"), ("بردبار", "bordbar"), ("دلسوز", "delsooz"), ("زودرنج", "zoodranj"), ("خوش‌مشرب", "khoshmashrab"), ("گشاده‌رو", "goshaderoo"), ("شجاع", "shoja"), ("دست و دلباز"...
Rust
0
v1: &Option<f64>, v2: &Option<i64>, ) -> Result<Option<f64>> { Ok(Some(v1.unwrap() + v2.unwrap() as f64 - 1.0)) } } let rpn_nodes = vec![ RpnExpressionNode::Constant { value: ScalarValue::Real(Some(1.5))...
Rust
0
#домашнее задание3 #отгадай число import random print("\tДобро пожаловать в игру Отгадай число!") print("Я загадал натуральное число из диапазона от 1 до 100.") print("Постарайтесь отгадать его за минимальное число попыток. Всего попыток 10") tossing = 10 answer = 0 damege = 1 number = random.randint(1, 100) while numb...
Python
1
import os import torch import numpy as np import cv2 from PIL import Image from utils.model_loader import load_config_path from basicsr.archs.rrdbnet_arch import RRDBNet # From Real-ESRGAN repo from realesrgan import RealESRGANer # From Real-ESRGAN repo # Cache model _model = None def load_model(): global _m...
Python
1
ches_eq!(expected, &actual); } #[tokio::test] async fn select_distinct_from_utf8() { let mut ctx = ExecutionContext::new(); let sql = "select 'x' IS DISTINCT FROM NULL as a, 'x' IS DISTINCT FROM 'x' as b, 'x' IS NOT DISTINCT FROM NULL as c, 'x' IS NOT DISTINCT FROM 'x' as d ...
Rust
0
class Solution(object): def numSubarraysWithSum(self, nums, goal): """ :type nums: List[int] :type goal: int :rtype: int """ # initialize variables # dictionary to store prefix sum frequencies prefixSumCount = {0:1} # keep track of running sum ...
Python
1