text
string
label_name
string
labels
int64
}' | // ệ [LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW] '\u{2091}' | // ₑ [LATIN SUBSCRIPT SMALL LETTER E] '\u{24D4}' | // ⓔ [CIRCLED LATIN SMALL LETTER E] '\u{2C78}' | // ⱸ [LATIN SMALL LETTER E WITH NOTCH] '\u{FF45}' // e [FULLWIDTH LATIN SMALL LETTER E] => Some("e"...
Rust
0
import click import torch import pathlib from matplotlib import pyplot as plt from tinyfold.models.esmfold import ESMFold @click.command() @click.option("--device", default="cpu") @click.option("esm_path", "--esm", type=click.Path(exists=True), default="./data/esm2_t36_3B_UR50D.pt") @click.option( "esmfold_path"...
Python
1
from app import create_server # Create a new instance of the SmartFeeder server # This initializes the Flask application, registers routes, # sets up socket events, and initializes the database server = create_server() # Export the Flask application instance for use with WSGI servers app = server.app if __name__ ...
Python
1
{ fn is_pausing_requested(&self) -> bool; fn get_unpausable_task_count(&self) -> u32; } impl PausabilityStateTrait for PausabilityState { fn is_pausing_requested(&self) -> bool { *self & PAUSING_REQUESTED_MASK > 0 } fn get_unpausable_task_count(&self) -> u32 { *self & UNPAUSABLE_...
Rust
0
s.softmax_scale) gate = [item.detach().cpu().numpy() for item in gate] gate_list.append(gate) return gate_list def print_args(args): dict = vars(args) print('arguments:--------------------------') with open(args.root_path+'/arguments.txt', 'w') as f: for key in dict.keys(): ...
Python
1
624021456704541],[0.106383290505281],[0.082728996731839],[0.0854908786657617],[0.125938816535883],[0.0813210335318743],[0.099588301495868],[0.0865549873691926],[0.0568122628063143],[0.209996278112163],[0.118661691424058],[0.0674093855176452],[0.255935764426958],[0.10060807793378],[0.477769377633249],[0.0922355290406963...
Python
1
"".format(**assets) raise WebpackError(error) raise WebpackLoaderBadStatsError( "The stats file does not contain valid data. Make sure " "webpack-bundle-tracker plugin is enabled and try to run " "webpack again.") class FakeWebpackLoader(WebpackLoader): """...
Python
1
d to mint {token_name}") except Exception as e: logger.error(f"{account_index} | Error minting {token_name}: {str(e)}") continue finally: random_pause = random.randint( config.SETTINGS.PAUSE_BETWEEN_SWAPS[0], ...
Python
1
_place) } (Some(xorout), false) => { let poly_no_xorout = add(&p, xorout); (poly_no_xorout, l) } }; ret_vec.push(appendix); prev = (p, l); } (ret_vec, xor_ret) } fn find_polyhull( spec: &RevInfo, polys: Vec<Init...
Rust
0
.output_dir.join("metadata.csv"); let mut out = File::create(csv_path).unwrap(); out.write_all("char, page_id, x, y, width, height\n".as_bytes()).unwrap(); for i in &self.metadata { let line = format!( "{}, {}, {}, {}, {}, {}\n", ...
Rust
0
# import pandas, numpy, and matplotlib import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler pd.set_option('display.width', 69) pd.set_option('display.max_columns', 7) pd.set_option('display.max_rows', 200) pd.options.displ...
Python
1
from django.shortcuts import render,HttpResponse,redirect from king_admin import king_admin from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils.safestring import mark_safe from django.db.models import Q from king_admin.form import dynamic_class from king_admin import permission d...
Python
1
f there are multiple subdirectory values, use the first one. # This matches the behavior of Link.subdirectory_fragment. subdirectory = fragment["subdirectory"][0] except (IndexError, KeyError): subdirectory = "" # If there are multiple hash values under the same algorithm, use the # ...
Python
1
database not initialized"); // Save the feed in the database. match feed { Ok(Feed::Rss(_)) => { database.try_create_feed(self.url.as_str(), 1 /* 1 = RSS */)?; } Ok(Feed::Atom(_)) => { database.try_create_feed(self.url.as_str(), 2 /* 2...
Rust
0
# coding: utf-8 # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
Python
1
# pynanosvg # # pip install svglib # # - https://pypi.org/project/svglib/ # - https://github.com/deeplook/svglib # # pygame.Surface object # https://www.pygame.org/docs/ref/surface.html # # SVG rendering in a PyGame application. Prior to Pygame 2.0, Pygame did not support SVG. Then how did you load it? # https:...
Python
1
RPQ_R::new((self.bits & 0xffff) as u16) } } <gh_stars>1-10 use crate::atom::Atom; use fxhash::FxHashMap; use std::sync::Arc; #[derive(Debug)] pub struct Edif { pub libs: FxHashMap<Atom, Library>, pub design: Design, } #[derive(Debug)] pub struct Design { pub inst_name: Atom, pub cellref: Atom, ...
Rust
0
from conexion import conectar import sqlite3 def registrar(nombre, apellidos, empresa, telefono, email, direccion): try: con = conectar() cursor = con.cursor() sentencia_sql = ''' INSERT INTO contacto( nombre, apellidos, empresa, telefono, email, direccion) values (...
Python
1
eters['unbound_probes_per_bound'] = localization_parameters['unbound_probes_per_bound']*noise_level single_localization_parameters['random_noise_per_blinks'] = localization_parameters['random_noise_per_blinks']*noise_level single_combination_parameters['segments_per_sim'] = 2 output_dir2 = outp...
Python
1
.str() .map_or(String::from("today"), |v| v.to_owned()), ); } else { panic!("Export type '{}' currently not supported", export_type); } } /// Export to a markdown file with the given file path. fn export_to_markdown(file_path: &str, filter: String) { let (from_timestamp, ...
Rust
0
, #[serde(rename = "720p60")] P720Hz60, #[serde(rename = "720p60 HDR")] P720Hz60HDR, #[serde(rename = "1080p")] P1080, #[serde(rename = "1080p50")] P1080Hz50, #[serde(rename = "1080p60")] P1080Hz60, #[serde(rename = "1080p60 HDR")] P1080Hz60HDR, #[serde(rename = "1440...
Rust
0
</a> {bin_info} """ await loading_message.delete() await message.reply(mess, parse_mode=enums.ParseMode.HTML, disable_web_page_preview=True) else: mess = f""" 𝗖𝗖 𝗚𝗘𝗡𝗘𝗥𝗔𝗧𝗘𝗗 ✅ [ϟ] 𝗔𝗹𝗴𝗼: 𝗟𝘂𝗵𝗻 [ϟ] 𝗔𝗺𝗼𝘂𝗻𝘁: <code>{amount}</code> [ϟ] 𝗘𝘅𝘁𝗿𝗮𝗽: <code>{text}</code> [ϟ] ...
Python
1
c_char; } extern "C" { pub fn swab(arg1: *const ::libc::c_void, arg2: *mut ::libc::c_void, arg3: isize); } extern "C" { pub fn bcmp(arg1: *const ::libc::c_void, arg2: *const ::libc::c_void, arg3: usize) -> ::libc::c_int; } extern "C" { pub fn bcopy(arg1: *const ::libc::c_void...
Rust
0
Ok(()) } fn redraw_screen( canvas: &mut Canvas<Window>, pixel_states: [[bool; SCREEN_Y]; SCREEN_X], ) -> Result<(), String> { for i in 0..pixel_states.len() { for j in 0..pixel_states[i].len() { if pixel_states[i][j] { canvas.set_draw_color(WHITE) } els...
Rust
0
= (instruction & 0x00ffu16) as u8; return format!("RND V{:x}, 0x{:0>2x}", x, kk); }, 0xd => { // Dxyn - DRW Vx, Vy, nibble let x = ((instruction >> 8u16) & 0x000fu16) as u8; let y = (instruction >> 4u16 & 0x000fu16) as u8; let n = (instruction...
Rust
0
""" A script to check the stress calculation """ from random import random import numpy as np from ase.build import bulk from ase.db import connect from ase import units from pyxtal_ff import PyXtal_FF from pyxtal_ff.calculator import PyXtalFFCalculator import warnings warnings.simplefilter("ignore") des, folder =...
Python
1
pixels() .map(|p| p.channels()) .map(|p| Pixel::new(p[0], p[1], p[2])) .collect::<Vec<Pixel>>(); Ok(Image::new( image.height() as usize, image.width() as usize, pixels, )) } } use classfile_parser::*; use classfile_parser::cons...
Rust
0
default(); let mut expected_lines: Vec<Str<'static>> = Vec::new(); let mut expected: Vec<Vec<Str<'static>>> = corpus .split(rs as char) .map(|line| { expected_lines.push(Str::from(line)); if line.len() == 0 { // For an empty lin...
Rust
0
#!/usr/bin/python # # \file 1_export.py # \brief Export ps # \date 2010-05-24 13:42GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export ps # # NeL - MMORPG Framework <https://wiki.ryzom.dev/> # Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute ...
Python
1
feature = "std", test))] use sp_version::NativeVersion; use sp_version::RuntimeVersion; use node_primitives::*; use pallet_staking::{EraIndex, Exposure, ExposureOf, StashOf}; // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); /// Runtime version. pub con...
Rust
0
de_Bool: &'static str = "directMode"; pub const k_pch_SteamVR_DirectModeEdidVid_Int32: &'static str = "directModeEdidVid"; pub const k_pch_SteamVR_DirectModeEdidPid_Int32: &'static str = "directModeEdidPid"; pub const k_pch_SteamVR_UsingSpeakers_Bool: &'static str = "usingSpeakers"; pub const k_pch_SteamVR_SpeakersForw...
Rust
0
from flet import * def create_view(page: Page): return View( "/procurar", [ AppBar(title=Text("Procurar", color='black'), bgcolor=colors.AMBER_700), # Adicione aqui os componentes da tela de procura ] )
Python
1
# pysqlite2/__init__.py: the pysqlite2 package. # # Copyright (C) 2005 Gerhard Haring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software...
Python
1
#!/usr/bin/env python # -*-coding:utf-8 -*- ''' @File : setup5.py @Time : 2023/01/31 14:15:08 @Author : Muhammed Patel @Version : 1.0 @Contact : m32patel@uwaterloo.ca @License : (C)Copyright 2022-2023, VIP Lab @Desc : None ''' _base_ = ['../_base_/base.py'] SCENE_VARIABLES = [ # -- Sentine...
Python
1
); } #[test] fn hyperbridge_mpmc() { let (sender, receiver) = channel::new(); let counter = Arc::new(AtomicUsize::new(0)); let mut handles = vec![]; for i in 0..THREADS { let ch = sender.clone(); let jh = thread::spawn(move || { for _ in 0..VALUES { ch.send...
Rust
0
s """ tokenizer = _get_punkt_tokenizer(language) return tokenizer.tokenize(text) # Standard word tokenizer. _treebank_word_tokenizer = NLTKWordTokenizer() def word_tokenize(text, language="english", preserve_line=False): """ Return a tokenized copy of *text*, using NLTK's recommended word to...
Python
1
estores without throwing an error when attributes are None.""" # restore state with None values attributes = { "brightness": None, "off_with_transition": None, "off_brightness": None, "color_mode": None, "color_temp": None, "xy_color": None, "hs_color": N...
Python
1
{ Self { plugboard: Plugboard::new(language), rotors: vec![ Rotor::from(RotorType::III), Rotor::from(RotorType::II), Rotor::from(RotorType::I), ], reflector: Reflector::from(ReflectorType::B), } } f...
Rust
0
= "x86_64"), not(feature = "force-soft") ))] { mod autodetect; mod ni; pub use autodetect::{Aes128, Aes192, Aes256}; #[cfg(feature = "ctr")] pub use autodetect::ctr::{Aes128Ctr, Aes192Ctr, Aes256Ctr}; } else { pub use soft::{Aes128, Aes192, Aes256}; ...
Rust
0
from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = ( "gmail.com", "yahoo.com", "hotmail.com", "yahoo.com.au", "hotmail.com.au", ) tlds = ( "com", "com.au", "org", "org.au", "net...
Python
1
def call_strings(self, command_name: str, args: Sequence[str]) -> Any: """ Call a command using a list of string arguments. May raise CommandError. """ if command_name not in self.commands: raise exceptions.CommandError("Unknown command: %s" % command_name) retu...
Python
1
XED_IFORM_V4FNMADDPS_ZMMf32_MASKmskw_ZMMf32_MEMf32_AVX512 = 1937, XED_IFORM_V4FNMADDSS_XMMf32_MASKmskw_XMMf32_MEMf32_AVX512 = 1938, XED_IFORM_VADDPD_XMMdq_XMMdq_MEMdq = 1939, XED_IFORM_VADDPD_XMMdq_XMMdq_XMMdq = 1940, XED_IFORM_VADDPD_XMMf64_MASKmskw_XMMf64_MEMf64_AVX512 = 1941, XED_IFORM_VADDPD_...
Rust
0
_SCGCUART_S5R { let bits = ((self.bits >> 5) & 1) != 0; SYSCTL_SCGCUART_S5R { bits } } #[doc = "Bit 6 - UART Module 6 Sleep Mode Clock Gating Control"] #[inline(always)] pub fn sysctl_scgcuart_s6(&self) -> SYSCTL_SCGCUART_S6R { let bits = ((self.bits >> 6) & 1) != 0; SYSC...
Rust
0
; } let limbs = v.limbs_mut(); // Read in data if cfg!(target_endian = "little") { let num_bytes = num_limbs * std::mem::size_of::<Limb>(); unsafe { let buf: &mut [u8] = std::slice::from_raw_part...
Rust
0
/// </p> pub job_name: std::option::Option<std::string::String>, /// <p> /// This parameter limits the response to the export jobs with the specified job status. /// </p> pub job_status: std::option::Option<crate::model::JobStatus>, /// <p> /// This parameter limits the response to FHIR expo...
Rust
0
validityRange = cms.EventRange("310001:min - 339999:max"), mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_totem_timing_2018.xml"), maskFileNames = cms.vstring() ), # 2022 cms.PSet( validityRange = cms.EventRange("340000:min - 999999999:max"), mappingFileNames = c...
Python
1
in a new IPC namespace. const NEWIPC = 1 << 27; /// create the process in a new user namespace const NEWUSER = 1 << 28; /// create the process in a new PID namespace const NEWPID = 1 << 29; /// create the process in a new net‐work namespace. ...
Rust
0
<'_, Self>, c: C, n: N, ) -> Option<ArenaRc<Self>> { let mut guard = self.inner().strong_pinned_lock(); let this = guard.get_strong_pinned_mut(); let mut empty: Option<NonNull<StaticArc<T>>> = None; for mut entry in this.entries().iter_mut() { if !entry.a...
Rust
0
== unsafe { cursor } { let _ = write!(line.begin(), "> "); } else { let _ = write!(line.begin(), " "); } let _ = write!(line.append(), "{}", item); } } use actix_web::client::Client; use actix_web::error; use actix_web::web::BytesMut; use actix_web::Error; use actix...
Rust
0
== "1": # login usuario return indice de usuario en lista usuario = longin(usuario_DB) if usuario != "No_Existe": # nivel de Poder: 0. usuario nuevo , 1. usuario , 2. administrador if usuario["nivel"] == 0: menu_usuario(usuario) ...
Python
1
base = base * base; } result } fn carrying_mul(&self, rhs: &Self, carry: &mut Self) -> Self { let r = self.0 as u128 * rhs.0 as u128 + carry.0 as u128; *carry = Self((r / M as u128) as u64); Self((r % M as u128) as u64) } } impl<const M: u64> From<i64> ...
Rust
0
{:?}", event); Ok(()) }) .unwrap(); println!("pool: {:?}", pool); let index = pool.get_random_index(); println!("{:?}", index); } #[test] fn test_basic_pool_2() { let mut pool = CounterMaximizingPool::<f64>::new("b", 5); let _ = pool.add...
Rust
0
) iren.SetRenderWindow(renWin) # Add the actors to the renderer, set the background and size # ren1.AddActor(outlineActor) ren1.AddActor(planeActor) ren1.AddActor(cutActor) ren1.AddActor(isoActor) ren1.AddActor(streamTubeActor) ren1.SetBackground(1, 1, 1) renWin.SetSize(400, 400) cam1 = ren1.GetActiveCamera() cam1.S...
Python
1
s, recompile raylib to OpenGL 3.3 version. * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). * * This example has been created using raylib 2.5 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Example contributed by ProfJski and re...
Rust
0
x, torch.ones_like(self.current_air_time), torch.zeros_like(self.current_air_time), ) reward = torch.sum(reward_per_foot, dim=1) else: # This mode gives (air_time - threshold) as reward on landing. air_time_over_min = (self.last_air_time - self.threshold_min).clamp(min=0.0) ...
Python
1
pub use self::tls::with_current_program; use ::chrono::{Datelike, Weekday, NaiveDate, Duration}; use crate::HolidayCalendar; /// United States federal holidays. pub struct USSettlement; fn end_of_month(mut yy: i32, mut mm: u32) -> NaiveDate { assert!(mm <= 12); if mm == 12 { yy += 1; mm = 1;...
Rust
0
: content += ' return HSA_API_ID_NUMBER;\n' content += '}\n' return content # generate stream operator def gen_out_stream(self, n, name, call, struct): content = '' if n == -1: content += '#ifdef __cplusplus\n' content += '#include "hsa_ostream_ops.h"\n' content += 'typed...
Python
1
array(Y_true), np.array(Y_pred) return np.mean(np.fabs((Y_true - Y_pred) / Y_true)) * 100 if __name__ == '__main__': plt.rcParams['figure.figsize'] = (10.0, 5.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' dataset = pd.read_csv...
Python
1
e, io::{BufReader, Read}, path::PathBuf, }; fn print_eval_result(v: BlisprResult) { match v { Ok(res) => println!("{}", res), Err(e) => eprintln!("Error: {}", e), } } fn repl(e: &mut Lenv) -> Result<()> { println!("Blispr v0.0.1"); println!("Use exit(), Ctrl-C, or Ctrl-D to exi...
Rust
0
CRUNTIME").map_or(false, |v| v == "true") { static_vcruntime::build(); } cfg_alias("dev", !has_feature("custom-protocol")); let mut manifest = Manifest::from_path("Cargo.toml")?; if let Some(millennium) = manifest.dependencies.remove("millennium") { let features = match millennium { Dependency::Simple(_) =...
Rust
0
import numpy as np import torch # 均方误差(Mean Square Error) def mse(loc_pred, loc_true): assert len(loc_pred) == len(loc_true), 'MSE: 预测数据与真实数据大小不一致' return np.mean(sum(pow(loc_pred - loc_true, 2))) # 平均绝对误差(Mean Absolute Error) def mae(loc_pred, loc_true): assert len(loc_pred) == len(loc_true), 'MAE: 预测数...
Python
1
from tkinter import * import tkinter as tk from tkinter import filedialog, ttk from pygame import mixer import os root = tk.Tk() root.title('Music Player') root.geometry('920x670+290+35') root.configure(bg='#0f1a2b') root.resizable(False, False) mixer.init() def open_folder(): path = filedialog.askdirectory(...
Python
1
let Some(image) = image_opt { image_opt = Some(concatenate![Axis(0), image, row]); } else { image_opt = Some(row); } if let Some((id, _)) = row_start_cell.borrow().down { row_start_cell = tiles.get(&id).unwrap(); current = row_start_cell.borrow_m...
Rust
0
, dim_hidden, kernel_size=1, padding=0, bias=True), ) self.query_layers = nn.Sequential( nn.Conv1d(dim_query, dim_hidden, kernel_size=3, padding=1, bias=True), nn.ReLU(), nn.Conv1d(dim_hidden, dim_hidden * 2, kernel_size=3, padding=1, bias=True), nn.ReLU(...
Python
1
ait.unwrap(); /// ``` pub async fn soft_delete<E>(&self, select: Select<E>, delete_user: &str) -> TardisResult<u64> where E: EntityTrait, { if let Some(tx) = &self.tx { TardisRelDBClient::soft_delete_inner(select, delete_user, tx).await } else { TardisRelD...
Rust
0
ioa.pa0.into_pull_up_input(); let exti = EXTI.put(exti::ExtiManager::new(dp.EXTI, dp.SYSCFG.constrain())); let pin = exti.new_pin(button, interrupt::take!(EXTI0)); pin_mut!(pin); info!("Starting loop"); loop { pin.as_mut().wait_for_rising_edge().await; info!("edge detected!"); ...
Rust
0
tring, #[serde(rename = "overwriteVhds")] pub overwrite_vhds: bool, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VirtualMachineCaptureResult { #[serde(flatten)] pub sub_resource: SubResource, #[serde(rename = "$schema", default, skip_serializing_if = "Option::is_none")] ...
Rust
0
s.decoder_layers = getattr(args, "decoder_layers", 6) args.decoder_cross_layers = getattr(args, "decoder_cross_layers", 6) args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 8) args.decoder_learned_pos = getattr(args, "decoder_learned_pos", False) args.activation_fn = getattr(args, ...
Python
1
test").env_remove("RUST_LOG"); if cfg.quiet { cmd.arg("--quiet"); } let status = cmd.current_dir(dir) .stdin(Stdio::null()) .status() .context("Unable to invoke cargo")?; if let Some(code) = status.code() { debug!("Tests ran with return code {}", code); } ...
Rust
0
ward_forward(self, n_coeffs, spin): r"""Given coefficients, ISWSFT -> SWFT must return them.""" coeffs_gt = np.linspace(-1, 1, n_coeffs) + 1j*np.linspace(0, 1, n_coeffs) # Coefficients for ell < abs(spin) are always zero. coeffs_gt[:spin**2] = 0 sphere = np_spin_spherical_harmonics.swsft_backward_na...
Python
1
from_file(self, file_path): """ Загружает и парсит XML из файла. Args: file_path: Путь к XML-файлу Returns: dict: Словарь с данными сцены (walls, regions, robot) Raises: XMLValidationError: Если XML некорректе...
Python
1
y['var_list'] tgt = geom_entry['conversations'][1]['value'] tgt_result = float(geom_entry['answer']) is_ans_same = is_eq_same = False pred_list = test_preds[question_id] # Correct key access tgt = [value for value in tgt.split()] for j in range(len(pred_list)): # pred ...
Python
1
azy; use crate::impl_::listener::Listener; use crate::impl_::node::{IsNode, Node, WeakNode}; use crate::impl_::sodium_ctx::SodiumCtx; use crate::impl_::sodium_ctx::SodiumCtxData; use crate::impl_::stream::Stream; use crate::impl_::stream::StreamWeakForwardRef; use crate::impl_::stream::WeakStream; use std::mem; use st...
Rust
0
let mut rets = vec![]; let (name, span) = match &*e.unwrapped_arc() { &LispKind::Atom(a) => (a, e.fspan()), LispKind::List(_) | LispKind::DottedList(_, _) => { let mut u = Uncons::from(e.clone()); let e = u.next().ok_or_else(|| ElabError::new_e(self.try_get_span(&e), "func/pro...
Rust
0
ge let page_remain = 0x1000 - (paddr.0 & 0xfff); // Compute the number of bytes to copy let to_copy = core::cmp::min(page_remain as usize, buf.len()); // Read the memory from the backing page into the user's buffer let psl = unsafe { mm::slice_phys(paddr, to...
Rust
0
/// ``` /// # use ethnum::I256; /// assert_eq!(I256::new(10).overflowing_abs(), (I256::new(10), false)); /// assert_eq!(I256::new(-10).overflowing_abs(), (I256::new(10), false)); /// assert_eq!(I256::MIN.overflowing_abs(), (I256::MIN, true)); /// ``` #[inline] pub fn overflowing_abs(self) ->...
Rust
0
} } } impl<T> Drop for JoinHandle<T> { fn drop(&mut self) { if let Some(raw) = self.raw.take() { if raw.header().state.drop_join_handle_fast() { return; } raw.drop_join_handle_slow(); } } } impl<T> fmt::Debug for JoinHandle<T> w...
Rust
0
enumerate_states(test, 1, 3) [|foo_1>, |foo_2>, |foo_3>] >>> test2 = XBra('bar') >>> enumerate_states(test2, [4, 5, 10]) [<bar_4|, <bar_5|, <bar_10|] """ state = args[0] if len(args) not in (2, 3): raise NotImplementedError("Wrong number of arguments!") if not isinstance(sta...
Python
1
< 2 { return Err(AssemblyError::empty_block(&head, first_step)) } add_span(body, &mut op_codes, &mut op_hints, false); return Ok(i) }, _ => parse_op_token(op, &mut op_codes, &mut op_hints, i)?, }; } // if all tokens were consumed by block end was not found, return an error return match head...
Rust
0
time_reg; #[doc = "CSIC_PRS_NCSIC_RX_SIGNAL0_DLY_ADJ_REG register accessor: an alias for `Reg<CSIC_PRS_NCSIC_RX_SIGNAL0_DLY_ADJ_REG_SPEC>`"] pub type CSIC_PRS_NCSIC_RX_SIGNAL0_DLY_ADJ_REG = crate::Reg<csic_prs_ncsic_rx_signal0_dly_adj_reg::CSIC_PRS_NCSIC_RX_SIGNAL0_DLY_ADJ_REG_SPEC>; #[doc = "CSIC Parser NCSIC RX S...
Rust
0
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Command line debugger using WinAppDbg # Determine the approximate exploitability rating # Copyright (c) 2009-2014, Mario Vilas # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
Python
1
} # If we're not penalizing double coverage, we can use a faster calculation coverage_func = calculate_coverage_fast if penalize_double: coverage_func = calculate_coverage with ThreadPoolExecutor(max_workers=workers) as executor: precision_func = partial(coverage_func, penalize_double=...
Python
1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch from sklearn.metrics import ( accuracy_score, balanced_accuracy_score, confusion_matrix, f1_score, precision_score, recall_score, ) from semilearn.core.hooks import Hook from semilearn.algorithms.utils impor...
Python
1
] - memory_before["process_rss"] ) logger.debug( "文件分塊 %s/%s 處理完成 (行 %s-%s), 記憶體增長: %.2fMB", i + 1, len(chunks), start, end, memory_growth, ) ...
Python
1
*sph = SpcHandler { key: "html:", exec: Some(spc_handler_html_default), }; ap.cur = &ap.cur[b"html:".len()..]; while !ap.cur.is_empty() && libc::isspace(ap.cur[0] as _) != 0 { ap.cur = &ap.cur[1..]; } Ok(()) } <reponame>maco/unused use colored::*; use read_ctags::ReadCta...
Rust
0
.row); if show_progress == 0 { path_finder_find(&mut path_finder, null_mut()); } else { path_finder_begin(&mut path_finder); while path_finder_find_step(&mut path_finder, null_mut()) == 1 { sleep(Duration::from_micros(25000)) } } ...
Rust
0
TidStatsInvalid => 0, TidStatsRxMsdu => 1, TidStatsTxMsdu => 2, TidStatsTxMsduRetries => 3, TidStatsTxMsduFailed => 4, TidStatsPad => 5, NumTidStats => 6, TidStatsMax => 5 ); impl_var_trait!( /// nl80211MpathFlags /// /// Enumer...
Rust
0
.temperature generator_options.args['beam_size'].int_value = FLAGS.beam_size generator_options.args['branch_factor'].int_value = FLAGS.branch_factor generator_options.args[ 'steps_per_iteration'].int_value = FLAGS.steps_per_iteration tf.logging.debug('input_sequence: %s', input_sequence) tf.logging.debu...
Python
1
bobbin_bits::U1 = value.into(); let value: u32 = value.into(); let shift: usize = 0 + index; self.0 &= !(0x1 << shift); self.0 |= value << shift; self } } impl From<u32> for Dirtgl { #[inline] fn from(other: u32) -> Self { Dirtgl(other) } } impl ::core...
Rust
0
{ // SAFETY: `pidfd_getfd` returns a valid file descriptor // on success. Ok(unsafe { File::from_raw_fd(res) }) } } /// Takes the file description referred to by `targetfd` within `pidfd` /// and creates a duplicate of it within this process. /// /// This is the raw syscall. For a somewhat...
Rust
0
ild_topo(prev) if v.learnable: topo.append(v) if not v.leaf: weights.append(v) build_topo(self) return topo, weights def backward(self, reset_grad=True) -> None: """ Computes the gradients of all Tensors in self...
Python
1
st = "\n hay i am ayesha ye wo abcd " f = open("myfile.txt","a") a = f.write(st) f.close #ye end me add krta jayega jo bhi hm dnegy
Python
1
clone(&ctx.http), Arc::clone(&ctx.cache), ); } Ok(SubCommandReturnValue::DeleteInteraction) } #[instrument(skip(ctx, guild_id, manager))] async fn leave_channel( ctx: &Ctx, guild_id: GuildId, manager: &Arc<Songbird>, ) -> anyhow::Result<SubCommandReturnValue> { if manager.g...
Rust
0
return Some(fuel) // } else { // return None // } // }) 50346 // fake it for now } #[cfg(test)] mod tests { use super::*; // part1: 100756 -> 33583 #[test] fn test_part1_with_known_values() { let input = vec![100_756]; assert_eq!(calculate_fuel(input...
Rust
0
r::default(), } } } /// A set of BFT timer. #[derive(Debug, Clone)] pub(crate) struct BftTimer { // in milliseconds. total_duration: Cell<u64>, // fraction: (numerator, denominator) propose: (u64, u64), prevote: (u64, u64), precommit: (u64, u64), } impl Default for BftTimer { f...
Rust
0
dht")] disable_dht: bool, /// Set this to disable DHT reading and storing it's state. /// For now this is a useful workaround if you want to launch multiple rqbit instances, /// otherwise DHT port will conflict. #[clap(long = "disable-dht-persistence")] disable_dht_persistence: bool, /// T...
Rust
0
import argparse import os import platform import subprocess import sys from check_python import check_python_version parser = argparse.ArgumentParser() parser.add_argument( "-d", "--dev", action="store_true", help="Use it to install development dependencies", ) args = parser.parse_args() def install...
Python
1
= 165, /// STMicroelectronics STxP7x STXP7X = 166, /// Andes Tech. compact code emb. RISC NDS32 = 167, /// Cyan Technology eCOG1X ECOG1X = 168, /// Dallas Semi. MAXQ30 mc MAXQ30 = 169, /// New Japan Radio (NJR) 16-bit DSP XIMO16 = 170, /// M2000 Reconfigurable RISC MANIK...
Rust
0
e().0, &mut error); if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } } } fn clone_node(&self, deep: bool) -> Result<DOMNode, Error> { unsafe { let mut error = ptr::null_mut(); let ret = webkit2_webextension_sys::webkit_dom_no...
Rust
0
}; if (buf_size as usize) < resolved_path.as_str().as_bytes().len() { return Err(Errno::ERANGE.into()); } let mut writer = UserBufWriter::from_uaddr(buf, buf_size); writer.write_bytes(resolved_path.as_str().as_bytes())?; writer.write(0u8)?; Ok(write...
Rust
0