text string | label_name string | labels int64 |
|---|---|---|
"""
* Crea un programa que calcule quien gana más partidas al piedra,
* papel, tijera, lagarto, spock.
* - El resultado puede ser: "Player 1", "Player 2", "Tie" (empate)
* - La función recibe un listado que contiene pares, representando cada jugada.
* - El par puede contener combinaciones de "🗿" (piedra), "📄" (p... | Python | 1 |
fb_size: 0,
},
hartid: hartid as u64,
dtb_addr: device_tree_paddr as u64,
initramfs_addr: 0,
initramfs_size: 0,
cmdline: "LOG=warn:TERM=xterm-256color:console.shell=true:virtcon.disable=true",
};
logging::init(get_log_level(boot_info.cmdline));
me... | Rust | 0 |
8
{
if ch > 64 && ch - 64 <= 17 {
TheDrawFont::OUTLINE_CHAR_SET[outline][(ch - 65) as usize]
} else {
b' '
}
}
pub fn get_font_height(&self) -> u8
{
self.font_data[1]
}
pub fn has_char(&self, char_code: u8) -> bool
{
let char... | Rust | 0 |
params={"dates": datestring, "limit": 1000},
headers=self.headers,
timeout=timeout,
max_retries=max_retries,
priority=priority,
callback=fetch_callback
)
# Track the request
self.background_fetch_requests[season_year] = req... | Python | 1 |
from __future__ import print_function, division, absolute_import
from __future__ import unicode_literals
from fontTools.misc.py23 import *
MVAR_ENTRIES = {
'hasc': ('OS/2', 'sTypoAscender'), # horizontal ascender
'hdsc': ('OS/2', 'sTypoDescender'), # horizontal descender
'hlgp': ('OS/2', 'sTypoLineGap'), # ho... | Python | 1 |
.mean(),
std_dev: linear_result.std_dev(),
float_mean: float_result.clone().mean(),
float_std_dev: float_result.std_dev(),
}
}
fn stack_total<R: Rng + Sized, D: Distribution<f64>>(
stack: &TolStack,
distribution: &D,
rng: &mut R,
) -> (f64, f64) {
stack
... | Rust | 0 |
import csv
while True:
scelta=input("""\nbenvenuto nella tua rubbrica, cosa vuoi fare:
1. aggiungi nuova persona alla rubbrica
2. trova persona nella rubbrica
3. Esci
""")
if scelta == "1":
#creazione dizionario con input
informazioni={}
nome=input("\ninser... | Python | 1 |
#!/usr/bin/env python3
# Copyright © 2020-2024, Meheret Tesfaye Batu <meherett.batu@gmail.com>
# 2024, Eyoel Tadesse <eyoel_tadesse@proton.me>
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit
from hdwallet.hds import ElectrumV2HD
from ... | Python | 1 |
import os
import glob
def create_dir(path):
try:
os.mkdir(path)
print(f"Directory '{path}' created successfully.")
except FileExistsError:
print(f"Directory '{path}' already exists.")
except PermissionError:
print(f"Permission denied: Unable to create '{path}'.")
except ... | Python | 1 |
subdomain_temp.txt", shell=True)
subprocess.run("grep -oE \"Lines: [0-9].*,\" ./"+dir_name+"/tools/FFUF/dirty_subdomain_temp.txt | sort -u > ./"+dir_name+"/tools/FFUF/regex_patterns.txt", shell = True)
###############
f=open("./"+dir_name+"/tools/FFUF/dirty_subdomain_temp.txt",'r')
... | Python | 1 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# * @file Parameter.py
# * @brief Parameter class
# * @author hoshina
# * @date 2024/10/31
# * @details
# *
# ----------------------------------------------------------------------------
import numpy as np
import json... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniQrcodePatternCreateModel(object):
def __init__(self):
self._invoke_type = None
self._pattern_url = None
self._template_id = None
@property
def invok... | Python | 1 |
"""
Unit testing for freedson_adult_1998
@authors Dominic Létourneau
@date 24/04/2018
"""
import unittest
# import libopenimu.algorithms.freedson_adult_1998 as freedson1998
from libopenimu.algorithms.freedson_adult_1998 import CutPoints
class Freedson1998Test(unittest.TestCase):
def setUp(self):
... | Python | 1 |
Q♥ 8♥ 5♥", 348, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♥ K♥ Q♥ 8♥ 4♥", 349, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♥ K♥ Q♥ 8♥ 3♥", 350, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♥ K♥ Q♥ 8♥ 2♥", 351, HandRankName::Flush, HandRankClass::AceHighFlush... | Rust | 0 |
"TYT"
MODEL = "TH9000_144"
BAUD_RATE = 9600
valid_freq = [(136000000, 174000000)]
@classmethod
def match_model(cls, filedata, filename):
return match_orig_model(cls, filedata, filename)
@directory.register
class Th9000440Radio(Th9000220Radio):
"""TYT TH-9000 440"""
VENDOR = "TYT"... | Python | 1 |
lockchain, &address);
assert_ok!(Creditcoin::register_address(
Origin::signed(account_id.clone()),
blockchain,
address
));
RegisteredAddress { account_id, address_id }
}
}
type TestAskOrderId = AskOrderId<u64, H256>;
type TestBidOrderId = BidOrderId<u64, H256>;
type TestOfferId = OfferId<u64, H256>;
ty... | Rust | 0 |
res: `\"Win32_Globalization\"`*"]
pub const U_SHAPE_LETTERS_UNSHAPE: u32 = 16u32;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub const U_SHAPE_PRESERVE_PRESENTATION: u32 = 32768u32;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub const U_SHAPE_PRESERVE_PRESENTATION_MASK: u32 = 32768u32;
#[d... | Rust | 0 |
import asyncio
import concurrent.futures
import time
def blocking_io(n):
# Simulate a blocking I/O operation
time.sleep(1)
return f"Result {n}"
async def run_blocking_io(n, executor):
loop = asyncio.get_running_loop()
result = await loop.run_in_executor(executor, blocking_io, n)
return result
... | Python | 1 |
#自签证书脚本 hezhihong
import sys,os
os.chdir('/www/server/panel/')
sys.path.insert(0,"class/")
sys.path.insert(0,"class_v2/")
import public,json
class CreateSSLMain:
cert_file="/www/server/vhost_virtual/data/cert/vhost.crt"
key_file="/www/server/vhost_virtual/data/cert/vhost.key"
def get_ipaddress(self):
... | Python | 1 |
ashed_label = H::merge(&[
name_hash_bytes,
H::merge_with_int(H::hash(stale_bytes), version),
]);
let message_vec = from_digest::<H>(hashed_label);
let message: &[u8] = message_vec.as_slice();
// VRF proof and hash output
let proof = key.prove(message);
... | Rust | 0 |
from django.core.management.base import BaseCommand
from inscricoes.models import Turma, InscricaoTurma
class Command(BaseCommand):
help = 'Verifica e corrige o contador de vagas para todas as turmas'
def handle(self, *args, **options):
# Busca todas as turmas
turmas = Turma.objects.all()
... | Python | 1 |
None => {self.lc.goals.extend(gs); RState::Ret(LispVal::undef())}
Some(p) => loop {
if let Some(g) = gs.next() {
if let Some(tgt) = g.goal_type() {
stack.push(RStack::Goals {g, gs, es});
break RState::RefineProof {tgt, p}
}
... | Rust | 0 |
Debug)]
#[must_use = "this `Data` may be an `Error` variant, which should be handled"]
pub enum Data {
Success(Vec<u8>),
Error(CallError),
}
// Import from `core` instead of from `std` since we are in no-std mode
use core::{convert::TryFrom, result::Result};
// Import CKB syscalls and structures
// https://ner... | Rust | 0 |
implemented!("BatchResult should only use try_mut_quiet")
// }
// fn try_mut_quiet<E, F>(&mut self, mut func: F)
// where
// E: Into<Self::Error>,
// F: FnMut(Self) -> Result<(), E>,
// {
// // This increments regardless and doesn't get rolled back
// self.count += 1;
// // let backup: B = ... | Rust | 0 |
# Model forward
model_inputs = common_utils.shard(model_inputs.data)
metrics = p_eval_step(optimizer.target, model_inputs)
eval_metrics.append(metrics)
eval_metrics_np = get_metrics(eval_metrics)
eval_metrics_np = jax.tree_map(jnp.sum, eval_metrics_np)
... | Python | 1 |
: bool = true;
#[cfg(any(not(target_os = "linux"), target_env = "musl"))]
pub const HAS_TRIM_ALLOC: bool = false;
/// Ask the memory allocator to return the freed memory to the system.
/// This only has effect when compiled for glibc, this is a no-op on other systems.
///
/// Cubestore produces allocation patterns tha... | Rust | 0 |
:
"""数据样本
:rtype: str
"""
return self._DataSample
@DataSample.setter
def DataSample(self, DataSample):
self._DataSample = DataSample
def _deserialize(self, params):
self._DataSample = params.get("DataSample")
memeber_set = set(params.keys())
... | Python | 1 |
for i, img_pair in enumerate(self.matched_images):
if img_pair['name'] == selected_name:
self.current_index = i
self.update_display()
return
def search_image(self, event=None):
if not self.matched_images:
return
... | Python | 1 |
nk)//columns)
levels = np.abs(chunk[::step])
levels = smooth(levels, window=6)
levels = np.interp(np.clip(levels,0,1), [0,1], [0,center-1]).astype(int)
hue = [0.15,0.3,0.6,0.8][int((play_time*0.2)%4)]
r,g,b = hsv_to_rgb(hue,0.5,0.9)
screen=[]
for row in range(center*2):
line=[]
... | Python | 1 |
pped
self.client_sub.disconnect() # Disconnect the client
# return True
return self.received_data
def process_received_data(self, data):
'''
Process the controls from the PC server.
Controls:
action (discrete integer):
... | Python | 1 |
# Copyright 2022 The Music Spectrogram Diffusion Authors.
# Copyright 2024 The HuggingFace Team. 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... | Python | 1 |
}
impl From<::std::io::Error> for PeerManagerError {
fn from(error: ::std::io::Error) -> Self {
PeerManagerError::IoError(error)
}
}
impl From<oneshot::Canceled> for PeerManagerError {
fn from(_: oneshot::Canceled) -> Self {
PeerManagerError::OneshotSenderDropped
}
}
extern crate reqw... | Rust | 0 |
+ '</td><td>' + mFormat(totals[i[1]][300]) + '</td></tr>\n'
ctnc += totals[i[0]]['total']
ctfc += totals[i[1]]['total']
page += '<tr><td><strong>' + localText.totals + '</strong></td><td><strong>' + mFormat(ctnc) + '</strong></td><td><strong>' + mFormat(ctfc) + '</strong></td><td><strong>' + mFormat(ct45c) + '</... | Python | 1 |
# MGEAR is under the terms of the MIT License
# Copyright (c) 2016 Jeremie Passerin, Miquel Campos
# 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, including without lim... | Python | 1 |
ty() { None } else { Some(party_abreviation.to_string()) };
builder.parties.push(GroupBuilder { name: party_name.to_string(), abbreviation, group_id: group_id.to_string(), ticket_id: None, tickets: vec![] });
}
if position_in_ticket != 0 { // real candidate.
... | Rust | 0 |
import sys
import pygame
from src import Config
class Game:
score = 0
ball_speed_multiplier = 1.2
def __init__(self, wall_width, ball_speed):
self.wall_width = wall_width
pygame.init()
self.ball_speed = ball_speed
self.current_ball_speed = 1.0
self.game_over = Fa... | Python | 1 |
{}", name, elem_name);
println!("{} -> {}", elem_name, page.name());
page.print(tx);
}
}
Page::TYPE_LEAF => {
for (i, elem) in self.leaf_elements().iter().enumerate() {
match elem.node_type {
... | Rust | 0 |
r Router {
type Init = LogInit;
fn create(init: Self::Init) -> Self {
Self { init }
}
}
/// Creates individual Handler Nodes for each client request and assigns client labels to them.
impl CommandHandler for Router {
type Command = grpc::Invocation;
fn handle_command(&mut self, invocation... | Rust | 0 |
velocity(A, F, f);
// // (self.consts.c * (f.2 - f.1) + ((self.consts.dt / 3.0) * F)) / A
// });
// }
fn area(&self, f: (&f64, &f64, &f64)) -> f64 {
return f.0 + f.1 + f.2;
}
fn dev(&self, v: &mut Vessel) {
for i in 0..v.x_dim {
let A_derivative = match i... | Rust | 0 |
"""从蚊香社-prestige抓取数据"""
import os
import re
import sys
import logging
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from web.base import *
from web.exceptions import *
from core.config import cfg
from core.datatype import MovieInfo
logger = logging.getLogger(__name__)
base_url =... | Python | 1 |