text
string
label_name
string
labels
int64
"module": "dw_openpose_full", "weight": 1.0, # "preprocessor": "dw_openpose_full", "guidance_start": 0, "guidance_end": 1, "pixel_perfect": False, "control_mode": "Balance...
Python
1
Drop for Renderer { fn drop(&mut self) { check!(gl2::delete_vertex_arrays(&[self.vao])); check!(gl2::delete_buffers(&[self.vbo])); } } <filename>liblumen_core/build.rs use std::fmt::{self, Display}; use std::ops::Range; use std::str::FromStr; // Emit custom cfg types: // cargo:rustc-cfg=has_foo // ...
Rust
0
perty::Existing { ref name, ref val, .. } => { write!(f, "{}", name)?; if let Some(ref data) = *val { if !data.is_empty() { let mut iter = data.iter(); write!(f, " = {}", iter.next().unwrap())?; f...
Rust
0
of CronHorizontalAutoscaler :param _LogEnable: 是否启用log,1为启用,0为不启用 :type LogEnable: int :param _ConfEdited: (除开镜像配置)配置是否修改 :type ConfEdited: bool :param _SpeedUp: 是否开启应用加速 :type SpeedUp: bool :param _StartupProbe: 启动探针配置 :type StartupProbe: :class:`tencentc...
Python
1
model = PPO.load("ppo_humanoid_deep_bullet") # Enjoy trained agent obs = env.reset() for i in range(1000): action, _states = model.predict(obs, deterministic=True) obs, reward, done, info = env.step(action) env.render() if done: obs = env.reset()
Python
1
valid port, keep looking except Exception as e: if not port_future.done(): port_future.set_exception(e) finally: pipe.close() def start(self): self._target_dir.mkdir(exist_ok=True) env = dict(os.environ) env['CARGO_TARGET_DIR'] = str(s...
Python
1
# 声明:本代码仅供学习和研究目的使用。使用者应遵守以下原则: # 1. 不得用于任何商业用途。 # 2. 使用时应遵守目标平台的使用条款和robots.txt规则。 # 3. 不得进行大规模爬取或对平台造成运营干扰。 # 4. 应合理控制请求频率,避免给目标平台带来不必要的负担。 # 5. 不得用于任何非法或不当的用途。 # # 详细许可条款请参阅项目根目录下的LICENSE文件。 # 使用本代码即表示您同意遵守上述原则和LICENSE中的所有条款。 # -*- coding: utf-8 -*- from abc import ABC, abstractmethod import exe...
Python
1
y = AnalysisWindow[:,2] aic = [] for n_components in n_components_range: gmm = GaussianMixture(n_components=n_components, covariance_type='full', random_state=42) gmm.fit(y.reshape(-1, 1)) aic.append(gmm.aic(y.reshape(-1, 1))) optimal_n = n_component...
Python
1
# -*- coding: utf-8 -*- from pandas_ta.utils import get_drift, get_offset, non_zero_range, verify_series def pdist(open_, high, low, close, drift=None, offset=None, **kwargs): """Indicator: Price Distance (PDIST)""" # Validate Arguments open_ = verify_series(open_) high = verify_series(high) low =...
Python
1
) } else { None }) } /// Converts the value to a `u128` if it's in the range 0...std::u128::MAX pub fn to_u128(&self) -> Option<u128> { match *self { I8(v) if v >= 0 => Some(v as u128), I16(v) if v >= 0 => Some(v as u128), I32(v) if v ...
Rust
0
''' Задача 56 Макисмальная сумма цифр Гугол (10100) - гигантское число: один со ста нулями; 100100 почти невообразимо велико: один с двумястами нулями. Несмотря на их размер, сумма цифр каждого числа равна всего лишь 1. Рассматривая натуральные числа вида ab, где a, b < 100, какая встретится максимальная сумма цифр ...
Python
1
H5T_FORTRAN_S1_g; pub static H5T_VAX_F32: &'static id_t = &__imp_H5T_VAX_F32_g; pub static H5T_VAX_F64: &'static id_t = &__imp_H5T_VAX_F64_g; pub static H5T_NATIVE_SCHAR: &'static id_t = &__imp_H5T_NATIVE_SCHAR_g; pub static H5T_NATIVE_UCHAR: &'static id_t = &__imp_H5T_NATIVE_UCHAR_g; pub static H5T...
Rust
0
""" intel_skylake.py: Intel Skylake detection """ from ..base import BaseHardware, HardwareVariant, HardwareVariantGraphicsSubclass from ...base import PatchType from ...shared_patches.monterey_opencl import MontereyOpenCL from .....constants import Constants from .....detections import device_probe from .....dat...
Python
1
from mage_ai.data_preparation.models.block.sql.utils.shared import ( create_upstream_block_tables as create_upstream_block_tables_orig, interpolate_input, ) from mage_ai.io.config import ConfigKey from typing import Dict, List def create_upstream_block_tables( loader, block, cascade_on_drop: bool ...
Python
1
calculates an Ethereum specific signature with: /// sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))). pub fn sign_message(&self, message: &[u8]) -> Result<TxEthSignature, SignerError> { let pack = PackedEthSignature::sign(&self.private_key, &message) .map_err(|err...
Rust
0
########################크루스칼 알고리즘############## # 간선의 갯수가 적다면 크루스칼이 메모리와 속도가 빠르다 # 대표자 찾기 def find_set(x): if parents[x] == x: return x parents[x] = find_set(parents[x]) return parents[x] # 대표자 합치기 def union(x, y): x = find_set(x) y = find_set(y) if x < y: parents[y] = x ...
Python
1
import concurrent.futures import os import pickle from dotenv import load_dotenv from tools.unstructure_pdf import unstructure from xata.client import XataClient load_dotenv() xata = XataClient( api_key=os.getenv("XATA_API_KEY"), db_url=os.getenv("XATA_DB_URL") ) table_name = "ESG" columns = ["id", "language"] ...
Python
1
#!/usr/bin/env python from os import path from datetime import datetime import pytest from netmiko import ConnectHandler from netmiko import NetmikoTimeoutException from test_utils import parse_yaml PWD = path.dirname(path.realpath(__file__)) DEVICE_DICT = parse_yaml(PWD + "/etc/test_devices_exc.yml") def test_valid...
Python
1
from .block_base import block_base import collections from CompileError import CompileError class switch_block(block_base): def __init__(self, line, expr, cases_raw): self.line = line self.expr = expr self.cases_raw = cases_raw def compile(self, func): if len(self.cases_raw) == 0: return result = s...
Python
1
r_lang::prelude::*; #[program] mod composite { use super::*; pub fn initialize(_ctx: Context<Initialize>) -> ProgramResult { Ok(()) } pub fn composite_update( ctx: Context<CompositeUpdate>, dummy_a: u64, dummy_b: u64, ) -> ProgramResult { let a = &mut ctx.ac...
Rust
0
62, 197, 21, 181, 33, 186, 77, 231, 2, 156, 47, 200, 52, 212, 36, 171, 192, 135, 222, 71, 56, 95, 217, 203, 226, 40, 126, 12, 216, 103, 57, 5, 195, 64, 44, 89, 45, 158, 149, 74, 147, 160, 179, 23, 166, 174, 230, 118, 187, ...
Rust
0
dleError{err: "Update older than last processed update", action: Some(ErrorAction::IgnoreError)}); } chan_was_enabled = $target.enabled; $target.last_update = msg.contents.timestamp; $target.enabled = chan_enabled; $target.cltv_expiry_delta = msg.contents.cltv_expiry_delta; $target.h...
Rust
0
## @file # Automate the process of building the various reset vector types # # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import glob import os import subprocess import sys def RunCommand(commandLine): #print ' '.join(commandLine) retu...
Python
1
def delenie(n): try: N = 100 / n return N except ValueError: return "Ошибка: Введена строка" except ZeroDivisionError: return "Ошибка: Введен ноль" def main(): user = input(f"Введите число для деления 100 ") try: n = float(user) N = delenie(n) ...
Python
1
n do_emulation_cycle( clock: &mut Clock, ch8: &mut VirtualMachine, paused: bool, printed_info: &mut bool, cycles_made: &mut u64, advance: bool, ) { if clock.elapsed_time().as_seconds() >= 1.0 / 60.0 { ch8.decrement_timers(); clock.restart(); } if paused && !*printed_...
Rust
0
ed_stream_from_worker_datapipes(datapipe_list=local_datapipes, batch_size=self.batch_size) # We also stream the local worker id for the use-case where we have a recurrent neural network that saves # its state based on the local worker ...
Python
1
from_xprv #[derive(Serialize, Deserialize, ApiType)] pub struct ParamsOfHDKeyPublicFromXPrv { /// Serialized extended private key pub xprv: String, } #[derive(Serialize, Deserialize, ApiType)] pub struct ResultOfHDKeyPublicFromXPrv { /// Public key - 64 symbols hex string pub public: String, } /// Ex...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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...
Python
1
booked_arrival, calling_point.realtime_arrival, calling_point.platform, calling_point.line, calling_point.booked_departure, calling_point.realtime_departure]) elif complexity == "s" or complexity == "s.p": calling_points.append([calling_point.stop_name, calling_point.booked_arrival, calling_point.r...
Python
1
], exhaustive: true } } } else { let schema = StandardSchema::OfKind(quote!(swim_model::ValueKind::Extant)); quote!(#schema) } } }; let attr_schema = match compoun...
Rust
0
isize, propertyid: u32, arrayindex: u32, flags: u32, propertyvaluebuffersize: u32, propertyvaluebuffer: *mut EVT_VARIANT, propertyvaluebufferused: *mut u32) -> super::super::Foundation::BOOL; #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")...
Rust
0
et(&env::predecessor_account_id()) .unwrap_or(0); self.data_mut() .reward_info .insert(&env::predecessor_account_id(), &(old_balance + amount)); env::log( format!( "{} added {} Reward...
Rust
0
''' bellmanFord Bellman-Ford Difficulty: MediumAccuracy: 48.11%Submissions: 153K+Points: 4 Given a weighted and directed graph of v vertices and edges, Find the shortest distance of all the vertex's from the source vertex, src and return a list of integers where the ith integer denotes the distance of the ith node f...
Python
1
n = 10 def solution(n): x = 0 for i in range(1, n+1): if n % i == 0: x += 1 return x a = solution(n) print(a)
Python
1
ollbar(top, orient=tk.VERTICAL) self.textb = Text(top,width=80,height=40, wrap='word', font="arial 11",padx=5,yscrollcommand=scrollbar.set) scrollbar.config(command=self.textb.yview) scrollbar.pack(side=RIGHT, fill=Y) self.textb.pack(side=LEFT, fill=BOTH, expand=1) self.textb.con...
Python
1
urn outputs raise NotImplementedError( f"The type of the sample is {type(samples)}, we currently don't support it now, the " "samples should be either a tensor, list of tensors, a image path or list of image paths." ) @classmethod def load_from_yolov5( cls, ...
Python
1
t('missing folder in metadata: {0}'.format(missing_folder_count)) print('no folder: {0}'.format(no_files)) print('new style urls processed: {}'.format(new_count)) print('new style urls with no match: {}'.format(new_failed_to_match_count)) print('old style urls processed: {}'.format(old_count)) print('old style urls wit...
Python
1
, _: &'a [u8]) -> Self::Item; /// Associated type used for building an item in `MultiVector` based on /// this variadic type. /// /// The builder is returned by /// [`MultiVector::grow`](struct.MultiVector.html#method.grow) /// method. It provides convenient methods `add_{variant_name}` for eac...
Rust
0
}; } } //! This file contains the dispatcher configurations used in various example projects. use specs::prelude::*; use specs_engine::*; use crate::systems::*; pub fn example_1_dispatcher<'a, 'b>(change_color:bool) -> Dispatcher<'a, 'b> { let mut builder = specs::DispatcherBuilder::new() .with(Ch...
Rust
0
enting the possible errors from trying to borrow a `WeakCell<T>` as `ArcRef<T>`. #[derive(Debug)] pub enum WeakBorrowError { /// Failure due to a `BorrowError`. BorrowError(BorrowError), /// Failure due to an `UpgradeError`. UpgradeError(UpgradeError), } #[derive(Debug)] /// An enum representing the po...
Rust
0
lse(|| ().into())), ); lib.set_fn_2_mut( "mixin", |map1: &mut Map, map2: Map| { map2.into_iter().for_each(|(key, value)| { map1.insert(key, value); }); Ok(()) }, ); lib.set_fn_2( "+", |mut map1: Map, map2: Map| {...
Rust
0
} fn complete(&mut self) { let mut observers = self.observers.lock().unwrap(); observers .iter_mut() .for_each(|subscriber| subscriber.complete()); observers.clear(); self.is_stopped = true; } #[inline] fn is_stopped(&self) -> bool { self.is_stopped } } impl<Item, Err, O> Observ...
Rust
0
import tkinter as tk from tkinter import messagebox # Function to handle button presses def press(key): current = entry.get() entry.delete(0, tk.END) entry.insert(0, current + key) # Function to clear the input field def clear(): entry.delete(0, tk.END) # Function to evaluate the entered expression d...
Python
1
tc.case.comment, g.tag_size ); let valid = tc.case.result == tink_testutil::WycheproofResult::Valid; let aes = match tink_mac::subtle::AesCmac::new(&tc.key, g.tag_size as usize / 8) { Err(e) => { if valid { ...
Rust
0
"""`eds.peptic_ulcer_disease` pipeline""" from typing import List, Optional from spacy.tokens import Doc, Span from edsnlp.core import PipelineProtocol from edsnlp.pipes.base import SpanSetterArg from edsnlp.pipes.core.contextual_matcher.models import FullConfig from edsnlp.pipes.ner.disorders.base import DisorderMa...
Python
1
p..p + n { self.used.insert(p); } } } use crate::error; use crate::eval; use crate::log; use std::sync::{ atomic::{AtomicI32, Ordering::SeqCst}, Arc, Mutex, RwLock, }; use std::time::{SystemTime, UNIX_EPOCH}; use tokio::time::{sleep, Duration}; pub const FUNCTIONS: &'static [&'static s...
Rust
0
.file(format!("{}/ClpDynamicMatrix.cpp", COIN_CLP_SRC)) .file(format!("{}/ClpEventHandler.cpp", COIN_CLP_SRC)) .file(format!("{}/ClpFactorization.cpp", COIN_CLP_SRC)) .file(format!("{}/ClpGubDynamicMatrix.cpp", COIN_CLP_SRC)) .file(format!("{}/ClpGubMatrix.cpp", COIN_CLP_SRC)) ...
Rust
0
ation in HH:MM format party_size: Number of people in the party hotel_id: Hotel identifier (uses default if not provided) guest_room: Guest's room number special_requests: Any special requests dietary_restrictions: Dietary restrictions or allergies Re...
Python
1
DataLoader(test_dataset, batch_size=1, shuffle=False,num_workers=1,pin_memory=True) # config for network and training parameters bsn_teacher = BSN(n_channels = 1,n_output = 1).cuda() if opt.test_mode: bsn_teacher.load_state_dict(torch.load(opt.bsn_path)) optim = Adam(bsn_teacher.parameters(...
Python
1
/// This function is similar with `exec`, but all check & checkpoints are removed. pub fn exec_static(&self, context: Context, tx: Transaction) -> Result<InterpreterResult, Error> { if tx.to.is_none() { return Err(Error::CreateInStaticCall); } let mut iparams = reinterpret_tx...
Rust
0
消息 start_str = ResultFormatter.get_week_start_description(dt, week) repeat_str = RepeatDescriptionGenerator.generate_repeat_description(repeat, holiday_type) # 确定项目类型名称 type_names = { 'reminder': '提醒', 'task': '任务', ...
Python
1
ception(status_code=500, detail=f"An unexpected error occurred.{str(e)}") @router.get("/{election_id}/results-breakdown/") def results_breakdown(election_id: int): query = ResultsBreakdownQuery(election_id=election_id) try: result = query_bus.handle(query) return result except Valu...
Python
1
.format(num - num_after, num, num_after)) return filtered_roidb def train_net(network, imdb, roidb, valroidb, output_dir, tb_dir, pretrained_model=None, max_iters=40000): """Train a Faster R-CNN network.""" roidb = filter_roidb(roi...
Python
1
#!/usr/bin/env python3 import tkinter as tk from CAMERA.camera_session import capture_raw_image, init_camera from ZONE_DETECT.get_zone import detect_zone def display_hull(hull, canvas_width=600, canvas_height=600, cm_scale=10): """ Desenează hull-ul primit (în cm) pe un canvas Tkinter unde (0,0) este în centru...
Python
1
_trans = str.maketrans( {";": ",", "“": '"', "”": '"', "‘": "'", "’": "'"} ) # add custom trans here, to address oov def is_chinese(c): return ( "\u3100" <= c <= "\u9fff" # common chinese characters ) for text in text_list: char_list = [] text = text.t...
Python
1
//参数是方法接收器的所有权,则立即返回错误 return Err(Error::new(ErrorKind::Other, format!("Generate fucntion call failed, function: {}, arg: {}, reason: not allowed take owner of receiver type", func_name, arg_name))); }, _ => { ...
Rust
0
db)) .and_then(handlers::delete_item) } /// POST /item fn post_item( db: models::SafeDB, ) -> impl Filter<Extract = (impl warp::Reply,), Error = warp::Rejection> + Clone { warp::path("item") .and(warp::post()) .and(with_db(db)) .and(json_body()) .and_then(handlers::add_i...
Rust
0
e": "Hrvatski"}, {"code": "ht", "english": "Haitian Creole", "native": "Kreyòl ayisyen"}, {"code": "hu", "english": "Hungarian", "native": "magyar"}, {"code": "hy", "english": "Armenian", "native": "Հայերեն"}, {"code": "hz", "english": "Herero", "native": "Otjiherero"}, {"code": "ia"...
Python
1
usize); fn Ball_TA_GetTrajectoryStartVelocity(obj: usize, result: *mut Vector); fn Ball_TA_GetTrajectoryStartRotation(obj: usize, result: *mut Rotator); fn Ball_TA_GetTrajectoryStartLocation(obj: usize, result: *mut Vector); fn Ball_TA_ShouldDrawTrajectory(obj: usize) -> bool; fn Ball_TA_GetAdditio...
Rust
0
s[i][j], matchedUnvoweledPatterns[i], matchedVoweledPatterns[i][j]]); return RefinedMatches; pass def __GetIntersectionsOfVoweledPatterns(self, matchedPatterns, roots, voweledPatterns): ''' أخذ التقاطعات للأوزان المشّكلة, بين قائمة الجذر وقائمة الأوزان الغير مشكّلة يعيد قائم...
Python
1
let m = mutex_pool::alloc_mutex().expect("mutex pool exhausted"); Some(DynMutex(NonNull::new_unchecked(m))) } } } impl Drop for DynMutex { fn drop(&mut self) { unsafe { #[cfg(not(mutex_pool))] Box::from_raw(self.0.as_mut()); #[cfg(mu...
Rust
0
ize>( m1: &[[E::Fr; DIM]; DIM], m2: &[[E::Fr; DIM]; DIM], ) -> [[E::Fr; DIM]; DIM] { let transposed_m2 = transpose::<E, DIM>(m2); let mut result = [[E::Fr::zero(); DIM]; DIM]; for (i, rv) in m1.iter().enumerate() { for (j, cv) in transposed_m2.iter().enumerate() { result[i][j] ...
Rust
0
0, 0, 0, 0, 0, 0]); assert_eq!(byte_to_bits_le(255), vec![1, 1, 1, 1, 1, 1, 1, 1]); } } // Copyright (c) 2020 <NAME> // SPDX-License-Identifier: Apache-2.0 OR MIT // #![forbid(unsafe_code)] use crate::cliprect::ClipRect; use crate::cursor::Cursor; use crate::fonts; use crate::fonts::{GlyphSet, NoGlyphErr}...
Rust
0
# Slicing # Accessing parts of a string # str[ starting_idx: ending_idx] #ending idx is not included # str = "ApnaCollege" # str[ 1 : 4 ] is “pna” # str[ :4] is same as str[ 0 : 4] # str[ 1 ] is same as str[ 1 : len(str) ] # Indexing index ↓ • position # Apna Colege # - # 0 1 2 3 4 5 6 7 8 9 10 11 # str = "Apna_Colle...
Python
1
a += '\x02\x00\x00\x00' #os unknown data += host_os.ljust(32, '\x00') data += '\x00' * 96 data += AUTH_VERSION if ror_version: data += '\x00' + chr(len(pwd)) data += ror(md5sum('\x03\x01' + salt + pwd), pwd) data += '\x02\x0C' data += checksum(data + '\x01\x26\x07\x11\x00\x00' + ...
Python
1
for (n, p) in gtn.model.named_parameters() if n == config.inner_params[-1]][0] edited_param = [p for (n, p) in edited.model.named_parameters() if n == config.inner_params[-1]][0] LOG.info((orig_param - edited_param).abs().max()) edited.eval() LOG.info(gtn(x, labels=x).loss, edited(x, labels=x).loss, ed...
Python
1
self.odoms[i].child_frame_id = str(i) #da bi mogao vidjet ko je to poslao i onda dobit od njega zetu, a da ne moram mjenjat poruku i nes dodatno komplicirat neighbours_dict[f'robot_{j}'].append(self.odoms[i]) #j-ti robot prima odometriju od i-tog i uskladuje se (...
Python
1
_stack_alloc_no_gc(), "small_heap_alloc_no_gc" => small_heap_alloc_no_gc(), "small_heap_alloc_no_gc_2" => small_heap_alloc_no_gc_2(), "large_alloc_no_gc_flat_obj" => large_alloc_no_gc_flat_obj(), "small_local_store" => small_local_store(), "shallow_load" => shallow_load(), ...
Rust
0
, level: DWORD, buf: LPBYTE, parm_err: LPDWORD, ) -> NET_API_STATUS; pub fn NetShareDel( servername: LMSTR, netname: LMSTR, reserved: DWORD, ) -> NET_API_STATUS; pub fn NetShareDelSticky( servername: LMSTR, netname: LMSTR, reserved:...
Rust
0
as_str() .expect("API break, 'listunspent` entry contains a non-string desc") }) { // If we have a descriptor, we derive only once, so the derivation index must be // between `/` and `]` let derivation_index_start = d.find('/'); let derivation_inde...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayInsSceneInvoiceApplyResponse(AlipayResponse): def __init__(self): super(AlipayInsSceneInvoiceApplyResponse, self).__init__() self._invoice_apply_no = None ...
Python
1
from typing import Tuple import pandas as pd import torch from sklearn.model_selection import train_test_split from tabularbench.constraints.constraints_backend_executor import ( ConstraintsExecutor, ) from tabularbench.constraints.pytorch_backend import PytorchBackend from tabularbench.constraints.relation_const...
Python
1
r, prefix="/mcp", tags=["LLM Load"]) app.include_router(prompt_router, prefix="/mcp", tags=["Prompt"]) app.include_router(model_prompt_router, prefix="/mcp", tags=["Model Prompt"]) app.include_router(memory_router, prefix="/mcp", tags=["Memory"]) app.include_router(sampling_router, prefix="/mcp", ta...
Python
1
r: JobStreaming, pub writer: Box<dyn Write>, } pub struct JobCollection { jobs_done: Vec<usize>, pub jobs: VecDeque<Job>, } impl JobFactory for JobCollection { fn job_peek(&self) -> Option<&Job> { self.jobs.get(0) } fn job_get(&mut self) -> Job { self.jobs .pop_fro...
Rust
0
c<Any>, LinkError> { if self.batch.is_empty() { warn!("assemble_msgs() method call on an empty OperationalData!"); return Ok(vec![]); } // For zero delay we prepend the client update msgs. let client_update_msg = if relay_path.zero_delay() { let updat...
Rust
0
(b'p', 48), (b'q', 49), (b'r', 50), (b's', 51), (b't', 52), (b'u', 53), (b'v', 54), (b'w', 55), (b'x', 56), (b'y', 57), (b'z', 58), (b'{', 59), (b'|', 60), (b'}', 61), (b'~', 62), ].into_iter().collect(); } lazy_static!{ pub static ref SOLEXA_HASHMAP_ENCODE: HashMap<u8, u8> = vec![ (b'@', 0), (b'A', 1)...
Rust
0
decoding != 0 { let ref mut fresh7 = *l_data.offset(i as isize); *fresh7 = (*l_tile_comp).data as *mut OPJ_BYTE } else { let ref mut fresh8 = *l_data.offset(i as isize); *fresh8 = (*l_tile_comp).data_win as *mut OPJ_BYTE } l_tile_comp = l_tile_comp.offset(...
Rust
0
_or(label) } fn translate(&self, label: &str) -> Option<&str> { let translations = if let Some(translations) = self.translations.get(self.current_lang.as_str()) { translations } else { self.translations.get(DEFAULT_LANG)? }; translations.get(label).map(St...
Rust
0
m2d(out_channels) if config.batch_size > 1 else nn.Identity() self.relu = nn.ReLU(inplace=True) self.dropout = nn.Dropout(0.5) def forward(self, x): x1 = self.aspp1(x) x_aspp_deforms = [aspp_deform(x) for aspp_deform in self.aspp_deforms] x5 = self.global_avg_pool(x) ...
Python
1
# Obtenha as dezenas mais sorteadas nos últimos 20 concursos def obter_dezenas_mais_sorteadas_ultimos_20(resultados, ultimos_sorteios=20): dezenas_sorteadas = {} for resultado in resultados[:ultimos_sorteios]: numeros_sorteados = list(map(int, resultado.split(","))) for numero in numeros_so...
Python
1
", False) if (use_short and use_long) or (not use_short and not use_long): half = args.num_prompts // 2 if not patterns_short and not patterns_long: raise ValueError("❌ Nessun pattern corto o lungo trovato nel file JSON. Controlla il file e riprova.") if patterns_short: ...
Python
1
hits up to `TEST_COUNT` times to make //! false positives less likely. Only when all of these tests are positive a pattern is flagged as //! superlinear. //! To prevent further edge-cases, we always align the tested input to pattern boundaries. //! //! Additionally, we abort if parsing took longer than `MAX_MILLIS`. /...
Rust
0
pub struct Invalid; impl<T> Validate<Invalid> for T { #[inline(always)] fn validate(self) -> Result<Self, &'static str> { Err("not valid") } } impl<T> Validate<Valid> for T { #[inline(always)] fn validate(self) -> Result<Self, &'static str> { Ok(self) } } impl<T: Validate<U> + Validate<V>, U, V> Validate<...
Rust
0
let l_series = df.column(w[0].as_ref()).map_err(|e| { ShellError::GenericError( "Error selecting columns".into(), e.to_string(), Some(col_span), None, Vec::new(), ) ...
Rust
0
es_t) trace_t = tf.reshape(trace_t, [shape_f[0], 1]) trace_t = tf.tile(trace_t, [1, shape_f[2]]) trace_t = 0.001*tf.matrix_diag(trace_t) return tf.add(features_t,trace_t) ''' # LogEig Layer def _cal_log_cov(features): [s_f, v_f] = tf.self_adjoint_eig(features) s_f = tf.log(s_f) s_f = tf.mat...
Python
1
import pandas as pd import numpy as np price_data = pd.read_csv("data/结果/full_销售单价.csv").iloc[:, 4:-1].values mask = price_data > 0 price_means = np.sum(price_data * mask, axis=0) / np.sum(mask, axis=0).ravel() sale_data = ( pd.read_csv("data/结果/result_2023_multi.csv") .iloc[-1:, 1:] .values.reshape(-1) ...
Python
1
println!("Result = {}", result); } } <reponame>edgex004/rust-hdl use std::collections::BTreeMap; use std::fmt::{Display, Formatter}; use enum_iterator::IntoEnumIterator; use rust_hdl_pcb_core::prelude::*; #[derive(Copy, Clone, Debug, PartialEq)] pub enum InputType { Nominal05, Nominal12, Nominal24...
Rust
0
# Copyright (c) DataLab Platform Developers, BSD 3-Clause license, see LICENSE file. """ Signal delta x dialog unit test. """ # pylint: disable=invalid-name # Allows short reference names like x, y, ... # guitest: show from guidata.qthelpers import exec_dialog, qt_app_context from cdl.algorithms.signal import full...
Python
1
.map(|l| l.unwrap()) .collect(); db.write_lines(&lines).await?; // Now, we should see the two tables assert_eq!( table_names(&db, Predicate::default()).await?, to_set(&["cpu", "disk"]) ); Ok(()) } #[tokio::test] async fn...
Rust
0
import keras import numpy as np from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Dropout from keras.models import Sequential from six.moves import cPickle as Pickle batch_size = 128 num_classes = 48 epochs = 12 pickle_file = 'data.pickle' with open(pickle_file, 'rb') as f: save = Pickle.load(f) ...
Python
1
is_bgzf: u32 = unsafe { ::std::mem::transmute(is_bgzf) }; is_bgzf as u64 }); __bindgen_bitfield_unit.set(5usize, 27u8, { let dummy: u32 = unsafe { ::std::mem::transmute(dummy) }; dummy as u64 }); __bindgen_bitfield_unit } } #[repr(C)] #[derive(Deb...
Rust
0
for IDXGIResource { fn iid() -> GUID { IID_IDXGIResource } } impl QueryIID for IDXGIResource1 { fn iid() -> GUID { IID_IDXGIResource1 } } impl QueryIID for IDXGISurface { fn iid() -> GUID { IID_IDXGISurface } } impl QueryIID for IDXGISurface1 { fn iid() -> GUID { IID_IDXGISurface1 } } impl QueryIID for IDXGISurface2 { ...
Rust
0
64 + PAD, 0)), ); // flat left display.draw( Triangle::new(Point::new(0, 0), Point::new(0, 64), Point::new(64, 30)) .stroke_color(Some(BinaryColor::On)) .translate(Point::new((64 + PAD) * 2, 0)), ); // flat bottom display.draw( Triangle::new(Point::new(2...
Rust
0
#[doc = " func(env.seeds, env.numSeeds);"] #[doc = " ```"] #[doc = " However, one should not rely upon their local pointer from getQuESTSeeds() to be"] #[doc = " automatically updated after a subsequent call to seedQuEST() or seedQuESTDefault()."] #[doc = " Instead, getQuESTSeeds() should be rec...
Rust
0
import numpy as np import open3d as o3d import copy def main(): orig_model = o3d.io.read_point_cloud( "data/assign01/BunnyXYZ.pcd") down_model = copy.deepcopy(orig_model) down_model = down_model.translate((0.2, 0, 0)) ''' # RANDOM sample_size = 1.0 sample_inc = 0.01 min_sam...
Python
1
peration<OnlineIdSystemTicketResult>>> { unsafe { let mut out = null_mut(); let hr = ((*self.lpVtbl).GetTicketAsync)(self as *const _ as *mut _, request as *const _ as *mut _, &mut out); if hr == S_OK { Ok(ComPtr::wrap(out)) } else { err(hr) } }} #[inline] pub fn set_application_id(&sel...
Rust
0
> for Allocations<'a> { type Output = CowStr<'a>; fn index(&self, ix: CowIndex) -> &Self::Output { self.cows.index(ix.0) } } impl<'a> Index<LinkIndex> for Allocations<'a> { type Output = (CowStr<'a>, CowStr<'a>); fn index(&self, ix: LinkIndex) -> &Self::Output { self.links.index(i...
Rust
0
=> None, Nature::Hasty => Some(StatType::Speed), Nature::Impish => Some(StatType::Defense), Nature::Jolly => Some(StatType::Speed), Nature::Lax => Some(StatType::Defense), Nature::Lonely => Some(StatType::Attack), Nature::Mild => Some(StatType::Sp...
Rust
0
: &mut UserInfo) -> Uint128 { let staked_lp_shares = user_info.lp_shares - user_info.withdrawn_lp_shares; let pending_user_rewards = (staked_lp_shares * state.global_astro_reward_index) - (staked_lp_shares * user_info.astro_reward_index); user_info.astro_reward_index = state.global_astro_reward_inde...
Rust
0
B = topi.argmin(A1, axis=axis, keepdims=keepdims) out_dtype = "int32" else: raise NotImplementedError target_hexagon = tvm.target.hexagon("v68") with tvm.target.Target(target_hexagon): fschedule = topi.hexagon.schedule_reduce s = fschedule(B) func = tvm.build( ...
Python
1