text
string
label_name
string
labels
int64
if fg_mask[i].sum(): idx = target_gt_idx[i][fg_mask[i]] gt_kpt = keypoints[batch_idx.view(-1) == i][idx] # (n, 51) gt_kpt[..., 0] /= stride_tensor[fg_mask[i]] gt_kpt[..., 1] /= stride_tensor[fg_mask[i]] ...
Python
1
24; let value = 12.0f64.j(0); let error = (target - value).abs() / target; println!("J(0, {}) = {:.6e}, expected {:.6e}, error {:.3e}", 12.0, value, target, error); assert!(error < MAX_ERROR); } #[test] fn j0_120() { let target = 0.0718234158291561276; let va...
Rust
0
_byte(address, data); } } impl WriteMem<u16> for CPU { fn write(&mut self, address: u16, data: u16) { self.cycles_until_done += 2; self.mem.borrow_mut().write_word(address, data); } } impl CPU { pub fn new(mem: Rc<RefCell<Memory>>) -> Self { Self { reg: Registers::n...
Rust
0
low(non_camel_case_types)] #![no_std] extern crate bare_metal; extern crate cortex_m; #[cfg(feature = "rt")] extern crate cortex_m_rt; extern crate vcell; use core::marker::PhantomData; use core::ops::Deref; #[doc = r"Number available in the NVIC for configuring priority"] pub const NVIC_PRIO_BITS: u8 = 3; #[cfg(featur...
Rust
0
义error、warn、debug、info等其他 :param args: 需要打印日志的list、tuple等 :param kwargs: 需要打印日志的字典 :return: """ if not logger.handlers: # block same/duplicate Log messages/entries multiple times set_file_logger_date(self_script_output_log_path, name="cobf") if level.lower() == "error": logger.e...
Python
1
n get_bundle_stats( &self, bundle_hash: BundleHash, block_number: U64, ) -> Result<BundleStats, FlashbotsMiddlewareError<M, S>> { self.relay .request_relay( "flashbots_getBundleStats", [GetBundleStatsParams { bundle_hash...
Rust
0
, 'title': 'Psycho-Pass', 'description': 'md5:94d572c0bd85894b193b8aebc9a3a806', }, 'playlist_count': 46, }, { 'url': 'https://www.vvvvid.it/show/156', 'only_matching': True, }] def _real_extract(self, url): base_url, show_id, show_title = sel...
Python
1
persists the cookies file locally This function can also be used to refresh the login By default, it will only login if the cookies are stale, but you can optionally force it to refresh - however, it will be guarded by ensuring that enough time has passed since the last login """ global _cookie...
Python
1
# # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 # # THIS SOFTWARE IS PR...
Python
1
n.rmaxsizerCrLrrs r wm_maxsizez Wm.wm_maxsize3}}TWW\\ )TWWeV56 6rc r|j|jjdd|j||S)zSet min WIDTH and HEIGHT for this widget. If the window is gridde...
Python
1
в vec2: {}", vec2.into_iter().any(| x| x == 2)); let array1 = [1, 2, 3]; let array2 = [4, 5, 6]; // `iter()` для массивов даёт `&i32`. println!("2 в array1: {}", array1.iter() .any(|&x| x == 2)); // `into_iter()` для массивов неожиданно даёт `&i32`. println!("2 в array2: {}", array2.into_...
Rust
0
data = data as *const _ as *const c_void; unsafe { ((*funcs).set_custom_event)( obj_data, user_data, Box::into_raw(f) as *const _, transmute(object_custom_trampoline_ud::<T> as usize), ); } self } ...
Rust
0
].predator_planes.1 ({}) != \ bundles[{}].predator_planes.1 ({})", i, bundles[i].predator_planes.1, j, bundles[j].predator_planes.1) } else { bundles[i].predator_planes.1 }, height: if bundles[i].predator_planes.2 != bundles[j].predator_planes.2 { panic!("both predator plane bun...
Rust
0
""" Test suite for the algorithmic trading project. """ __version__ = '0.1.0'
Python
1
""" Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and a list (List[Node]) of its neighbors. class Node { public int val; public List<Node> neighbors; }   Test case format: For simplicity sake, each node's valu...
Python
1
Debug)] pub struct Builder { pub(crate) message: std::option::Option<std::string::String>, } impl Builder { pub fn message(mut self, input: impl Into<std::string::String>) -> Self { self.message = Some(input.into()); self } pub fn set_message(mut self,...
Rust
0
, 'order': 'desc' }, { 'name': 'FP', 'value': fp / num, 'order': 'asc' }, { 'name': 'FN', 'value': fn / num, 'order': 'asc' }]), accuracy / num, fp / num, fn / num if __name__ == '__main__': import sys ...
Python
1
font-weight: bold; }} .footer {{ background-color: #f8f9fa; padding: 20px; text-align: center; color: #6c757d; font-size: 12px; }} </style> </head>...
Python
1
: NextFn<$type>, ) -> Pin<Box<dyn Future<Output = Result<$type, ThrusterError<$type>>> + Sync + Send>> { Box::pin($fn(a, b)) } __internal }}; } macro_rules! expand_combine { ($($param:ident),*) => { paste! { expand_combine!(@mid $($param),*); ...
Rust
0
e_id, None) ) .children( state.stickers .iter() .map(clone!(state => move |sticker| { match sticker { RawSticker::Sprite(sprite) => render_sticker_sprite_raw(sprite, None), ...
Rust
0
lgorithm with phrase matching") print("✅ Increased source diversity (8 sources, 2 per domain)") print("✅ Expanded retrieval pipeline (500 DB results)") print("✅ Improved summarization (12-20 sentences, 4000 tokens)") print("✅ Enhanced prompts for comprehensive analysis") print("✅ Longer excerpts (80...
Python
1
_const(Some(dna_file.clone())); dna_store.expect_add_dnas::<Vec<_>>().return_const(()); dna_store.expect_add_entry_defs::<Vec<_>>().return_const(()); dna_store.expect_get_entry_def().return_const(None); let (_tmpdir, _app_api, handle) = setup_app( vec![( "test_app", vec!...
Rust
0
a setting value in the object ( i.e. "settings.dtmf.pttid") :param name: The human-readable name for this setting :param values: The RadioSettingValue (only one allowed) :param *kwargs: Other kwargs to be passed to RadioSetting """ def __init__(self, path, name, value, **kwargs): sel...
Python
1
mode_t = __mode_t; pub type nlink_t = __nlink_t; pub type uid_t = __uid_t; pub type pid_t = __pid_t; pub type id_t = __id_t; pub type daddr_t = __daddr_t; pub type caddr_t = __caddr_t; pub type key_t = __key_t; pub type clock_t = __clock_t; pub type clockid_t = __clockid_t; pub type time_t = __time_t; pub type timer_t ...
Rust
0
import math n = 0 while n!=int(n) or n<=0: n = float(input("Ingrese un numero entero y positivo: ")) n = int(n) fact = 1 for i in range(1, n): #[2,3,4,5...n] fact *= i #fact = fact * i print(f"El factorial de {n} es : {fact} ") print(f"The factorial de {n} es : {math.factorial(n)} ")
Python
1
import sqlite3 from sqlite3 import Error import sqlalchemy def create_connection(db_file): """ create a database connection to the SQLite database specified by db_file :param db_file: database file :return: Connection object or None """ conn = None try: conn = sqlite3.connect(db_file) ...
Python
1
"""init schema Revision ID: 0001_init Revises: Create Date: 2025-08-19 """ from alembic import op import sqlalchemy as sa revision = '0001_init' down_revision = None branch_labels = None depends_on = None def upgrade(): # tables from models.py op.create_table('user', sa.Column('id', sa.String(), p...
Python
1
# # Copyright 2012 NVIDIA Corporation # # 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 ...
Python
1
ax(p5).max(p6).max(p7).max(p8); AABB::new(min_p, max_p) } } impl<T: ShapeIntersect> ShapeIntersect for TransformShape<T> { fn intersect(&self, ray: &Ray, min_dist: f32) -> (f32, i32) { let world_p = ray.origin + min_dist * ray.direction; let local_p = self.world_to_obj.transform_point(w...
Rust
0
# -*- coding: utf-8 -*- # pylint: disable=line-too-long,consider-using-f-string """Access Technology Type Option Type Values =============================================== .. module:: pcapkit.const.mh.access_type This module contains the constant enumeration for **Access Technology Type Option Type Values**, which i...
Python
1
), ); } let num_children = revision.children.len(); for (child_index, child) in revision.children.iter().enumerate() { let formatted_child = &formatted_tree[child.index]; let x = middle_x + formatted_child.transform.x; ...
Rust
0
rient: Wii_Orientation, #[doc = "< Is the Nunchuk enabled ?"] pub Enabled: bool, } extern "C" { pub static mut Wiimote: [WPads; 5usize]; } #[doc = " \\struct Nunchuk_Buttons"] #[doc = " \\brief This structure is a part of the Nunchuks struct. (Buttons)"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct N...
Rust
0
None => Err(DamlError::new_failed_conversion("GRPC Event was None")), } } } #[derive(Debug, Eq, PartialEq, Clone)] pub enum DamlTreeEvent { Created(DamlCreatedEvent), Exercised(DamlExercisedEvent), } impl DamlTreeEvent { pub fn event_id(&self) -> &str { match self { DamlTre...
Rust
0
var.is_evaluated() { // if this var is new to the dependency set, if required.insert(var.clone()) { // add its ancestors. if let Some(ref op) = node.origin { stack.extend(op.input()) ...
Rust
0
println!("You must have openssl installed for this module to run successfully"); println!("Testing key regen with hardcoded values..."); recreate_rsa("b089029fe0b4b5b785fef2bbae1d650d7ffc72cde478739174a589f660b3092f2a2f943afe593bd0be5165c947aa5769e6180b1e5bd7ed5ae6471621d9a7c321a266...
Rust
0
from django.shortcuts import render from django.views.generic import FormView, ListView from properties.forms import SearchForm from properties.models import Properties class HomeView(ListView, FormView): model = Properties form_class = SearchForm context_object_name = 'properties' template_name = 'i...
Python
1
, #[structopt(long, default_value = "12")] max_merkle_tree_depth: usize, #[structopt(long, default_value = "benchmark.csv")] output: String, } #[derive(Serialize)] struct Record<'a> { bench: &'a str, proof: u128, verify: u128, merkle_tree_depth: Option<usize>, num_revocation_ids: Op...
Rust
0
# optimizer #optimizer = dict(type='AdamW', lr=0.00006, betas=(0.9, 0.999), weight_decay=0.01) #print('just adam') #optimizer = dict(type='AdamW', lr=0.00006, betas=(0.9, 0.999), weight_decay=0.01) #optimizer_config = dict() optimizer = dict(type='AdamW', lr=0.0002, weight_decay=0.0001, paramwise_cfg=dict(custo...
Python
1
sig), false); assert!(outcomes.is_empty()); let era_too_high_sig = FinalitySignature::random_for_block(block_hash, block_era.value() + auction_delay + 1); let outcomes = lc.handle_finality_signature(Box::new(era_too_high_sig), false); assert!(outcomes.is_empty()); // ...
Rust
0
expr.evaluate(df)?; Ok(series.sort(self.reverse)) } fn to_field(&self, input_schema: &Schema) -> Result<Field> { self.expr.to_field(input_schema) } } #[derive(Debug)] pub struct NotExpr(Arc<dyn PhysicalExpr>); impl NotExpr { pub fn new(expr: Arc<dyn PhysicalExpr>) -> Self { Sel...
Rust
0
connection_by_uuid(&self, uuid: &str) -> Option<RemoteConnection> { unsafe { from_glib_none(nm_sys::nm_client_get_connection_by_uuid( self.to_glib_none().0, uuid.to_glib_none().0, )) } } pub fn get_connections(&self) -> Vec<RemoteConnectio...
Rust
0
X_dense = np.random.poisson(2, (20, 10)) adata_csr = AnnData(sparse.csr_matrix(X_dense)) adata_csc = AnnData(sparse.csc_matrix(X_dense)) adata_dense = AnnData(X_dense) for adata in [adata_csr, adata_csc, adata_dense]: adata.obs["condition"] = ["A"] * 10 + ["B"] * 10 ...
Python
1
], Tuple[None, Path], Tuple[Path, Path] ], ) -> Path: return ( manifest_lockfile_paths[0].parent if manifest_lockfile_paths[0] is not None else manifest_lockfile_paths[1].parent ) @dataclass(frozen=True) class ManifestOnlyMatcher(SubprojectMatcher): ...
Python
1
_len, strong_len, sig_type)?; let written = io::copy(&mut sig, output)?; Ok(written) } /// Generates the signature of a basis input, by using default settings. /// /// This function will consume the given input stream and attempt to write the resulting signature /// to the given output. In case of success, the...
Rust
0
e = step_metrics[step]["MAE"] mse = step_metrics[step]["MSE"] st.write(f"R²: {r2:.4f} | MAE: {mae:.4f} | MSE: {mse:.4f}") row = st.columns(3) with row[0]: st.pyplot(step_figs_pred[i]) with row...
Python
1
17 as input. /// gpioSetMode(18, PI_OUTPUT); // Set GPIO18 as output. /// gpioSetMode(22,PI_ALT0); // Set GPIO22 to alternative mode 0. /// ``` fn gpioSetMode(pin: c_uint, mode: c_uint) -> c_int; /// ```c /// int gpioPWM(unsigned pin, unsigned dutycycle); /// ```` /// /// Starts ...
Rust
0
import matplotlib.pyplot as plt from functions import * from tabulate import tabulate # Начальные условия x0, y0, h, xn = 0, 0, 0.1, 1 epsilon = 0.001 x_table = np.arange(x0, xn + h, h) y_table = np.zeros_like(x_table) for i in range(len(x_table)): y_table[i] = correct_f(x_table[i]) x_e, y_e = Euler(x0, y0, h, ...
Python
1
TvInputInfo;)V" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())]; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("android/media/tv/TvInputManager$TvInputCal...
Rust
0
} #[inline] pub fn dw_access(&self) -> wsi::win32::DWORD { self.dwAccess } #[inline] pub fn name(&self) -> wsi::win32::LPCWSTR { self.name } } #[cfg(feature = "VK_KHR_external_memory_win32")] #[cfg(feature = "VK_USE_PLATFORM_WIN32_KHR")] impl<'l> Default for VkExportMemoryWin32HandleInfoKHR<'l> { ...
Rust
0
Returns `Ok((position of last used byte in passed array, parsed BString))` /// or `Err` if couldn't parse `BString` correctly. /// # Examples /// /// `BString` must have following structure: <length>:<data>, where data - sequence /// of bytes with corresponding length. /// /// ``` /// ...
Rust
0
from bots.base.base import BaseFarmer from bots.template.strings import HEADERS class BotFarmer(BaseFarmer): name = "bot_username" extra_code = "ref_code" # в случае если рефка вида https://t.me/bot_username?start=ref_code app_extra = "ref_code" # в случае если рефка вида https://t.me/bot_username?actio...
Python
1
from dataclasses import asdict import pytest from qualang_tools.wirer import * from qualang_tools.wirer.connectivity.element import QubitReference from qualang_tools.wirer.connectivity.wiring_spec import WiringLineType from qualang_tools.wirer.instruments.instrument_channel import ( InstrumentChannelOpxPlusInput,...
Python
1
device: DeviceId, local_addr: A, body: S, ) -> Result<(), (MtuError<S::InnerError>, S)> where A: IpAddress, S: Serializer, { match device.protocol { DeviceProtocol::Ethernet => self::ethernet::send_ip_frame(ctx, device.id, local_addr, body), } } /// Receive a device layer frame from th...
Rust
0
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # This file is part of SCAMP (Suite for Computer-Assisted Music in Python) # # Copyright © 2020 Marc Evanstein <marc@marcevanstein.com>. # # ...
Python
1
_xmm_k1z_xmmm64b32 0x228A_007B,// EVEX_Vcvtps2qq_ymm_k1z_xmmm128b32 0x230A_007B,// EVEX_Vcvtps2qq_zmm_k1z_ymmm256b32_er 0x222A_007B,// EVEX_Vcvtpd2qq_xmm_k1z_xmmm128b64 0x22AA_007B,// EVEX_Vcvtpd2qq_ymm_k1z_ymmm256b64 0x232A_007B,// EVEX_Vcvtpd2qq_zmm_k1z_zmmm512b64_er 0x2172_007B,// EVEX_Vcvtusi2ss_xmm_xmm_rm32_...
Rust
0
+ value + '"\n') else: new_config.write(setting + '=' + value + '\n') except: pass init_file.close() new_config.close() sleep(1) sys.path.append("/etc/setoolkit") from set_config import CONFIG_DATE as verify print_info("New set.config.py f...
Python
1
0x01,// Normal_1 0xD2, 0x09,// 1234 = "stc" // Cli 0x01,// Normal_1 0xF2, 0x06,// 882 = "cli" // Sti 0x01,// Normal_1 0xD5, 0x09,// 1237 = "sti" // Cld 0x01,// Normal_1 0xED, 0x06,// 877 = "cld" // Std 0x01,// Normal_1 0xD3, 0x09,// 1235 = "std" // Inc_rm8 0x02,// Normal_2 0x92, 0x01,// 146 = "inc"...
Rust
0
''' Created on Dec 7, 2010 @author: Jason Carver ''' import unittest from mock import Mock from carver.htm.column import Column from carver.htm import HTM from carver.htm.cell import Cell from carver.htm.config import config class TestColumn(unittest.TestCase): def setUp(self): pass def tearDown(s...
Python
1
from pydantic import BaseModel class FeedbackResponse(BaseModel): reply: str fake: bool
Python
1
######## # Mosaic imagery # ############################################################################ overview = True # False will reduce overall file size, but reduce performance in a GIS if mosaic > 0: start_time = time.time() ...
Python
1
# # Copyright (C) 2018 The Android Open Source Project # # 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 la...
Python
1
"""Discovery module. This module uses async_upnp_client to discover devices supporting the urn:schemas-sony-com:service:ScalarWebAPI:1 service used by this library. """ import logging from xml import etree import attr from async_upnp_client.aiohttp import AiohttpRequester from async_upnp_client.client_factory import...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import urllib from time import sleep import pytumblr # https://github.com/tumblr/pytumblr # set yours: CONSUMER_KEY = '' CONSUMER_SECRET = '' OAUTH_TOKEN = '' OAUTH_TOKEN_SECRET = '' def download_img(url, dst=os.getcwd()): dst = os.path.join(dst...
Python
1
with concurrent.futures.ThreadPoolExecutor(max_workers=aconf.threads) as executor: future_to_server = {executor.submit(target_worker_thread, target_server[0], target_server[1], aconf): target_server for target_server in target_servers} for future in concurrent.futures.as_completed(future_to_...
Python
1
ettle_unconscious_semen_and_cloth(character_id: int) -> None: """ 结算角色在无意识期间的部位精液与服装偷窃的二段行为 参数: character_id: int -- 角色ID 返回: None -- 该函数只更新角色脏污数据,无返回值 功能描述: 当角色在恢复意识时触发的二段行为。 """ # 从缓存中获取角色数据 character_data: game_type.Character = cache.character_data[character_id...
Python
1
-header-cell-filtered span { color: #fff !important; } ``` ### Customising Filter Placeholder Text Filter placeholder text can be customised on a per column basis using filterParams.filterPlaceholder within the grid option columnDefs. The example above has a custom placeholder in the Age column """ layout = htm...
Python
1
et = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `clk_sys_vreg_and_chip_reset` writer - "] pub struct CLK_SYS_VREG_AND_CHIP_RESET_W<'a> { w: &'a mut W, } impl<'a> CLK_SYS_VREG_AND_CHIP_RESET_W<'a> { #[doc = r"Sets the field ...
Rust
0
AutoConcurrencyLimit { pub concurrency: u64, pub reached_limit: bool, pub had_back_pressure: bool, pub current_rtt: Duration, pub past_rtt: Duration, } impl InternalEvent for AutoConcurrencyLimit { fn emit_logs(&self) { trace!( message = "changed concurrency.", ...
Rust
0
(r) = e.resize_args() { view.resize(r[0], r[1]); } else { if controler.event(&e) { break; } } } } // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. use std::alloc::{GlobalAlloc, Layout}; use std::sync::atomic::{AtomicPtr, Ordering...
Rust
0
import json loaded_config = dict() with open('DDP_training.json', 'r') as f: loaded_config = json.load(f) print(loaded_config)
Python
1
39()..."); uri::urltest_239(); print!("Success.\n"); print!("Testing urltest_240()..."); uri::urltest_240(); print!("Success.\n"); print!("Testing urltest_241()..."); uri::urltest_241(); print!("Success.\n"); print!("Testing urltest_242()..."); uri::urltest_242(); print!("...
Rust
0
protocol.send_batch(input.frontier().frontier().to_owned(), &mut results); } }) } /// A type that guides the transmission of rows back to the coordinator. /// /// A protocol instance may `send` rows indefinitely, and is consumed by `complete`, /// which is used only to indicate the end of a stream....
Rust
0
(8, 80_877_103) => Ok(PacketType::SSLRequest), (8, 80_877_104) => Ok(PacketType::GSSENCRequest), (_, 196_608) => Ok(PacketType::StartupMessage), _ => Err(Error::new(ErrorKind::Other, "Invalid packet type")), } ...
Rust
0
from web3 import Web3 # Arbitrum Sepolia RPC URL (替换为您的实际 RPC URL) arb_sepolia_rpc = "https://arbitrum-sepolia.infura.io/v3/a7ebd0bf015b48a697850cbf4cbc44a8" web3 = Web3(Web3.HTTPProvider(arb_sepolia_rpc)) # 合约地址 contract_address = "0x12fBAf906c3c4af268976bF855B2159813909D69" # 合约 ABI contract_abi = [ { "inputs":...
Python
1
''' /* * EJERCICIO: * Implementa los mecanismos de introducción y recuperación de elementos propios de las * pilas (stacks - LIFO) y las colas (queue - FIFO) utilizando una estructura de array * o lista (dependiendo de las posibilidades de tu lenguaje). * * DIFICULTAD EXTRA (opcional): * - Utilizando la implemen...
Python
1
, torch_dtype=torch.bfloat16, model_prompts=model_prompts, ), name="castorini/repllama-v1-7b-lora-passage", languages=["eng-Latn"], open_weights=True, revision="01c7f73d771dfac7d292323805ebc428287df4f9-6097554dfe6e7d93e92f55010b678bcca1e233a8", # base-peft revision release_date=...
Python
1
len = cursor.take() as usize; } map } #[cfg(test)] mod tests {}<reponame>f32by/openizual<filename>crates/nh_vulkan_backend/src/raw/public_types.rs<gh_stars>0 // Copyright (c) 2021 The Lutino Projects // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or a...
Rust
0
32-bit ARMs it is not efficient to pass by value pub fn raw(&self) -> u16 { self.raw } } <filename>src/nhlapi.rs<gh_stars>0 //! Docs: https://gitlab.com/dword4/nhlapi use std::fmt::Display; use std::str::FromStr; use serde::{Deserialize, Deserializer, Serialize, Serializer}; fn from_str<'de, T, D>(de...
Rust
0
number written let candidate_name_column = find_col("CandidateName")?; // if BTL, the candidate name let group_column = if mayoral {0} else {find_col("GroupCode")?}; // Not applicable for mayoral. let mut helper = PreferencesComingOutOfOrderHelper::default(); let candidate_name_lookup = metadata.get_ca...
Rust
0
& (disp_gt > 0) disp_ests = model(imgL, imgR) disp_gts = [disp_gt, disp_gt, disp_gt, disp_gt, disp_gt, disp_gt] loss = model_loss_test(disp_ests, disp_gt, mask) scalar_outputs = {"loss": loss} image_outputs = {"disp_est": disp_ests, "disp_gt": disp_gt, "imgL": imgL, "imgR": imgR} image_outputs["...
Python
1
, pub __size: [libc::c_char; 48], pub __align: libc::c_longlong, } pub type sa_family_t = libc::c_ushort; #[repr(C)] #[derive(Copy, Clone)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [libc::c_char; 14], } #[repr(C)] #[derive(Copy, Clone)] pub struct sockaddr_storage { pub ss_fa...
Rust
0
""" regression tests checking plotted values """ from pathlib import Path import numpy as np import pytest from open_atmos_jupyter_utils import notebook_vars from PySDM_examples import Toon_et_al_1980 from PySDM.physics import si PLOT = False @pytest.fixture(scope="session", name="notebook_variables") def notebo...
Python
1
&mut fmt::Formatter) -> fmt::Result { match *self { Font::TTFFont { .. } => write!(f, "<TTFFont: {:p}>", &self), Font::BitmapFontVariant(BitmapFont { .. }) => write!(f, "<BitmapFont: {:p}>", &self), Font::GlyphFont { .. } => write!(f, "<GlyphFont: {:p}>", &self), } ...
Rust
0
from dash import Dash, html, dcc import plotly.express as px external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"] app = Dash(__name__, external_stylesheets=external_stylesheets) app.layout = html.Div( [ html.H1("Simple HTML Only Site"), html.H2("TalkPython Training"), html...
Python
1
== "Y" { // separately defined phonetic component if record.len() == 11 { Some(record[10].chars().next().unwrap()) } // defined in 北京师范声旁 else if &record[3] == "Y" { Some(record[2].chars().next().unwrap()) } // defined in 中央大学声旁 else { Some(record[4].chars().next().unwrap()) } ...
Rust
0
ld test_counts = Counter() print(f"Resetting GC content counts: \n{test_counts}") fold_number = fold_dir.name.split('_')[-1] name = f"bg_B{fold_number.zfill(2)}" # the per-fold GC summary file created by the previous script with open(fold_dir / f"{name}.gc.txt") ...
Python
1
_node = RBTree::cvt_to_node_mut(&mut z); let (mut z_parent, mut z_parent_right) = z_node.parent_right(); let mut z_parent_copy = z_parent; let z_parent_pro = RBTree::node_property(&z_parent); if z_parent.is_none() { *z_node.property_mut().color_mut() = NodeColor::Bla...
Rust
0
# src/outline_extraction/builders/__init__.py from .outline_builder import OutlineBuilder from .hierarchy_validator import HierarchyValidator __all__ = ['OutlineBuilder', 'HierarchyValidator']
Python
1
extra={"exc": exc, "cinema_url": pivot.cinemaUrl}, ) flash("Connexion à l'API KO.", "warning") @classmethod def delete_pivot(cls, pivot_id: int) -> bool: pivot_model = cls.pivot_class() pivot = db.session.query(pivot_model).filter_by(id=pivot_id).one_or_none() ...
Python
1
ace('½', '\x19\x3D') text = text.replace('¾', '\x19\x3E') text = text.replace('←', '\x19\x2C') text = text.replace('↑', '\x19\x2D') text = text.replace('→', '\x19\x2E') text = text.replace('↓', '\x19\x2F') text = text.replace('̶', '\x60') text = text.replace('|', ...
Python
1
user_number = input("Enter your number:") user_number_list = list(map(int, user_number)) user_number_sum = sum(user_number_list) print("Number sum :",user_number_sum) user_number_sorted = sorted(user_number) print("Number sorted :",user_number_sorted) user_number_reverse = user_number [::-1] print("Number reverse...
Python
1
else selected_block # Change selected block elif event.type == pygame.MOUSEBUTTONDOWN: mouse_x, mouse_y = pygame.mouse.get_pos() if menu_active: if save_button.collidepoint(mouse_x, mouse_y): save_world() elif load_button.collidepoint(...
Python
1
{ from_glib(ffi::nm_connection_serialization_flags_get_type()) } } } impl glib::value::ValueType for ConnectionSerializationFlags { type Type = Self; } unsafe impl<'a> FromValue<'a> for ConnectionSerializationFlags { type Checker = glib::value::GenericValueTypeChecker<Self>; unsafe fn from_value(val...
Rust
0
= 0.25; sprite.origin.y = 0.25; // sprite.rotation = 90.0; } } fn on_key(&mut self, scancode: u32) { if scancode == 26 { self.sprites[0].rotation += 15.0; } if scancode == 22 { self.lmao2 -= 0.006; } if scancode ...
Rust
0
ir superiority complex in online chats and/or forums. > Discord chat Person 1: Man, sometimes being shorter than average sucks. Discord troll: Cope person 1: How is this a 'Cope'? Discord troll: Haha, cope manlet. person 1: This is rude, mind your language. Discord troll: Cope harder manlet. In orig...
Rust
0
https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(any(feature = "v2_24", feature = "dox"))] use glib::translate::*; #[cfg(any(feature = "v2_24", feature = "dox"))] use glib::GString; use soup_sys; #[cfg(any(feature = "v2_24", feature = "dox"))] use URI; glib_wrapper! { #[derive(Debug, PartialEq, Eq, Parti...
Rust
0
def enable_fuser(self, enabled=True): for module in self.unet.modules(): if type(module) is GatedSelfAttentionDense: module.enabled = enabled
Python
1
None ) if not user: raise HTTPException(status_code=400, detail="invalid credentials") # Back-compat: accept password_hash OR any legacy/plain storage stored = user.get("password_hash") or user.get("password") or "" if not verify_password(password, stored): raise HTTPException(stat...
Python
1
; mod rectangle; use core::future::Future; use core::sync::atomic::{AtomicU32, Ordering}; use drogue_device::*; pub struct MyActor { name: &'static str, counter: Option<&'static AtomicU32>, } impl MyActor { pub fn new(name: &'static str) -> Self { Self { name, counter: None...
Rust
0
&& LLIST_link(q as usize).opt().is_none() => { b } _ => hpack(Some(q), Scaled::ZERO, PackMode::Additional), }, }; let q = x.list_ptr(); if is_char_node(q.opt()) { if let Some(r) = LLIST_link(q as u...
Rust
0