text
string
label_name
string
labels
int64
test_d45ort("f7", "IIOrIII", &ort); ort = Degree45Orthant::new(&RelAdr::new(-1, -1)); test_d45ort("f8", "IIOrIII", &ort); } // 相対番地のテスト { test_rsq("b1", "(0x -1y rel-1sq)", &RelAdr::new(0, -1)); test_rsq("b2", "(1x -1y rel9sq)", &RelAdr::new(1, -1)); test_rsq...
Rust
0
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
Python
1
0].len(), geom_loops_store1[0][1].len()); let compatible0 = match geom_loops_store1[0][0].status() { ShapesOpStatus::And => a == 3, ShapesOpStatus::Or => a == 5, _ => false, }; let compatible1 = match geom_loops_store1[0][1].status() { ShapesOpStatus::And => b == 3, S...
Rust
0
let dest_x = screen_width() / 2.0; let dest_y = self.logo.height() * (dest_x / self.logo.width()); draw_texture_ex( self.logo, screen_width() / 2. - dest_x / 2., 20.0, WHITE, DrawTextureParams { dest_size: Some(vec2(des...
Rust
0
class LocalViagem: def __init__(self, cidade: str, pais: str): if not isinstance(cidade, str): raise TypeError ("Cidade deve ser uma instância da classe str.") if not isinstance(pais, str): raise TypeError ("País deve ser uma instância da classe str.") if not cidad...
Python
1
f8PathBuf; pub type RepoName = Utf8PathBuf; pub type DocumentName = Utf8PathBuf; pub type FieldKey = DataType; pub type FieldValue = DataType; pub struct TuringDBOps(DBName); impl Default for TuringDBOps { fn default() -> Self { Self(Utf8PathBuf::default()) } } impl TuringDBOps { pub fn set_db_na...
Rust
0
16; const TILE_H: usize = 16; const WIDTH_IN_TILES: usize = 128; const HEIGHT_IN_TILES: usize = 96; const PTCL_INITIAL_ALLOC: usize = 1024; const N_CIRCLES: usize = 0; pub fn render_svg(rc: &mut impl RenderContext, filename: &str, scale: f64) { let xml_str = std::fs::read_to_string(filename).unwrap(); let s...
Rust
0
} #[allow(missing_docs)] pub fn set_ignore_count(&self, count: u32) { unsafe { sys::SBBreakpointLocationSetIgnoreCount(self.raw, count) } } #[allow(missing_docs)] pub fn is_resolved(&self) -> bool { unsafe { sys::SBBreakpointLocationIsResolved(self.raw) } } #[allow(missin...
Rust
0
2 + 2 + 4 * COEFFS.len() as u32) .unwrap(); buf.write_u16::<LE>(2).unwrap(); // WAVE_FORMAT_ADPCM buf.write_u16::<LE>(self.channels).unwrap(); buf.write_u32::<LE>(self.sample_rate).unwrap(); buf.write_u32::<LE>(self.avg_bytes_per_sec()).unwrap(); // nAvgBytesPerSec b...
Rust
0
ds.append(tokenized_prompt) # 调用模型生成答案 print(f"Generating answers for task: {task_type} graph: {graph_type}") generations = llm.generate(prompt_token_ids=prompt_token_ids, sampling_params=sampling_params) for i in range(len(task_data)): d = task_data[i].c...
Python
1
# PLY package # Author: David Beazley (dave@dabeaz.com) # https://github.com/dabeaz/ply __version__ = '2022.10.27'
Python
1
import torch, math from bisect import bisect_right class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler): def __init__( self, optimizer, milestones, gamma=0.1, warmup_factor=1.0 / 3, warmup_epochs=5, warmup_method="linear", last_epoch=-1, ...
Python
1
onent of a group element, i.e. secret w such as h = g^^w, where g is group generator, h is a public key. DlogSecretKey(DlogProverInput), } impl SecretKey { /// Generates random DlogProverInput pub fn random_dlog() -> SecretKey { SecretKey::DlogSecretKey(DlogProverInput::random()) } /// Par...
Rust
0
rgs.curve_csv) return if args.plot and not args.curve_csv.exists(): print("[INFO] --plot bez CSV -> trening, zapis i wykres...") model, history = train_model(args.epochs) args.model.parent.mkdir(parents=True, exist_ok=True) model.save(args.model) save_learning_cu...
Python
1
f64::NEG_INFINITY); assert_eq!(rev_xg, 2.); assert_eq!(rev_slope, 1.); assert_eq!(intercept, -2.); } #[test] fn test_ee_reverse_inf_lower_to_lower() { let quad1 = BoundedQuadratic::new(f64::NEG_INFINITY, 0., 0., 1., 1.); let quad2 = BoundedQuadratic::new(2., 4., 0., ...
Rust
0
steal(), RTC: rtc::RTC::steal(), SAI1: sai::SAI1::steal(), SAI2: sai::SAI2::steal(), SAI3: sai::SAI3::steal(), SAI4: sai::SAI4::steal(), SDMMC1: sdmmc::SDMMC1::steal(), SDMMC2: sdmmc::SDMMC2::steal(), SDMMC3: sdmmc::SDMMC3::...
Rust
0
# Compute diffusion using fake RNG # See qmc_algorithms/Diffusion/DMC_Propagator.ipynb # Generate values for test_vmc.cpp and test_vmc_omp.cpp # import numpy as np import math import sys # Box-Muller, copies Utilties/RandomGenerator.h def gaussian_rng_list(n): input_rng = [0.5]*(n+1) # Fake RNG currently output...
Python
1
of errors you might encounter: /// /// **Missing `@weak` or `@strong`**: /// /// ```compile_fail /// # use glib::clone; /// # use std::rc::Rc; /// let v = Rc::new(1); /// /// let closure = clone!(v => move |x| println!("v: {}, x: {}", v, x)); /// # drop(v); /// # closure(2); /// ``` /// /// **Passing `self` as an argu...
Rust
0
import discord from discord.ext import commands from discord import app_commands from dotenv import load_dotenv import os from joblib import load from pythainlp.tokenize import word_tokenize import warnings # ปิดคำเตือนที่ไม่จำเป็น warnings.filterwarnings("ignore", message="The parameter 'token_pattern' will not be us...
Python
1
here, this comes with two advantages: /// /// * Works with already provided fragments, like the network primitives in [`net`][crate::net]. In /// that case you might want to prefer the [`ToFuture`], as it also gives access to the original /// configuration fragment, including any extra configuration for the future...
Rust
0
# print('33',env.mchsEndTimes[0]) # print('reward',reward[0],env.dur_a) # t4 = time.time() # ts.append(t4 - t3) # jobRdyTime_a, mchRdyTime_a = calJobAndMchRdyTimeOfa(a=action,mch_a=mch_a, mchMat=m, durMat=data, mchsStartTimes=mchsStartTime...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.RefundRecordVO import RefundRecordVO class RefundInfoVO(object): def __init__(self): self._refund_list = None @property def refund_list(self): return...
Python
1
import numpy as np from keras.layers.core import Dense, Activation, Dropout from keras.layers import LSTM from keras.models import Sequential, load_model from keras.callbacks import Callback import keras.backend.tensorflow_backend as KTF import tensorflow as tf import pandas as pd import os import keras.callbacks im...
Python
1
uired(true) .short("l") .long("location"), ) .arg( Arg::with_name("timeout") .help("the connection timeout i.e. the time to wait for a response body.") .short("t") .long("timeout") .default_value(...
Rust
0
over all sets of the `PartitionVec<T>`. /// /// The iterator returned yields `SetMut` iterators. /// These `SetMut` iterators yield pairs `(i, &mut value)` where `i` is the index of /// the value and `value` is the value itself. /// /// The sets are returned in order by there first member. ...
Rust
0
_ser[1..33]; let mut key = [0; 32]; pbkdf2::derive(&digest::SHA512, 10000, &salt, common_secret_slice, &mut key); Ok(key) } pub fn decrypt_with_key(&self, key: &[u8; 32]) -> Result<String> { let mut encrypted_message = from_hex(self.encrypted_message.clone()).map_err(|_| ErrorKind::Decryption)?; let n...
Rust
0
_01GPOEFGEJ@?7?$AA@", "`string'"); expect("??_C@_01HGPPGHAI@?$AI?$AA@", "`string'"); expect("??_C@_01PBGHHLMH@?$AH?$AA@", "`string'"); expect("??_C@_01OIHMEKIG@?$AG?$AA@", "`string'"); expect("??_C@_01MDFBBJEF@?$AF?$AA@", "`string'"); expect("??_C@_01NKEKCIAE@?$AE?$AA@", "`string'"); expect("??_...
Rust
0
ications event queue. pub fn repaint() { unsafe { c_api::CloseApp(); } } //////////////////////////////////////////////////////////////////////////////// // Graphic functions pub type Dither = c_api::Dither; pub fn screen_width() -> i32 { unsafe { c_api::ScreenWidth() } } pub fn screen_height() ...
Rust
0
txlist)) # We can always get a proof if we have a -txindex assert_equal(self.nodes[0].verifytxoutproof(self.nodes[1].gettxoutproof([txid_spent])), [txid_spent]) # We can't get a proof if we specify transactions from different blocks assert_raises_rpc_error(-5, "Not all transactions found...
Python
1
SharedJoinHandle`]. #[allow(dead_code)] fn shared_handle(handle: JoinHandle<()>) -> SharedJoinHandle { handle.map_err(Arc::new).boxed().shared() } /// Implementation of the `QuerierHandler` trait (that currently does nothing) #[derive(Debug)] pub struct QuerierHandlerImpl { /// Catalog (for other services) ...
Rust
0
"], "br"); let body = res.into_body().data().await.unwrap().unwrap(); let mut decompressed = Vec::new(); BrotliDecompress(&mut &body[..], &mut decompressed).unwrap(); let decompressed = String::from_utf8(decompressed.to_vec()).unwrap(); assert!(decompressed.starts_with("\"This i...
Rust
0
, Debug, Serialize, Deserialize)] pub struct Point { pub x: i32, pub y: i32, } #[wasm_bindgen] impl Point { #[must_use] #[wasm_bindgen(constructor)] pub fn new(x: i32, y: i32) -> Self { Self { x, y } } #[must_use] pub fn serialize(self) -> JsValue { serde_wasm_bindgen::...
Rust
0
); let wit_4 = Witness::PedersenCommitment(vec![ Fr::rand(&mut rng), Fr::rand(&mut rng), Fr::rand(&mut rng), ]); test_serialization!(Witness<Bls12_381>, wit_4); witnesses.add(wit_4); test_serialization!(Witnesses<Bls12_381>, witnesses); }...
Rust
0
_success()); resp }) .map(|resp| resp.concat2()) .flatten() .map(|body| assert_eq!(&body[..], b"123")) .map_err(|err| panic!(err)); runtime.block_on(future).unwrap(); } #[test] fn it_should_fetch_in_light_mode() { let server = TestServer::run(); let client = Client::new(1).unwrap(); let ...
Rust
0
u16x32, src: u16x32, mask: u32) -> u16x32; #[link_name = "llvm.x86.avx512.mask.psubus.w.256"] fn vpsubusw256(a: u16x16, b: u16x16, src: u16x16, mask: u16) -> u16x16; #[link_name = "llvm.x86.avx512.mask.psubus.w.128"] fn vpsubusw128(a: u16x8, b: u16x8, src: u16x8, mask: u8) -> u16x8; #[link_name = ...
Rust
0
.expect("Config to be well formed TOML"); } use crate::decode::Decoder; use crate::{DecodeError, DecodeResult, Dns, Flags, Opcode, RCode, MAXIMUM_DNS_PACKET_SIZE}; use std::convert::TryFrom; impl<'a, 'b: 'a> Decoder<'a, 'b> { fn flags(&mut self) -> DecodeResult<Flags> { let buffer = self.u8()?; let...
Rust
0
ove(0).unwrap(), 1); assert!(map.data.is_empty()); } #[test] fn test_insert() { let mut map = IdMap::new(); assert!(map.insert(1, 2).is_none()); assert_eq!(map.data, vec![None, Some(2)]); assert!(map.insert(3, 4).is_none()); ...
Rust
0
macro_export] macro_rules! fallible { ($base:expr) => { $base }; ($base:expr, $($b_type:ty :)? | $id:ident $(: $ty:ty)? | $expr:expr $(, $($tail:tt)+)? ) => { Fallible::process$(::<_, $b_type>)?($base, |$id $(: $ty:ty)?| fallible!($expr $(, $($tail)+)?)) }; ($base:expr, $($b_type:ty ...
Rust
0
import posto as pt from dados import * combustiveis = ler_combustives('combustivel.csv') frentistas = ler_frentistas('frentistas.csv') print('***BEM-VINDO AO SOFTWARE DE GESTÃO DO SEU POSTO***') nome_posto = input('Informe o nome do seu posto: ') salario_fixo = float(input('Informe o salário fixo de cada frentista...
Python
1
sage" def test_redirect_stdout(tmp_path): file_path = tmp_path / "stdout.txt" redirect_stdout(b"stdout message", b"", str(file_path)) with open(file_path, "r") as f: content = f.read().strip() assert content == "stdout message" def test_redirect_stderr(tmp_path): file_path = tmp_path / "...
Python
1
at(0.0f32).take(nsps - 1)); if bit == 1 { v.push(1.0f32); } else { v.push(-1.0f32); } word = word >> 1; } } v } #[cfg(test)] mod tests { use super::*; #[test] fn test_cisoid_matched_filter() { const FR...
Rust
0
, GuestAddress(0x100300) ); assert_eq!(vring.queue_next_avail(), 0); vring.set_queue_next_avail(0x20); assert_eq!(vring.queue_next_avail(), 0x20); vring.set_queue_size(0x200); assert_eq!(vring.get_mut().get_queue_mut().size, 0x200); vring.set_queue_...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 流式消息相关的工具函数 """ import json from demo.WXBizJsonMsgCrypt import WXBizJsonMsgCrypt def MakeTextStream(stream_id, content, finish): """生成文本流式消息""" plain = { "msgtype": "stream", "stream": { "id": stream_id, "finish": finis...
Python
1
# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel from ...types.admin_priority_level import AdminPriorityLevel class Team(UncheckedBaseModel): """ Tea...
Python
1
h.join(output_test_image_dir, file)) for file in os.listdir(test_label_dir): shutil.copy(os.path.join(test_label_dir, file), os.path.join(output_test_label_dir, file)) print("Imagens de teste copiadas.") def main(): parser = argparse.ArgumentParser() parser.add_argument("input_fold", type=str, ...
Python
1
fn from(value: $enum_name) -> $field_type { match value { $( $enum_name::$field_name => $field_value, )+ $enum_name::Unknown(unknown) => unknown, } } } }; } <gh_stars>0 use cross...
Rust
0
er, parent_hash: b.header.prev_hash, sha3_uncles: Default::default(), logs_bloom: Some(b.header.log_bloom), transactions_root: b.header.transactions_root, state_root: b.header.state_root, receipts_root: b.header.receip...
Rust
0
import streamlit as st from openai import OpenAI import os from dotenv import load_dotenv load_dotenv() # Get the API key from the environment variable ngc_api_key = os.getenv('NGC_API_KEY') if ngc_api_key is None: raise ValueError("API key not found. Please set the NGC_API_KEY environment variable.") client = ...
Python
1
group_layout: wgpu::BindGroupLayout, pub uniform_bind_group: wgpu::BindGroup, uniforms: Uniforms, uniform_buffer: wgpu::Buffer, } impl Camera { fn calc_direction(yaw: Rad<f32>, pitch: Rad<f32>) -> Vector3<f32> { let direction = Vector3::new(pitch.cos() * yaw.cos(), pitch.sin(), pitch.cos() * ya...
Rust
0
regardless (it should prefer not going // through 'CoerceUnsized'), but I'm keeping it anyway serialize::Serialize::serialize(&self.prg_ram, file)?; self.bank_register_to_update.serialize(file)?; self.bits.serialize(file) } fn deserialize(&mut self, file: &mut io::BufReader<fs::...
Rust
0
ef, clippy::useless_transmute)] use core::any::TypeId; use core::ffi::c_void; use core::mem::{size_of, transmute, MaybeUninit}; fn value<T>() -> T { unimplemented!() } struct Empty; struct Ty<T>(T); struct Ty2<T, U>(T, U); #[repr(C)] struct Ty2C<T, U>(T, U); fn main() { unsafe { let _: () = transmu...
Rust
0
=80 use nix::libc::{c_int, off_t}; use mio::{ Interest, Registry, Token, event::Source, }; use nix::errno::Errno; use nix::sys::aio; use nix::sys::signal::SigevNotify; use std::io; use std::iter::Iterator; use std::os::unix::io::AsRawFd; use std::os::unix::io::RawFd; use std::pin::Pin; pub use nix::sys...
Rust
0
WindowOptions, Scale, ScaleMode, KeyRepeat}; use std::{io::Write, time::{Instant, Duration}}; use std::fs::File; use std::path::Path; use std::io::BufWriter; const WIDTH: usize = 256; const HEIGHT: usize = 240; const MENU_NORMAL: usize = 2; const MENU_SINGLE_FRAME: usize = 3; const MENU_BEGIN_LOG: usize = 5; const ...
Rust
0
# coding:utf-8 import sys from PyQt5.QtCore import QEasingCurve, Qt from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QApplication from qfluentwidgets import SmoothScrollArea, PixmapLabel, ScrollBarHandleDisplayMode class Demo(SmoothScrollArea): def __init__(self): super().__init__() se...
Python
1
import sqlite3 # Импортируем модуль для работы с SQLite class Database(): def __init__(self, db_name): # Инициализация базы данных self.connection = sqlite3.connect(db_name) # Подключаемся к базе данных self.cursor = self.connection.cursor() # Создаем объект курсора для выполнения запрос...
Python
1
# # Copyright 2011-2013 Blender Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
1
import pytest import json from app.commands import read_file, read_text def test_read_file(tmp_path): # Arrage file_path = tmp_path / "sample.txt" file_content = "One one two \none two three" file_path.write_text(file_content) expect_response = json.dumps( {'words':6, 'characters':...
Python
1
_) # ------------------------- # 8) Оценка на тесте # ------------------------- best_model = random_search.best_estimator_ y_pred = best_model.predict(X_test) print("\n--- Test set evaluation ---") print("RMSE", root_mean_squared_error(y_test, y_pred)) print('R^2', r2_score(y_test, y_pred)) # ----------------------...
Python
1
= registers.accumulator as u16; registers.flags = 0x40; if ((n_value & 0x0F) + carry_bit) > (accumulator_value as u8 & 0x0F) { registers.flags |= 0x20; } if sub_value > accumulator_value { registers.flags |= 0x10; registers.accumulator = ((accumulator_value + 0x100) - s...
Rust
0
import re from collections import defaultdict class PasswordStrengthChecker: def __init__(self): self.min_length = 8 self.common_passwords = { 'password', '123456', 'qwerty', 'admin', 'letmein', 'welcome', 'monkey', 'dragon' } def check_strength(self, pa...
Python
1
def print_devisor(n): for i in range(1,n+1): if n%i==0: print(i) n=int(input("rnter the number")) print("diversors are: ") print_devisor(n)
Python
1
{ "∞".to_string() } else { index.to_string() } } /// AckedIndexer allows looking up a commit index for a given ID of a voter /// from a corresponding MajorityConfig. pub trait AckedIndexer { fn acked_index(&self, voter_id: &u64) -> Option<&Index>; } pub(crate) type MapAckIndexer = HashMap...
Rust
0
import torch VAL_MIN_DEPTH = 1e-3 VAL_MAX_DEPTH = 80 def _validation_mask_kitti_zhou(depth_gt): # Select only points that are not too far or too near to be useful dist_mask = (depth_gt > VAL_MIN_DEPTH) & (depth_gt < VAL_MAX_DEPTH) # Mask out points that lie outside the # area of the image that conta...
Python
1
(|py| { let v = vec![7, 3, 2, 5]; let list = PyList::new(py, &v); assert_eq!(7, list[0].extract::<i32>().unwrap()); assert_eq!(3, list[1].extract::<i32>().unwrap()); assert_eq!(2, list[2].extract::<i32>().unwrap()); assert_eq!(5, list[3].extract::<...
Rust
0
name = x ) ] #[doc = "Getter for the `x` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGForeignObjectElement/x)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedLength`, `SvgForei...
Rust
0
# 문자열 str 타입 다루기 # - 문자열에서 일부 문자 또는 문자열 추출 # - 방법 : Indexing 방법 # 문자 1개 1ㅐ에 번호를 붙임(단, 0부터 시작) # - 원소 : '' 또는 "" 사이에 있는 문자 1개를 의미 # - 원소 읽기 : 변수명[번호] # [예시] Merrt Christmas! Happy New Year 2025! msg = "Merrt Christmas! Happy New Year 2025!" # 0 1 2 3 # 012345678901234567890123...
Python
1
m Django-style query URLs into appropriate /// [`Filter`] objects. /// /// Note that the context object provided on construction may be /// stored within the resulting object, and may also be cloned into /// the [`Meta`] for other types. pub struct OperatorSetWithContext<R, A> { _marker: core::marker::PhantomData<R...
Rust
0
{ return (template, rules); } let split: Vec<_> = line.split(" -> ").collect(); if split.len() != 2 { return (template, rules); } let left: Vec<_> = split[0].chars().collect(); if left.len() != 2 { ...
Rust
0
: &Context) -> Result<H> { self.validate()?; let id = self.id.parse::<i64>()?; let db = ctx.db.deref(); let user = ctx.current_user()?; can(db, user.id)?; let now = Utc::now().naive_utc(); let cnt: i64 = forum_tags::dsl::forum_tags .filter(forum_tags::...
Rust
0
p2z32hdpag_, lrghaf24mwf, msolf6c6pri, b_g7g_z78gh: x90r1fzjn8k, via1bq4de1o, w8cshiit1jd: nlpyx6zbc9p, d4wirpnu00z: kc_vl19ak39, v0faz6c6kod): del zr98qq0uyn9 qfapdbrmsjp += od4yat4bc1x z1f5lcjhli3 0j.iidyneh96od: None = fgyzc0l6vlo from xrvh41rkeke import dwyj5rv4ahb, xtafyzbm11k as ajmkvd6trll, j...
Python
1
harset()).rstrip(' ') def unpack_type_string(defaults, context): """Unpack a CHAR(N) fixed length string""" # Trailing spaces are always stripped for CHAR fields bytestr = defaults.read(context.length) if context.charset.name == 'binary': bytestr = bytestr.replace(b"\x00", b"\\0") retu...
Python
1
erraidNoFrameskip-v4': 250.0, 'RoadRunnerNoFrameskip-v4': 217.0, 'RobotankNoFrameskip-v4': 73.0, 'SeaquestNoFrameskip-v4': 315.0, 'SpaceInvadersNoFrameskip-v4': 318.0, 'StarGunnerNoFrameskip-v4': 261.0, 'TimePilotNoFrameskip-v4': 24.0, 'UpNDownNoFrameskip-v4': 246.0, 'VideoPinballNoFrameskip-v4': 1078.0,...
Python
1
# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ Double Machine Learning. The method uses machine learning methods to identify the part of the observed outcome and treatment that is not predictable by the controls X, W (aka residual outcome and residual treatment). Then ...
Python
1
columnspan=2, sticky="nsew") # Datos de prueba para el boton mostrar # Cargar aca los pokemones self.lista_nombre_campeones = [ "Jinx", "Akali", "Ashe", "Vladimir", "Kalista", "Teemo", "Annie", "Zed", "Katarina", "Hecarim" ] self.lista_asesinatos_a_favor...
Python
1
cnr01 = iopaths[speed][key][0] - sub_iopath[1] cnr10 = iopaths[speed][key][1] - sub_iopath[0] cnr11 = iopaths[speed][key][1] - sub_iopath[1] iopaths[speed][key] = ( min(cnr00, cnr01, cnr10, cnr11), max(cnr00, cnr01, cnr10, cnr11), ...
Python
1
ngErrorKind<DB::ErrorType>> { let vert: Vec<_> = points.collect(); let mut polygon = vec![]; for mask in [1, 2, 4].iter().cloned() { let mask_a = if mask == 4 { 1 } else { mask * 2 }; let mask_b = if mask == 1 { 4 } else { mask / 2 }; let a = 0; le...
Rust
0
mmm128); h.insert("VEX_Vphaddd_ymm_ymm_ymmm256", Code::VEX_Vphaddd_ymm_ymm_ymmm256); h.insert("Phaddsw_mm_mmm64", Code::Phaddsw_mm_mmm64); h.insert("Phaddsw_xmm_xmmm128", Code::Phaddsw_xmm_xmmm128); h.insert("VEX_Vphaddsw_xmm_xmm_xmmm128", Code::VEX_Vphaddsw_xmm_xmm_xmmm128); h.insert("VEX_Vphaddsw_ymm_ymm_ym...
Rust
0
Null, /// 64-bit signed integer Integer, /// 64-bit IEEE floating point number Real, /// String Text, /// BLOB Blob, } impl fmt::Display for Type { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Type::Null => write!(f, "Null"), ...
Rust
0
until(&current_task, zx::Time::ZERO).is_ok()); assert!(waiter1.wait_until(&current_task, zx::Time::ZERO).is_err()); assert!(waiter2.wait_until(&current_task, zx::Time::ZERO).is_ok()); queue.notify_mask_count(0x1, usize::MAX); assert!(waiter0.wait_until(&current_task, zx::Time::ZERO).is_...
Rust
0
func(&engine.canvas, x, y, radius, color.into()) }) } /// Draw an ellipse outline with the given center and radii, and in the specified color. pub fn draw_ellipse<P, R, C>(center: P, radii: R, color: C) -> Result<(), String> where P: Into<Point>, R: Into<Point>, C: Into<Color>, { ENGINE.with(|e| { ...
Rust
0
(): # check compatibility of CG coeffs with SH from escnn.group import SO3 from escnn.group.groups.so3group import spherical_harmonic G = SO3(2) def cart_to_sp(point): x, y, z = point.reshape(3) theta = np.arccos(np.clip(z, -1., 1.)) phi = np.arctan2(y, x) ...
Python
1
} else if let Ok(ip) = trustable_resolver_fut.await { let mut v = ip.iter().collect::<Vec<IpAddr>>(); log::debug!("builtin resolver lookup result: {:?} - {:?}", host, v); self.cache_insert( host, CacheEntry { ips: v.clone()...
Rust
0
_text = f"Hint: Invalid at row {row+1}, col {col+1}" else: hint_text = "Hint: everything is well" screen.fill(DARK_GRAY) draw_background() draw_title() draw_grid() draw_buttons() draw_hints_and_status() if selected_cell and not paused: ...
Python
1
__author__ = 'jingyuan' import numpy as np import theano import theano.tensor as T import cPickle #from theano import pp def softmask(x,mask): #y = T.exp(x-x.max(axis=1, keepdims=True)) #y = y * mask #sumx = T.sum(y,axis=1,acc_dtype='float32') #x=y/sumx.dimshuffle(0,'x') #return x x_mask = T.sw...
Python
1
bled. pub subtitle_enable: bool, /// Subtitle track. Minimum value is `1`. pub subtitle: u32, } impl<'a> Default for VlcSource<'a> { fn default() -> Self { Self { loop_: true, shuffle: false, playback_behavior: PlaybackBehavior::StopRestart, playl...
Rust
0
' % ops_executed) print('Total routine calls: %lu' % routine_calls) print('Max. stack usage: %li' % max_stack_use) print('') print('%-35s %-10s %-10s %-10s %-4s' % ('Routine', 'Ops', 'Ops(+Subs)', 'Calls', 'Nest')) for func in ls: func.dump_dumbfrotz_style()...
Python
1
er itself should have the exact /// length of the trace (ie. contain no partial message). /// See also [`MessageFileReader::from_length_prefixed_buffer`]. #[must_use] pub fn from_buffer(buffer: &'buffer [u8]) -> Self { Self::from_reader(Cursor::new(buffer)) } /// Creates a new `MessageF...
Rust
0
sort pub fn sort(values: &mut[u32]) { // Sort for _ in 0..values.len() { for j in 1..values.len() { // if next value is bigger than previous, swap if values[j - 1] > values[j] { let tmp = values[j - 1]; values[j - 1] = values[j]; v...
Rust
0
""" 142. Linked List Cycle II -> Find the cycle node. • Use two pointers, slow and fast (tortoise and hare method). • Move slow by 1 step and fast by 2 steps. • If slow meets fast, a cycle exists; otherwise, there’s no cycle. • Reset slow to head, and move both pointers by 1 step until they meet again. The meet...
Python
1
YCLE: &str = "cycle"; pub const ENV_DELAY: &str = "HULK_SCANNER_DELAY"; pub const ENV_CYCLE: &str = "HULK_SCANNER_CYCLE"; pub const ENV_MAX_WAIT: &str = "HULK_SCANNER_MAX_WAIT"; lazy_static! { pub static ref DEFAULT_KVS: KVS = KVS(vec![ KV { key: DELAY.to_owned(), value: "10".to_ow...
Rust
0
{ let _copied: ImageReference = build_oci( repo, ostree_ref, Path::new(dest.name.as_str()), config, compression, )?; } else { let tempdir = tempfile::tempdir_in("/var/tmp")?; let tempdest = tempdir.path().join("d"); ...
Rust
0
import matplotlib matplotlib.use('svg') import numpy as np from sklearn.metrics import precision_recall_curve from sklearn.metrics import average_precision_score import matplotlib.pyplot as plt plt.clf() filename = ['CNN+ATT', 'Hoffmann', 'MIMLRE', 'Mintz', 'PCNN+ATT'] color = ['red', 'turquoise', 'darkorange', 'corn...
Python
1
#[cfg(target_arch = "x86_64")] #[cfg(test)] fn fill_bytes(&mut self, dest: &mut [u8]) { getrandom(dest); } #[cfg(target_arch = "x86_64")] #[cfg(not(test))] fn fill_bytes(&mut self, _dest: &mut [u8]) {} fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand::Error> {...
Rust
0
)] pub fn SetRflags(val: u64) { unsafe { llvm_asm!("\ push rax popfq " : : "{rax}"(val) : "memory" : "intel", "volatile") }; } pub fn SaveFloatingPoint(addr: u64) { if SUPPORT_XSAVEOPT.load(Ordering::Acquire) { xsaveopt(addr); } else if SUPPORT_XS...
Rust
0
irectory srcTfrecDir = Path(config['srcTfrecDir']) # destination TFRecord destTfrecDir = Path(config['destTfrecDir']) destTfrecDir.mkdir(exist_ok=True) # save run setup with open(destTfrecDir / 'normalization_run.yaml', 'w') as file: yaml.dump(config, file, sort_keys=False) # get ...
Python
1
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
Python
1
ValidationModel, request: Request): return await update_endpoint_validation(endpoint_id, endpoint_validation_data, request) """ Endpoint Request: {} Response: {} """ @endpoint_router.delete('/validation/{endpoint_id}', description='Delete endpoint validation by endpoint ID (alias)', response_model=Respon...
Python
1
let cost = SHA3_COST * hash_arg.len() as u64; let hash_vec = HashValue::from_sha3_256(hash_arg.as_bytes()).to_vec(); let return_values = vec![Value::byte_array(ByteArray::new(hash_vec))]; Ok(NativeResult::ok(cost, return_values)) } <reponame>kenpratt/rusty_torrent use peer_connection::Message; #[deriv...
Rust
0
from playwright.sync_api import Locator, Page, expect from tests.e2e.pages.build_application_page import BuildApplicationPage from tests.e2e.pages.page_base import PageBase class SelectApplicationPage(PageBase): def __init__(self, page: Page, base_url: str = None, metadata=None): super().__init__(page, b...
Python
1
# # Copyright (C) 2019 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