text
string
label_name
string
labels
int64
acceleration to set fn set_acceleration(&mut self, _new_accel: Vec2<f32>) { // If no implementation is provided, then setting the acceleration does nothing } /// Gets the object's velocity /// # Return /// Returns the velocity of the object as a vector fn velocity(&self) -> Vec2<f32>; ...
Rust
0
rows, columns = [int(x) for x in input().split(', ')] matrix = [] column_sums = [] for _ in range(rows): current_row = [int(x) for x in input().split()] matrix.append(current_row) for col in range(columns): sum_col = 0 for row in range(rows): sum_col += matrix[row][col] column_sums.appe...
Python
1
ait; let original_replica_version = get_software_version(endpoint) .await .expect("Could not obtain software version after installing NNS"); let nns = runtime_from_url(endpoint.url.clone()); let governance = nns::get_governance_canister(&nns); let test_neuron_i...
Rust
0
own), _ => panic!("Char separation failed"), }; } Ok(result) } } impl Display for Message { fn fmt(&self, f: &mut Formatter) -> FormatResult { for signal in self.iter() { write!(f, "{}", signal)?; } Ok(()) } } use {ffi, libc}; ...
Rust
0
_resource_requirements def _ToV2PolicyControllerResourceList( self, v1_resource_list, ): """Converts a v1alpha PolicyControllerResourceList to a v2alpha PolicyControllerResourceList.""" if v1_resource_list is None: return None v2_resource_list = self.messages_v2.PolicyControllerResourceList() v2_...
Python
1
ation of the string) type Elem; } pub(crate) mod private { use std::os::raw::c_char; use crate::ffi::ListElem; pub unsafe trait ListImpl { /// The list's name. /// /// # Safety /// /// Must point to a valid, null-terminated C-style string. const NAME: *...
Rust
0
import subprocess # noqa: S404 import sys from http import HTTPStatus import gevent import requests def test_backend(): """Just runs the backend code to make sure `python -m rotkehlchen` works""" proc = subprocess.Popen( # Only works with --logtarget stdout. Figure out why it does not work #...
Python
1
arr1=[list(input()) for _ in range(4)] arr2=[ ['A','B','C','D'], ['B','B','A','B'], ['C','B','A','B'], ['B','A','A','A'], ] max_cnt=-21e8 answer=0 for i in range(4): cnt=0 for j in range(4): for k in range(4): if arr2[j][k] == arr1[j][k] and arr2[j][k] == chr(65+i): ...
Python
1
http::operation::SerializationError> { let mut out = String::new(); #[allow(unused_mut)] let mut writer = aws_smithy_query::QueryWriter::new(&mut out, "DescribeFastLaunchImages", "2016-11-15"); #[allow(unused_mut)] let mut scope_2345 = writer.prefix("ImageId"); if let Some(var_2346) = &i...
Rust
0
{ BoxOrArcClient::BoxClient(client) => client.process_changes(time_source, artifacts), BoxOrArcClient::ArcClient(client) => client.process_changes(time_source, artifacts), } } } /// Metrics for a client artifact processor. struct ArtifactProcessorMetrics { /// The processing tim...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AnttechNftBaseinfoNftidQueryResponse(AlipayResponse): def __init__(self): super(AnttechNftBaseinfoNftidQueryResponse, self).__init__() self._nft_hash = None s...
Python
1
"foo.bar"); } #[test] fn test_unpack_tarball() { let file = get_test_tar(); let mut archive = Archive::new(file.as_slice()); let mut lines = Vec::new(); let tmp_dir = tempfile::TempDir::new().unwrap(); unpack_tarball_impl( &mut archive, Pat...
Rust
0
ing.info(f'QLoRA: Quantizing linear layer: {prefix}.{name}') layer_norm_weight = checkpoint.get(f"{prefix}.{name}.layer_norm_weight", None) if layer_norm_weight is None: setattr(module, name, NF4LinearWrapper(bf16_weight)) else: lay...
Python
1
#!/usr/bin/python # Copyright 2015 Huawei Devices USA Inc. All rights reserved. # # 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 r...
Python
1
sponse::new(StatusCode::Ok); // /// http_types::security::frameguard(&mut headers, None); // /// assert_eq!(headers["X-Frame-Options"], "sameorigin"); // /// ``` #[inline] pub fn frameguard(mut headers: impl AsMut<Headers>, guard: Option<FrameOptions>) { let kind = match guard { None | Some(FrameOptions::Sa...
Rust
0
debug!("Discovered invalid regex during parsing."); return Err(()); } }; if regex.is_match(url) { debug!("Deny filter {} contains URL {}", deny, url); return Ok(false); } } debug!( "No filter matched. Applying defaul...
Rust
0
]', '^', '\\', '`']); // 0x7B - 0x7E assert_not_valuable_trigram_chars(&['[', '|', '{', '}', '~']); } fn assert_count(text: &str, pairs: &[(&str, u32)]) { let result = count(text); for &(trigram_str, expected_n) in pairs.iter() { let chars: Vec<char> = trigram_str.cl...
Rust
0
# Copyright 2024 The human_scene_transformer Authors. # # 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 ...
Python
1
::HelloRequest, 1 => HandshakeType::ClientHello, 2 => HandshakeType::ServerHello, 3 => HandshakeType::HelloVerifyRequest, 11 => HandshakeType::Certificate, 12 => HandshakeType::ServerKeyExchange, 13 => HandshakeType::CertificateRequest, ...
Rust
0
); assert_eq!(transfers.len(), 2); assert_eq!( transfers[0], Transfer { debitor: person_2.clone(), creditor: person_1.clone(), amount: 3, } ); assert_eq!( transfers[1], Transfer { ...
Rust
0
serde::json; #[test] fn main() { let result = json::from_str::<bool>(" true && false "); assert!(result.is_err()); } use ops::interface::*; use primitives::*; use graph::*; use errors::*; use std::any::Any; use std::collections::HashSet; #[derive(Debug, Clone)] pub struct TensorShape { pub axis: Axis, } ...
Rust
0
el. """ # Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=test_size, random_state=random_state, stratify=y ) # Define a list of classification models to test models = { "Logistic Regression": LogisticRegression(...
Python
1
import os from bcbio import bam from bcbio import utils from bcbio.log import logger from bcbio.distributed import transaction from bcbio.provenance import do CALCULATE_EXP = ( "rsem-calculate-expression --bam {core_flag} {paired_flag} " "--no-bam-output --forward-prob 0.5 " "--estimate-rspd {bam_file} {r...
Python
1
TE_LAST_OUTPUT: _MFT_PROCESS_OUTPUT_FLAGS = 2i32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub type _MFT_PROCESS_OUTPUT_STATUS = i32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS: _MFT_PROCESS_OUTPUT_STATUS = 256i32; #[doc = "*Require...
Rust
0
lone, Copy, Debug, PartialEq, TryFromPrimitive)] pub enum StakePoolState { Uninitialized, Initialized, Frozen, } impl Default for StakePoolState { fn default() -> Self { StakePoolState::Uninitialized } } // // Define the data struct // #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct StakePoo...
Rust
0
from eth_tester import EthereumTester from json import loads from web3 import Web3 from .account import Account from .factory import Factory from .failure_handler import FailureHandler class Tester: def __init__(self, _web3: Web3, ethereum_tester: EthereumTester, compiled_inter...
Python
1
(witver, witprog) = decode_segwit_address(hrp, addr) self.assertEqual(encode_segwit_address(hrp, witver, witprog), addr) # P2WPKH test_python_bech32('bcrt1qthmht0k2qnh3wy7336z05lu2km7emzfpm3wg46') # P2WSH test_python_bech32('bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...
Python
1
# Add incidents into map import sys sys.path.append(r'/home/songshuhao/anaconda3/bin/') from concurrent.futures import ThreadPoolExecutor from geopy.distance import great_circle import folium def station_map_add(stalist,lats,lons,this_map,c,cr): # this function adds incidents into the map based on an existing m...
Python
1
""" Classifies: CHEBI:29256 thiol """ from rdkit import Chem def is_thiol(smiles: str): """ Determines if a molecule is a thiol based on its SMILES string. A thiol is an organosulfur compound in which a thiol group (-SH) is attached to a carbon atom of an aliphatic or aromatic moiety. Args: ...
Python
1
class Columns: DTIME_COLUMN = "Time" ACCELEROMETER_X = "Accelerometer_X" ACCELEROMETER_Y = "Accelerometer_Y" ACCELEROMETER_Z = "Accelerometer_Z" BAROMETER_X = "Barometer_X" GYROSCOPE_X = "Gyroscope_X" GYROSCOPE_Y = "Gyroscope_Y" GYROSCOPE_Z = "Gyroscope_Z" LINEAR_ACCELEROMETER_X = "...
Python
1
# 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 u...
Python
1
# -*- coding: utf-8 -*- from garbevents.custom_sensors_events import GetData from garbevents.settings import Settings as ST import pandas as pd import openpyxl as xl from openpyxl.worksheet.worksheet import Worksheet from openpyxl.cell import MergedCell def parser_merged_cell(sheet: Worksheet, row, col): cell ...
Python
1
import requests import pandas as pd import numpy as np import ta def get_binance_futures_klines(symbol="BTCUSDT", interval="1h", limit=1000): url = f"https://fapi.binance.com/fapi/v1/klines?symbol={symbol}&interval={interval}&limit={limit}" response = requests.get(url) data = response.json() df = pd.Da...
Python
1
from math import dist def centroid(cluster): dists = [] for dot1 in cluster: sumd = 0 for dot2 in cluster: sumd += dist(dot1, dot2) dists.append([sumd, dot1]) return min(dists)[1] with open('txt/27A_18056.txt') as file: data = [list(map(float, i.replace(',', '.')....
Python
1
// You should have received a copy of the MIT License along with this software. // If not, see <https://opensource.org/licenses/MIT>. use alloc::string::{String, ToString}; use alloc::vec::Vec; use core::borrow::Borrow; use core::cmp::Ordering; use core::convert::TryFrom; use core::fmt::{self, Display, Formatter}; us...
Rust
0
("show-tables") .help("Show supported NCBI Genetic Code tables") .takes_value(false) ) ) .get_matches() } use std::collections::{HashMap, HashSet}; use std::mem; use std::time::SystemTime; use sdl2::pixels::Color; use sdl2::render::Canvas;...
Rust
0
import math while True: num1 = float(input("\nEnter first number: ")) num2 = float(input("Enter second number: ")) print("\nWhich mathematical operation would you like to perform? \n1. Addition\n2. Subtraction\n3. Multiplication\n4. Division\n5. Square Root") operation = int(input("\nChoose the math...
Python
1
m" RESET = "\033[0m" url = "https://client-proxy-server.pump.fun/comment" payload = {"text": text, "mint": mintId} requests.proxies = {"http": proxy, "https": proxy} headers_copy = self.headers.copy() headers_copy["x-aws-proxy-token"] = token print(f"{...
Python
1
print('------------ CONSULTA PREÇO CONVERTIDO -------------') preco = float(input('Insira o valor do produto: ')) dollar = float(5.85) if preco <= 5: print(f'Valor R${preco} Produto barato') print(f'No dollar atual custa ${preco / dollar}') elif preco >= 10 and preco <= 15: print(f'Valor R${preco} Produto de médi...
Python
1
, gamma=config.opt.gamma ) else: raise ValueError(f"Got scheduler={config.opt.scheduler}") # Creating the losses l2loss = LpLoss(d=2, p=2) h1loss = H1Loss(d=2) if config.opt.training_loss == "l2": train_loss = l2loss elif config.opt.training_loss == "h1": train_loss = h1loss else: raise ValueError...
Python
1
. Morbi mauris dui, ultricies nec tempus vel, \ gravida nec quam."; // check the panic includes the prefix of the sliced string #[test] #[should_panic(expected="byte index 1024 is out of bounds of `Lorem ipsum dolor sit amet")] fn test_slice_fail_truncated_1() { &LOREM_PARAGRAPH[..1024]; ...
Rust
0
) def add_quant_suffix(tensor_name: str) -> str: return tensor_name + "_QuantizeLinear" def add_quant_input_suffix(tensor_name: str) -> str: return tensor_name + QUANT_INPUT_SUFFIX def add_quant_output_suffix(tensor_name) -> str: return tensor_name + "_QuantizeLinear_Output" def add_dequant_suffix...
Python
1
/// # extern crate partitions; /// # /// # fn main() { /// let partition_vec = partition_vec![ /// 'a' => 0, /// 'b' => 1, /// 'c' => 2, /// 'd' => 1, /// 'e' => 0, /// ]; /// /// assert!(partition_vec[0] == 'a'); /// assert!(partition_vec[1] == 'b'); /// assert!(partition_vec[2] == 'c'); /// asser...
Rust
0
, Box_::into_raw(f) as *mut _) } } fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId { unsafe { let f: Box_<Box_<Fn(&Self, &Track) + 'static>> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "track-removed", ...
Rust
0
# pop() must change the version if the key exists self.check_version_changed(d, d.pop, 'key') # pop() must not change the version if the key does not exist self.check_version_dont_change(d, self.assertRaises, KeyError, d.pop, 'key') def test_popitem(...
Python
1
dcMillisecType = c_int32 """时间(毫秒)类型""" TThostFtdcSecType = c_int32 """时间(秒)类型""" TThostFtdcVolumeMultipleType = c_int32 """合约数量乘数类型""" TThostFtdcTradingSegmentSNType = c_int32 """交易阶段编号类型""" TThostFtdcRequestIDType = c_int32 """请求编号类型""" TThostFtdcYearType = c_int32 """年份类型""" TThostFtdcMonthType = c_int32 """月份...
Python
1
em! { #[test] fn [<test_zero_like_2_ $t>]() { let a = (vec![42 as $t; 4]).zero_like(); for i in 0..4 { assert!(((0 as $t - a[i]) as f64).abs() < std::f64::EPSILON); } } } ...
Rust
0
joincond.parent_selectable, right, True) self.assert_compile( pj, "pj.group_id = composite_selfref.group_id " "AND composite_selfref.id = pj.parent_id" ) def test_join_targets_m2o_composite_...
Python
1
UPDC16_A { #[doc = "0: External input pin configured as interrupt"] WUPDC16_0, #[doc = "1: External input pin configured as DMA request"] WUPDC16_1, #[doc = "2: External input pin configured as trigger event"] WUPDC16_2, } impl From<WUPDC16_A> for u8 { #[inline(always)] fn from(variant: WUPDC16_A) -> Se...
Rust
0
join(target.rules_data_path, './rulesets/default.json'))) target = Ruleset(cloud_provider='aws', environment_name="notexist", filename=None) assert (prompt_yes_no.call_count == 0) assert (os.path.samefile(target.filename, os.path.join(target.rules_data_path, './rulesets/default.json'))) ...
Python
1
-near * (far / near).powf((z_slice - 1) as f32 / (z_slices - 1) as f32) } } fn ndc_position_to_cluster( cluster_dimensions: UVec3, cluster_factors: Vec2, is_orthographic: bool, ndc_p: Vec3, view_z: f32, ) -> UVec3 { let cluster_dimensions_f32 = cluster_dimensions.as_vec3(); let frag_coo...
Rust
0
if self.conf.inlier_ratio is not None: assert self.conf.inlier_prob_threshold is None assert self.conf.topk is None # Ratio-based filtering num_top = int(len(inlier_probs) * self.conf.inlier_ratio) num_top = max(1, num_top) th = np.sort(outlier_...
Python
1
_at = query.from_job.unwrap_or(0); let results = resque::queue_details(state.redis.clone(), &path.0, start_at, start_at + 9) .await .map_err(resque_error_map)?; Ok(HttpResponse::Ok().json(&results)) } #[get("/failed")] async fn failed_jobs( query: web::Query<JobParam>, state: web::Data<...
Rust
0
def fast_collate(memory_format, batch): imgs = [img[0] for img in batch] targets = torch.tensor([target[1] for target in batch], dtype=torch.int64) w = imgs[0].size[0] h = imgs[0].size[1] tensor = torch.zeros((len(imgs), 3, h, w), dtype=torch.uint8).contiguous( memory_format=memory_format) ...
Python
1
""" Program: dicesimulator ---------------------- Simulate rolling two dice, three times. Prints the results of each die roll. This program is used to show how variable scope works. """ # Import the random library which lets us simulate random things like dice! import random # Number of sides on each die to roll NU...
Python
1
} pub fn alphabetic_baseline(&self) -> scalar { self.native().fAlphabeticBaseline } pub fn ideographic_baseline(&self) -> scalar { self.native().fIdeographicBaseline } pub fn longest_line(&self) -> scalar { self.native().fLongestLine } pub fn did_exceed_max_lines(...
Rust
0
= (opcode & 0x0010_0000) != 0; let operation = ((opcode & 0x01E0_0000) >> 21) as u8; let mut rn = gba.regs[rn_num]; if rn_num == 15 { rn = rn.overflowing_add(4).0; // Account for PC pipelining } let (op2, shift_carry) = { if immediate { let ror_shift = u32::from(third_byte) << 1; let va...
Rust
0
rev_from(29).collect::<Vec<(u32, u32)>>(), vec![(25, 42), (20, 42), (15, 42), (10, 42), (5, 42)]); assert_eq!( map.iter_rev_from(30).collect::<Vec<(u32, u32)>>(), vec![(25, 42), (20, 42), (15, 42), (10, 42), (5, 42)]); assert_eq!( map.iter_rev_from(31).c...
Rust
0
Thread() -> Looper; fn ALooper_prepare(opts: i32) -> Looper; fn ALooper_acquire(looper: Looper); fn ALooper_release(looper: Looper); fn ALooper_pollOnce(looper: Looper, timeout: i32, fd: *mut i32, events: *mut i32, data: *mut usize) -> i32; fn ALooper_pollAll(looper: Looper, timeout: i32, fd: *mut i32, events...
Rust
0
#!/usr/bin/env python """ Extract gene positions from GTF file for fusion detection """ import sys import pickle import re from collections import defaultdict from intervaltree import IntervalTree def extract_gene_positions(gtf_file, output_file): """ Extract gene positions from GTF file and create interval t...
Python
1
connecting = 20, wlan_notification_acm_disconnected = 21, wlan_notification_acm_adhoc_network_state_change = 22, wlan_notification_acm_profile_unblocked = 23, wlan_notification_acm_screen_power_change = 24, wlan_notification_acm_profile_blocked = 25, wlan_notification_acm_scan_list_refresh = 26,...
Rust
0
TE, 'CLIENT_SSL_BIND_CERT': CLIENT_SSL_BIND_CERTIFICATE, 'CONTROL_SSL_BIND_KEY': CONTROL_SSL_BIND_KEY, 'CLIENT_SSL_BIND_KEY': CLIENT_SSL_BIND_KEY, 'CONTROL_SSL_CLIENT_CERT': CONTROL_SSL_CLIENT_CERTIFICATE, 'CLIENT_SSL_CLIENT_CERT': CLIENT_SSL_CLIENT_CERTIFICAT...
Python
1
from fastapi import FastAPI, Depends, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates from sqlalchemy.orm import Session from app.db import Base, engine, get_db from app.models import SenderAccount, Recipient, Campaign, EmailSend, EngagementEvent from app.config import ...
Python
1
ing(v) => v.to_object(py), CellValue::Bool(v) => v.to_object(py), CellValue::Time(v) => PyTime::new( py, v.hour() as u8, v.minute() as u8, v.second() as u8, (v.nanosecond() / 1000) as u32, None, ...
Rust
0
ub struct RightClickSystem; impl<'a> System<'a> for RightClickSystem { type SystemData = ( Read<'a, MouseState>, WriteExpect<'a, UiState>, Read<'a, Town>, WriteExpect<'a, RestApiState>, WriteExpect<'a, ErrorQueue>, Entities<'a>, WriteStorage<'a, Worker>, ...
Rust
0
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Issues"), "items": [ { "type": "doctype", "name": "Issue", "description": _("Support queries from customers."), "onboard": 1, }, { "type": "doctype", "name": "Issue Typ...
Python
1
44063491565474664"); let full_signal = repeat_signal(&signal, 10000); let mut solver = FFTSolver::new(&signal, 10000); let last_digit = signal.len() * 10000 - 1; println!(""); for x in 0..10 { let values : Vec<i8> = (0..100).map(|i| solver.get_value(i, last_digit - x))....
Rust
0
# pipeline/jobs/asset_jobs.py """ Utility helpers – no Dagster code at import time to avoid cycles. • materialize_all_assets_job – runs the entire graph • build_pair_jobs(keys) – 1 job per “<name>_raw ↔ <name>” pair • build_multi_pair_job(names) – combine any number of those pairs into ...
Python
1
2 WASM_INS_F32_CONVERT_U_I32 = 0xb3 WASM_INS_F32_CONVERT_S_I64 = 0xb4 WASM_INS_F32_CONVERT_U_I64 = 0xb5 WASM_INS_F32_DEMOTE_F64 = 0xb6 WASM_INS_F64_CONVERT_S_I32 = 0xb7 WASM_INS_F64_CONVERT_U_I32 = 0xb8 WASM_INS_F64_CONVERT_S_I64 = 0xb9 WASM_INS_F64_CONVERT_U_I64 = 0xba WASM_INS_F64_PROMOTE_F32 = 0xbb WASM_INS_I32_REIN...
Python
1
from __future__ import absolute_import from __future__ import print_function import pyverilog.vparser.ast as vast from pyverilog.ast_code_generator.codegen import ASTCodeGenerator def main(): # Define ports a = vast.Ioport(vast.Input('A', width=vast.Width(vast.IntConst('7'), vast.IntConst('0')))) y = vast....
Python
1
".to_owned(), )); } Ok(()) } struct ArrowFile { schema: Schema, // we can evolve this into a concrete Arrow type // this is temporarily not being read from _dictionaries: HashMap<i64, ArrowJsonDictionaryBatch>, batches: Vec<RecordBatch>, } fn read_json_file(json_name: &str) -> Res...
Rust
0
for the container */ } } .slide-in { animation: slidein 10s infinite linear; /* Adjusted animation duration */ } """ # Display the CSS style st.write("<style>{}</style>".format(css), unsafe_allow_html=True) # Display the sliding message st.markdown("<div class='slide-in'>Please note that the predictions prov...
Python
1
from pydantic import BaseModel class AppointmentCreate(BaseModel): patient_name: str doctor_name: str time: str class Appointment(AppointmentCreate): id: int class Config: orm_mode = True
Python
1
# -*- coding: utf-8 -*- ''' © 2012-2013 eBay Software Foundation Authored by: Tim Keefer Licensed under CDDL 1.0 ''' from ebaysdk.poller.orders import Poller from ebaysdk.poller import parse_args class CustomStorage(object): def set(self, order): try: print(order.OrderID) print(o...
Python
1
Incorrect Move: d1f3, // depth: 4232, fen: rnb1k2r/pppp1ppp/7n/2b1P3/4P3/2P5/PP3PPP/RN1QKBNR w KQkq - 1 6 // in check?: false // ttm: a5e2b bits: 54048 // killer1: d1f3 bits: 5443 // killer1: c2f8q bits: 65354 // counter: d6h2q bits: 62443', pleco_engine\src\movepick\mod.rs:...
Rust
0
Ni.reshape(-1, 1)) else: MHAP_SNPs = np.sum(MsplitHAPs != 0, axis=1) MHAP_Sites = np.sum(MsplitHAPs * MNi.reshape(-1, 1), axis=1) MHAP_Sites_nozero = np.where(MHAP_Sites == 0, np.nan, MHAP_Sites) Ka = np.nansum(MNi * MHAP_SNPs / MHAP_Sites_nozero) / N KA.append(Ka) ...
Python
1
import torch import torch.nn as nn import kornia from types import SimpleNamespace class DISK(nn.Module): default_conf = { 'weights': 'depth', 'max_num_keypoints': None, 'desc_dim': 128, 'nms_window_size': 5, 'detection_threshold': 0.0, 'pad_if_not_divisible': True,...
Python
1
import random as rn trials = ['rock','paper','sicssor'] c_computer = 0 c_player = 0 print("Rock Paper Sicssors Game") name = input("Enter your name: ") print("Welcome to the game: ",name) while True: user = input("Enter your play (Rock,Paper or Sicssor) or PRESS 'q' to exit the game: ") computer = rn.cho...
Python
1
as u8) } #[doc = "Bits 0:7"] #[inline(always)] pub fn rf_id(&self) -> RF_ID_R { RF_ID_R::new((self.bits & 0xff) as u8) } } impl W { #[doc = "Bits 16:23"] #[inline(always)] pub fn hw_rev(&mut self) -> HW_REV_W { HW_REV_W { w: self } } #[doc = "Bits 8:15"] #[in...
Rust
0
op: UnaryOperator::Not, expr: Box::new(Expr::Value(Value::Number(BigDecimal::from(1)))) }]] )), Err(PlanError::syntax_error(&"operation 'logical not' not supported")) ); } /// ```sql /// insert into schema_name.table_name values (not 1); /// ``` #[rstest::rs...
Rust
0
yParent(where: { id: 1 }, data: { uniq: "u1" }) { count }}"#, 2003, "Foreign key constraint failed on the field" ); Ok(()) } /// Updating the parent succeeds if no child is connected. #[connector_test] async fn update_parent(runner: Runner) -> TestResult<()> { ...
Rust
0
ITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TOR...
Rust
0
#[serde(rename = "extreme-summitstack-128")] ExtremeSummitstack128, #[serde(rename = "extreme-summitstack-256")] ExtremeSummitstack256, #[serde(rename = "extreme-summitstack-512")] ExtremeSummitstack512, #[serde(rename = "other")] Other, } <filename>demo/src/modes/add_line_mode.rs use cra...
Rust
0
True stop_key = next_key stop = next_stop return False def move_to_correct_column(stop: Stop): actions.edit.line_end() move_cursor_left(stop.columns_left) def move_to_correct_row(current_stop: Stop, next_stop: Stop): start = current_stop.row end = next_stop.row ...
Python
1
<'gc>], ) -> Result<Value<'gc>, Error<'gc>> { avm_warn!(activation, "Stage.align: unimplemented"); Ok("".into()) } fn set_align<'gc>( activation: &mut Activation<'_, 'gc>, _context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, _args: &[Value<'gc>], ) -> Result<Value<'gc>, Error<'gc>> { ...
Rust
0
hy_request/0)] fn result(process: &Process) -> Term { // ```elixir // # pushed to stack: () // # returned from call: N/A // # full stack: () // # returns: {:ok, document} // ``` process.queue_frame_with_arguments(document::new_0::frame().with_arguments(false, &[])); // ```elixir // #...
Rust
0
MER_TBMR_TCACT_SETTO, #[doc = "Set CCP immediately and toggle on Time-Out"] TIMER_TBMR_TCACT_SETTOGTO, #[doc = "Clear CCP immediately and toggle on Time-Out"] TIMER_TBMR_TCACT_CLRTOGTO, #[doc = "Set CCP immediately and clear on Time-Out"] TIMER_TBMR_TCACT_SETCLRTO, #[doc = "Clear CCP immedia...
Rust
0
6]); bits.shift_left(4); assert_eq!(bits, bits![1, 1, 0, 0, 0, 0]); bits.shift_right(2); assert_eq!(bits, bits![0, 0, 1, 1, 0, 0]); } <filename>cmd/starcoin/src/dev/generate_multisig_txn_cmd.rs // Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::cli_state::CliState; ...
Rust
0
# digite um valor, mostre o dobro do valor. # pergunte se quer calcular outra vez e repita resp = "s" # VALOR INICIAL while resp == "s": # TESTE LÓGICO num = int(input("Digite um número: ")) print(f"O dobro de {num} é {num*2}") resp = ...
Python
1
cord.write("%d\n" % cnt) record.close() print("low-res test set done") if not args.no_full_test: # test full-res cnt = 0 out_dir = f"{args.data_dir}/{args.satellite}/Dataset/test_full_res" mmcv.mkdir_or_exist(out_dir) record = open(f'{out_dir}/record.txt', "w...
Python
1
if op == 2: q[:,0,:] = q[:,2,:] q[:,1,:] = q[:,2,:] return q if op == 3: q[:,1,:] = q[:,2,:] q[:,0,:] = q[:,3,:] q[2,0,:] = -q[2,3,:] q[2,1,:] = -q[2,2,:] return q if op1 == 1: if op == 1: ...
Python
1
def einstein(): c = 300000000 m = int(input("Enter the mass as an integer:")) return int(m*c*c) def main(): print("E:" + str(einstein())) main()
Python
1
# coding=utf-8 """Tests for augment.inline.""" # Copyright 2017 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
Python
1
6, 6, 14, p6dir, p6out, p6in, p6ren, p6sel0, p6sel1, p6ie, p6ies, p6ifg, Input<Floating>), P6_7: (p6_7, 7, 15, p6dir, p6out, p6in, p6ren, p6sel0, p6sel1, p6ie, p6ies, p6ifg, Input<Floating>), ] } (portd, pddir, pdout, pdin, pdren, pdsel0, pdsel1, pdie, pdies, pdifg, PDx): { P7x: [ ...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional from typing_extensions import Literal from ..._models import BaseModel __all__ = ["BatchExpiredWebhookEvent", "Data"] class Data(BaseModel): id: str """The unique ID of the batch API request.""...
Python
1
ET_DEFAULT_MTU } else { let mtu_res = dev_lock.as_ref().unwrap().get_mtu_size(); let dev_mtu = if mtu_res.is_ok() { mtu_res.unwrap() } else { log::debug!( "MTU not provided by the device, using default mtu={}", ...
Rust
0
assert_eq!(bitvec.first_mut().map(|access| access.get()), Some(true)); assert_eq!(bitvec.last(), Some(true)); assert_eq!(bitvec.last_mut().map(|access| access.get()), Some(true)); // Push `0` bitvec.push(false); assert_eq!(bitvec.len(), 2); assert_eq!(bitvec.capacity(), 256); assert_eq!(bitv...
Rust
0
> PyErr where A: Send + Sync + IntoPy<Py<PyAny>>, { PyRuntimeError::new_err(message) } <gh_stars>1-10 // WARNING: THIS CODE IS AUTOGENERATED. // DO NOT EDIT!!! use serde::{Deserialize, Serialize}; /// This object represents an animated emoji that displays a random value. /// <https://core.telegram.org/bots/ap...
Rust
0
d"]: 0 for n in serialisable_nodes} for e in serialisable_edges: degrees[e["source"]] += 1 degrees[e["target"]] += 1 max_deg = max(degrees.values()) or 1 for idx, n in enumerate(serialisable_nodes): deg = degrees[n["id"]] centrality = deg / max_deg...
Python
1
e(pub petgraph::prelude::NodeIndex); impl $name { pub fn idx(self) -> petgraph::prelude::NodeIndex { self.0 } pub fn index(self) -> usize { self.0.index() } } impl From<$name> for ...
Rust
0