text
string
label_name
string
labels
int64
op.multiply: (2x-1x49xf32) <- (2x-1x49xf32, 2x-1x1xf32) multiply_3 = paddle._C_ops.multiply(sum_3, data_10) del data_10, sum_3 # pd_op.full: (1xi32) <- () full_3 = paddle._C_ops.full( [1], float("-1"), paddle.int32, paddle.core.CPUPlace() ) # builtin.combine...
Python
1
n>().unwrap(); //4 cursor.seek(SeekFrom::Current(fmt_size as i64)).unwrap(); assert_eq!(cursor.read_fourcc().unwrap(), ELM1_SIG); //4 let elm1_size = cursor.read_u32::<LittleEndian>().unwrap(); //4 cursor.seek(SeekFrom::Current(elm1_size as i64)).unwrap(); assert_eq!(cursor.read_fourcc().unwrap(),...
Rust
0
egister(17) def cutout(x, level): """Apply cutout to pil_img at the specified level.""" size = 1 + int(level * min(x.size) * 0.499) img_height, img_width = x.size height_loc = np.random.randint(low=img_height // 2, high=img_height) width_loc = np.random.randint(low=img_height // 2, high=img_width) ...
Python
1
ndex = <$generic::PalletInfo as $crate::traits::PalletInfo> ::index::<$module<$generic $(, $inst_generic)?>>() .expect("Every active module has an index in the runtime; qed") as u8; $crate::sp_runtime::DispatchError::Module { index, error: err.as_u8(), message: Some(err.as_str()), } ...
Rust
0
s triggers have higher # priority than those in any inherited topics. Enforce this with an # {inherits} tag. if topic in rs._lineage or inherited: for trigger in inThisTopic: rs._say("\t\tPrefixing trigger with {inherits=" + str(inheritance) + "}" + trigger[0]) triggers.appen...
Python
1
mut P, } impl<'a, 's, P, R> SortVisitor<'s> for OptionVisitor<'a, P> where P: SortVisitor<'s, Target = Option<R>>, { type Target = R; fn visit_sort<F, T, S>(&mut self, name: &str, field: &F, sort: &S) where F: Field<R, Value = T> + 's, S: SorterTypedClass<T> + 's, <S as SorterT...
Rust
0
or n_pages in page_counts: metrics = await benchmark.benchmark_pages(n_pages) all_metrics.extend(metrics) # Convert results to DataFrame results_df = pd.DataFrame(all_metrics) # Save raw results results_df.to_csv("benchmark_results.csv", index=False) # Print summary statistics ...
Python
1
} #[derive(Debug)] enum Flavor { Single, Double, Unknown, } let mut flavor = Flavor::Unknown; let (mut start, mut end) = (None, None); for (i, c) in input.char_indices() { if start.is_some() && end.is_some() { break; } if matches!(f...
Rust
0
enum Event { /// The `String` was updated. Update(String), /// The `Return` or `Enter` key was pressed. Enter, } impl<'a> Widget for TextBox<'a> { type State = State; type Style = Style; type Event = Vec<Event>; fn init_state(&self, id_gen: widget::id::Generator) -> Self::State { ...
Rust
0
*data }; assert_eq!(result, true); unsafe { free_value_and_module(ret_value) }; } fn simple_vector_lookup() { let code = "|x:vec[i32]| lookup(x, 3L)"; let conf = default_conf(); let input_vec = [1, 2, 3, 4, 5]; let ref input_data = WeldVec { data: &input_vec as *const i32, len:...
Rust
0
info.doc_freq as u64).serialize_into_vec(buffer); VInt(term_info.postings_range.len() as u64).serialize_into_vec(buffer); VInt(term_info.positions_range.len() as u64).serialize_into_vec(buffer); } self.term_infos.clear(); } } #[cfg(test)] mod tests { use std::io; us...
Rust
0
echo ${param%%$(subst7 ignore)} echo ${param#$(subst8 ignore)} echo ${param##$(subst9 ignore)} # Nested subst echo $(subst10 ignore $(subst11 ignore) $(subst12 ignore $(subst13 ignore))) # Redirects echo <$(redsub) >$(redsub) <>$(red...
Rust
0
from rest_framework import serializers from permissions import models from users import models as user_models from utils import serializers as utils_serializers class ObjectPermissionModelSerializer(utils_serializers.BaseSerializer[models.ObjectMembership]): """ Serializer for the ObjectPermission model. ...
Python
1
_swap_chain_preferred_format(&surface).unwrap(); let mut sc_desc = wgpu::SwapChainDescriptor { usage: wgpu::TextureUsage::RENDER_ATTACHMENT, format: swapchain_format, width: size.width, height: size.height, present_mode: wgpu::PresentMode::Mailbox, }; let mut swap_cha...
Rust
0
""" Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once in the combination. Note: The solution set must not contain duplicate combinations. Example 1: In...
Python
1
``` /// use types::common::Contour; /// /// let contour = vec![[0.0, 0.0], [0.0, 10.0], [10.0, 10.0], [10.0, 0.0]]; /// assert_eq!(40.0, contour.length()); /// ``` fn length(&'a self) -> T; } pub trait SurfaceContour<'a, T: Float, P: 'a>: Contour<'a, T, P> { /// Calculates area of the cont...
Rust
0
import hashlib def generate_diversified_key( chip_serial_number: bytes, root_key: bytes | bytearray | list[int], target_slot: int, ) -> bytes: """Generates the diversified key for a given device""" serial_pad = [0x00] * (32 - 9) generation_hash_data = list(root_key) generation_hash_data +...
Python
1
PIPE_INSTANCE, FILE_FLAG_WRITE_THROUGH, FILE_FLAG_OVERLAPPED, PIPE_ACCESS_DUPLEX, PIPE_ACCESS_INBOUND, PIPE_ACCESS_OUTBOUND, PIPE_READMODE_BYTE, PIPE_READMODE_MESSAGE, PIPE_TYPE_BYTE, PIPE_TYPE_MESSAGE, PIPE_NOWAIT, PIPE_REJECT_REMOTE_CLIENTS, }, w...
Rust
0
del(self) -> None: pass with torch.device("meta"): model = CustomModel() assert model.layer1[0].weight.is_meta assert model.layer2.weight.is_meta assert model.buffer.is_meta strategy = ModelParallelStrategy() strategy._accelerator = Mock() strategy._device_mesh = Mock()...
Python
1
.arg(nombre) .spawn() .expect("Algo fallo al crear el archivo .abc"); println!("La creacion del archivo {}.abc a sido correcta", nombre); } } fn constuir(ruta: &str) { if archivos::es_abc(ruta) { let mut child = std::process::Command::new("bash") .arg("/etc/a...
Rust
0
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Interface for Baidu's RT-DETR, a Vision Transformer-based real-time object detector. RT-DETR offers real-time performance and high accuracy, excelling in accelerated backends like CUDA with TensorRT. It features an efficient hybrid encoder and IoU...
Python
1
GLE_SERIF: DWRITE_PANOSE_ARM_STYLE = 10i32; #[doc = "*Required features: `\"Win32_Graphics_DirectWrite\"`*"] pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_DOUBLE_SERIF: DWRITE_PANOSE_ARM_STYLE = 11i32; #[doc = "*Required features: `\"Win32_Graphics_DirectWrite\"`*"] pub type DWRITE_PANOSE_ASPECT = i32; #[doc = "*Required...
Rust
0
n oci specification pub fn drop_privileges(cs: &LinuxCapabilities, syscall: &impl Syscall) -> Result<()> { log::debug!("dropping bounding capabilities to {:?}", cs.bounding); syscall.set_capability(CapSet::Bounding, &to_set(&cs.bounding))?; syscall.set_capability(CapSet::Effective, &to_set(&cs.effective))?...
Rust
0
Ok(()) } macro_rules! test_day { ($name: ident, $sol_a: literal, $sol_b: literal) => { #[test] fn $name() -> Result<(), std::io::Error> { let day_name = stringify!($name); let day_num: u8 = day_name[3..].parse().unwrap(); test_day(day_num, $sol_a, $sol_b) ...
Rust
0
import pytest from brownie import accounts from telliot_core.apps.core import TelliotCore from web3.datastructures import AttributeDict from telliot_feeds.feeds.bct_usd_feed import bct_usd_median_feed from telliot_feeds.reporters.tellor_360 import Tellor360Reporter @pytest.mark.asyncio async def test_bct_usd_reporte...
Python
1
ta") if not subname: return path return os.path.join(path, subname) def readResource(name, mode="r"): with open(resourceLocation(name), mode) as fh: return fh.read() def skipIfAptPkg(): return skipIf( HAS_APT_PKG, "No python-apt dependency present.", ) try: ...
Python
1
.0 as u64; let cycles = clk.saturating_mul(period) / 1_000_000_u64; cycles as u32 } } impl Add for MicroSecond { type Output = Self; fn add(self, other: Self) -> Self::Output { Self(self.0 + other.0) } } impl From<Hertz> for MicroSecond { fn from(freq: Hertz) -> MicroSecon...
Rust
0
r { /// Ok(1..=4) => true, /// _ => false, /// }); /// ``` /// /// If you want to insert an item to a sorted vector, while maintaining /// sort order: /// /// ``` /// use janetrs::{tuple, Janet, JanetArray}; /// # let _client = janetrs::client::JanetClient::init().un...
Rust
0
from dataclasses import dataclass from ..base import BaseContribution # CPP: # https://www.canada.ca/en/revenue-agency/news/newsroom/tax-tips/tax-tips-2024/canada-revenue-agency-announces-maximum-pensionable-earnings-contributions-2025.html # # EI & EIQuebec: # https://www.canada.ca/en/revenue-agency/services/tax/busi...
Python
1
.push_back(target); } }); } let count = (0..first_out.len() - 1).into_iter().filter(|&idx| is_vertex_reachable[idx]).count(); println!("Number of reachable nodes: {} of {}", count, first_out.len() - 1); is_vertex_reachable } #![feature(proc_macro_hygiene, decl_macro)] #[ma...
Rust
0
# Routes # routes/pdf_cours_routes.py from flask import Blueprint, jsonify from Controllers.CoursController import PdfCoursController from Middleware.AuthMiddleware import role_required from Middleware.AuthMiddleware import auth_required from UseCases.CoursUseCase import PdfCoursUseCase # Correction: Utiliser __name_...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys, time, subprocess, shlex, itertools try: import yaml except Exception: subprocess.run([sys.executable, "-m", "pip", "install", "pyyaml"], check=True) import yaml HERE = os.path.dirname(os.path.abspath(__file__)) BASE = os.path.dirname(HERE) def...
Python
1
or); Output::success(channel).exit(); } /// Creates a new channel, reusing an already existing connection and its clients. fn run_reusing_connection(&self, connection_a: &ConnectionId) { let config = app_config(); // Validate & spawn runtime for side a. let chain_a = spawn...
Rust
0
G.add_node(n, **nodes[n]) for e in edges: G.add_edge(e[0], e[1], **edges[e]) return G def build_kdtree(subgraph, G): # Extract x, y coordinates for nodes in the subgraph coords = [(G.nodes[node]['x'], G.nodes[node]['y']) for node in subgraph] # Build and return a KDTree for these coordina...
Python
1
⇄', '𓀛', '⠸', '李', 'ລ', '🨤', 'ꯈ', 'ꆰ', '🥔', '🎬', 'ꖏ', '▂', '𛆪', 'ភ', 'ః', '🅟', 'エ', '🅑', '🅝', '𛋊', '𔓀', '𞸢', '🆞', '𝡝', '🕷', '\u{1d179}', '\u{826}', 'ꚛ', 'Ṋ', 'ŀ', 'ᳺ', 'ᴎ', '𐕲', 'ﻗ', '𞲋', 'ᛣ', '🌆', '擄', '𑖜', '壟', '\u{1a69}', '🦎', '☞', '𘭫', '﨎', 'Ꝥ', '𔕽', 'ꠔ', '\u{103a}', 'ܖ', '𑁡', ...
Rust
0
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
32, lpstrFileTitle: ptr::null_mut(), nMaxFileTitle: 0, lpstrInitialDir: ptr::null_mut(), lpstrTitle: title.as_mut_ptr(), Flags: OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR, nFileOffset: 0, nFileExtension: 0, lpstrDefExt: ptr::null_mut(), lCustData: 0, ...
Rust
0
dst_bot, .. } = area; let front = &ctx.surfaces.front; let back = &ctx.surfaces.back; let prev = &ctx.surfaces.prev; // Draw move the scrolled part on the cairo surface. front.save()?; // Create pattern which we can then "safely" draw to the surface. On X11, the pattern part wa...
Rust
0
r def blockConfigPreSolver(self): r = '' for extConfig in self.data['extFluidConfigs']: r = r+(' ' + extConfig[0] + '(&network->netFluidProperties, ' + extConfig[0] + 'FluidTypes, ' + self.data['networkName'] + 'ConfigData::N_' + extConfig[0].upper() + '_FLUIDS),\n') if len(self.data['intTcConf...
Python
1
Ret; /// Execute a phase in a protocl with a given setup and return a result fn execute(setup: &Self::Setup, params: &T) -> Result<Self::Ret>; } pub mod btc; pub mod xmr; #[cfg(test)] #[allow(non_snake_case)] mod tests { use super::{Protocol, btc::Btc, xmr::Xmr}; use rand::rngs::OsRng; use crate...
Rust
0
v); // run schema command with value constraints option let mut cmd = wrk.command("schema"); cmd.arg("adur-public-toilets.csv"); cmd.arg("--enum-threshold"); cmd.arg("13"); cmd.arg("--pattern-columns"); cmd.arg("ReportEmail,OpeningHours"); cmd.arg("--strict-dates"); wrk.output(&mut ...
Rust
0
import pathlib from datetime import datetime import imageio.v3 as iio import numpy as np import ouroboros as ob vlc_db = ob.VlcDb(3) robot_id = 0 session_id = vlc_db.add_session(robot_id) def load_resource_image(image_name): resource_path = pathlib.Path(__file__).absolute().parent.parent / "resources" ret...
Python
1
t OPJ_BYTE; l_tile_comp = l_tile_comp.offset(1); i = i.wrapping_add(1) } if opj_mct_encode_custom( (*(*p_tcd).tcp).m_mct_coding_matrix as *mut OPJ_BYTE, samples, l_data, (*l_tile).numcomps, (*(*(*p_tcd).image).comps).sgnd, ) == 0 { opj_free(l_data as *mut ...
Rust
0
data_type: PhantomData, }) } } /// Creates a tensor descriptor with the given shape and format. /// /// # Arguments /// /// * `shape` - slice containing the size of the tensor for every dimension. /// /// * `format` - format for the tensor descriptor. /...
Rust
0
offset: Expression, exprs: Vec<Expression>, } = 0x04, #[cfg(feature = "bulk-memory-operations")] PassiveWithExprs { ty: RefType, exprs: Vec<Expression> } = 0x05, #[cfg(feature = "bulk-memory-operations")] ActiveWithTableAndExprs { table: TableId, offset: Expression, t...
Rust
0
idyWrapLen = 93, #[doc = "< Wrap consecutive PHP pseudo elements"] TidyWrapPhp = 94, #[doc = "< Wrap within JavaScript string literals"] TidyWrapScriptlets = 95, #[doc = "< Wrap within <![ ... ]> section tags"] TidyWrapSection = 96, #[doc = "< If true then output tidied markup"] TidyWrit...
Rust
0
&params, ) .unwrap(); } target.finish().unwrap(); events_loop.poll_events(|ev| match ev { glutin::Event::WindowEvent { event, .. } => match event { glutin::WindowEvent::CloseRequested => closed = true, ...
Rust
0
) .message("Rota não encontrada") .build() } #[catch(503)] fn service_unavailable() -> ServerError { ServerError::builder() .code(Status::ServiceUnavailable) .message("A aplicação se encontra temporariamente indisponível") .build() } ...
Rust
0
func, opaque: *mut ::std::os::raw::c_void, ) -> *mut BrotliEncoderState; } extern "C" { pub fn BrotliEncoderDestroyInstance(state: *mut BrotliEncoderState); } extern "C" { pub fn BrotliEncoderMaxCompressedSize(input_size: usize) -> usize; } extern "C" { pub fn BrotliEncoderCompress( qual...
Rust
0
], vec![2]), (vec![0, 0, 0, 0, 0, 9, 9], vec![1]), (vec![0], vec![0]), (vec![8, 255, 9], vec![3]), (vec![9], vec![4]), (vec![255, 255], vec![5]), ]; for (k, v) in entries { tree.set(k, v).unwrap(); } assert_eq!( pred_incl(&tree, &[8, 255, 9]).unwra...
Rust
0
[allow(missing_docs)] // documentation missing in model EndOfFile, #[allow(missing_docs)] // documentation missing in model StartOfFile, /// Unknown contains new variants that have been added since this code was generated. Unknown(String), } impl std::convert::From<&str> for CloudWatchLogsInitialPos...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import re from odoo import models from odoo.exceptions import AccessDenied class IrWebsocket(models.AbstractModel): _inherit = 'ir.websocket' def _build_bus_channel_list(self, channels): if self.env.u...
Python
1
xact(&mut buf)?; Ok(Sc3String(buf.into())) } fn replace_strings<'a>(&mut self, changes: &HashMap<usize, Sc3String<'a>>) -> io::Result<()> { if self.string_index.entries.is_empty() { return Ok(()); } let lines = self .string_index .iter() ...
Rust
0
import sys import os sys.path.append(os.curdir) from experiments.ldm_moises_db_utils import get_cfg, ExperimentConfig, train, infer import argparse from typing import Literal from schmid_werkzeug.pydantic import load_cfg, save_cfg def main(): parser = argparse.ArgumentParser( description="Argument pars...
Python
1
param_checker=TypeChecker(param_types, enums), target_class=Profile, api_type='EDGE', response_parser=ObjectParser(target_class=Profile, api=self._api), ) request.add_params(params) request.add_fields(fields) if batch is not None: reques...
Python
1
Vec<Syntax> { &self.scope } fn get_node_index(&self, index: usize) -> Option<&Syntax> { self.get_node().get(index) } fn get_node_len(&self) -> usize { self.get_node().len() } fn push_node(&mut self, node: Syntax) { self.scope.push(node); } } #[derive(Debug, Clone)] pub struct FunctionA...
Rust
0
e_best_weights=True) # **训练模型** history = model.fit( train_generator, steps_per_epoch=train_samples // 32, validation_data=test_generator, validation_steps=test_samples // 32, epochs=5 , callbacks=[lr_scheduler, early_stopping] ) # 保存模型 model.save('face_detection_model.h5') print("Mode...
Python
1
# -*- coding: utf-8 -*- """ Copyright (c) 2020 Vivone Gemine. All rights reserved. This work should only be used for nonprofit purposes. @author: Vivone Gemine (website: https://sites.google.com/site/vivonegemine/home ) """ """ Description: interp23 interpolates the image I_Interpolated using a polynomial...
Python
1
from talos.models.gecko_terminal import OHLCV, GeckoTerminalOHLCVData from talos.utils.http_client import SecureHTTPClient class GeckoTerminalClient: def __init__(self, network: str = "arbitrum", pool_address: str = "0xdaAe914e4Bae2AAe4f536006C353117B90Fb37e3"): from talos.utils.validation import sanitiz...
Python
1
let mut event = Event::new(); event.set_event_type(e.get_event_type().into()); event.set_data(e.get_data().into()); event.set_attributes( e.get_attributes() .iter() .map(...
Rust
0
"), } } else if path == *ROOT { Ok(PathBuf::from("/.")) } else { Ok(path.to_owned()) } } #[cfg(test)] mod tests { use super::*; #[test] fn empty() { assert_eq!( String::from("couldn't generate a Nix-safe version of a blank path"), clean_p...
Rust
0
import numpy as np import matplotlib.pyplot as plt from utilities3 import * import random import matplotlib.cm as cm from mpl_toolkits.mplot3d.axes3d import Axes3D j = 0 # 第 j 组数据 path = 'pred/pred10/' dataloader = MatReader(path + 'true6.mat') dataloader2 = MatReader(path + 'ns_fourier_3d_rnn_V500_T10_N400_ep200...
Python
1
ntity_id: String::arbitrary(g), passphrase: SecretBytes::arbitrary(g), }, 11 => Command::Identities(String::arbitrary(g)), 12 => Command::AddIdentity { store_name: String::arbitrary(g), identity: Identity::arbitrary(g), passphrase: SecretBytes::arbitrary(g), }, ...
Rust
0
file_out = f'results_{prefix}{rmab}.csv' use_header = not os.path.exists(file_out) # append data frame to CSV file df_out.to_csv(file_out, mode='a', index=False, header=use_header) # plot per-timestep reward x_vals = np.arange(rmab.horizon * n_episodes_eval...
Python
1
fn enqueue(sound: Option<SoundSource>, kind: QueueKind) { AUDIO_QUEUE.with(|q| { q.borrow_mut().push(QueueEntry { sound, kind }); }); } fn enqueue_id(source_id: &str, kind: QueueKind, volume: f32) { let sound = match ResourceSet::sound(source_id) { Err(e) => ...
Rust
0
ces(x_L) # (nAtoms, num_targets) else: x_L = 0 # --------------------------------------- Atom type Prediction -------------------------------------- # if self.regress_lattices: rbf_emb_L = self.dense_rbf_L(rbf) # (nEdges, emb_size_edge) x_L = m * rbf_emb_L ...
Python
1
99000; pub const VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT: VkDynamicState = 1000143000; pub const VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR: VkDynamicState = 1000347000; pub const VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV: VkDynamicState = 1000164004; pub const VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_OR...
Rust
0
r) } pub fn new(path: std::path::PathBuf, offset: u64, length: u64) -> Self { Self { path, offset, length, } } } mod account_checker; mod cache; mod config; mod customers_config; mod errors; mod flags; use { crate::{ account_checker::{Account...
Rust
0
(FuseAttr, f64), i32> { Err(ENOSYS) } fn readlink(&mut self, _ctx: &FuseCtx, _ino: u64) -> Result<Vec<u8>, i32> { Err(ENOSYS) } fn mknod( &mut self, _ctx: &FuseCtx, _parent: u64, _name: &[u8], _mode: u32, _rdev: u64, ) -> Result<FuseEnt...
Rust
0
License at // // https://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 ANY KIND, either express or implied. // See the License for the specific lang...
Rust
0
irs(&self) -> Vec<(llir::IntrinsicInstrKind, u16)> { vec![] // msg is vapid } fn instr_header_size(&self) -> usize { 4 } fn read_instr(&self, f: &mut BinReader, _: &dyn Emitter) -> ReadResult<ReadInstr> { let time = match f.read_i16_or_eof() { Ok(Some(time)) => time, ...
Rust
0
/// **get** public static final [AF_INET](https://developer.android.com/reference/android/system/OsConstants.html#AF_INET) pub fn AF_INET<'env>(env: &'env __jni_bindgen::Env) -> i32 { unsafe { let (class, field) = env.require_class_static_field("android/system/OsConstants\0...
Rust
0
[POSITION_X[i, t], POSITION_Y[i, t]] = new_position nodes_velocity_p[i, :] = new_velocity nodes[i, :] = new_position velocity_magnitudes[i, t] = np.linalg.norm(new_velocity) # velocity_magnitudes[i, :, t] = new_velocity if (t+1) % SNAPSHO...
Python
1
(self) -> &'a mut W { self.variant(RATIO_A::DIV16) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) ...
Rust
0
WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::Window, }; use winit_input_helper::WinitInputHelper; pub fn run<T: 'static>( init: impl Fn(Arc<Device>, UVec2, TextureFormat) -> T, draw: impl Fn(&mut T, Option<UVec2>, TextureView, &Queue) + 'static, ) -> ! { // Init winit let events...
Rust
0
from __future__ import annotations from dxtbx.model.experiment_list import Experiment, ExperimentList from dials.algorithms.indexing.indexer import Indexer class IndexerKnownOrientation(Indexer): def __init__(self, reflections, experiments, params, known_orientations): self.known_orientations = known_or...
Python
1
# Atividade 01: # Tabuada de um Número: # Faça um programa que solicite um número ao usuário e use # um laço for para exibir a tabuada desse número (de 1 a 10). r = 0 n = int(input('Digite um numero: ')) for i in range(10): r = i * n print
Python
1
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. """A lab app that runs a sub process for a demo or a test.""" from __future__ import annotations import sys from typing import Any from jupyter_server.extension.application import ExtensionApp, ExtensionAppJinjaMixin...
Python
1
unit = input("enter the tenparature ceils or farhenhut (c or f): ") temp = float(input("enter the temparature values: ")) if unit =="c": temp = round((9 * temp)//5,1) print(f" temparature celisus {temp}") elif unit == "f": temp = round((temp-32) *5/9,1) print(f"temparature is {temp}in farehenhei") e...
Python
1
1+"\nMã đường truyền: "+shd1+" & "+shd2+"\nĐịa chỉ: "+add1+"\nContact: "+contact+" - "+sdt) output="\U00002709\U00002709\U00002709 MESSAGE Content \U00002709\U00002709\U00002709\nMail to: haint78@viettel.com.vn; cskhdn@viettel.com.vn\nDear Viettel Team,\n\nNhờ Team check gấp giúp line MPLS tại cửa hàng sau ...
Python
1
int('\n🚀 SYSTEM BENEFITS') print('-' * 50) benefits = ['✅ FAIR COMPENSATION: Contributors get credit based on actual impact', '✅ USAGE RECOGNITION: Widely-used methods receive proper attribution', '✅ BREAKTHROUGH PROTECTION: Theoretical advances are not overlooked', '✅ DYNAMIC TRACKING: System adapts to changi...
Python
1
object_empty_key, "./tests/data/parsing/y_object_empty_key.json" ); test_fail!( n_structure_unclosed_object, "./tests/data/parsing/n_structure_unclosed_object.json" ); test_fail!( n_number_neg_real_without_int_part, "./tests/data/parsing/n_number_neg_real_without_int_part.json" ); test_fail!(n_numbe...
Rust
0
if j > 0: tile = self.blend_h(row[j - 1], tile, blend_extent) if j == 0: tile = self.blend_h(row[-1], tile, blend_extent) if i != len(rows) - 1: if j == len(row) - 1: ...
Python
1
ansmute(phsubd(a.as_i32x8(), b.as_i32x8())) } /// Horizontally subtract adjacent pairs of 16-bit integers in `a` and `b` /// using saturation. /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsubs_epi16) #[inline] #[target_feature(enable = "avx2")] #[cfg_attr(t...
Rust
0
fn from_sprite_tile_id(tile_id: u8, subidx_y: u8, sprite_size: SpriteSize) -> TileRowAddr { match sprite_size { SpriteSize::W8H8 => TileRowAddr(tile_id as u16 * 16 + subidx_y as u16 * 2), SpriteSize::W8H16 => { if subidx_y < 8 { TileRowAddr((tile_id &...
Rust
0
ap( long, help = "Right bound for search (*with* regression). You can use \ a date (YYYY-MM-DD), git tag name (e.g. 1.58.0) or git commit SHA." )] end: Option<Bound>, #[clap(long, help = "Bisect via commit artifacts")] by_commit: bool, #[clap(long, arg_enum, help = "How to access R...
Rust
0
import urllib.parse as parse from subprocess import run from functools import partial from pyvista import start_xvfb as pv_start_xvfb from streamlit.runtime.scriptrunner import get_script_run_ctx from datetime import datetime _run_command = partial(run, capture_output=True, text=True) def is_the_app_embedded(): ...
Python
1
.data_mapper.get(key) { Some(data_type) => match data_type { DataType::String => match self.string_store.remove(key) { Some(_) => 1, None => 0, }, DataType::List => 0, DataType::Set => 0, ...
Rust
0
} impl AsRef<InternalLinkTypeBotStartInGroup> for InternalLinkTypeBotStartInGroup { fn as_ref(&self) -> &InternalLinkTypeBotStartInGroup { self } } impl AsRef<InternalLinkTypeBotStartInGroup> for RTDInternalLinkTypeBotStartInGroupBuilder { fn as_ref(&self) -> &InternalLinkTypeBotStartInGroup { &self.inner } } ...
Rust
0
import os # Configuration settings for the application # Global pattern for file matching GLOB_PATTERN = "**/*" # List of file types accepted SUFFIXES = [ ".py", ".cpp", ".go", ".java", ".kt", ".js", ".ts", ".php", ".rb", ".rs", ".scala", ".swift", ".sol", ".cs...
Python
1
g went wrong? {:?}", e), }; let solver_init = SolverImpl::default_init(); let mut solver = sut.get_solver::<SolverImpl>(&solver_init); let mca = MCA::<usize>::new_constrained::<usize, SolverImpl, 4>(&sut.sub_sut.parameters, &mut solver); assert_eq!( mca.array, u_vec![ u...
Rust
0
named_file.set_extension("camp"); if mod_file.is_file() { if named_file.is_file() { bail!(ParseError::DuplicateModuleFile { span: decl.mod_token.span.until(decl.name.span), mod_name: decl.name.ident.clone(), ...
Rust
0
def task(): tasks = [] # Empty list for addition or deletion of data print("__WELCOME TO do list __") # Prompt for the number of tasks totaltask = int(input("Enter the number of tasks: ")) # Adding initial tasks for i in range(1, totaltask + 1): taskname = input(f"Enter the t...
Python
1
// The query engine reverses lists when querying for `last`, so we need to reverse again to have the intended order. let reversed = self.query_arguments.last.is_some(); if reversed { self.scalars.reverse(); } match (self.query_arguments.first, self.query_arguments.las...
Rust
0
"""modify default model name length Revision ID: 47cc7df8c4f3 Revises: 3c7cac9521c6 Create Date: 2024-05-10 09:48:09.046298 """ import sqlalchemy as sa from alembic import op import models as models # revision identifiers, used by Alembic. revision = '47cc7df8c4f3' down_revision = '3c7cac9521c6' branch_labels = Non...
Python
1
65625, 12.83203125, 148.7109375, 149.0625}}, {"qwj7353", Box{-10.6608581543, -10.6594848633, 119.928131104, 119.929504395}}, {"j", Box{-90.0, -45.0, 45.0, 90.0}}, {"v6", Box{56.25, 61.875, 56.25, 67.5}}, {"5mpwtp", Box{-60.6939697266, -60.6884765625, -22.9833984375, -22.9724121094}}, {"ukgs", Box{72.421875, 72.597...
Rust
0
import numpy as np import pickle from fig3_function_without_importing import acc_psr_fun import matplotlib.pyplot as plt # initialize parameters PSR_vec = np.arange(-20,1,1) print(PSR_vec) num_times = 5 # number of Monte Carlo N = 50 # number of samples SNR = 10 l = len(PSR_vec) acc_moosavi = np.zeros([l,1]) acc_...
Python
1
e::digest_authenticator::DigestAccess>() .unwrap(); d.set_username("Mufasa"); d.set_password("<PASSWORD>"); let auth_str = d.generate_authorization( "GET", "/dir/index.html", None, Some("f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ"), ...
Rust
0
write!(s, ","))?; if !self.having.is_empty() { write!(state, "HAVING")?; state.join(&self.having, |s| write!(s, "AND"))?; } }; Ok(()) } } impl<'q, DB: Database> BindArgs<'q, DB> for GroupSelect where DatabaseValue: for<'p> AppendToArgs<...
Rust
0
# AUTO GENERATED FILE - DO NOT EDIT import typing # noqa: F401 from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401 from dash.development.base_component import Component, _explicitize_args ComponentType = typing.Union[ str, int, float, Component, None, typing.Sequence[t...
Python
1