text string | label_name string | labels int64 |
|---|---|---|
', '#', '>', '}', ']', '%', '_', '+', //
'Y', 'P', 'O', 'U', '=', 'K', 'D', 'L', 'C', 'W', 'X', //
'I', 'N', 'E', 'A', ':', 'M', 'H', 'T', 'S', 'R', '~', //
'`', '?', '*', ';', '&', 'B', 'F', 'G', 'V', 'J', //
'\0', ' ',
])),
); //
pub static CAPEWELL_LAYOUT: Layout = Layout(
Layer(KeyMap([
'`'... | Rust | 0 |
import frappe
from frappe.model import no_value_fields, table_fields
@frappe.whitelist()
def get_preview_data(doctype, docname):
preview_fields = []
meta = frappe.get_meta(doctype)
if not meta.show_preview_popup:
return
preview_fields = [
field.fieldname
for field in meta.fields
if field.in_preview
and... | Python | 1 |
index {:}", w);
}
//send a contiguous set of blocks
let mut dq = VecDeque::new();
loop {
let k = *consumed % NUM_BLOBS;
if window[k].is_none() {
break;
}
dq.push_back(window[k].clone().unw... | Rust | 0 |
gc @ s d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d d l m Z d d l
m Z d d l m Z d Z d S( s 8.0.134i( t start( t RTDETR( t SAM( t YOLO( t FastSAM( t NAS( t
check_yolo( t downloadt _... | Python | 1 |
ope {
web::scope("/interior_cell_start")
.route("", web::post().to(interior_cell_start))
}
pub fn data() -> web::Data<AppGeometry> {
web::Data::new(AppGeometry::default())
}
const FIRST_PRIME:u32 = 2;
pub fn nth(n: u32) -> u32 {
if n == 0 {
return FIRST_PRIME;
}
let primes = calcul... | Rust | 0 |
_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Table>>(
"source_table",
|m: &Snapshot| { &m.source_table },
|m: &mut Snapshot| { &mut m.source_table },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf... | Rust | 0 |
}
Ok(false)
}
async fn stat(&self, password: &str, upload: u64, download: u64) -> Result<()> {
if self.config_auth.auth(password).await? {
return Ok(self.config_auth.stat(password, upload, download).await?);
}
if let Some(redis) = &self.redis_auth {
if re... | Rust | 0 |
t_long_description(),
'keywords': meta.get_keywords(),
'platform': meta.get_platforms(),
'classifiers': meta.get_classifiers(),
'download_url': meta.get_download_url(),
# PEP 314
'provides': meta.get_provides(),
'requires': meta.get_req... | Python | 1 |
::long::{from_digits_index, is_even};
use euler::algorithm::prime::miller_rabin;
use euler::Solver;
// We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once.
// For example, 2143 is a 4-digit pandigital and is also prime.
// What is the largest n-digit pandigital prime... | Rust | 0 |
# Atividade 07:
# Contagem de Vogais em uma Palavra:
# Crie um programa que solicite uma palavra ao usuário e use um laço for com
# uma condicional para contar quantas vogais (a, e, i, o, u) a palavra contém.
word = 'Patati caiu e o Patata voou!'
for letter in word:
if | Python | 1 |
RYACCESS._serialized_start=1675
_PBTRACESIMPLEMEMORYACCESS._serialized_end=1749
_PBTRACEINSTRUCTIONCOUNT._serialized_start=1751
_PBTRACEINSTRUCTIONCOUNT._serialized_end=1791
_PBTRACESTATESWITCH._serialized_start=1793
_PBTRACESTATESWITCH._serialized_end=1832
_PBTRACECACHESIMPARAMS._serialized_start=1835
_P... | Python | 1 |
"""This example showcase point queries by highlighting the shape under the
mouse pointer.
"""
__version__ = "$Id:$"
__docformat__ = "reStructuredText"
import random
import sys
import pygame
from pygame.locals import *
from pygame.color import *
import pymunk as pm
from pymunk import Vec2d
import pymunk.pygame_util... | Python | 1 |
from typing import List, Dict
from app.repository.vendor_repository import VendorRepository
from app.schemas.vendor_schema import VendorOutput, VendorUpdate
from app.service import vendor_validation, vendor_validation_update
class VendorService:
def __init__(self):
self.vendor_repo = VendorRepository()
... | Python | 1 |
"BUGC-JDIT/CompRecEquivServlet"
)
for partner in self:
country_code, _, vat_number = partner._parse_aeat_vat_info()
if country_code != "ES":
continue
if "company_id" in partner._fields:
public_crt, private_key = (
s... | Python | 1 |
(())
}
}
/// Build the final message to be sent to the servomotor through a serial connection.
pub fn build(self) -> HerkulexMessage {
let mut packet = Packet::default();
packet.pid = self.pid;
packet.cmd = 5;
for data in self.pos {
let d = data.mode.asso... | Rust | 0 |
> {
vs.variables()
.into_iter()
.map(|(k, _)| k)
.collect::<BTreeSet<_>>()
}
#[test]
fn albert_encoder() {
let config = albert_config();
let mut vs = VarStore::new(Device::Cpu);
let root = vs.root_ext(|_| 0);
let embeddings = Alb... | Rust | 0 |
Display::fmt(&self.0, f)
}
}
impl From<u64> for WebhookId {
fn from(id: u64) -> Self {
WebhookId(id)
}
}
#[cfg(test)]
mod tests {
use super::GenericId;
use serde_test::Token;
#[test]
fn test_id_deser() -> Result<(), Box<dyn std::error::Error>> {
serde_test::assert_... | Rust | 0 |
.function_nesting += 1;
self.syntax_nesting += 1;
let parens = self.parens;
self.parens = 0;
let value = if coroutine {Value::Empty} else {Value::Null};
let body = self.statements(i,value)?;
self.function_nesting -= 1;
self.statement = statement;
let p = i.next_token_optional(self)?;
... | Rust | 0 |
ms1scan_list = ms1scan_list_pre + ms1scan_list_cur
ms2scan_list = ms2scan_list_pre + ms2scan_list_cur
ms2premz_list = ms2premz_list_pre + ms2premz_list_cur
ms2premz_array = np.array(ms2premz_list)
pos1=np.nonzero((ms2premz_array>=pre_mz-0.0001) & (ms2premz_array<=pre_m... | Python | 1 |
results = ping_ip(args.target, count=50)
origin = best_result["routes"][0]["hops"][0] if best_result["routes"] and best_result["routes"][0]["hops"] else None
destination = best_result["routes"][-1]["hops"][0] if best_result["routes"] and best_result["routes"][-1]["hops"] else None
all_... | Python | 1 |
return matrix after shifting up
game = transpose(game)
game, done = cover_up(game)
game, done = merge(game, done)
game = cover_up(game)[0]
game = transpose(game)
return game, done
def down(game):
print("down")
# return matrix after shifting down
game = reverse(transpose(game))
g... | Python | 1 |
t a21 = l.col[1].z;
let a02 = l.col[2].x;
let a12 = l.col[2].y;
let a22 = l.col[2].z;
let b00 = r.col[0].x;
let b10 = r.col[0].y;
let b20 = r.col[0].z;
let b01 = r.col[1].x;
let b11 = r.col[1].y;
let b21 = r.col[1].z;
let b02 = r.col[2]... | Rust | 0 |
LocalToWorld, cx: &mut Context) {
for child in &self.ids {
let child_id = id.child(child);
let offset = cx.layout.entry(child_id).or_default().offset;
let xf = xform.pre_translate(offset);
((self.func)(child)).dirty(child_id, xf, cx);
}
}
fn hitte... | Rust | 0 |
2;
pub const MaxCreationsPerBlock: u32 = 2;
pub const ProtocolTokenId: u32 = PROTOCOL_TOKEN_ID;
pub const PaymentTokenId: CurrencyId = PAYMENT_TOKEN_ID;
pub const MinimumDeposit: Balance = 1 * DOLLARS;
pub const ControlPalletId: PalletId = PalletId(*b"gd/cntrl");
pub const Game3FoundationTreasuryAccountId: Accou... | Rust | 0 |
) -> &'a mut W {
self.variant(EXS1B_A::VALUE1)
}
#[doc = "Input ERU_1B1 is selected"]
#[inline(always)]
pub fn value2(self) -> &'a mut W {
self.variant(EXS1B_A::VALUE2)
}
#[doc = "Input ERU_1B2 is selected"]
#[inline(always)]
pub fn value3(self) -> &'a mut W {
sel... | Rust | 0 |
import telebot
import re
import datetime
# Токен бота
bot_token = '***'
# Создание экземпляра бота
bot = telebot.TeleBot(bot_token)
c = chr(24)
# Обработчик сообщений
@bot.message_handler(func=lambda message: True)
def handle_message(message):
request_id_num = message.text
report_text = get_report_from_file... | Python | 1 |
ton(self.frame_part, text='↓', cnf=CNF_BTN, font=FONT2, width=4, height=1, command=self.down_tree_part)
self.btn_up_tree_part.grid(row=19, column=0, cnf=CNF_GRID, sticky='s')
self.btn_confirm_tree_part.grid(row=20, column=0, cnf=CNF_GRID)
self.btn_down_tree_part.grid(row=21, column=0... | Python | 1 |
(_: *mut JNIEnv, _: jobject, data: jpointer, size: jfloat) {
get_safe_data(data).glinit.set_brush_size(size);
}
pub unsafe fn init(env: *mut JNIEnv) {
LUA_EXCEPTION = CaseClass::new(env, cstr!("com/github/wartman4404/gldraw/LuaException"), cstr!("(Ljava/lang/String;)V"));
RUNTIME_EXCEPTION = CaseClass::ne... | Rust | 0 |
"sim-operator-id")]
pub fn connect_sim_operator_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_sim_operator_id_trampoline<F: Fn(&SettingGsm) + 'static>(
this: *mut ffi::NMSettingGsm,
_param_spec: glib::ffi::gpointer,
f: gl... | Rust | 0 |
st_matrix[i][j] for i, j in indices)
logger.info('total cost for %d debates: %f', n_debates, total_cost)
# transfer the indices to the debates
alloc = []
for debate, njudges in zip(debates_sorted, judges_per_room):
aa = AdjudicatorAllocation(debate)
panel_indices... | Python | 1 |
"hs_Rank_Art_Ranking": "排名",
"hs_Rank_Art_Turnover": "成交额",
"hs_Rank_Art_Ranking_Change": "排名变化",
"hs_Rank_Art_Name_Cn": "姓名",
"hs_Rank_Art_Age": "年龄",
"hs_Rank_Art_ArtCategory_Cn": "艺术类别",
},
inplace=True,
... | Python | 1 |
///
/// This is usually constructed for you using the the fluent builder returned by
/// [`update_webhook`](crate::client::Client::update_webhook).
///
/// See [`crate::client::fluent_builders::UpdateWebhook`] for more details about the operation.
#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
pu... | Rust | 0 |
)]
pub struct NotFollowedBy;
/// Succeeds only if `parser` fails.
/// Never consumes any input.
///
/// ```
/// # extern crate combine;
/// # use combine::*;
/// # use combine::parser::char::{alpha_num, string};
/// # fn main() {
/// let result = string("let")
/// .skip(not_followed_by(alpha_num()))
/// .parse(... | Rust | 0 |
marks = 0
whileLoop = True
retry = None
def thanks():
print("Thanks")
while whileLoop == True:
H_O = input("Are you (H)igher or (L)ower? ").lower()
marks = int(input("What is your marks/percentage: "))
if H_O == "h":
if marks >= 90:
if marks <= 100:
print("H1,... | Python | 1 |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the F... | Python | 1 |
#[serde(rename = "base64_standard")]
Base64,
#[serde(rename = "base64_urlsafe")]
Base64UrlSafe,
}
impl Default for Decode {
fn default() -> Self {
Self::PlainText
}
}
impl Decode {
pub fn decode<'a>(&self, input: Cow<'a, str>) -> Result<Cow<'a, str>, DecodeError> {
let res = ma... | Rust | 0 |
ssl_ca_from_pem(vec![]);
/// ```
pub fn ssl_ca_from_pem(mut self, pem_certificate: Vec<u8>) -> Self {
self.ssl_ca = Some(CertificateInput::Inline(pem_certificate));
self
}
}
<reponame>juanmaroni/advent-of-code-2020
mod manage_input;
mod day01;
mod day02;
mod day03;
mod day04;
mod day05;
mod ... | Rust | 0 |
for the extrinsics in this module.
type WeightInfo: WeightInfo;
}
#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)]
pub struct ContractInfo {
pub code_hash: H256,
pub maintainer: EvmAddress,
pub deployed: bool,
}
#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo... | Rust | 0 |
(r)))
}
}
}
/// Element-wise logical xor.
pub fn xor(&self, other: &Array) -> Array {
let this: ArrayExt<bool> = self.type_cast();
let that: ArrayExt<bool> = other.type_cast();
Array::Bool(this.xor(&that))
}
/// Element-wise logical xor, relative to a co... | Rust | 0 |
_ROAD1,
TERRAIN_BUMPY_ROAD2,
TERRAIN_BUMPY_ROAD3,
TERRAIN_MARBLES,
TERRAIN_GRASSY_BERMS,
TERRAIN_GRASS,
TERRAIN_GRAVEL,
TERRAIN_BUMPY_GRAVEL,
TERRAIN_RUMBLE_STRIPS,
TERRAIN_DRAINS,
TERRAIN_TYREWALLS,
TERRAIN_CEMENTWALLS,
TERRAIN_GUARDRAILS,
TERRAIN_SAND,
TERRAIN_BUMPY_SAND,
TERRAIN_DIRT,
... | Rust | 0 |
L=[12,23,45,68,72,95]
deger=int(input("sayı giriniz: "))
if deger in L:
indis=L.index(deger)
print("aranan ",indis,"indis değerinde bulundu")
else:
print("aranan değer bulunamadı!")
| Python | 1 |
_r32_xmmm32
0x1400_3FF0,// VEX_Vcvttss2si_r64_xmmm32
0x1E00_3FFA,// EVEX_Vcvttss2si_r32_xmmm32_sae
0x1400_3FF0,// EVEX_Vcvttss2si_r64_xmmm32_sae
0x1E00_3FFF,// Cvttsd2si_r32_xmmm64
0x1400_3FF0,// Cvttsd2si_r64_xmmm64
0x1E00_3FFA,// VEX_Vcvttsd2si_r32_xmmm64
0x1400_3FF0,// VEX_Vcvttsd2si_r64_xmmm64
0x1E00_3FFA,/... | Rust | 0 |
ame(slot: ArtifactSlotName, n1: StatName, n2: StatName, n3: StatName) -> StatName {
match slot {
ArtifactSlotName::Flower => StatName::HPFixed,
ArtifactSlotName::Feather => StatName::ATKFixed,
ArtifactSlotName::Sand => n1,
ArtifactSlotName::Goblet => n2,
ArtifactSlotName::Hea... | Rust | 0 |
Variable(ref s2)) => s1 == s2,
(&List(ref l1), &List(ref l2)) => l1
.iter()
.zip(l2.iter())
.all(|(v1, v2)| v1.item.unlocated_eq(&v2.item)),
(&Object(ref o1), &Object(ref o2)) => {
o1.len() == o2.len()
&& o1.iter... | Rust | 0 |
lue
let mut rep = 0;
for c in self.collections.values_mut() {
for img in c.backgrounds.iter_mut() {
if img.basename == basename {
rep += 1;
if img.update && rep == 1 {
continue;
}
img.basename = with.basename.clone();
img.source_path = with.source_path.clone();
img.origi... | Rust | 0 |
iver,
ir_remote::*,
messenger::{Messenger, ID_MOVEMENT, ID_OPEN},
rgb::{Colors, RgbLed, Rgb},
timing::{Ticker, TimeExt},
};
use cortex_m_semihosting::hprintln;
static START_MELODY: [(u16, u16); 5] = [(440, 100), (0, 100), (880, 100), (0, 100), (440, 100)];
static OPEN_MELODY: [(u16, u16); 5] = [(440, 100), (0, 10... | Rust | 0 |
Self::new(field.tag, field.value.into())
}
}
impl TryFrom<Field> for Vec<u8> {
type Error = io::Error;
fn try_from(field: Field) -> Result<Self, Self::Error> {
let mut buf = Vec::new();
put_field(&mut buf, &field)?;
Ok(buf)
}
}
fn put_field<B>(buf: &mut B, field: &Field) ->... | Rust | 0 |
nt(class_scope:apollo.planning.NavigationPlanningConfig)
})
_sym_db.RegisterMessage(NavigationPlanningConfig)
TopicConfig = _reflection.GeneratedProtocolMessageType('TopicConfig', (_message.Message,), {
'DESCRIPTOR' : _TOPICCONFIG,
'__module__' : 'modules.planning.proto.planning_config_pb2'
# @@protoc_insertio... | Python | 1 |
fn_b_fn_meta(),
ScalarFuncSig::CastIntAsString => fn_c_fn_meta(),
ScalarFuncSig::CastIntAsDecimal => fn_d_fn_meta(),
_ => unreachable!(),
})
}
let node =
ExprDefBuilder::scalar_func(ScalarFuncSig::CastIntAsDecimal, FieldTypeTp::Lo... | Rust | 0 |
type Target = crate::R<RF_SRAM_CTRL6_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::convert::From<crate::R<RF_SRAM_CTRL6_SPEC>> for R {
fn from(reader: crate::R<RF_SRAM_CTRL6_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `rf_sram_ctrl6` writer"]... | Rust | 0 |
= self.w_network(x).view(batch_size, self.num_transformed, self.num_bins) #has shape (Nbatch, num_transformed, num_bins)
heights = self.h_network(x).view(batch_size, self.num_transformed, self.num_bins) #has shape (Nbatch, num_transformed, num_bins)
derivatives = self.d_network(x).view(batch_s... | Python | 1 |
# -*- coding: utf-8 -*-
import re
import sys
from wheel.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| Python | 1 |
frags >= 2 {
let back_0 = RangeFragIx::new(num_out_frags - 1);
let back_1 = RangeFragIx::new(num_out_frags - 2);
if out_frags[back_0] == *frag && out_frag_metrics[back_0] == *frag_metrics {
new_fix = Some(back_0);
} else if out_frags[back_1] == *frag && out_frag_metrics[back_... | Rust | 0 |
= earcutr::earcut(&vec![], &vec![], 2);
println!("{:?}", indices);
assert!(indices.len() == 0);
}
// file based tests
#[test]
fn test_building() {
assert!(area_test("building", 13, 0e0));
}
#[test]
fn test_dude() {
assert!(area_test("dude", 106, 0e0));
}
#[test]
fn test_water() {
assert!(area_t... | Rust | 0 |
emode,
previous_gamemode,
world_names: LengthPrefixedVec::new(world_names),
dimension_codec: Nbt::new(dimension_codec),
dimension: Nbt::new(dimension),
world_name,
hashed_seed,
max_players,
vi... | Rust | 0 |
> IResult<I::Item, I, S, M> {
let ICont { ok: IOk { mut input, err, state, .. }, drop, .. } = cont;
if cont.ok.cutted {
drop()
}
let (index, pos) = (input.index(), input.pos());
match input.next() {
None => Err(Eb::unexpected_eoi().at::<I>(index, pos, None... | Rust | 0 |
ds[f], message)
except AssertionError:
raise AssertionError(
'Field "' + f + '" should have error, but does not'
)
if ok is not None:
for f in ok:
try:
self.test.assert_field_has_no_er... | Python | 1 |
# author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2021.05.31
#
# title: Python telegram bot create/modify variable from input
# url: https://stackoverflow.com/questions/67766468/python-telegram-bot-create-modify-variable-from-input/67766651#67766651
import os
from telegram.ext import Updater, Command... | Python | 1 |
dio.com/v2/track";
const STATUS_OK: u16 = 200;
const STATUS_PARTIAL_CONTENT: u16 = 206;
const STATUS_REQUEST_TIMEOUT: u16 = 408;
const STATUS_TOO_MANY_REQUESTS: u16 = 429;
const STATUS_APPLICATION_INACTIVE: u16 = 439; // Quota
const STATUS_INTERNAL_SERVER_ERROR: u16 = 500;
const STATUS_SERVICE_UNAVAILABLE: u16 = 503;
... | Rust | 0 |
=[2, 2, 2, 2], replace_stride_with_dilation=_replace_stride_with_dilation)
resnet34 = ResNet(block=BasicBlock, layers=[3, 4, 6, 3], replace_stride_with_dilation=None)
resnet50 = ResNet(block=Bottleneck, layers=[3, 4, 6, 3], replace_stride_with_dilation=_replace_stride_with_dilation)
resnets = {
# "R... | Python | 1 |
"""Plotting routine for use with the mandelbrot set
Ole Nielsen, SUT 2003
"""
def plot(A, kmax=None):
"""Plot matrix A as an RGB image using the Python Imaging Library
and Tkinter
A is converted to an RGB image using PIL and saved to disk
Then it is displayed using PhotoImage
A m... | Python | 1 |
nager.update_state(chat_id=tg_chat.id, state=States.two_fa)
except BadRequest:
text = f"Log in code invalid or expired. Please send a valid login code."
error_count += 1
else:
text = f"S... | Python | 1 |
blob_ref).unwrap();
//! assert_eq!(metadata.filename, "test_file.txt");
//! assert_eq!(metadata.mime_type, "text/plain");
//! ```
mod error;
mod models;
mod utils;
pub use error::{Error, Result};
pub use models::{BlobMetadata, BlobRef, BlobStore};
pub use sha2::Digest as Sha2Digest;
/*
* Copyright (c) 2012-2020 MIRA... | Rust | 0 |
TypeId::of::<Array>() {
panic!("Cannot register indexer for arrays.");
}
#[cfg(not(feature = "no_object"))]
if TypeId::of::<T>() == TypeId::of::<Map>() {
panic!("Cannot register indexer for object maps.");
}
if TypeId::of::<T>() == TypeId::of::<String>()
... | Rust | 0 |
class Solution:
def goodTriplets(self, nums1: List[int], nums2: List[int]) -> int:
n = len(nums1)
# Map each number to its index in nums2 – so we know their "real" position
pos = [0] * n
for i, val in enumerate(nums2):
pos[val] = i
# Convert nums1 into the 'mapp... | Python | 1 |
(10));
}
// Check that our block decoder agrees ptxed on a (likely) empty trace;
#[test]
fn test_block_iterator2() {
let tracer = PerfPTThreadTracer::default();
trace_and_check_blocks(tracer, || test_helpers::work_loop(0));
}
// Check that our block decoder deals with traces in... | Rust | 0 |
# Log every 10 steps
verbose=True,
device=args.device,
autocast_dtype=t.bfloat16, # Speed up training with mixed precision
normalize_activations=args.normalize_activations,
normalization_steps=args.normalization_steps,
use_wandb_multiprocess=not args.no_wandb_multiproc... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. 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 requir... | Python | 1 |
from enum import Enum
class UserType(Enum):
RIDER = "RIDER"
DRIVER = "DRIVER"
class VehicleType(Enum):
AUTO = "AUTO" # (short for Auto-rickshaw in ride apps like Ola/Uber) → a 3-wheeler vehicle, cheaper, for short city trips, usually seats 2–3 passengers.
SEDAN = "SEDAN" # A 4-door passenger car w... | Python | 1 |
"""Support for Rituals Perfume Genie sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from pyrituals import Diffuser
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassi... | Python | 1 |
import tkinter as tk
from app.view.training_model_panel import TrainingModel
from view.dashboard_panel import Dashboard
from view.make_model_panel import MakeModel
from view.make_pipeline_panel import MakePipeline
from view.show_results_panel import ShowResults
class App(tk.Tk):
def __init__(self):
super... | Python | 1 |
import time
import pyautogui
from pyautogui import *
from PIL import Image
import numpy as np
from paddleocr import PaddleOCR, draw_ocr
def get_curtime(time_format="%Y-%m-%d %H:%M:%S"):
curTime = time.localtime()
curTime = time.strftime(time_format, curTime)
return curTime
def ocr_img_text(window, path... | Python | 1 |
ad) # (640, 32, 60)
V = V.view(batch_size * self.num_heads, -1, self.dim_head) # (640, 32, 60)
# Q = Q.view(batch_size, -1, self.num_heads, self.dim_head).transpose(1, 2) # (128, 5, 32, 60)
# K = K.view(batch_size, -1, self.num_heads, self.dim_head).transpose(1, 2) # (128, 5, 32, 60)
... | Python | 1 |
e ExtractorError('No episodes found')
video_urls = re.findall(r'<a[^>]+href="([^"]+)"', drama_list)
return playlist_data, [
self.url_result(self._proto_relative_url(video_url, 'http:'), YoukuIE.ie_key())
for video_url in video_urls]
def _real_extract(self, url):
show... | Python | 1 |
from setuptools import setup, find_packages
INSTALL_REQUIRES = [
'wheel',
'six',
]
TESTS_REQUIRES = [
'absl-py',
"mock; python_version<'3.0'"
]
setup(name='pytruth',
version='1.1.0',
description='Provides unittest assertions in a fluent style.',
long_description=open('README.md').read(),
... | Python | 1 |
for (i, (vid, eid)) in self.vertices_adj_to_face[i1 as usize..i2 as usize]
.iter()
.zip(self.edges_adj_to_face[i1 as usize..i2 as usize].iter())
.enumerate()
{
out_feature.vertices[i] = self.points[*vid as usize];
out_feature.vids[i] = *vid;
... | Rust | 0 |
:Haazinu => "האזינו",
Parsha::Vayelech => "וילך",
Parsha::Bereishis => "בראשית",
Parsha::Noach => "נח",
Parsha::LechLecha => "לך לך",
Parsha::Vayeira => "וירא",
Parsha::ChayeiSara => "חיי שרה",
Parsha::Toldos... | Rust | 0 |
"""Add last_activity_time and launched_at to cluster history.
Revision ID: 009
Revises: 008
Create Date: 2025-09-24
"""
# pylint: disable=invalid-name
import pickle
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sky.utils.db import db_utils
# revision identifiers, used by Al... | Python | 1 |
pring + H_damping, -(H_spring + H_damping)],
# [-(H_spring + H_damping), H_spring + H_damping]]))
H_local = utils.make_PSD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
# add to global matrix
for nI in range(0, 2):
for nJ in range(0, ... | Python | 1 |
testKNNCF():
train = 'ml-100k/u1.base'
test = 'ml-100k/u1.test'
cf = KNN(train, test)
cf.ItemSim()
print("%3s%20s%20s%20s%20s" % ('K', "precision", 'recall', 'coverage', 'popularity'))
# for k in [5,10,20,40,80,160]:
for k in [5, 10, 20, 40]:
recall, precision = cf.recallAndPrecisio... | Python | 1 |
l.width - 1:
assert actual.getpixel((expected_focus[2] + 1, expected_focus[1])) == 0
# Assert the bottom-right pixel.
assert actual.getpixel((expected_focus[2], expected_focus[3])) == 1
# Assert the pixel right of the bottom-right pixel.
if expected_focus[2] < actual.width -... | Python | 1 |
import pytest
from spacy.lang.tl.lex_attrs import like_num
# https://github.com/explosion/spaCy/blob/master/spacy/tests/lang/en/test_text.py
def test_tl_tokenizer_handles_long_text(tl_tokenizer):
# Excerpt: "Sapagkat ang Pilosopiya ay Ginagawa" by Padre Roque Ferriols
text = """
Tingin tayo nang tingin.... | Python | 1 |
const MASK: bool = true;
const OFFSET: u8 = 24;
((self.bits >> OFFSET) & MASK as u32) != 0
};
SETENA24R { bits }
}
#[doc = "Bit 23 - 23:23\\] Writing 0 to this bit has no effect, writing 1 to this bit enables the interrupt number 23 (See EVENT:CPUIRQSEL23.EV f... | Rust | 0 |
import numpy as np
import pandas as pd
import yfinance as yf
from hmmlearn.hmm import GaussianHMM
import matplotlib.pyplot as plt
# Télécharge les données de Bitcoin (BTC-USD) depuis Yahoo Finance pour la période de 2022 à 2024
start_date = "2022-01-01" # Date de début
end_date = "2024-12-31" # Date de fin
btc_dat... | Python | 1 |
#[derive(Copy, Clone, Default, Debug , Hash,
PartialEq, Eq , PartialOrd, Ord)]
struct Foo {
data: i32 ,
}
//
let v1 = Foo {data: 0} ;
let v2 = v1 ;
println!("{:?}", v2) ;
}
fn trait_alias(){
// pub trait Service {
// type Request;
// typ... | Rust | 0 |
MergeRequests> {
let query = self.build_query();
debug!("query: {:?}", query);
self.gl.get(&query, page, per_page).chain_err(|| format!("cannot get query {}", query))
}
}
#[allow(dead_code)]
impl<'a> MergeRequestsLister<'a> {
pub fn new(gl: &'a ::GitLab, id: i64) -> MergeRequestsListe... | Rust | 0 |
Event::LoopDestroyed => control_flow = ControlFlow::ExitWithCode(1),
_ => callback(event, window_target, &mut control_flow),
},
Err(_) => {
callback(Event::MainEventsCleared, window_target, &mut control_flow);
if dr... | Rust | 0 |
#!/usr/bin/env python3
'''
t1_retry.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
if __name__ == '__main__':
import sys
import pytest
sys.exit(pytest.main([__file__] + sys.argv[1:]))
import logging
... | Python | 1 |
(ops::eq(
op.eval_once(invop.eval_once(a.clone(), b.clone()), b)
.as_ref(),
a.as_ref(),
));
}
/// Asserts that the binary operation `invop` is the inverse of the binary operation `op`.
///
/// It must hold:
/// - `invop` is the left inverse of `op` ([`left_inverse`])
/// - `invop` is th... | Rust | 0 |
})?;
close(mount_fd)?;
}
if cf.contains(CloneFlags::CLONE_NEWNS) {
mounts::pivot_rootfs(&*rootfs)
.chain_err(|| "failed to pivot rootfs")?;
// only set sysctls in newns
for (key, value) in &linux.sysctl {
set_sysctl(key, value)?;
}
// NO... | Rust | 0 |
a type `T` is
// `MyMarker` if it is either `Debug` or `Display`.
#![feature(marker_trait_attr)]
use std::fmt::{Debug, Display};
#[marker] trait MyMarker {}
impl<T: Debug> MyMarker for T {}
impl<T: Display> MyMarker for T {}
fn foo<T: MyMarker>(t: T) -> T {
t
}
fn main() {
// Debug && Display:
assert... | Rust | 0 |
import numpy as np
def verify_stimulus_code_order(stimulus_code, target_chars):
"""
Verify if the 12-flash sequence is consistent across all repetitions.
Supports both III2a [char, 1, time] and II2b [1, time] format.
"""
stim_code = stimulus_code
if stim_code.ndim == 2 and stim_code.shape[0] =... | Python | 1 |
ignore_ascii_case("any") {
get_array3(
Expr_::Int(unary.into()),
Expr_::Int("1".into()),
Expr_::Null,
)
} else if name.eq_ignore_ascii_case("pcdata") {
get_array3(
Expr_::Int(unary... | Rust | 0 |
;
// }
// }
for byte in &self.bytes {
write!(f, "{:X}", byte)?;
}
Ok(())
}
}
use crate::common::*;
use std::{thread::sleep, time::Duration};
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
pub enum BlockInput {
Block,
DontBlock,
}
#[derive... | Rust | 0 |
"<" => Op::LessThan,
"<=" => Op::LessThanEquals,
"==" => Op::EqualTo,
"!=" => Op::NotEqual,
"&" => Op::BitwiseAnd,
"|" => Op::BitwiseOr,
"^" => Op::BitwiseXor,
"!" => Op::Bang,
_ => unreachable!(),
}
... | Rust | 0 |
persistence = PicklePersistence(filepath="arbitrarycallbackdatabot")
application = (
Application.builder()
.token(TOKEN_TELEGRAM)
.persistence(persistence)
.arbitrary_callback_data(True)
.build()
)
# Add your handlers
application.add_handler(CommandHandler("start... | Python | 1 |
import json
import pytest
from conductor.client.http.models.rerun_workflow_request import RerunWorkflowRequestAdapter
from tests.serdesertest.util.serdeser_json_resolver_utility import JsonTemplateResolver
@pytest.fixture
def request_json():
return json.loads(JsonTemplateResolver.get_json_string("RerunWorkflowR... | Python | 1 |
import os
from typing import Optional
from .reader_image_folder import ReaderImageFolder
from .reader_image_in_tar import ReaderImageInTar
def create_reader(
name: str,
root: Optional[str] = None,
split: str = 'train',
**kwargs,
):
kwargs = {k: v for k, v in kwargs.items() if v is... | Python | 1 |
#!/usr/bin/env python3
# A simple script that connects to a server and displays block headers
import time
import asyncio
from electrum.network import Network
from electrum.util import print_msg, json_encode, create_and_start_event_loop, log_exceptions
from electrum.simple_config import SimpleConfig
config = SimpleC... | Python | 1 |
t_pre:\n {dy_jit_pre}\n, st_pre: \n{st_pre}.',
)
predictor_pre = self.predict_analysis_inference(image)
flat_st_pre = st_pre.flatten()
flat_predictor_pre = np.array(predictor_pre).flatten()
for i in range(len(flat_predictor_pre)):
# modify precision to 1e-6, avoid un... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.