text
string
label_name
string
labels
int64
(); eprintln!(); insn } pub fn xor(&self, left: Value, right: Value, name: &str) -> Value { let cstr = CString::new(name).unwrap(); let insn = Value(unsafe_llvm!( llvm::core::LLVMBuildXor(self.0, left.0, right.0, cstr.as_ptr()) )); insn.dump(); eprintln!(); insn } //...
Rust
0
t res.dtype == dtyp # The values in SciPy 1.14 agree with those in SciPy 1.9.1 to this # accuracy only. Implementation differences are twofold: # 1. boundary conditions are computed differently # 2. the filter itself uses sosfilt instead of a hardcoded iteration # The boundary co...
Python
1
strip_prefix("--ignore-url=") { let str = format!(r"^{}.*", pattern); ignores.push(Regex::new(&str)?) } else if let Some(pattern) = arg.strip_prefix("--ignore-domain=") { let str = format!(r"https?://([^/.]\.)*{}/", pattern); ignores.push(Regex...
Rust
0
MCC digit 2 | MCC digit 1 | /// +-------------------------------+ /// | MNC digit 3 | MCC digit 3 | /// +-------------------------------+ /// | MNC digit 2 | MNC digit 1 | /// +-------------------------------+ /// | LAC\[0] | /// +-------------------------------+ /// | ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by xiaoqin00 on 2017/7/8 #doc格式转成pdf import sys, os from win32com.client import Dispatch, constants, gencache from optparse import OptionParser # def usage(): # sys.stderr.write ("doc2pdf.py -i input -o [output]") # sys.exit(2) def doc2pdf(input, output)...
Python
1
from flask import Blueprint, render_template, request, redirect, url_for from app import db from app.models import Vehicle bp = Blueprint('main', __name__) @bp.route('/') def index(): vehicles = Vehicle.query.all() return render_template('index.html', vehicles=vehicles) @bp.route('/add', methods=['POST']) de...
Python
1
.tray_handler .update_item(self.id, MenuUpdate::SetSelected(selected)) .map_err(Into::into) } #[cfg(target_os = "macos")] #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] pub fn set_native_image(&self, image: crate::NativeImage) -> crate::Result<()> { self .tray_handler .update_i...
Rust
0
der_year.txt"); assert_error_kind!( parse_txt_header_str(txt).err().unwrap(), ultrastar_txt::parser::ErrorKind::ValueError(7, "YEAR") ); } #[test] fn unknown_note_type() { let txt = include_str!("txts/unknown_note_type.txt"); assert_error_kind!( parse_txt_lines_str(txt).err().un...
Rust
0
from django.urls import path from .views import VenueListView, VenueGEOJsonListView, VenueAdd, VenueDetail, VenueFSA, VenueCounties, VenueTowns, VenueNames urlpatterns = [ path('all/', VenueListView.as_view(), name='venue-list'), path('allgeojson/', VenueGEOJsonListView.as_view(), name='venue-list'), path(...
Python
1
&Self { self.use_conductor_agent_invoker = use_conductor_agent_invoker; self } pub fn use_conductor_agent_invoker(&self) -> bool { self.use_conductor_agent_invoker } /** * Set whether memory mapped files should be pre-touched so they are pre-loaded to avoid later page faul...
Rust
0
bus.as_ptr()); if i2c_ptr.is_null() { Err(I2CError::I2CCreationError) } else { Ok(I2CMaster { i2c_ptr, connection, bus, address, }) } } /// This function reads bytes from the given addre...
Rust
0
<'a> AsRef<str> for Ident<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> Deref for Ident<'a> { type Target = str; fn deref(&self) -> &str { self.as_str() } } // Note: this uses `TryFrom` instead of `FromStr` to support a lifetime on // the `str` the value is being par...
Rust
0
p_err(|e| GetLinksError::SendRequest(e))?; let response = response.error_for_status() .map_err(|e| GetLinksError::ServerError(e))?; let base_url = response.url().clone(); let status = response.status(); let body = response.text() .map_err(|e| GetLinksError::Respon...
Rust
0
_id(&mut self, type_id: TypeId) -> Result<(), sp_externalities::Error> { self.ext.deregister_extension_by_type_id(type_id) } } use std::env; use std::fs::File; use std::io::Write; use std::path::{Path, PathBuf}; use std::process::Command; use anyhow::{Error, Result}; use clap_complete::{generate_to, shells::*}; use...
Rust
0
ain.HIGH: glog.debug('Left is high') else: glog.debug('Left is low') if vdrivetrain.right_gear is VelocityDrivetrain.HIGH: glog.debug('Right is high') else: glog.debug('Right is low') for t in numpy.arange(0, 1.7, vdrivetrain.dt): if t < 0.5: vdrivetrain.Update(throttle=0.00, steering...
Python
1
f = open('code', 'r') total = 0 for line in f: a= len(line.strip()) div = a //2 one = line[:div] two = line[div:-1] letter = '' for x in one: if x in two: letter = x num = ord(letter) if num < 91: total += (num - 38) if num > 90: total += (num - 9...
Python
1
# Copyright (c) 2020, NVIDIA CORPORATION. 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 required by appli...
Python
1
in shape] mask_shape[-3] = num_rows mask_shape[-2] = num_cols return mask.reshape(*mask_shape).astype(np.float32) def calculate_acceleration_mask( self, shape: Sequence[int], acceleration: int, offset: Optional[int], num_acs: int, ) -> np.ndarra...
Python
1
ult<()> { let bank_progress = &mut progress .entry(bank.slot()) .or_insert_with(|| ForkProgress::new(bank.last_blockhash())); let result = Self::verify_and_process_entries(&bank, &entries, &bank_progress.last_entry); bank_progress.num_blobs += num; if let Some(las...
Rust
0
: {:?}", message); } #[tokio::main] async fn main() { dotenv().ok(); env_logger::init(); let token = env::var("CARAPAX_TOKEN").expect("CARAPAX_TOKEN is not set"); let proxy = env::var("CARAPAX_PROXY").ok(); let username = env::var("CARAPAX_ACCESS_USERNAME").expect("CARAPAX_ACCESS_USERNAME"); ...
Rust
0
} } } State::SingleLineEscapeSequence => { let p = self.escape_sequence_p.as_mut().unwrap(); match p.parse(look_ahead_items) { PResult::End => { self.buffer.as_mut().unwrap().extend_tokens(&p.flush()); ...
Rust
0
dynamic routing table // routes:static hash static routing table // accounts:<id> hash information for each account // btp_outgoing // For interactive exploration of the store, // use the redis-cli tool included with your redis install. // Within redis-cli: // keys * ...
Rust
0
#!/usr/bin/env python3 """ 简化的DeepSeek API测试脚本 """ import sys import os import traceback # 添加项目根目录到Python路径 sys.path.append(os.path.dirname(os.path.abspath(__file__))) def test_config(): """测试配置加载""" print("=" * 50) print("测试1: 配置加载") try: from src.core.config import config print...
Python
1
if not remark: remark = nickname gender = '未知' signature = '' label_list = contact_info_list[10].split(',') if contact_info_list[10] else [] region = ('', '', '') if detail: gender_code = detail.get('gender', 0) if gender_code == 1: ...
Python
1
ascii_control_codes = { b"\x00": "NUL (Null char)", b"\x01": "SOH (Start of Heading)", b"\x02": "STX (Start of Text)", b"\x03": "ETX (End of Text)", b"\x04": "EOT (End of Transmission)", b"\x05": "ENQ (Enquiry)", b"\x06": "ACK (Acknowledge)", b"\x07": "BEL (Bell)", b"\x08": "BS (Back...
Python
1
.encode(op, &mut buf).unwrap(); let mut cursor = std::io::Cursor::new(&buf); // magic assert_eq!(cursor.get_u8(), 0xEC); assert_eq!(cursor.get_u8(), 0xAA); // size assert_eq!(cursor.get_u16_le(), 0); // opcode assert_eq!(cursor.get_u8(), opcode::CL_CON...
Rust
0
ntry(root, width=50) entry_site_filter.grid(row=4, column=1, padx=10, pady=10) tk.Button(root, text="Search", command=on_search).grid(row=5, column=0, columnspan=2, pady=20) text_output = tk.Text(root, wrap=tk.WORD, height=20, width=80) text_output.grid(row=6, column=0, columnspan=2, padx=10, pady=10)...
Python
1
1).nest(x), }); coarbitrary!( ['a, K: CoArbitrary + Eq + Hash, V] hash_map::VacantEntry<'a, K, V>; self, var => var.nest(self.key())); coarbitrary!( ['a, K: CoArbitrary + Eq + Hash, V: CoArbitrary] hash_map::OccupiedEntry<'a, K, V>; self, var => var.nest(self.key()).nest(self.get()));<file...
Rust
0
""" UltraAgent is an AI agent with real-world powers to control many applications. Copyright (C) 2024 Olav "Olavorw" Sharma - 4934 Tech This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Founda...
Python
1
return {"results": results_to_write} # Return classified results if targets.parse_only != None: results = Results(targets = targets, classifier = None, prompt_objects = targets.parse_only.prompt_objects) results_from_parsing = results.to_json() return {"results": results_from_parsing} else: resul...
Python
1
om_dset_train(train_pkl, cap_pkl, cate_pkl, file1, file2, wtoi_path, opt.vocab_size, opt.feat_K, opt) myvalid_dset = custom_dset_test(valid_pkl, cap_pkl, cate_pkl, file1, file2, wtoi_path, opt.vocab_size, opt.feat_K, opt) mytest_dset = custom_dset_test(test_pkl, cap_pkl, cate_pkl, file1, file2, wtoi_path, opt.vocab_s...
Python
1
iented source using `Decoder::decode` or `Decoder::decode_interval`. Fetch results using `get_frame` or the `Iterator` interface. MP3 files often begin or end with metadata, which will cause libmad to produce errors. It is safe to ignore these errors until libmad reaches the start of the audio data or the end of th...
Rust
0
= Arc::into_raw(next_epoch_arc.clone()) as *mut Epoch; let old = self.current_epoch.next.compare_and_swap( std::ptr::null_mut(), next_ptr, SeqCst, ); if old != std::ptr::null_mut() { ...
Rust
0
import torch import argparse from pathlib import Path from alphafold.Model import model_config import numpy as np from alphafold.Tests.utils import check_recursive, load_data, get_total_alloc, mem_to_str from alphafold.Model.protein import atom37_to_frames, atom37_to_torsion_angles, make_backbone_frames, frame_aligned_...
Python
1
get(&self.pokemon)?, nickname: self.nickname, level: self.level, gender: self.gender, hp: self.hp, ailment: self.ailment, }) } } use support::{ decl_event, decl_module, decl_storage, dispatch::Result, ensure, traits::{Currency, Lock...
Rust
0
} ag_model_dict[split] = { lat_obj_name: find_best_model(meta, "lat"), "io_mb": find_best_model(meta, "io"), } ag_model = ag_model_dict["val"] else: ag_model = { lat_obj_name: params.ag_model_q_latency, "io_mb": p...
Python
1
ending to {}", arg); socket.send_to(&buf[0..buf.len()], arg).expect("failed to send"); } let mut agent = Agent::new(this); agent.set_handler(|e| { match e { Event::Append(rec) => println!("append: {:?}", rec), Event::Remove(rec) => println!("remove: {:?}", rec), ...
Rust
0
} Ok(()) } <reponame>martindisch/bookclub //! Logic for getting a book. use actix_web::{ error::{Error, ErrorBadRequest, ErrorInternalServerError, ErrorNotFound}, get, web, HttpResponse, Responder, }; use mongodb::{ bson::{self, doc, oid::ObjectId, Document}, Collection, }; use crate::{BookDocument...
Rust
0
idth / n clrs = sns.color_palette("husl", 6) with sns.axes_style('darkgrid'): fig = plt.figure() fig.set_size_inches(15, 7) plt.bar(x, shadow_loss, width=width, label='single_shadow', fc=clrs[0]) for i in range(len(x)): x[i] = x[i] + width plt.bar(x, human_loss, width=width, label='single...
Python
1
u64) { for _ in 0..n_steps { step(bodies) } } fn calculate_energy (bodies: &Vec<Body>, n_steps: u64) -> u64 { let mut state = bodies.to_vec(); steps(&mut state, n_steps); state.iter().map(|body| body.get_total_energy()).sum() } fn gcd (a: u64, b: u64) -> u64 { let mut a = a; let ...
Rust
0
| { constructors.iter().map(move |ctor| { witness.clone().push_wild_constructor(cx, ctor, pcx.ty) }) }).collect()) } result => result } } } } fn is_useful_specialized<...
Rust
0
consecutive_backslash_count = 0; string::const_iterator span_begin = input.begin(); for (string::const_iterator it = input.begin(), end = input.end(); it != end; ++it) { switch (*it) { case kBackslash: ++consecutive_backslash_count; break; case kQuote: result->append(...
Rust
0
r.public()); config.with_user_defined(first_swarm_peer_id_and_addr.clone()) .allow_private_ipv4(true) .allow_non_globals_in_dht(true) .discovery_limit(50) .add_protocol(protocol_id.clone()); config.finish() }; let mut swarm = Swarm::new(transport, behaviour, keypair.public().into_pee...
Rust
0
vec![ r#type("date"), classes, value(v.format("%Y-%m-%d").to_string()), onchange(|input| Msg::TextChange(input.value)), ], vec![], ), Value::DateTime(v) => input( ...
Rust
0
ServiceError::WriteInReadonlyContext => 112, ServiceError::AssertFailed(_) => 113, } } } impl<T: Default> From<ServiceError> for ServiceResponse<T> { fn from(err: ServiceError) -> ServiceResponse<T> { ServiceResponse::from_error(err.code(), err.to_string()) } } use s...
Rust
0
from collections import deque n, m = map(int, input().split()) # 도착점 array = [] for _ in range(n): array.append(list(map(int, input()))) dx = [1, 0, -1, 0] dy = [0, -1, 0, 1] q = deque() q.append((0, 0)) while q: x, y = q.popleft() for i in range(4): nx = x + dx[i] ny = y + dy[i] ...
Python
1
ass if self.nl_colm['USEMPI']: pass if not self.nl_colm['SinglePoint']: self.nblkme = 0 if self.MPI.p_is_io: self.nblkme = len(np.where(self.pio == self.MPI.p_iam_glb)[0]) if self.nblkme > 0: iblkme = 0 ...
Python
1
| double iHeigth [in] The height of the area. The value must be strictly | positive. | | Returns: | Un HRESULT | | S_OK | The print area was successfully defi...
Python
1
def reverse_string(input_string): return input_string[::-1] input_str = input("Enter the string: ") reverse_str = reverse_string(input_str) print(reverse_str)
Python
1
s descarga") confirm = st.checkbox("He descargado mis entregas y quiero borrarlas del servidor") if st.button("🧹 Borrar todas las entregas (.md)", disabled=not confirm): removed = _delete_md_in_folder("entregas") if removed > 0: st.success(f"Se borraron {removed} archivo(s) .md de '...
Python
1
for v in column_mapping.values(): if isinstance(v, str) and v.startswith("$"): all_static = False break if all_static: raise ValidationException( "Column mapping must contain at least one mapping binding, " f"current ...
Python
1
the full GRANDPA voter // NOTE: non-authorities could run the GRANDPA observer protocol, but at // this point the full voter should provide better guarantees of block // and vote data availability than the observer. The observer has not // been tested extensively yet and having most nodes in a network run it ...
Rust
0
, and predicate. fn make_output(qty: u64, flv: Scalar, pred: Predicate) -> Contract { let anchor = Anchor::nonce( [0u8; 32], &Predicate::Opaque(RISTRETTO_BASEPOINT_COMPRESSED), 0, ); Contract { anchor, payload: vec![PortableItem::Value(Value { qty: Commitm...
Rust
0
fn aarch64_vmaxnmv_f32(x: f32x2) -> f32; fn aarch64_vmaxnmvq_f32(x: f32x4) -> f32; fn aarch64_vmaxnmvq_f64(x: f64x2) -> f64; fn aarch64_vminnmv_f32(x: f32x2) -> f32; fn aarch64_vminnmvq_f32(x: f32x4) -> f32; fn aarch64_vminnmvq_f64(x: f64x2) -> f64; fn aarch64_vqtbl1_s8(x: i8x16, y: u8x8) ->...
Rust
0
hash); assert_eq!(hashes[13], k_hash); assert_eq!(hashes[14], n_hash); assert_eq!(hashes[15], o_hash); assert_eq!(hashes[16], s_hash); assert_eq!(hashes[17], v_hash); // TODO uncomment when we have confirmation index // assert_eq!(hashes.len(), 12); // as...
Rust
0
r i in 1 .. xs_.len() { let x = xs_[i].get(txn); *y += *x; } }) }) }, build: None, tangent: None, adjoint: Some({ Box::new(move |_: Pass, this: Val<_>, _state: RefMut<Self>, sink: &mut Sink| { if let Some(this_adj) = thi...
Rust
0
, RpcControlError>>, ), UnvaultTx( (OutPoint, UnvaultTransaction), SyncSender<Result<(), RpcControlError>>, ), ListPresignedTransactions( Option<Vec<OutPoint>>, SyncSender<Result<Vec<VaultPresignedTransactions>, RpcControlError>>, ), ListOnchainTransactions( ...
Rust
0
sics_matrices().to(device) color_images = torch.tensor(np.array(color_images), device=device).permute(0, 3, 1, 2) # shape (N, 3, H, W) depth_images = torch.tensor(np.array(depth_images), device=device).permute(0, 3, 1, 2) # shape (N, 1, H, W) CONSOLE.print("Integrating the TSDF") for i in range(0, le...
Python
1
ontext.round_wind { reasons.push(FuReason::YakuhaiPairRoundWind); } if &division.remaining[0] == &context.player_wind { reasons.push(FuReason::YakuhaiPairPlayerWind); } if division.remaining[0].is_colour() { reasons.push(FuReason::YakuhaiPairColours); ...
Rust
0
args.limit) params['limit'] = parsed_args.limit params['marker'] = parsed_args.marker if parsed_args.detail: params['detail'] = parsed_args.detail columns = res_fields.RUNBOOK_DETAILED_RESOURCE.fields labels = res_fields.RUNBOOK_DETAILED_RESOURCE.labels ...
Python
1
re_as_shader_resource::<ColorFormat>(&tex, levels, format::Swizzle::new()) .unwrap(); Ok((tex, view)) } pub fn load_cubemap( factory: &mut gfx_device_gl::Factory, mut data: Vec<Cursor<Vec<u8>>>, ) -> Result< ( gfx::handle::Texture<Resources, gfx::format::R8_G8_B8_A8>, gfx::handl...
Rust
0
_snake_case)] #[derive(Default, Deserialize)] struct SignInUpUserResponse { localId: String, idToken: String, refreshToken: String, } #[allow(non_snake_case)] #[derive(Serialize)] struct SignInUpUserRequest { pub email: String, pub password: String, pub returnSecureToken: bool, } fn sign_up_in...
Rust
0
# TODO: Support RegExp. with assertRaises(TypeError): await env.PythonRpc.identity(js.RegExp.new("ab+c", "i")) with assertRaises(TypeError): await env.PythonRpc.identity(lambda x: x + x) with assertRaises(TypeError): def my_func(): pass await env.PythonRpc.id...
Python
1
#!/usr/bin/env python3 """ 日志查看和分析脚本 方便查看和分析应用日志 """ import os import sys import argparse from datetime import datetime, timedelta from pathlib import Path import re # 项目根目录 PROJECT_ROOT = Path(__file__).parent.parent LOG_FILE = PROJECT_ROOT / 'logs' / 'app.log' def print_header(title): """打印标题""" print("=" ...
Python
1
pty()); assert_eq!(messages[0].exchange, $exchange.to_string()); assert_eq!(messages[0].market_type, $market_type); assert_eq!(messages[0].msg_type, $msg_type); for msg in messages { assert!(parse(msg)); } }}; } #[allow(unused_macros)] macro_rules! gen_test_crawl...
Rust
0
from typing import Union, Optional, Tuple, List, Dict, Any import asyncpg from asyncpg import Connection from asyncpg.pool import Pool from data import config def logger(statement): print(f""" _____________________________________________________ Executing: {statement} ___________________________________...
Python
1
impl From<Trap> for Error { fn from(trap: Trap) -> Error { let mut code = OutterTrapCode::Unknown; if let Some(cc) = trap.trap_code() { code = match cc { TrapCode::BadConversionToInteger => OutterTrapCode::BadConversionToInteger, TrapCode::BadSignature => ...
Rust
0
::from(self.get_reg32(IXGBE_GOTCL)) + (u64::from(self.get_reg32(IXGBE_GOTCH)) << 32); stats.rx_pkts += rx_pkts; stats.tx_pkts += tx_pkts; stats.rx_bytes += rx_bytes; stats.tx_bytes += tx_bytes; } /// Resets the stats of this device. fn reset_stats(&mut self) { self....
Rust
0
<filename>lumen_runtime/src/otp/erlang/tests/monotonic_time_1.rs<gh_stars>1-10 use super::*; use proptest::strategy::Strategy; mod with_atom; mod with_small_integer; #[test] fn without_atom_or_integer_errors_badarg() { with_process_arc(|arc_process| { TestRunner::new(Config::with_source_file(file!())) ...
Rust
0
) >= &Version(Api::GlEs, 1, 0) { false } else { unreachable!(); } } /// Creates a new buffer. /// /// # Panic /// /// Panics if `mem::size_of_val(&data) != size`. unsafe fn create_buffer<D: ?Sized>(mut ctxt: &mut CommandContext, size: usize, data: Option<&D>, ...
Rust
0
ysql.log'), 'maxBytes': 1024 * 1024 * 10 }, }, 'loggers': { 'django': { 'handlers': ['null'], 'level': 'ERROR', 'propagate': True, }, 'django.request': { 'handlers': ['console'], 'level': 'ERROR', 'propagate'...
Python
1
self.num_levels, self.num_points) # TODO: try remove sampling offsets offset_normalizer = torch.stack( [spatial_shapes[..., 1], spatial_shapes[..., 0]], -1) # changed to (h, w) _, _, num_points, _ = reference_p...
Python
1
) } fn encode(&self, buf: &mut BytesMut) { encode_detach_inner(self, buf) } } #[derive(Clone, Debug, PartialEq)] pub struct End { pub error: Option<Error>, } impl End { pub fn error(&self) -> Option<&Error> { self.error.as_ref() } #[allow(clippy::identity_op)] const FIELD...
Rust
0
_token="r", userinfo={}, realm="realm") ids = store.list_session_ids() assert "a" in set(ids) # TTL returns the dummy value assert store.get_ttl("a") == 2100 assert store.get_ttl("b") == 2100 def test_nonce_lifecycle(store): # store_nonce and get_nonce should round-trip the JSON-able object ...
Python
1
til.CLVar('') env['RCSUFFIXES']=['.rc','.rc2'] env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES' env['BUILDERS']['RES'] = res_builder env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.obj' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX...
Python
1
freeing_skrach_uglogwee(c: &RegionCombination) -> bool { c[Region::Kandarin] } fn count_subquests(c: &RegionCombination) -> u8 { freeing_awowogei(c) as u8 + freeing_mountain_dwarf(c) as u8 + freeing_goblin_generals(c) as u8 + freeing_pirate_pete(c) as u8 + freeing_lumbridge_gui...
Rust
0
.chain(crc.to_be_bytes().iter()) .copied() .collect(); let chunk = Chunk::try_from(chunk_data.as_ref()).unwrap(); let chunk_string = chunk.data_as_string().unwrap(); let expected_chunk_string: String = String::from("This is where your secret messag...
Rust
0
lippy::trivially_copy_pass_by_ref)] // needs to match signature for use in serde attribute #[inline] pub const fn is_false(v: &bool) -> bool { !(*v) } <gh_stars>0 #![forbid(unsafe_code)] //! This crate houses all code for the level editor. #[macro_use] extern crate log; pub mod components; pub mod resources; pub...
Rust
0
} else { format!("{}", nr_rools) } } //! build my own async executor #[macro_use] extern crate log; mod executor; use custom_futures::TimerFuture; fn main() { simple_logger::SimpleLogger::new().with_level(log::LevelFilter::Info).init().unwrap(); futures::executor::block_on( test_run()); } ...
Rust
0
= "Sets the USB device address, in order to ignore packets going to other devices on the bus. This value is reset when the host issues a USB Device Reset condition.\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_z...
Rust
0
# Copyright 2021 The SODA 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 in wri...
Python
1
OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] rg [OPTIONS] --files [<path> ...] rg [OPTIONS] --type-list", ) .help_template( "\ {bin} {version} USAGE:{usage} FLAGS: {flags}", ); assert!(utils::compare_output( app, "rg --help", RIPGREP_USAGE, ...
Rust
0
ck_filter_frame<T: Pixel>( fi: &FrameInvariants<T>, fs: &mut FrameState<T>, blocks: &FrameBlocks, ) { let fs_rec = Arc::make_mut(&mut fs.rec); for pli in 0..PLANES { deblock_plane(fi, &fs.deblock, &mut fs_rec.planes[pli], pli, blocks); } } fn sse_optimize<T: Pixel>( fi: &FrameInvariants<T>, fs: &mut Fram...
Rust
0
}") if raza != None: print(f"Filtrando por Raza: {raza}") self._values_filtrados = self._values_filtrados[self._values_filtrados["Raza"] == raza] print(f"Después del filtro de Raza: {self._values_filtrados.shape}") if sexo != None: print(f"Filtrando por ...
Python
1
rents, ..Header::default() }, ..Certificate::default() }; (certificate.digest(), certificate) } // Creates one certificate per authority starting and finishing at the specified rounds (inclusive). // Outputs a VecDeque of certificates (the certificate with higher round is on the fro...
Rust
0
print("📱 You can open this URL in a browser to test WebSocket connections") print("⏹️ Press Ctrl+C to stop all services") # Wait for interrupt try: await server_task except KeyboardInterrupt: print("\n⏹️ Stopping serv...
Python
1
wrap_or(false); if some_required { FieldArity::Required } else { self.ast_field().arity } } /// Used for validation. pub fn references_singular_id_field(self) -> bool { let singular_referenced_id = match self.attributes().references.as_deref() { ...
Rust
0
match value { ServiceCapability::MediaCodec { media_type: avdtp::MediaType::Audio, codec_type, codec_extra, } => { match codec_type { &MediaCodecType::AUDIO_SBC => { let _ = SbcCod...
Rust
0
delay = Delay::new(cp.SYST, clocks); reset_si4703(&mut rst, &mut sda, &mut delay).unwrap(); let sda = sda.into_alternate_open_drain(&mut gpiob.crh); let i2c = BlockingI2c::i2c1( dp.I2C1, (scl, sda), &mut afio.mapr, Mode::Fast { frequency: 400_000.hz(), ...
Rust
0
from langchain_community.agent_toolkits.slack.toolkit import SlackToolkit __all__ = ["SlackToolkit"]
Python
1
cify ``%s`` attributes that are consistent for each species and for the multi species catalog; " % name) return _vals[0] def split_column(col, species): """ Split the column name of the form 'species/name' """ fields = col.split('/') if len(fields) != 2: msg = "new column names should ...
Python
1
audit logs admin_service = AdminService(db) recent_logs = admin_service.get_admin_audit_log(limit=1) last_ingest_time = recent_logs[0]["timestamp"] if recent_logs else None return { "totalUsers": total_users, "totalTeams": total_teams, "totalLeagues":...
Python
1
{ " " }; // Format the Power Indicator and set the label let mut buf = new_string(); write!( &mut buf, // Write the formatted text "{} {}%{}#\nLOVE ({}mV)\0", // Must terminate Rust strings with null color, perc...
Rust
0
e: table_platform = table['platform'].lower() if len(table['campaign']) > 0: campaign_platform = { "file": "simulate/{}/intro".format(table_platform), "sections": [ { "file": "simulate/{}/...
Python
1
for j in (0..M) { for i in (0..N) { for l in (j..M) { for k in (i..N) { let sum = Solution::sum_submatrix(&matrix_sum, i, j, k, l); if sum == target { return sum; } e...
Rust
0
# -*- coding: utf-8 -*- # Author: Ilya Gusev # Description: Loss calculation. import torch import torch.nn as nn from utils.vocabulary import Vocabulary from src.models import Discriminator class DiscriminatorLossCompute: def __init__(self, discriminator: Discriminator): self.discriminator = discriminat...
Python
1
} if let Some(T![@]) = p.peek() { directive::directives(p); } if let Some(T!['{']) = p.peek() { field::fields_definition(p); } } /// See: https://spec.graphql.org/draft/#InterfaceTypeExtension /// /// *InterfaceTypeExtension*: /// **extend** **interface** Name ImplementsInter...
Rust
0
# 17 - Verificação de Palíndromo: # Escreva um programa que solicite uma palavra ao usuário e # use um laço while para verificar se a palavra é um palíndromo # (lê-se da mesma forma de trás para frente). word = input('Digite a palavra: ') for letter in word: if word == letter: print('lett') print(letter)
Python
1
import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, js_to_json, parse_duration, ) class NTVDeIE(InfoExtractor): IE_NAME = 'n-tv.de' _VALID_URL = r'https?://(?:www\.)?n-tv\.de/mediathek/videos/[^/?#]+/[^/?#]+-article(?P<id>.+)\.html' ...
Python
1
} const MIN_SIZE: usize = 2048; const CUTOFF_SIZE: usize = 128 * 1024; const MAX_SIZE: usize = 4 * 1024 * 1024; // Buffer allows writing packets to an intermediate buffer, which can then be read form. // This is verify similar to bytes.Buffer but avoids combining multiple writes into a single read. struct BufferInte...
Rust
0