text
string
label_name
string
labels
int64
name))?; let mut props = MachineProps::default(); props.name = mach_name.to_owned(); // emoji-version let emoji_version = obj .remove(&Yaml::String("emoji-version".into())) .ok_or_else(|| { format!("missing field 'emoji-version' in '{}'", mach_name) })?; let emoji_version...
Rust
0
import re import os import pathlib oss_output_dir = os.path.join('output', 'typomind') minified_output_dir = os.path.join('output') all_packages = [pathlib.Path(f).stem for f in os.listdir(oss_output_dir) if os.path.isfile(os.path.join(oss_output_dir, f))] with open(os.path.join(minified_output_dir, 'targets.csv'), ...
Python
1
class Solution: def isItPossible(self, word1: str, word2: str) -> bool: count1 = collections.Counter(word1) count2 = collections.Counter(word2) distinct1 = len(count1) distinct2 = len(count2) for a in count1: for b in count2: if a == b: # Swapping the same chars won't chan...
Python
1
ndarDateFill => '\u{f1d1}', Icon::CalendarDay => '\u{f1d4}', Icon::CalendarDayFill => '\u{f1d3}', Icon::CalendarEvent => '\u{f1d6}', Icon::CalendarEventFill => '\u{f1d5}', Icon::CalendarFill => '\u{f1d7}', Icon::CalendarMinus => '\u{f1d9}', Icon::CalendarMinusFill => '\u{f1d8}', Icon::CalendarMonth => '...
Rust
0
for i in range(10): tc=int(input()) row_list=[list(input()) for _ in range(100)] col_list=list(map(list,zip(*row_list))) cnt=0 for i in range(100): for j in range(100): for k in range(j+1,101): slice_row = row_list[i][j:k] slice_col = col_list[i...
Python
1
const PROBE2: (usize, usize) = (PROBE1.0 + 2, PROBE1.1 + 1); // Apply voltage source to probe1 and apply ground to probe2. const V_SOURCE: f64 = 1.0; const V_GROUND: f64 = 0.0; state[coords_to_index(PROBE1.0, PROBE1.1)] = V_SOURCE; state[coords_to_index(PROBE2.0, PROBE2.1)] = V_GROUND; let mut r...
Rust
0
_name="fdimf"] pure fn abs_sub(a: c_float, b: c_float) -> c_float; #[link_name="floorf"] pure fn floor(n: c_float) -> c_float; #[link_name="frexpf"] pure fn frexp(n: c_float, &value: c_int) -> c_float; #[link_name="fmaf"] pure fn mul_add(a: c_float, ...
Rust
0
F2_9C8E), (r"icons\s\b_tx_s_alm_intervt.dds", 0x4A37_1327, 0x2DF7_3240), (r"icons\s\b_tx_s_water_breath.dds", 0x4A37_1327, 0x2F1A_CFE6), (r"icons\s\b_tx_s_light_shield.dds", 0x4A37_1327, 0x2FEE_F38C), (r"icons\s\b_tx_s_rst_cpsdise.dds", 0x4A37_1327, 0x32BD_4FC5), (r"icons\s\b_tx_s_cure_comdise....
Rust
0
lf } pub fn add_label(&mut self, label: Box<dyn Value>) -> &mut Self { self.label = label; self } pub fn boxed(&self) -> Box<dyn Value> { Box::new(self.to_owned()) } } <reponame>krsnnik/lighthouse<filename>beacon_node/eth2-libp2p/src/lib.rs<gh_stars>0 /// This crate contains the main link for li...
Rust
0
p.zeros_like(image, dtype=np.uint8) overlay[mask > 0] = color blended = cv2.addWeighted(image, 1 - alpha, overlay, alpha, 0) # ปรับความสว่างของภาพให้อยู่ในช่วงปกติ blended = cv2.normalize(blended, None, 0, 255, cv2.NORM_MINMAX) return blended while True: if zed.grab() == sl.ERROR_CODE...
Python
1
_ck(), Val(d2ccip2r::LPTIM1SEL_A::PLL3_R) => clocks.pll3_r_ck(), Val(d2ccip2r::LPTIM1SEL_A::LSE) => unimplemented!(), Val(d2ccip2r::LPTIM1SEL_A::LSI) => unimplemented!(), Val(d2ccip2r::LPTIM1SEL_A::PER) => clocks.per_ck(), _ => unreachable!(), } } ...
Rust
0
es to be activated: `SvgaElement`*"] pub fn set_ping(this: &SvgaElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "SVGAElement" , js_name = rel)] #[doc = "Getter for the `rel` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.o...
Rust
0
_each(|(idx, &oidx)| output[oidx] = items[idx].clone()); } false => { permutation .iter() .enumerate() .for_each(|(idx, &oidx)| output[idx] = items[oidx].clone()); } }; items.clear(); items.extend(output); } #[cfg(test)] m...
Rust
0
"""Server script. This is not used in this baseline. Please refer to the strategy-specific server files. """
Python
1
::pyo3::ffi::PyTypeObject, _args: *mut ::pyo3::ffi::PyObject, _kwargs: *mut ::pyo3::ffi::PyObject) -> *mut ::pyo3::ffi::PyObject { use ::pyo3::typeob::PyTypeInfo; const _LOCATION: &'static str = concat!(stringify!(#cls),".",stringify!(#name),"()"); l...
Rust
0
@ratio: 1.0; "", "", ""; @part_per_hundred: 1.0_E-2; "parts per hundred", "part per hundred", "parts per hundred"; @percent: 1.0_E-2; "%", "percent", "percent"; @part_per_thousand: 1.0_E-3; "parts per thousand", "part per thousand", "parts per thousand"; @per_mille: 1.0_E...
Rust
0
# -*- coding: utf-8 -*- """Decomposition-AA-RNN-Published """ import numpy as np import pandas as pd from pandas.core.nanops import nanmean as pd_nanmean from statsmodels.tsa.seasonal import DecomposeResult from statsmodels.tsa.filters._utils import _maybe_get_pandas_wrapper_freq import statsmodels.api as sm import ma...
Python
1
impl<T: sealed::VariableLengthOnion> Features<T> { #[cfg(test)] pub(crate) fn requires_variable_length_onion(&self) -> bool { <T as sealed::VariableLengthOnion>::requires_feature(&self.flags) } pub(crate) fn supports_variable_length_onion(&self) -> bool { <T as sealed::VariableLengthOnion>::supports_feature(&s...
Rust
0
enGl, (3, 3)); let gl_profile = GlProfile::Core; let (events_loop, gl_window, width, height) = if headless { let headless_context = glutin::HeadlessRendererBuilder::new(width, height) // .with_gl(gl_request) // .with_gl_profile(gl_profi...
Rust
0
-08 17:55:58 */ use std::cmp; fn house_robber_linear(nums: &Vec<i32>) -> i32 { let size = nums.len(); if size <= 2 { return cmp::max(nums[0], nums[1]); } let mut dp = vec![i32::MIN; size]; dp[0] = nums[0]; dp[1] = nums[1]; for i in 2..size { dp[i] = cmp::max(dp[i - 2] + n...
Rust
0
}\n" f"Time range in data: {min(self.foo[self.time_variable])}" f" - {max(self.foo[self.time_variable])}\n" f"Time range for loss minimization: {self.time_optimize_ssr}\n" f"Time range for predictors: {self.time_predictors_prior}\n" f"Predictors: {', '.join([s...
Python
1
rigin.x; new_geo.size.w = MIN_SIZE.w; } if new_geo.size.h < MIN_SIZE.h { new_geo.origin.y = geo.origin.y; new_geo.size.h = MIN_SIZE.h; } new_geo } /// If the geometry is at the minimum size (in either the x or y plane) /// and the pointer is trying to make it even smaller in th...
Rust
0
from urllib import parse # Create your views here. from apps.common.config import commonWebConfig from apps.common.func.WebFunc import * logger = logging.getLogger("django") def businessLineModuleCheckPage(request): context = {} context["businessLine_module_check"] = "active" return render(request, "myad...
Python
1
s.user_id, s.company_id, s.sale_journal, s.pricelist_id, s.account_move, s.create_date, s.session_id, l.product_id, pt.categ_id, pt.pos_categ_id, p.product_tmpl_id, ps.config_id """ def init(self): tools....
Python
1
""" This module contains classes and functions for formatting log messages. """ from logging import Formatter, LogRecord from typing import Literal, Optional, Any class CustomFormatter(Formatter): """ This class is used for custom formatting of log messages. """ # Colors for log levels colors = ...
Python
1
ance(ckpt.names, (list, tuple)): ckpt.names = dict(enumerate(ckpt.names)) # convert to dict model.append( ckpt.fuse().eval() if fuse and hasattr(ckpt, 'fuse') else ckpt.eval() ) # model in eval mode # Module compatibility updates for m in model.modules(): t = ...
Python
1
5d0-8d14-01424a72b11e", r"ПараметрыСеанса"); retval.insert(r"30d554db-541e-4f62-8970-a1c6dcfeb2bc", r"ПараметрыФункциональныхОпций"); retval.insert(r"37f2fa9a-b276-11d4-9435-004095e12fc7", r"Подсистемы"); retval.insert(r"39bddf6a-0c3c-452b-921c-d99cfa1c2...
Rust
0
"description": "Allow the uploading of certificates to AWS IAM", "slug": "aws-destination", "title": "AWS" }, "label": "test546" } "total": 1 } :query sor...
Python
1
tuple = ("1", "2", "3") tuple = tuple[:-1] print(tuple)
Python
1
line_type: LineType::Paragraph } } pub fn into_raw(&self) -> Vec<u16> { vec![vec![U16_SPACE;self.indent], self.content.clone()].concat() } pub fn render(&self) -> Vec<u16> { match self.line_type { LineType::Paragraph => self.render_paragraph(), ...
Rust
0
from collections import deque def solution(maps): # ➊ 이동할 수 있는 방향을 나타내는 배열 move 선언 move = [[-1, 0], [0, -1], [0, 1], [1, 0]] # ➋ 맵의 크기를 저장하는 변수 선언 n = len(maps) m = len(maps[0]) # ➌ 거리를 저장하는 배열 dist를 -1로 초기화 dist = [[-1] * m for _ in range(n)] # ➍ bfs 함수를 선언 def bfs(start): # ➎ deque를 선언, 시작 위...
Python
1
= transform_type(ty) { if expr.into_token_stream().to_string() == "0" { return Some(ConstValue::String(String::new())); } } None } fn transform_array(ty: &syn::TypeArray, size: &syn::Expr) -> Option<Type> { let size = match extract_array_size(size) { None => return None...
Rust
0
d[User, Depends(get_current_user)] CurrentUserNotActive = Annotated[User, Depends(get_current_user_not_active)] AsyncCurrentUser = Annotated[User, Depends(get_async_current_user)] async def get_current_active_superuser(current_user: CurrentUser) -> User: if not current_user.isSuperuser: raise UserWithNotE...
Python
1
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
Python
1
import time import board from analogio import AnalogIn from digitalio import DigitalInOut, Direction, Pull import usb_hid from adafruit_hid.mouse import Mouse from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode # Initialize joystick pins x_axis = AnalogIn(board.A1) # Joystick x-axis y_...
Python
1
s": True, "progression_short_sidequests": True, "progression_mail": True, "progression_submarines": True, "progression_expensive_purchases": False, "progression_island_puzzles": True, "progression_misc": True, "randomize_mapcompass": "startwith", "required...
Python
1
).unwrap(); //! //! assert_eq!(Vec::from_iter(result_multi .iter().map(|&i| i)), //! Vec::from_iter(result_single.iter().map(|&i| i))); //! ``` //! //! # Special thanks //! //! To all who support further development on [Patreon](https://patreon.com/nabijaczleweli), in particular: //! //! * ThePhD //! * E...
Rust
0
{ v[between.sample(&mut rng)] = G::zero(); } for _ in 0..5 { let s = between.sample(&mut rng); v[s] = v[s].into_affine().into_projective(); } let expected_v = v .iter() .map(|v| v.into_affine().into_projective()) ....
Rust
0
masked* before writing it to the //! // bitfield. This makes it impossible to write, for example, `6` to a 2-bit //! // field; instead, `6 & 3` (i.e. `2`) will be written to the bitfield. //! ``` //! //! ## `modify` //! //! Finally, the `modify` method performs a **single** read-modify-write //! operation that involves...
Rust
0
cmpl = doc.completion(Position(12, 21)) assert "cl-schemadef-import.cwl" in [c.label for c in cmpl] # The completer should look for all files in the current directory cmpl = doc.completion(Position(4, 11)) assert "./paired_end_record.yml#paired_end_options" in [c.label for c in cmpl] # The comp...
Python
1
indent=4) @staticmethod def extract_response(data): generated_text = data['results'][0]['generated_text'] # Parse generated text to extract each component based on labeled titles lines = generated_text.split("\n") structured_response = {} for line in lines: ...
Python
1
def solution(arr1, arr2): answer = 0 for i in range(len(arr1)): for j in range(len(arr2)): for k in range(len(arr2)): answer += arr1[i][j] * arr2[k][j] return answer print(solution([[1,4],[3,2],[4,1]],[[3,3],[3,3]]))
Python
1
let ref mut fresh18 = (*(*article).beads.offset(i as isize)).id; *fresh18 = 0 as *mut i8; (*(*article).beads.offset(i as isize)).page_no = -1i32; } } bead = &mut *(*article).beads.offset((*article).num_beads as isize) as *mut pdf_bead; if !bead...
Rust
0
Iterator, Panic> { match (self.limits, self.start, self.end) { (RangeLimits::HalfOpen, Some(Value::Integer(start)), Some(Value::Integer(end))) => { return Ok(Iterator::from_double_ended("std::ops::Range", start..end)); } (RangeLimits::Closed, Some(Value::Integ...
Rust
0
u8, pub feedback_id: u8, pub feedback_class: u8, pub percent: i8, } impl Default for xcb_input_device_bell_request_t { fn default() -> Self { unsafe { std::mem::MaybeUninit::zeroed().assume_init() } } } /// The cookie for the reply to a `Input::SetDeviceValuators` request. /// /// Pass th...
Rust
0
let parsed: Result<ApiSuccess<ResultType>, reqwest::Error> = resp.json().await; Ok(parsed?) } else { let parsed: Result<ApiErrors, reqwest::Error> = resp.json().await; if let Some(e) = parsed?.errors.pop() { Err(e.into()) } else { ...
Rust
0
button_layout.addWidget(update_button) button_layout.addWidget(cancel_button) # Add the buttons to the layout layout.addLayout(button_layout) # Set the main layout of the dialog dialog.setLayout(layout) # Connect buttons to actions def on_ok(): ...
Python
1
import numpy as np from functools import lru_cache from scipy.stats import multivariate_normal @lru_cache() def get_gauss_pdf(sigma): n = sigma * 8 x, y = np.mgrid[0:n, 0:n] pos = np.empty(x.shape + (2,)) pos[:, :, 0] = x pos[:, :, 1] = y rv = multivariate_normal([n / 2, n / 2], [[sigma ** ...
Python
1
} fn node_remove(tree: &mut KDTree2D, index: usize) { let mut node_index = tree.nodes_map[index]; if node_index == KDNODE_UNSET { return; } else { tree.nodes_map[index] = KDNODE_UNSET; } tree.totnode -= 1; debug_assert!((tree.nodes[node_index].flag & KDNODE_FLAG_REMOVED) == 0)...
Rust
0
# Build Tower # Build a pyramid-shaped tower, as an array/list of strings, given a # positive integer number of floors. A tower block is represented # with "*" character. # For example, a tower with 3 floors looks like this: # [ # " * ", # " *** ", # "*****" # ] # And a tower with 6 floors looks like this:...
Python
1
m_BackgroundSubtractorCNT_apply_const__InputArrayR_const__OutputArrayR_double(self.as_raw_mut_BackgroundSubtractorCNT(), image.as_raw__InputArray(), fgmask.as_raw__OutputArray(), learning_rate) }.into_result() } fn get_background_image(&self, background_image: &mut dyn core::ToOutputArray) -> Result<()> { output_...
Rust
0
serde::{Deserialize, Serialize}; use structopt::StructOpt; use thiserror::Error; use self::hoard::Hoard; use environment::Environment; use crate::command::Command; use crate::CONFIG_FILE_STEM; use crate::HOARDS_DIR_SLUG; use self::hoard::Config as PileConfig; use super::Config; pub mod environment; pub mod envtrie...
Rust
0
, ); } #[allow(unused)] let mut written_len: usize = 8; unsafe { std::ptr::copy( &x as *const Int, &mut send_buffer[written_len] as *mut u8 as *mut Int, 1, ); } #[allow(unused)] wr...
Rust
0
fn bench_legal_moves_extraction(c: &mut Criterion) { let board = board_for_legal_moves(); let moves = board.moves_for(Stone::Black); c.bench_function("legal_moves_extraction", |b| { b.iter(|| moves.stones().collect::<Vec<u64>>()) }); } fn bench_square_extraction(c: &mut Criterion) { let b...
Rust
0
x0a, 0x98, 0x27, 0x20, 0xd6, 0xd6, 0x13, 0x20]; //! //! let my_pk = match x25519(&public, &private) { //! Ok(k) => k, //! Err(e) => panic!("Error x25519 {:?}", e), //! }; //! assert_eq!(&expected_result[..], &my_pk[..]); //! //! let sk_a = x25519::key_gen(); //! let pk_a = x25519::dh_base(&sk_a); //! //! let sk...
Rust
0
hannelmanager::{PaymentHash, PaymentPreimage}; use ln::msgs::DecodeError; use util::ser::{Readable, Writeable, Writer, WriterWriteAdaptor}; use util::byte_utils; use bitcoin::secp256k1::key::{SecretKey, PublicKey}; use bitcoin::secp256k1::{Secp256k1, Signature}; use bitcoin::secp256k1::Error as SecpError; use bitcoin:...
Rust
0
j: Box<_> = Box::new(101); g(i, j); } fn copyable() { fn f<T:PartialEq + Debug>(i: T, j: T) { assert_eq!(i, j); } fn g<T:PartialEq>(i: T, j: T) { assert!(i != j); } let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(100); f(i, j); let i: Box<_> = Box::new(10...
Rust
0
a @RVug8@sZddlZddlZddlZzeWney:ddZYn 0ddZddZddZgd Zd d Z d d dddiddiddiddidddddddidddddddddd idd!idd"idd#id$d%id&d'dd(d)dd*d+dd,d-d.d/ddd0id1d2dd3d4d5d6dd7id8d9dd:d;d<d=dd>d?dd...
Python
1
"""Removes tags that are attached by AI and have no human attachments.""" import json import fire from tqdm import tqdm from karakeep_python_api import KarakeepAPI VERSION: str = "1.0.0" def main(dry_run: bool = False): """ Lists all tags and removes those that are attached by AI and have no human attachment...
Python
1
t}; use std::pin::Pin; use std::sync::atomic::{AtomicUsize, Ordering::*}; use std::sync::{Arc, Mutex}; use std::task::{Context, Poll}; mod atomic_serial_waker; use atomic_serial_waker::AtomicSerialWaker; use std::fmt; #[cfg(test)] mod test; /// the map type used to store lock keys #[cfg(feature = "hashbrown")] pub typ...
Rust
0
recv_next=False) if timers is not None: timers('forward-send-forward-recv').stop() return input_tensor def send_backward_recv_backward(input_tensor_grad, recv_next, timers=None): """Batched recv from next rank and send to previous rank in pipeline.""" if timers is not None: timers('ba...
Python
1
type: ignore[attr-defined] self._noise_model_info.read_noise_scale ) # Drift compensation in protobuf is boolean (bool) rpu_config.drift_compensation = None # type: ignore[assignment] if self._noise_model_info.drift_compensation: rpu_config.drift_compensation =...
Python
1
files_unsafe_change_stats .iter() .find(|stat| stat.file == "src/main.rs") .unwrap(); // A line has changes withing unsafe block // but the total counter remains same // TODO: how to detect such changes? assert_eq!(file.unsafe_delta.expressions, 0); ...
Rust
0
s() <= EPS); } } mod jwk; use crate::CLI; use anyhow::Error; use clap::{Parser, Subcommand}; #[derive(Debug, Parser)] pub struct GenerateCommand { #[clap(subcommand)] command: GenerateSubcommand, } #[derive(Debug, Subcommand)] #[clap(rename_all = "kebab-case")] pub enum GenerateSubcommand { Jwk(jwk::...
Rust
0
تخدم\n√**") try: user = await client.get_users(ask.text.strip()) except Exception: return await message.reply("❌ معرف المستخدم غير صحيح") ask_title = await zom_ask(client, message, "**◍ أرسل اللقب الجديد للمشرف\n√**") title = ask_title.text await client.promo...
Python
1
return logits def regress_score(self, preds, labels): y_pred = preds.detach().cpu().numpy() y_label = labels.detach().cpu().numpy() mse = get_mse(y_label, y_pred) rmse = get_rmse(y_label, y_pred) CI = get_cindex(y_label, y_pred) r2 = r_squared_error(y_label,...
Python
1
:InvalidLL) }; let lon = match text[95] { b'E' => lon_value, b'W' => -lon_value, _ => return Err(JMAFormatParseError::InvalidLL) }; let depth = { let t = &text[101..104]; match parse_number(t) { Some(v) => Some(v as f32), None => match t { b"///" => None, _ => return Err(JMAFormatParseErr...
Rust
0
""" Transcription service using OpenAI's Whisper API. """ from pathlib import Path import openai from rich.console import Console console = Console() class WhisperTranscriber: def __init__(self, api_key: str = None): """Initialize transcriber with optional API key.""" if api_key: opena...
Python
1
"title": "Тип устройства", "type": "string", }, { "description": None, "is_dim": True, "name": "ym:pc:device", "title": "Устройство", "type": "string", }, { "description": None, "is_dim": True, "name": "ym:pc:hour", ...
Python
1
seconds). pub fn receipt(&self) -> PyResult<PyQueryTransactionGetReceipt> { Ok(PyQueryTransactionGetReceipt::new( &self.client, self.transaction.clone(), )) } /// record(self) -> QueryTransactionGetRecord /// -- /// /// Get the record of the transaction....
Rust
0
// See the License for the specific language governing permissions and // limitations under the License. //! # Blackhole benchmarking offramp //! //! Offramp used for benchmarking to generate latency histograms //! //! ## Configuration //! //! See [Config](struct.Config.html) for details. #![cfg(not(tarpaulin_include...
Rust
0
uniform([5, 5], 10, 10); assert_eq!(x2.is_err(), true); // low > high let x3 = rmb.uniform([5, 5], 10, -10); assert_eq!(x3.is_err(), true); } #[test] fn test_normal() { let mut rmb = RandomMatrixBuilder::new(); let a = rmb.normal([5, 5], 2.0, 4.0).unwrap(); let b = rmb.normal([5, 5], 2.0,...
Rust
0
fn new(recursive: bool, paths_to_watch: Vec<PathBuf>) -> Arguments { Arguments { recursive, paths_to_watch } } } <gh_stars>0 /* src/screen.rs Copyright (c) 2020-2022 <NAME> All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa...
Rust
0
ot: u8, func: u8, field: u8, value: u16) { set_address(bus, slot, func, field); unsafe { Port::new(CONFIG_DATA).write(value) }; } fn write_u32(bus: u8, slot: u8, func: u8, field: u8, value: u32) { set_address(bus, slot, func, field); unsafe { Port::new(CONFIG_DATA).write(value) }; } impl Device { ...
Rust
0
genize(word_nm, harakat): """ لإreat the jonction of WAW, YEH. معالجة التحولات التي تطرا على الياء أو الوا في وسط الكلمة أو في اخرها @param word_nm: given unvocalized word. @type word_nm: unicode. @param harakat: given harakat. @type harakat: unicode. @return: (letters, harakat)after treatme...
Python
1
# Supported source languages SOURCE_LANGUAGES = { "AR": "Arabic", "BG": "Bulgarian", "CS": "Czech", "DA": "Danish", "DE": "German", "EL": "Greek", "EN": "English", "ES": "Spanish", "ET": "Estonian", "FI": "Finnish", "FR": "French", "HU": "Hungarian", "ID": "Indonesian...
Python
1
d.v2i32")] fn vabd_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t; } vabd_u32_(a, b) } /// Absolute difference between the arguments #[inline] #[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u...
Rust
0
e implementation of multiplication and division. macro_rules! md_impl( ( // Operator, operator method, and scalar bounds. $Op: ident, $op: ident $(where T: $($ScalarBounds: ident),*)*; // Storage dimensions, and dimension bounds. ($R1: ty, $C1: ty),($R2: ty, $C2: ty) // Const type declaratio...
Rust
0
and feel of a # theme further. html_theme_options = { # Navigation bar title. (Default: ``project`` value) 'navbar_title': "tick", # Tab name for entire site. (Default: "Site") 'navbar_site_name': "Browse", # A list of tuples containing pages to link to. The value should # be in the form [(na...
Python
1
import server import server.rpc import server.config import tbmatch.event_pb2 import uuid @server.rpc.HandleRpc('CreateLobby') def CreateLobby(request, response, handler): """ Create a new lobby and join it, with the creator as owner. Fails if user is already in a lobby. Success confirmed by LobbyJoi...
Python
1
n[ R "/X@R"R$S9nUR'[)UR"USS95 OC[ R "/URUR"R$S9R'U5nX%U'...
Python
1
import pygame from classes import * WIDTH = 1000 # можно изменить HEIGHT = 325 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Google's Dinosaur") timer1 = pygame.USEREVENT + 0 timer2 = pygame.USEREVENT + 1 pygame.init() pygame.time.set_timer(timer1, 2000) pygame.time.set_timer(timer2...
Python
1
raTS2019" json_dict["description"] = "nothing" json_dict["tensorImageSize"] = "4D" json_dict["reference"] = "see BraTS2019" json_dict["licence"] = "see BraTS2019 license" json_dict["release"] = "0.0" json_dict["modality"] = {"0": "T1", "1": "T1ce", "2": "T2", "3": "FLAIR"} json_dict["labels"...
Python
1
let interconnect = NetworkInterconnect { a: j as u8, b: i as u8, config, }; interconnects.push(interconnect); } } Self { partitions, interconnects, } } } fn run( ...
Rust
0
ct) > 0: evaluator.patch_optim_param_group(module_name_param_dict) self.register_trigger(evaluator) def _fuse_postprocess(self, evaluator: Evaluator) -> None: pass def track_min_max_val(wrapper: ModuleWrapper, target_name: str, target: Tensor): def amin_reduce_func(converted_targe...
Python
1
.bind_attribs(optional_edges); bind.bind_non_instanced_properties(&color, &edge_color); unsafe { gl.draw_arrays(glow::LINES, 0, optional_edges.length as i32); } } } } pub fn render_display_list( &mut self, ...
Rust
0
ate, model_selector], queue=False) else: raise ValueError(f"Unknown model list mode: {args.model_list_mode}") return demo if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--host", type=str, default="0.0.0.0") parser.add_argument("--port", type=int...
Python
1
import torch from train import train_model from infer import infer def main(): # --- Option 1: Train the model and then immediately infer --- # This trains the model from scratch every time you run main.py print("Starting model training...") trained_model, trained_processor = train_model() pri...
Python
1
age="Model loaded successfully", model_info=model_info ) assert response.success is True assert response.model_info is not None assert response.model_info.model_name == "large-v3" assert response.model_info.memory_usage_mb == 1024.5 def test_model_unload_response(self): ...
Python
1
.join(", ") ))) } } else { Ok(()) } } /// Collects all flat scalar fields that are used in the having filter. fn collect_scalar_fields(filter: &Filter) -> Vec<&ScalarFieldRef> { match filter { Filter::And(inner) => inner.iter().flat_map(|f| collect_scalar_fields(f))....
Rust
0
# -*- coding: utf-8 -*- from kivy.base import runTouchApp from kivy.lang import Builder from kivy.factory import Factory as F class DemoBox(F.ButtonBehavior, F.BoxLayout): base_direction = F.StringProperty(None, allownone=True) font_context = F.StringProperty(None, allownone=True) font_size = F.NumericPr...
Python
1
test = { 'name': 'What Would Scheme Display?', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" scm> (- 10 4) 6 scm> (* 7 6) 42 scm> (+ 1 2 3 4) 10 scm> (/ 8 2 2) 2 scm> (quotient 29 5) ...
Python
1
side): LEGAL_MOVES = [] for from_sq, from_mask in mog.MOVES_DICT.items(): m = from_mask while m: lsb = m & -m to_sq = lsb.bit_length() - 1 m ^= lsb moved_piece = b.SQUARE_MAP[from_sq] if (moved_piece == b.WP and to_sq > 55 and side == ...
Python
1
import pandas as pd import argparse import os parser = argparse.ArgumentParser() parser.add_argument("--date", required=True, help="予測対象日(例: 2023-01-01)") args = parser.parse_args() target_date = args.date # 🔹 予測スコア読み込み(選手単位) pred_df = pd.read_csv("data/5th/tmp/step5_arare_predictions.csv") # 🔹 レース単位の最大スコア(または平均でも...
Python
1
epresentation for NAN } else if self.0 == 0.0 { // catches both positive and negative zero 0u32.hash(state); } else { self.0.to_bits().hash(state); } } } impl From<F32> for f32 { fn from(f: F32) -> Self { f.0 } } impl From<f32> for F32 { fn from(...
Rust
0
ormation, see: //! <https://docs.rs/abscissa_core/latest/abscissa_core/testing/index.html> #![forbid(unsafe_code)] #![warn(missing_docs, rust_2018_idioms, unused_qualifications)] use abscissa_core::testing::prelude::*; use lazy_static::lazy_static; use libra_config::config::{ConsensusConfig, NetworkConfig, NodeConfig...
Rust
0
RROR_VALUE, "Invalid value : vel, v") # _acc temp = get_param(acc, a) if temp == None: _acc = self._g_accj else: if type(temp) == int or type(temp) == float: _acc = [temp] * DR_ACCJ_DT_LEN elif type(temp) == list and len(temp) == DR_AC...
Python
1
from abaqusConstants import * from .LoadState import LoadState class SurfaceChargeState(LoadState): """The SurfaceChargeState object stores the propagating data of a surface charge in a step. One instance of this object is created internally by the SurfaceCharge object for each step. The instance is also ...
Python
1
b fn OSRSetAxisMappingStrategy( hSRS: OGRSpatialReferenceH, strategy: OSRAxisMappingStrategy::Type, ); } extern "C" { pub fn OSRGetDataAxisToSRSAxisMapping( hSRS: OGRSpatialReferenceH, pnCount: *mut libc::c_int, ) -> *const libc::c_int; } extern "C" { pub fn OSRSetDataAxi...
Rust
0
on == (0, 1, 0) assert line.dxf.thickness == 4 def test_copy_entity_transparency(): line = Line() line2 = line.copy() assert line2.dxf.hasattr("transparency") is False line.transparency = 0.5 line2 = line.copy() assert line2.dxf.transparency == 0x0200007F def test_setting_invalid_transp...
Python
1