text
string
label_name
string
labels
int64
n_hid] # k = [batch, gene, n_heads, n_hid] # attn_scores = [batch, n_heads, gene, gene] attn_scores = q.permute(0, 2, 1, 3) @ k.permute(0, 2, 3, 1) # Rank normalization by row attn_scores = attn_scores.reshape((-1, M)) order = torch.argsort(attn_scores, dim=1) ra...
Python
1
<radialGradient id="g" cx="0.5" cy="0.5" r="0.5" fx="0.75" fy="0.6" fr="5%" gradientTransform="scale(2) translate(-0.25, -0.25)"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialGradient> </defs>"#, view_box.x, view_box.y,...
Rust
0
ors::MINNEN_JOHNSTON_SUPPORT, &table_hyperpriors::MINNEN_JOHNSTON_HYPERPRIOR, ) } } fn encode_gaussians( coder: &mut AnsCoder<u32, u64>, symbols: Array1<i32>, means: &Array1<f64>, stds: &Array1<f64>, ) { let quantizer = DefaultLeakyQuantizer::new(GAUSSIAN_SUPPORT_LOWER..=GAU...
Rust
0
t, uint16x8_t, uint32x2_t, uint32x4_t, uint64x1_t, uint64x2_t ); #[cfg(all(feature = "simd-nightly", target_arch = "arm"))] #[rustfmt::skip] simd_arch_mod!( arm, float32x2_t, float32x4_t, int8x4_t, int8x8_t, int8x8x2_t, int8x8x3_t, int8x8x4_t, int8x16_t, int16x2_t, int16x4_t, int...
Rust
0
fdZddlZddlZejZd dZGddej ZGddejZGdd ejZ Gd d ejZ d Z y)z Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@le...
Python
1
_section_headers() { let doc = test::mk_doc( ~"iface i { #[doc = \"\ # Header \n\ Body\"]\ fn a(); }"); assert doc.cratemod().traits()[0].methods[0].sections[0].header == ~"Header"; } #[test] fn should_execute_on_trait_method_section_bodies() { let doc...
Rust
0
_IM_1 } } #[doc = "Write proxy for field `RNACK_IM`"] pub struct RNACK_IM_W<'a> { w: &'a mut W, } impl<'a> RNACK_IM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RNACK_IM_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "RTE interru...
Rust
0
crate::plugin_capnp::value::Owned, > as ::capnp::traits::SetPointerBuilder>::set_pointer_builder( self.builder.get_pointer_field(2), value, false, ) } #[inline] pub fn init_named( self, ) -> crate::plug...
Rust
0
.clone(); let t3 = thread::spawn(move|| { test00_start(&tx2, number_of_messages * 2, number_of_messages); }); let tx2 = tx.clone(); let t4 = thread::spawn(move|| { test00_start(&tx2, number_of_messages * 3, number_of_messages); }); let mut i: isize = 0; while i < number_of_m...
Rust
0
票的计票结果与传统明文计票结果一致。"); pause_cn(); println!( "{} {} \n", "【演示进度】 申请密文空白选票 ↦ 投出对各候选人的密文选票 ↦ \ 验证密文选票 ↦ 联合计票并公布计票信息 ↦ 验证计票过程 ↦ 公布计票结果 ↦", "<<验证计票结果>>".yellow(), ); println!( "\n最终计票结果的有效性:{}", if verifier::verify_vote_result( &poll_parameters, ...
Rust
0
value { break; } while let Some(_) = *ref_value { break; } } fn syntax_for() { let ref_value = &Some(23); let slice = &[(2, 3), (4, 2)]; // not ok for (_a, _b) in slice.iter() {} // ok for &(_a, _b) in slice.iter() {} } fn syntax_let() { let ref_value = &(2, 3...
Rust
0
mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy::INIT; unsafe { descriptor.get(|| { ::protobuf::reflect::EnumDescriptor::new_pb_name::<DatasetType>("DatasetType", file_descriptor_proto()) }) } } } impl ::s...
Rust
0
from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium import webdriver from bs4 import BeautifulSoup import lxml.html import pymongo import...
Python
1
not(any(target_env = "gnu", target_env = "musl")), target_os = "linux", test)))] use std::mem; use compiler_builtins::float::sub::__subsf3; fn mk_f32(x: u32) -> f32 { unsafe { mem::transmute(x) } } fn to_u32(x: f32) -> u32 { unsafe { mem::transmute(x) } } static TEST_CASES: &...
Rust
0
(1)[0]; // Register lab assert_ok!(Labs::register_lab( Origin::signed(2), LabInfo { box_public_key: Keccak256::hash("box_public_key".as_bytes()), name: "<NAME>".as_bytes().to_vec(), email: "DeBio Email".as_bytes().to_vec(), country: CountryCode::from_vec("DC".as_bytes().to_vec()), region:...
Rust
0
Default::default(); let mut responder_key: Key = Default::default(); let mut auth_resp_key: Key = Default::default(); initiator_key.copy_from_slice(&okm[0..KEY_LENGTH]); responder_key.copy_from_slice(&okm[KEY_LENGTH..2 * KEY_LENGTH]); auth_resp_key.copy_from_slice(&okm[2 * KEY_LENGTH..3 * KEY_LENGT...
Rust
0
{ Self::AHash } } impl Default for ReplicationFactor { fn default() -> Self { ReplicationFactor::Over(1) } } impl std::str::FromStr for ReplicationFactor { type Err = String; fn from_str(value: &str) -> Result<Self, Self::Err> { use ReplicationFactor::*; const SEP...
Rust
0
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
best_candidate.link def _find_name_version_sep(fragment, canonical_name): # type: (str, str) -> int """Find the separator's index based on the package's canonical name. :param fragment: A <package>+<version> filename "fragment" (stem) or egg fragment. :param canonical_name: The package's cano...
Python
1
self.hift_cache_dict[uuid] = {'mel': tts_mel[:, :, -self.mel_cache_len:], 'source': tts_source[:, :, -self.source_cache_len:], 'speech': tts_speech[:, -self.source_cache_len:]} tts_speech = tts_speech[:, :-sel...
Python
1
on) .context("failed to reserve pmem memory")?; // If the disk is not a multiple of the page size, the OS will fill the remaining part // of the page with zeroes. However, the anonymous mapping added below must start on a // page boundary, so round up the size before calculating the...
Rust
0
in an invalid format (only applies if passed in as a /// `&str`, since `&Scorekey` is guaranteed to be valid) /// /// # Example /// ```rust,no_run /// # fn main() -> Result<(), etternaonline_api::Error> { /// # use etternaonline_api::v2::*; /// # let mut session: Session = unimplemented!(); /// let score_inf...
Rust
0
s.push_str(" "); return s; } } mod shells; // Std use std::io::Write; // Internal use clap::App; pub use shells::*; /// Generator trait which can be used to write generators pub trait Generator { /// Returns the file name that is created when this generator is called during compile time. /// /...
Rust
0
D, LPARAM, LRESULT, POINT, S_FALSE, WPARAM}; use windows::Win32::System::Com::{CoCreateInstance, CLSCTX_INPROC_SERVER}; use windows::Win32::UI::Shell::Common::ITEMIDLIST; use windows::Win32::UI::Shell::IShellBrowser; use windows::Win32::UI::WindowsAndMessaging::{RegisterWindowMessageW, SendMessageW}; use crate::{BROWS...
Rust
0
.signals = Some(signals.clone()); self.threads.push( thread::Builder::new() .name("signal_handler".to_string()) .spawn(move || Vm::os_signal_handler(signals, console)) .map_err(Error::SignalH...
Rust
0
d background {background_path.name}: {e}") print(f"➡️ Using fallback background: {DEFAULT_BG_PATH.name}") bg = ImageClip(str(DEFAULT_BG_PATH)).resize( height=VIDEO_SIZE[1], width=VIDEO_SIZE[0] ).set_duration(total_duration) clips = [bg] ...
Python
1
set. #epub_language = '' # The scheme of the identifier. Typical schemes are ISBN or URL. #epub_scheme = '' # The unique identifier of the text. This can be a ISBN number # or the project homepage. #epub_identifier = '' # A unique identification for the text. #epub_uid = '' # A tuple containing the cover image and...
Python
1
def get_dummy_components(self): prior = self.dummy_prior text_encoder = self.dummy_text_encoder tokenizer = self.dummy_tokenizer shap_e_renderer = self.dummy_renderer scheduler = HeunDiscreteScheduler(beta_schedule='exp', num_train_timesteps=1024, prediction_type='sample', use_karras...
Python
1
# DATAMIMIC # Copyright (c) 2023-2025 Rapiddweller Asia Co., Ltd. # This software is licensed under the MIT License. # See LICENSE file for the full text of the license. # For questions and support, contact: info@rapiddweller.com import random import secrets from datamimic_ce.domains.domain_core.base_literal_generato...
Python
1
ey: &Pubkey) { let _ = self.executors.remove(pubkey); } fn get_primer_count_upper_bound_inclusive(counts: &[(&Pubkey, u64)]) -> u64 { const PRIMER_COUNT_TARGET_PERCENTILE: u64 = 85; #[allow(clippy::assertions_on_constants)] { assert!(PRIMER_COUNT_TARGET_PERCENTILE <=...
Rust
0
eObjectTableNVX<'h>( device: VkDevice, pCreateInfo: &VkObjectTableCreateInfoNVX, pAllocator: Option<&VkAllocationCallbacks>, ) -> VkResult<VkObjectTableNVX<'h>> { unsafe { let mut pObjectTable: VkObjectTableNVX<'h> = ::std::mem::zeroed(); VkDeviceDispatchTable::with(device, |_t| { let _r = _t.vkCr...
Rust
0
SetupPolynomial(name, 3), row); let q_m = poly_storage.get_poly_at_step(PolyIdentifier::GateSetupPolynomial(name, 4), row); let q_const = poly_storage.get_poly_at_step(PolyIdentifier::GateSetupPolynomial(name, 5), row); let q_d_next = poly_storage.get_poly_at_step(PolyIdentifier::GateSetupPolyno...
Rust
0
import unittest from src.quantum_encryption_framework.quantum_cipher import QuantumCipher from src.quantum_encryption_framework.key_manager import KeyManager class TestQuantumEncryptionFramework(unittest.TestCase): def setUp(self): self.key_manager = KeyManager() self.quantum_cipher = QuantumCipher...
Python
1
from numpy import linalg as la import numpy.matlib as ml import numpy as np from butools.moments import ReducedMomsFromMoms, FactorialMomsFromMoms from butools.ph import MEFromMoments def MGFromMoments (moms): """ Creates a matrix-geometric distribution that has the same moments as given. Paramete...
Python
1
a> { pub header: Header, pub grammar: Option<Grammar<'a>>, pub lexicon: Lexicon<'a>, } impl<'a> BinaryDictionary<'a> { /// Creates a binary dictionary from bytes fn read_dictionary(dictionary_bytes: &[u8]) -> SudachiResult<BinaryDictionary> { let header = Header::new(&dictionary_bytes[..Hea...
Rust
0
wait?; // Exec js on browser and Deserialize with serde let url: String = page.eval("() => location.href").await?; assert_eq!(url, "https://docs.rs/playwright/0.0.5/playwright/"); // Wait until navigated page.click_builder(r#"a[title="playwright::api mod"]"#) .click() .await?; a...
Rust
0
import argparse, os, sys, numpy, cdms2, MV2, vcs, vtk p = argparse.ArgumentParser(description="Basic gm testing code for vcs") p.add_argument("--source", dest="src", help="source image file") p.add_argument("--mask", dest="mask", action="store_true",help="mask out part of data") p.add_argument("--show", dest="show", ...
Python
1
pty() { logger::init_logger_with_env(Some(Box::new(std::io::stdout()))) .chain_err(|| "Failed to init logger.")?; } else { let logfile = std::fs::OpenOptions::new() .read(false) .write(true) .append(true) .cr...
Rust
0
from turtle import Turtle, Screen import random screen = Screen() screen.setup(width=1800, height=600) user_bet = screen.textinput(title="Make your bet", prompt="Which turtle will win the race? Enter a color: ") is_race_on = False all_turtles = [] for turtle_num in range(0, 6): toni = Turtle(shape="turtle") a...
Python
1
_W { OUT1_W { w: self } } #[doc = "Bit 11 - Request to send. This bit is the complement of the UART request to send, nUARTRTS, modem status output. That is, when the bit is programmed to a 1 then nUARTRTS is LOW."] #[inline(always)] pub fn rts(&mut self) -> RTS_W { RTS_W { w: self } ...
Rust
0
y, start) # handle grid input if grid: LOGGER.info("loading grid", type="step") grid = np.loadtxt(grid) # where to get the box size from if box is not None and topology.box is not None\ and not np.array_equal(topology.box, box): msg = ("A box is provided via the -box c...
Python
1
ipPoint>, inspect_node: inspect::Node, ) -> Self { inspect_node.record_uint("proxy", proxy.as_handle_ref().raw_handle().into()); inspect_node.record_uint("actor_type", actor_type as u64); for (i, trip_point) in trip_points.iter().enumerate() { let node = inspect_node.crea...
Rust
0
>>(expected: u32, input: T) { assert_eq!(expected, input.as_()); } fn check_as_u64<T: AsPrimitive<u64>>(expected: u64, input: T) { assert_eq!(expected, input.as_()); } fn check_as_u128<T: AsPrimitive<U128>>(expected: U128, input: T) { assert_eq!(expected, input.as_()); } ...
Rust
0
ut new best layout if different than previous best print!("\n"); if best_score != prev_best_score { print_layout(&best_layout); print!("\n Score: {}\n", best_score.to_f64()); objective.print_layout_finger_usage(&best_layout); print!("\n"); write_layou...
Rust
0
(90, 93) ax1.set_ylabel('Test Accuracy (Test set)', fontsize=12); lns3 = ax1.bar(x=np.array([1.0]), width=bar_width, height=ax1_data[0], fc='steelblue', alpha=0.8) plt.text(1.0, ax1_data[0] + 0.0005, '%s' % ax1_data[0], ha='center', fontsize=12) lns3 = ax1.bar(x=np.array([1.25]), wid...
Python
1
from enum import Enum from recordclass import recordclass from datetime import datetime class WaterDetectionSensor(Enum): S2_NDWI = 'S2_NDWI' S2_NDWI_DEM = 'S2_NDWI_DEM' S1_VH_DB = 'S1_VH_DB' class WaterDetectionStatus(Enum): UNKNOWN_ERROR = -1 MEASUREMENT_VALID = 1 INVALID_DATA = 2 TO...
Python
1
parser = OptionParser(option_list = option_list) (options, args) = parser.parse_args() if options.infect is not None: if options.payload is None: print('[!] --payload must be specified') return -1 print('[+] Target image to infect: %s' % options.infect) prin...
Python
1
enums::*, menu, prelude::*, table, window}; use std::{cell::RefCell, rc::Rc}; /// Defines a calendar dialog pub struct Calendar { wind: window::Window, table: table::TableRow, month_choice: menu::Choice, year_choice: menu::Choice, } impl Calendar { /// Creates a new calendar dialog pub fn new...
Rust
0
A> for bool { #[inline(always)] fn from(variant: REG_GPIO_28_MASK_A) -> Self { variant as u8 != 0 } } #[doc = "Field `reg_gpio_28_mask` reader - Mask register for GPIO28."] pub struct REG_GPIO_28_MASK_R(crate::FieldReader<bool, REG_GPIO_28_MASK_A>); impl REG_GPIO_28_MASK_R { pub(crate) fn new(bi...
Rust
0
def prepare_ref_latents(self, refimage, batch_size, dtype, device, generator, do_classifier_free_guidance): refimage = refimage.to(device=device, dtype=dtype) if isinstance(generator, list): ref_image_latents = [self.vae.encode(refimage[i:i + 1]).latent_dist .sample(generator=generator[i...
Python
1
# Copyright (c) 2019-2025, Saransh Chopra, Henry Schreiner, Eduardo Rodrigues, Jonas Eschle, and Jim Pivarski. # # Distributed under the 3-clause BSD license, see accompanying file LICENSE # or https://github.com/scikit-hep/vector for details. from __future__ import annotations import math import pytest import vect...
Python
1
newtons_3() { let result: f64 = force::kilogramforce::to_newtons(5.0); assert_approx_eq!(49.0332, result, 0.01); } /// Need to convert to parameterized tests #[test] fn it_convert_knownkilogramforce_to_dynes_1() { let result: f64 = force::kilogramforce::to_dynes(0.1); assert_approx_eq!(98066.5, result, 0.0...
Rust
0
{ path: PathBuf::new(), content: String::from( r"FROM rust:latest AS builder FROM alpine COPY --from=builder", ), }; let invalid_images = dockerfile.validate().invalid_images; assert_eq!(invalid_images.len(), 2...
Rust
0
t EC_R_INCOMPATIBLE_OBJECTS: u32 = 106; pub const EC_R_INVALID_COMPRESSED_POINT: u32 = 107; pub const EC_R_INVALID_COMPRESSION_BIT: u32 = 108; pub const EC_R_INVALID_ENCODING: u32 = 109; pub const EC_R_INVALID_FIELD: u32 = 110; pub const EC_R_INVALID_FORM: u32 = 111; pub const EC_R_INVALID_GROUP_ORDER: u32 = 112; pub c...
Rust
0
_warnings_in_order() { let mut logger = Logger::default(); logger.add_warning(Warning::ShuffleSequenceNoRandom, &MetaData::from(0)); logger.add_warning(Warning::ShuffleSequenceNoRandom, &MetaData::from(1)); let logged_messages = logger.warnings.clone(); let iter_messages = logg...
Rust
0
def maxMin(k, arr): arr.sort() min_diff = sys.maxsize for i in range(len(arr)-k+1): min_diff = min(min_diff, arr[i+k-1] - arr[i]) return min_diff if __name__ == '__main__': k = int(input().strip()) arr = list(map(int, input().rstrip().split())) result = maxMin(k, arr...
Python
1
############################################################################### # Ganga Project. http://cern.ch/ganga # # $Id: DefaultSplitter.py,v 1.2 2008-09-09 15:11:35 moscicki Exp $ ############################################################################### from GangaCore.Core.exceptions import ApplicationCon...
Python
1
SPI3: (spi3, spi3_slave, APB1R1, spi3en, spi3rst, pclk1), } #[cfg(any( feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x5", feature = "stm32l4x6", ))] pins!(SPI3, AF6, SCK: [PB3, PC10], MISO: [PB4, PC11], MOSI: [PB5, PC12]); #[cfg(any(feature = "stm32l4x5", feature = "s...
Rust
0
filled_cells_grid2_d == 0)); } #[test] fn it_renames_the_correct_grids_after_an_addgrid_action() { let mut log = Log::new(2, 3); let grid_area = (0, log.grids_getwidth(), 0, log.grids_getheight()); log.gridname_setvalue('0'); log.grids_add(); log.check_last_action(grid_area); let check1 =...
Rust
0
same value is returned. #[inline(always)] pub fn update(&self, value: T) -> Arc<T> { self.raw.update(value) } } impl<T: Default> Default for QrwCell<T> { fn default() -> Self { Self { raw: RawQrwCell::default(), } } } impl<T: Default> QrwCell<T> { /// Update...
Rust
0
#!/usr/bin/env python3 """Training script for Multi-layer Feedforward Neural Network. Copyright (C) 2023 by Akira TAMAMORI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, inc...
Python
1
d81:2137:bd2a:2c5b IpAddr::V6(Ipv6Addr::new(9760, 0, 3277, 0, 0, 0, 0, 2)), ], DEFAULT_DNS_PORT, QueryMethod::AAAA, ); /// Combined Google DNS IPv4 and IPv6 options #[cfg(feature = "google")] #[cfg_attr(docsrs, doc(cfg(feature = "google")))] pub const GOOGLE: &dyn crate::Resolver<'static> = &&[GOOG...
Rust
0
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE from __future__ import annotations import pytest # noqa: F401 import awkward as ak def test_all_none(): result = ak.argsort([None, None, None]) assert ak.is_valid(result) assert result.to_list() == [0, 1, 2] assert...
Python
1
; } while !bs.is_byte_aligned() { bs.read1(Some("t0"))?; } EVC_TRACE(&mut bs.tracer, "************ PPS End ************\n"); EVC_TRACE(&mut bs.tracer, "***********************************\n"); Ok(()) } pub(crate) fn evcd_eco_sh( bs: &mut EvcdBsr, pps: &EvcPps, sh: &mut ...
Rust
0
m_comparer".to_owned())), unpacked : vec![SvArrayKind::Queue], is_const: false, access: Access::Public}; o.defs.insert(mb.name.clone(),ObjDef::Member(mb)); mb = DefMember{ name: "packer".to_owned(), kind: DefType::User(TypeUser::new("uvm_packer".to_owned())), unpacked : vec![SvArrayKind::Queue], is_const: false...
Rust
0
te5ozor25r3rfigznje").unwrap(); let count = 256; for _ in 0..count { let key = random_cid(&mut rng); if let Err(e) = insert(&ipfs, &mut root, key, value).await { panic!("Index: {} Key: {} Error: {}", root.link, key, e); } } let sum ...
Rust
0
hecNiveau(message, userFromDb, 17) if str(reaction.emoji) == '❓': totalPoints += 1 # Il nous dit qu'on hésite? await embed_histoire_character(message, "L'homme vous questionne :", "", "nanami", "", "Vous hésitez?", CONSTANTS['COLORS']['NANAMI']) await asyncio.sleep(2.5) await asy...
Python
1
} extern "C" { #[doc = " Create a client channel to 'target' using file descriptor 'fd'. The 'target'"] #[doc = "argument will be used to indicate the name for this channel. See the comment"] #[doc = "for grpc_insecure_channel_create for description of 'args' argument."] pub fn grpc_insecure_channel_cr...
Rust
0
} } return (coordinates, folds); } let split: Vec<usize> = line.split(',').filter_map(|n| n.parse().ok()).collect(); if split.len() == 2 { coordinates.insert((split[0], split[1])); } (coo...
Rust
0
bReserved: BYTE, HighNumber: SHORT, rgbReserved: [BYTE; 2], }} STRUCT! {struct IMAGE_AUX_SYMBOL_EX_s { TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF, rgbReserved: [BYTE; 2], }} STRUCT! {struct IMAGE_AUX_SYMBOL_EX_CRC { crc: DWORD, rgbReserved: [BYTE; 16], }} STRUCT! {struct IMAGE_AUX_SYMBOL_EX { Sym...
Rust
0
ter services hass.services.async_remove(DOMAIN, SERVICE_CONNECT) hass.services.async_remove(DOMAIN, SERVICE_DISCONNECT) hass.services.async_remove(DOMAIN, SERVICE_PUMP_ON) hass.services.async_remove(DOMAIN, SERVICE_PUMP_OFF) hass.services.async_remove(DOMAIN, SERVICE_HEAT_ON) hass.services.async...
Python
1
Default for JsonDataType { fn default() -> Self { JsonDataType::MAP } } impl ::protobuf::reflect::ProtobufValue for JsonDataType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) } } static file_descriptor_proto...
Rust
0
id UTF-8 sequence" )] pub raw: bool, #[structopt( long, short, help = "Quit when input EOF from stdin. Currently, do not quit if last character is not newline" )] pub escape_quit: bool, } /// Parse command line arguments. /// /// This function parses command line arguments ...
Rust
0
from __future__ import annotations from collections.abc import Sequence from datetime import datetime from pydantic import Field from no_llm.models.config import ( ConfigurableModelParameters, IntegrationAliases, ModelCapability, ModelConstraints, ModelIdentity, ModelMetadata, ModelMode, ...
Python
1
#!/usr/bin/python # *****BatteryMonitor Getdata from battery cells getdata.py***** # Copyright (C) 2020 Simon Richard Matthews # Project loaction https://github.com/simat/BatteryMonitor # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
Python
1
conv_cfg=conv_cfg, norm_cfg=norm_cfg, act_cfg=act_cfg)) else: convs = [nn.Conv2d(in_channels, channels, 1)] for _ in range(num_convs - 1): convs.append(nn.Conv2d(channels, channels, 1)) if len...
Python
1
t1) t2_c1, t2_c2, t2_c3, t2_c4, t2_c5 = self.context_encoder(t2) # t1_c5 = self.feature_extraction_c5(t1_c5) t2_c5 = self.feature_extraction_c5(t2_c5) t1_ = self.Dec1(t1_c5, t1_c2) t2_ = self.Dec2(t2_c5, t2_c2) # td_c5 = self.resCD(torch.cat([t1_c5, t2_c5]...
Python
1
expected_output = { "vrf": { "default": { "address_family": { "ipv4": { "prefix": { "10.255.255.224/32": { "version": 31880810, "internal": "0x1000001 0x30 (ptr 0x79189280) [1], 0x...
Python
1
# SPDX-FileCopyrightText: 2020 Lukas Schrangl <lukas.schrangl@tuwien.ac.at> # # SPDX-License-Identifier: BSD-3-Clause import operator from typing import Optional from PyQt5 import QtCore, QtGui, QtQml, QtQuick import pandas as pd from .. import helper from .loc_display import LocDisplay from .qml_wrapper import Simp...
Python
1
ool { // CHECK: call zeroext i1 %f(i1 zeroext %x) f(x) } // CHECK: align 4 i32* @borrow(i32* align 4 %x) #[no_mangle] pub fn borrow(x: &i32) -> &i32 { x } // CHECK-LABEL: @borrow_call #[no_mangle] pub fn borrow_call(x: &i32, f: fn(&i32) -> &i32) -> &i32 { // CHECK: call align 4 i32* %f(i32* align 4 %x) f(x) }...
Rust
0
$(config: $config:expr,)? $(env: $env:expr,)? $(imp: $imp:expr,)? src: $src:expr, exp: $exp:expr $(,)? ) => {{ #[allow(unused_mut, unused_assignments)] let mut env = HashMap::default(); $( env = $env; )? #[allow(unused_mut, unused_assignments)] let mut imp = H...
Rust
0
import pygame import numpy as np import random # Initialize pygame pygame.init() # Constants WIDTH, HEIGHT = 600, 600 LINE_WIDTH = 15 BOARD_ROWS, BOARD_COLS = 3, 3 SQUARE_SIZE = WIDTH // BOARD_COLS CIRCLE_RADIUS = SQUARE_SIZE // 3 CIRCLE_WIDTH = 15 CROSS_WIDTH = 25 SPACE = SQUARE_SIZE // 4 BG_COLOR = (28, 170, 156) ...
Python
1
global_replication_state, global_stat: GlobalStoreStat::default(), store_meta, plightlikeing_create_peers: Arc::new(Mutex::new(HashMap::default())), applying_snap_count: Arc::new(AtomicUsize::new(0)), }; let brane_peers = builder.init()?; let ...
Rust
0
, 0x43, 0x71, 0x73, 0xea, 0x1d, 0x75, 0x56, 0xc1, 0x58, 0xbc, 0x7a, 0x99, 0xe7, 0x4a, 0x34, 0xd9, 0x3d, 0xa6, 0xbf, 0x72, 0xac, 0x97, 0x36, 0xa2, 0x15, 0xac, 0xae, 0xfd, 0x4e, 0xc0, 0x31, 0xf3, 0xf1, 0x3f, 0x09, 0x9e, 0x3d, 0x81, 0x1d, 0x83, 0xa2, 0xcf, 0x1d, 0x54, 0x4a, 0x68, 0xd2, 0x75, 0x24, ...
Rust
0
l StatusInfo { pub fn empty() -> StatusInfo { StatusInfo { em: [0; 3], si: BitFlags::empty(), } } pub fn contains(&self, sie: StatusInfoEnum) -> bool { self.si.contains(sie) } pub fn change_kind(&self) -> ChangeKind { if self.contains(StatusInfoEnum::Disposed) { // DISPOSED...
Rust
0
nt); match nearest_distance { Some(nearest) => { if distance <= nearest { if distance < nearest { // We've found a new minimum element, remove all other neighbors found so far ...
Rust
0
# Python bytecode 2.7 (decompiled from Python 2.7) # Embedded file name: scripts/client/uilogging/wot_plus/logging_constants.py from collections import namedtuple from enum import Enum InfoPageInfo = namedtuple('InfoPageInfo', 'item, parent_screen') FEATURE = 'wot_plus' MIN_VIEW_TIME = 2.0 class WotPlusLogActions(Enum...
Python
1
let simple_nkp = intrinsics.simple_intrinsics.calibrate(kp); /// let distance = (nkp.0.coords - (simple_nkp.0.coords / (1.0 + k1 * simple_nkp.0.coords.norm_squared()))).norm(); /// assert!(distance < 0.1); /// ``` fn calibrate<P>(&self, point: P) -> NormalizedKeyPoint where P: ImagePoint, ...
Rust
0
, "First-person exploration"] ) self.add_mechanic( mechanic_id="souls_like", name="Souls-like Mechanics", description="Challenging gameplay mechanics inspired by Dark Souls", examples=["Difficult combat", "Death penalties", "Sparse checkpoints"] ...
Python
1
FROM movies GROUP BY unknown", group_join: "SELECT s.name, COUNT(*) FROM movies m JOIN studios s ON m.studio_id = s.id GROUP BY s.name ORDER BY s.name ASC", group_expr: "SELECT MAX(rating) AS rating FROM movies GROUP BY studio_id * 2 ORDER BY rating", group_expr_aliased: "SELECT studio_id * 2 AS twice, MAX(...
Rust
0
value(&self) -> u8 { ((self.0 as u8 & 1) << 1 | (self.0 as u8 & 2) >> 1) << 5 | (self.1 as u8) << 7 } } /// Unit for the limit attribute of a segment. /// * Byte mode uses 1 byte blocks /// * Page mode uses 4kb blocks #[allow(dead_code)] #[derive(Copy, Clone, Debug)] #[repr(u8)] enum Granularity { Byt...
Rust
0
_nullable_f64_stream (stream: &mut Cursor<Vec<u8>>, n_values: usize, result: &mut [Option<f64>]) { unpack_stream(stream, n_values, |idx, value| { result[idx] = value }).unwrap() } <filename>bip_disk/examples/add_torrent.rs extern crate bip_disk; extern crate bip_metainfo; extern crate futures; use std:...
Rust
0
import threading import time from utils.common import GlobalVal import requests import config def get_rank(room_id): url = f"https://live.douyin.com/webcast/ranklist/audience/?aid=6383&app_name=douyin_web&live_id=1&device_platform=web&language=zh-CN&cookie_enabled=true&screen_width=2560&screen_height=1440&browser...
Python
1
tb_writer.add_scalar(config['name'] + '/loss_viewpoint - psnr', psnr_test, iteration) if tb_writer: tb_writer.add_histogram("scene/opacity_histogram", scene.gaussians.get_opacity, iteration) tb_writer.add_scalar('total_points', scene.gaussians.get_xyz.shape[0], itera...
Python
1
0} of type `{}`", desc, expected, actual, ) } fn match_bool( expected: bool, actual: bool, desc: &str, if_true: &str, if_false: &str, ) -> Result<()> { if expected == actual { return Ok(()); } bail!( "{} types incompatible: expected {} {0}, fo...
Rust
0
# Generated by Django 2.2.6 on 2019-11-26 16:19 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("a4_candy_cms_images", "0001_initial"), ("a4_candy_cms_pages", "0004_auto_20191112_1354"), ] operations = [ ...
Python
1
Vec<Vertex> { use rusttype::{point, Font, Scale}; let mut vertexes = Vec::new(); const THRESHOLD: f32 = 0.2; let ttf = Font::try_from_bytes(include_bytes!("../../assets/font.ttf")).unwrap(); let scale = Scale::uniform(self.px_size); let v_metrics = ttf.v_metrics(scale)...
Rust
0
n { scope_276.string(var_277); } #[allow(unused_mut)] let mut scope_278 = writer.prefix("DBParameterGroupFamily"); if let Some(var_279) = &input.db_parameter_group_family { scope_278.string(var_279); } #[allow(unused_mut)] let mut scope_280 = writer.prefix("Filters"); if ...
Rust
0
mtx = pca_analysis(X_train_std, X_test_std, y_train, y_test) # compute max accuracy and #of components to achieve it max_accuracy = np.max(acc_list) n_components = acc_list.index(max_accuracy) + 1 # print maximum accuracy with #of components print(f'\nmax accuracy = {round(max_accuracy, 2)} was ac...
Python
1
import cv2 import os dataset="Dataset" name="Arjun_face" path=os.path.join(dataset,name) # WE ARE CREATING A PATH BY JOINING THE DATASET ALONG WITH NAME WE DESIRE TO NAME IT WHEREIN IT CREATES Dataset/Arjun_face if not os.path.isdir(path): # WE ARE CHECKING IF THERE IN ANY PATH THAT IS CREATED FOR THE SAME PATH NAME...
Python
1