text string | label_name string | labels int64 |
|---|---|---|
def _n2p(w, t=True):
if w.ndim == 4 and w.shape[0] == w.shape[1] == w.shape[2] == 1:
w = w.flatten()
if t:
if w.ndim == 4:
w = w.transpose([3, 2, 0, 1])
elif w.ndim == 3:
w = w.transpose([2, 0, 1])
elif w.ndim == 2:
w = w.transpose([1, 0])
... | Python | 1 |
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.59 2017/01/04 12:31:01 mikeb Exp $ */
+/* $OpenBSD: parse.y,v 1.60 2017/01/05 12:42:18 krw Exp $ */
__EOL__
/*
* Copyright (c) 2010-2013 <NAME> <<EMAIL>>
@@ -1513,9 +1513,10 @@ symset(const char *nam, const char *val, int persist)
{
struct sym *sym;
__EOL__
- for (sym ... | Rust | 0 |
from(x: protocol::PrimaryKeySchema) -> Self {
let mut res = PkeyColumnSchema{
name: x.name.into(),
type_: PkeyValueType::Blob,
};
match x.type_pb {
protocol::PrimaryKeyType::INTEGER => {
let mut opts = PkeyIntTypeOption{
au... | Rust | 0 |
ing";
pub const TXT_MP_PANEL: &str = "Microperforated Panel";
pub const TXT_Y_AXIS_TITLE: &str = "Absorption";
pub const TXT_X_AXIS_TITLE: &str = "Frequency (Hz)";
pub const RGB_BLACK: &str = "rgb(0, 0, 0)";
pub const RGB_PINK: &str = "rgb(234, 51, 247)";
pub const RGB_LIGHT_PINK: &str = "rgb(246, 195, 203)";
pub co... | Rust | 0 |
Scope)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuErrorFilter`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwas... | Rust | 0 |
return AnimState::AirDownDuckRight;
}
AnimState::AirDownRight
}
}
return if self.jump_state == JumpState::Up {
if self.is_crouched() {
return AnimState::AirUp... | Rust | 0 |
"Foo<UUID>",
"Foo <UUID>",
"Foo< UUID>",
"Foo<UUID >",
"Foo<UUID,>",
];
for content in contents.iter() {
assert_parse(
parse_type(Span::new(content)),
Type::Ref(TypeRef {
abs: false,
ns: vec![],
name:... | Rust | 0 |
}
// let (m, statements) = many1(statement)(inline)?;
if statements.len() == 0 {
rest = r;
} else {
// strip leading whitespace & comments
let (last, _) = many0(alt((is_a(" \t\r\n"), line_comment, c_style_comment)))(
*statements.last().... | Rust | 0 |
igned_start.offset(size), gap_end);
}
if cfg!(target_family = "unix") {
Reservation {
start: aligned_start,
size,
unaligned_start: aligned_start,
unaligned_size: size,
}
} else if cfg!(target_family = "windows") {
Reservation {
... | Rust | 0 |
or>();
}
#[cfg(feature = "serde")]
#[test]
fn test_deserialize() {
fn assert_deserialize<'de, T: serde::Deserialize<'de>>() {}
assert_deserialize::<Error>();
}
}
<filename>rhdfs/src/dt/write_streamer.rs<gh_stars>10-100
use *;
use bytes::*;
use super::{
packet::BlockDataPacket,
... | Rust | 0 |
cense, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may not use this file except in accordance with one or both of these
// licenses.
fn main() -> Result<(), Box<dyn std::error::Error>> {
... | Rust | 0 |
ames = {
"consumable": "消費アイテム",
"weapon": "武器",
"armor": "防具",
"accessory": "アクセサリー",
"key": "重要アイテム",
"misc": "その他"
}
return type_names.get(item_type, item_type)
def _update_action_buttons(self) -> None:
"""アクションボ... | Python | 1 |
# 第二层可分离卷积和Batch Normalization
block2 = SeparableConv2D(F2, (1, 256), use_bias=False, padding='same')(block1)
block2 = BatchNormalization()(block2)
block2 = Activation('elu')(block2)
block2 = AveragePooling2D((1, 8))(block2)
block2 = dropoutType(dropoutRate)(block2)
# 新增Dropout层
... | Python | 1 |
", 0x0765_635D, 0x572A_3B1B),
(r"textures\tx_ci_d_03.dds", 0x0765_635D, 0x572A_3F1B),
(r"textures\tx_ivy_02.dds", 0x0765_635D, 0x6DBE_8A3A),
(r"textures\tx_ivy_01.dds", 0x0765_635D, 0x6DBE_BA3A),
(r"textures\tx_default.dds", 0x0765_635D, 0x6E63_797B),
(r"textures\tx_rug_04.dds", 0x0765_635D, 0x... | Rust | 0 |
# src/presentation/api/schemas.py
"""Schemas para validação e serialização dos dados da API."""
from pydantic import BaseModel
class DeviceBase(BaseModel):
"""Dados básicos de um dispositivo."""
name: str
status: str
ip_address: str
class DeviceCreate(DeviceBase):
"""Dados necessários para cri... | Python | 1 |
),
..Default::default()
}))?;
Ok(())
}
#[test]
fn create_order_limit_buy() -> Fallible<()> {
let _ = dotenv::dotenv();
let _ = env_logger::try_init();
let mut rt = Runtime::new()?;
let bm = BitMEX::with_credential(&var("BITMEX_KEY")?, &var("BITMEX_SECRET")?);
let resp = rt.block_on... | Rust | 0 |
"""
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have security system connected and it will automatically co... | Python | 1 |
= [RResList]
# send to the RNC in connection-less signaling
ret = self.start_ranap_proc(RANAPResetResourceCN, **IEs)
if not ret:
self._log('ERR', 'reset: error')
return True if ret else False
def page(self, **IEs):
"""start a RANAPPaging toward the RNC
... | Python | 1 |
# Generated by Django 5.2.4 on 2025-07-05 09:38
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('telegram_users', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | Python | 1 |
test]
async fn test_ubuntu_ami_sql_post() -> Result<()> {
let table = helpers::get_ubuntu_ami_table();
let (app, address) = helpers::test_api_app(vec![table]).await;
tokio::spawn(app.run_until_stopped());
let response = helpers::http_post(
&format!("{}/api/sql", address),
"SELECT ami_id... | Rust | 0 |
# Copyright 2017 The TensorFlow Authors. 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 required by applica... | Python | 1 |
+ h3.modpow(&two, &m)
+ h4.modpow(&two, &m)
+ h5.modpow(&two, &m));
b %= &m;
if b < BigInt::default() {
b += &m;
}
let c = g6.clone();
let c2 = c.modpow(&two, &m);
let mut d = -(&g1 * &h1 +... | Rust | 0 |
voxels_ref(1, space_ref.clone()).build();
let mut sink = Sink::new();
block.listen(sink.listener()).unwrap();
assert_eq!(None, sink.next());
// Now mutate the space and we should see a notification.
space_ref.borrow_mut().set((0, 0, 0), &block_0).unwrap();
assert!(sink.next().is_some());
/... | Rust | 0 |
+ 9000i32
+ 1i32
+ 1i32
+ 19i32
+ 256i32
+ 256i32
+ 13i32
+ 256i32
+ 4i32
+ 256i32
+ 1i32
+ 3i32 * 256i32
+ (0x10ffffi32 + 1i32)
+ (0x10ffffi32 + 1i32)
... | Rust | 0 |
# -*- coding: utf-8 -*-
# get_resolve_map.py
# 2015-7-7
# github: https://github.com/michael92ht
#__author__ = 'huangtao'
#求为旋转不变模式的36种特征值从小到大进行序列化编号得到的字典
import string
#对一个二进制表示旋转一周取最小值
def get_min_for_revolve(arr,values):
h=[]
circle=arr
circle.extend(arr)
for i in range(0,8):
... | Python | 1 |
app_data:
raise HTTPException(status_code=404, detail='App not found')
app = App(**app_data)
# Check if user has app installed
user_enabled = set(get_enabled_apps(uid))
if app_id not in user_enabled:
raise HTTPException(status_code=403, detail='User does not have this app installed')
... | Python | 1 |
class Solution:
def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:
return sum(abs(seat - student) for seat, student in zip(sorted(seats), sorted(students)))
| Python | 1 |
# =================================================================================================
# This code is part of PyLith, developed through the Computational Infrastructure
# for Geodynamics (https://github.com/geodynamics/pylith).
#
# Copyright (c) 2010-2025, University of California, Davis and the PyLith Dev... | Python | 1 |
import os
from airflow import DAG
from airflow.providers.apache.spark.operators.spark_submit import SparkSubmitOperator
from airflow.utils.dates import days_ago
default_args = {
'owner': 'loader',
'start_date': days_ago(1),
'retries': 1
}
dag = DAG(
dag_id="Load_Kafka__order_events",
default_args... | Python | 1 |
'https://twitter.com/pizzamamagenova',
'whatsapp': '+39 010 123 4567'
},
'statistiche': {
'pizze_consegnate': '50000+',
'clienti_attivi': '15000+',
'anni_esperienza': 5,
'zone_servite': 5
},
... | Python | 1 |
e::fmt::Formatter) -> ::core::fmt::Result {
try!(write!(f, "[0x{:08x}", self.0));
if self.clr_t_en(0) != 0 { try!(write!(f, " clr_t_en[0]"))}
if self.clr_t_en(1) != 0 { try!(write!(f, " clr_t_en[1]"))}
if self.clr_t_en(2) != 0 { try!(write!(f, " clr_t_en[2]"))}
if self.clr_t_en(3... | Rust | 0 |
"""
小批量梯度下降实现散点分类
"""
import utils.opt_utils as opt
import numpy as np
import matplotlib.pyplot as plt
train_X, train_Y = opt.load_dataset(is_plot=True)
print("训练集维度:", train_X.shape)
iterations = 1000
learning_rate = 0.001
def model():
seed = 10
layer_dims = [train_X.shape[0], 20, 5, 1]
parameters = op... | Python | 1 |
b"z".repeat(BLOB_CHUNK_SIZE),
b"z".repeat(BLOB_CHUNK_SIZE / 2),
];
assert_eq!(chunks, expected_chunks);
}
}
<filename>fs/opts/aliasopts/src/aliasopts.rs
// aliasopts.rs
// Copyright (c) 2019 <NAME>
use std::collections::HashMap;
use std::env;
#[derive(Debug, PartialEq)]
pub ... | Rust | 0 |
pt)
if not audio_file:
sm.state.update_task(task_id, state=const.TASK_STATE_FAILED)
return
sm.state.update_task(task_id, state=const.TASK_STATE_PROCESSING, progress=30)
if stop_at == "audio":
sm.state.update_task(
task_id,
state=const.TASK_STATE_COMPLETE,
... | Python | 1 |
ata_to_rfi(hue_bin_data_vf,
cri_type = cri_type,
scale_factor = scale_factor,
scale_fcn = scale_fcn)
# Store in dict:
_data_vf.update({'Rfi' : Rfi_vf, 'DEi' : ... | Python | 1 |
when `B` is
// missing, is `A WS WS C`. Even worse, `A? B` ends up as
// `A? WS B`, which has an incorrect leading whitespace.
fn fold_concat(
&mut self,
left: RuleWithNamedFields<Pat>,
right: RuleWithNamedFields<Pat>,
) ->... | Rust | 0 |
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub const GLU_TESS_BEGIN_DATA: u32 = 100106u32;
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub const GLU_TESS_BOUNDARY_ONLY: u32 = 100141u32;
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub const GLU_TESS_COMBINE: u32 = 100105... | Rust | 0 |
from rest_framework import exceptions
from rest_framework.permissions import AllowAny
from rest_framework.renderers import CoreJSONRenderer
from rest_framework.response import Response
from rest_framework.schemas import SchemaGenerator
from rest_framework.views import APIView
from . import renderers
def get_swagger_... | Python | 1 |
w resources to existing ones. Defaults to True.
Example:
>>> bundle = create_bundle()
>>> # Append to existing resources (default behavior)
>>> set_resources(bundle, [condition1, condition2], "Condition")
>>> set_resources(bundle, [medication1], "MedicationStatement")
>>>
... | Python | 1 |
ens input batch
emb_tok_idx = create_padded_batch(emb_tok_idx, emb_len, dico.pad_index)
dec_tok_idx = create_padded_batch(dec_tok_idx, dec_len, dico.pad_index)
enc_typ_idx = create_padded_batch(enc_typ_idx, enc_len, TYPE_PAD_IDX)
assert (dec_tok_idx == dico.emb_index).sum() == len(dec_ptr_pos) == len(de... | Python | 1 |
.group("size") == "<DIR>"
raw_info = {
"basic": {
"name": match.group("name"),
"is_dir": is_dir,
},
"details": {
"type": int(ResourceType.directory if is_dir else ResourceType.file),
},
"ftp": {"ls": line},
}
if not is_dir:
... | Python | 1 |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import TwistStamped
from nav_msgs.msg import Odometry
from std_msgs.msg import Bool
import tf_conversions
import math
import numpy as np
import matplotlib.pyplot as plt
MAX_V = 0.4
MAX_OMEGA = 2.439
def wrapToPi(x):
return ((x + math.pi) % (2*math.pi)) - m... | Python | 1 |
'''
This script doesn't learn any useful policies.
It's an example of how to interface with stable baselines.
'''
import argparse
from autolab_core import YamlConfig
from isaacgym_utils.rl.stable_baselines import GymFrankaBlockVecEnvStableBaselines
from isaacgym_utils.draw import draw_transforms
from stable_baselines... | Python | 1 |
e, $ctx);
return;
}
}
}};
}
use std::convert::TryFrom;
use nom::combinator::map_res;
use nom::number::complete::le_u8;
use crate::ParseResult;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u8)]
pub enum Formula {
Formula1Modern = 0,
Formula1Classic = 1,
Formu... | Rust | 0 |
t '%s[%s!%s]%s ERROR%s: %sanvima%s:%s NOT found%s' % (Y, R, Y, R, Y, G, Y, G, N)
sys.exit()
if opsi.strip() in ('02 2').split():
try:
import winvima
except ImportError:
print '%s[%s!%s]%s ERROR%s: %swinvima%s:%s NOT found%s' % (Y, R, Y, R, Y, G, Y, G, N)
sys.exit()
if opsi.stri... | Python | 1 |
#
# MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# 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 limitation the rights
#... | Python | 1 |
"""This script is the data preparation script for Deep3DFaceRecon_pytorch
"""
import os
import numpy as np
import argparse
from util.detect_lm68 import detect_68p,load_lm_graph
from util.skin_mask import get_skin_mask
from util.generate_list import check_list, write_list
import warnings
warnings.filterwarnings("ignor... | Python | 1 |
ws_edges = {'1-3', '9-6', '2-4', '7-10', '10-8', '2-3', '3-4', '3-5', '9-10', '8-10', '0-1', '7-8', '4-6', '11-13', '10-12', '6-7', '12-13', '8-9', '13-6', '5-13', '5-7', '1-2', '12-5', '4-5', '13-5', '0-2', '11-12', '14-1', '14-0'}
opt_edges = {'13-14', '0-7', '6-13', '2-3', '3-4', '3-11', '7-14', '9-10', '2-9', '0-1... | Python | 1 |
, 0x62, 0x59, 0x44, 0x36, 0x38, 0x79, 0x41, 0x4e,
0x6f, 0x64, 0x6a, 0x38, 0x78, 0x71, 0x6d, 0x55, 0x73, 0x33, 0x33, 0x4e, 0x76, 0x4e,
0x4d, 0x62, 0x2b, 0x32, 0x6f, 0x4e, 0x49, 0x67, 0x4c, 0x71, 0x54, 0x34, 0x65, 0x31,
0x46, 0x64, 0x4d, 0x6d, 0x72, 0x4f, 0x54, 0x31, 0x41, 0x53, 0x50, ... | Rust | 0 |
from havoc import Demon, RegisterCommand, RegisterModule
from os.path import exists
def psexec( demonID, *param ):
TaskID : str = None
demon : Demon = None
packer : Packer = Packer()
Host : str = ""
SvcName : str = ""
SvcPath : str = ""
SvcBinary : bytes = b''
demo... | Python | 1 |
cpu.task = None;
}
schedule(hartid);
} else {
//should drop the lock before sleep
drop(cpu);
//Allow cpu enter interrupt when goto sleep, if there's soft int, handler should ignore it. Then after go back from handler,
... | Rust | 0 |
# MCP Toolbox for Databases カスタムtools.yaml本番設定
# Google Trends BigQuery専用ツール
# 自動生成: 2025-09-25 02:53:27
MCP_CONFIG = {
"server_url": "https://mcp-trends-custom-babj3ulyaa-uc.a.run.app",
"project_id": "data-agent-bq",
"region": "us-central1",
"service_name": "mcp-trends-custom",
"service_account": ... | Python | 1 |
role = discord.utils.get(self.roles, name=role_name)
member = self.guild.get_member(interaction.user.id)
if role and member:
try:
await member.add_roles(role)
await interaction.followup.send(f"You have been assigned the {role_name} role.", ephemeral=T... | Python | 1 |
if (droneTrail.length > 1) {{
trailLayer = L.polyline(droneTrail, {{color: 'yellow'}}).addTo(droneMap);
}}
setTimeout(function() {{
if (droneTrail.length > 1) {{
droneTrail.shift();
... | Python | 1 |
(::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protob... | Rust | 0 |
# type: ignore
string1="this is a string"#example of a string declaration
#for the line to be printed in new line
string2="this string is in first line\nthis string is in new line"
print(string2)
#for a tab space btween
string3="before gap\tafter gap"
print(string3)
#conacatenation of strings
str1="vardhan"
str2="vel... | Python | 1 |
tx_belt_common04.dds", 0x5053_2B0B, 0x0723_9916),
(r"icons\c\tx_belt_common01.dds", 0x5053_2B0B, 0x0723_9946),
(r"icons\c\tx_belt_common03.dds", 0x5053_2B0B, 0x0723_9966),
(r"icons\c\tx_belt_common02.dds", 0x5053_2B0B, 0x0723_9976),
(r"icons\l\tx_buglamp_01.dds", 0x505C_476E, 0x717D_2B38),
(r"i... | Rust | 0 |
f.bits {
false => FAULT3EN_A::FAULT3EN_0,
true => FAULT3EN_A::FAULT3EN_1,
}
}
#[doc = "Checks if the value of the field is `FAULT3EN_0`"]
#[inline(always)]
pub fn is_fault3en_0(&self) -> bool {
**self == FAULT3EN_A::FAULT3EN_0
}
#[doc = "Checks if the valu... | Rust | 0 |
ибка", "Укажите корректную папку.")
# return
# if not search_text:
# messagebox.showerror("Ошибка", "Введите текст для поиска.")
# return
# #### 📜 Початок логування:
# self.log_text.insert(tk.END, f"🔍 Поиск текста: '{search_text}' в архивах папки: {folder}\n")
# ... | Python | 1 |
num_columns]
for i in range(num_columns)
])
table_data = [headers]
table_data += [result for result in results_2d]
table = AsciiTable(table_data)
logger.info('\n' + table.table)
i... | Python | 1 |
2_1のチェックリストのデータフレームを保存(ファイル名は「書類02_1チェックリスト_受付{latest_reception_data_date_str}_作成{YYYYMMDDHHMMSS}.xlsx」)
logging.info("書類02_1のチェックリストのデータフレームを保存します")
now_jst = get_jst_now()
document02_1_checklist_file_name = f'書類02_1チェックリスト_受付{latest_reception_data_date_str}_作成{now_jst.strftime("%Y%m%d%H%M%S")}.xlsx'
d... | Python | 1 |
import pygame
import sys
# Initialize Pygame
pygame.init()
# Set up some constants
WIDTH, HEIGHT = 800, 600
BALL_RADIUS = 20
PADDLE_WIDTH, PADDLE_HEIGHT = 100, 20
FPS = 60
# Set up some colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
# Set up the display
screen = pygame.display.set_mode((WIDTH, HEIGHT))
# Set up ... | Python | 1 |
{
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
deserializer.deserialize_option(LazyCellVisitor(PhantomData))
}
}
struct AtomicLazyCellVisitor<T>(PhantomData<*const T>);
impl<'de, T: Deserialize<'de>> Visitor<'de> for AtomicLazyCellVisitor<T> {
type Value = Atom... | Rust | 0 |
0x68, 0x00, 0x80, 0x9c, 0x97, 0x00, 0x00])
def splitToLines (text: str) -> Iterable[str]:
return re.split(r'\r\n|[\r\n]', text)
def txt2odc (text: str) -> bytes:
# text = text.replace('\n', chr(0x0d))
text = chr(0x0d).join(splitToLines(text))
txt = text.encode('ascii')
l = len(txt)
return hdr0 + Int(l + 873)... | Python | 1 |
class Pajaro:
#Atributos de la clase
alas = True
'Metodos de instancia'
#Este es un contructor
#Atributos de un objeto
def __init__(self, color, especie):
self.color = color
self.especie = especie
def piar(self):
print('pio, mi color es {}'.format(self.color))
... | Python | 1 |
value, VARIANTS,
)),
}
}
fn visit_bytes<E>(
self,
value: &[u8],
) -> serde::export::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
b"NotFound" => serde::expo... | Rust | 0 |
eur::{Acteur, Actor, ActorAssistant, Receive};
use async_trait::async_trait;
#[derive(Debug)]
struct Employee {
salary: u32,
}
#[async_trait]
impl Actor for Employee {
// We use the type () as id-less id. Therefore, only one actor will exist
type Id = ();
async fn activate(_: Self::Id, _: &ActorAssis... | Rust | 0 |
#!/usr/bin/env python3
from common import LOCALHOST, RootCert, STATUS_PORT, print_ok, run_ghostunnel, terminate
if __name__ == "__main__":
ghostunnel = None
try:
# create certs
root = RootCert('root')
root.create_signed_cert('client')
# start ghostunnel with bad cert
g... | Python | 1 |
Err(PacketError::Abort(mbuf, err)) => {
error_chain!(&err);
drop_q.push(mbuf);
// transmit_q.push(mbuf);
}
}
}
let pkt_sents = transmit_q.len();
if !transmit_q.is_empty() {
let mu... | Rust | 0 |
# request.py
import requests # pip install requests
students = [ # 虚拟数据,务必当真
{
'name': '王毅',
'age': 21,
'sex': 1,
'email': 'wangyi@gmail.com',
'money': 4488.5
},
{
'name': '张晓',
'age': 19,
'sex': 0,
'email': 'zhangxiao@example.com',
... | Python | 1 |
ume, anime costume",
"Tùy chỉnh": "nhập mô tả của bạn"
}
outfit_choice = st.selectbox("Chọn loại trang phục thay thế:", list(outfit_options.keys()))
if outfit_choice == "Tùy chỉnh":
custom_prompt = st.text_input("Nhập mô tả trang phục mới:")
prompt = custom_prompt if custom... | Python | 1 |
# Generated by Django 3.0.10 on 2021-02-04 21:47
import django.db.models.deletion
from django.db import migrations, models
import ghostwriter.rolodex.models
class Migration(migrations.Migration):
dependencies = [
("rolodex", "0010_auto_20210204_1957"),
]
operations = [
migrations.Create... | Python | 1 |
from tkinter import *
from tkinter import filedialog, messagebox
from threading import Thread
from pytube import YouTube
def threading():
# Call work function
t1 = Thread(target=download)
t1.start()
def download():
try:
url = YouTube(str(url_box.get()))
video = url.streams.first()
... | Python | 1 |
FR0_EL1::TGran16::Value::Supported) =
mmfr.read_as_enum(ID_AA64MMFR0_EL1::TGran16)
{
println!("[i] MMU: 16 KiB granule supported!");
}
if let Some(ID_AA64MMFR0_EL1::TGran64::Value::Supported) =
mmfr.read_as_enum(ID_AA64MMFR0_EL1::TGran64)
{
println!("[i] MMU: 64 KiB gran... | Rust | 0 |
t) = serial.read(&mut buf) {
for (i, c) in buf.iter().enumerate() {
if i >= count {
break;
}
serial.write(&[c.clone()]).unwrap();
LED.as_mut().map(|led|... | Rust | 0 |
PUBLIC_KEY_LENGTH]),
]);
let keys_hash = KeysHash::from(&keys);
let s = serde_json::to_string(&keys_hash).unwrap();
// hash of 5's and 9's cross referenced against dalek and ring
// @see https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=40c0671da85d1d71544b3c9facffc541
a... | Rust | 0 |
#User function Template for python3
class Solution:
##Complete this function
#Function to find the sum of contiguous subarray with maximum sum.
def maxSubArraySum(self,arr):
cursum=float('-inf')
umaxsum=float('-inf')
for i in range(len(arr)):
cursum=max(cursum+arr[... | Python | 1 |
aracter = cache.character_data[character_data.target_character_id]
if len(target_data.cloth.cloth_wear[11]):
return 1
return 0
@add_premise(constant_promise.Premise.TARGET_NOT_WEAR_SHOES)
def handle_t_not_wear_shoes(character_id: int) -> int:
"""
交互对象没有穿着鞋子
Keyword arguments:
character_... | Python | 1 |
# -*- coding: utf-8 -*-
from pandas import DataFrame, Series
from atklip.controls.pandas_ta._typing import DictLike, Int
from atklip.controls.pandas_ta.utils import v_offset, v_pos_default, v_series, v_talib
from .smma import smma
def alligator(
close: Series, jaw: Int = None, teeth: Int = None, lips: Int = None... | Python | 1 |
their order of
/// preference from most to least preferred.
///
/// If a suite appears more than once in `ciphers`, only the first suite
/// (and its relative order) is considered. If all cipher suites for a
/// version oF TLS are disabled, the respective protocol itself is disabled
/// entirel... | Rust | 0 |
all(oom_score_adj.to_string().as_bytes())?;
}
}
// if new user is specified in specification, this will be true and new
// namespace will be created, check
// https://man7.org/linux/man-pages/man7/user_namespaces.7.html for more
// information
if rootless.is_some() {
// child ne... | Rust | 0 |
Op::new(ZerosSrcOp, ext)))
}
}
impl<T> ZerosSrcOpLikeExt<GPUDeviceArray2d<T>> for ZerosSrcOp
where ZerosSrcOp: ZerosSrcOpExt<GPUDeviceArray2d<T>, Rc<Fn(Txn, GPUDeviceConn) -> GPUDeviceArray2d<T>>>,
T: ZeroBits + Copy + 'static,
{
fn build_like(x_: Val<GPUDeviceArray2d<T>>) -> Val<GPUDeviceArray2d<T>> {
l... | Rust | 0 |
tor1, n)
ren.AddViewProp(coneActor1)
# Pick the image
picker.Pick(170, 220, 0, ren)
#print picker
p = picker.GetPickPosition()
n = picker.GetPickNormal()
coneActor2 = vtkActor()
coneActor2.PickableOff()
coneMapper2 = vtkDataSetMapper()
coneMapper2.SetInputConnection(coneSource.GetOutputPort())
coneActor2.SetMapper(co... | Python | 1 |
class Singleton:
_instance = None
def __new__(cls):
if cls._instance is None:
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance
singleton1 = Singleton()
singleton2 = Singleton()
print(singleton1 is singleton2)
| Python | 1 |
from opencompass.models import HuggingFaceCausalLM
_meta_template = dict(
round=[
dict(role='HUMAN', begin='<|im_start|>user\n', end='<|im_end|>\n'),
dict(role='BOT', begin='<|im_start|>assistant\n', end='<|im_end|>\n', generate=True),
],
eos_token_id=92542
)
models = [
dict(
... | Python | 1 |
P4_C2.append(-p_f_expr[f]*self.k_star_plus<= v[f])
P4_C.extend(P4_C1)
P4_C.extend(P4_C2)
P4_C.extend(P4_C3)
P4_Obj = cp.Minimize(
cp.sum((cp.inv_pos(x) @ a_multi_g)) - cp.sum(cp.multiply(x, y_cur)) + cp.sum(cp.multiply(v, tao)))
P4 = cp.Proble... | Python | 1 |
rt g1_did.fingerprint == TEST_BLS12381G1_FINGERPRINT
assert g1_did.did == TEST_BLS12381G1_DID
assert g1_did.public_key_b58 == TEST_BLS12381G1_BASE58_KEY
assert g1_did.public_key == b58_to_bytes(TEST_BLS12381G1_BASE58_KEY)
assert g1_did.key_type == BLS12381G1
def test_bls12381g1g1_to... | Python | 1 |
'ģ', 'Ġ', 'ð', 'Ł', 'ĺ', 'ģ', 'Ġ?'],
['G', 'l', 'u', 'on', 'N', 'L', 'P', 'Ġis', 'Ġgreat', 'ï', '¼', 'ģ',
'ï', '¼', 'ģ', 'ï', '¼', 'ģ', '!', '!', '!'],
['G', 'l', 'u', 'on', 'N', 'L', 'P', '-', 'Am', 'az', 'on', '-',
... | Python | 1 |
from rest_framework import status
from rest_framework.views import Response, APIView
import rest_framework.generics
from .models import Recipe
from .serializers import (
RecipeCreateSerializers, RecipeListSerializers,
RecipeDetailSerializers, RecipeUpdateSerializers)
class RecipeListView(APIView):
def get... | Python | 1 |
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "({}, {}, {})", self.x, self.y, self.z)
}
}
impl Clone for Point {
fn clone(&self) -> Point { Point{x:self.x, y:self.y, z:self.z} }
}
use std;
pub const TWO_PI: f32 = 2.0 * std::f32::consts::PI;
pub fn clamp<T>(x: T, a: T, b: T) ... | Rust | 0 |
doctor_record(step_handler, record_params).await?;
}
Ok(())
}
async fn doctor_record(
step_handler: &mut impl DoctorStepHandler,
record_params: DoctorRecorderParameters,
) -> Result<()> {
let log_root =
record_params.log_root.context("log_root not present despite record set to true")?;
... | Rust | 0 |
ar(self):
df = DataFrame(
{
"A": np.random.uniform(size=20),
"B": np.random.uniform(size=20),
"C": np.arange(20) + np.random.uniform(size=20),
}
)
ax = df.plot.hexbin(x="A", y="B", colorbar=None)
assert ax.collection... | Python | 1 |
"""
Этот модуль представляет собой реализацию фильтра для проверки статуса регистрации пользователей
в системе. Фильтр предназначен для предотвращения повторной регистрации уже зарегистрированных пользователей.
Основные компоненты модуля:
1. Класс RegistrationFilter:
- Наследуется от базового класса фильтров Base... | Python | 1 |
"children": [
{"name": "Axes", "value": 1302},
{"name": "Axis", "value": 24593},
{"name": "AxisGridLine", "value": 652},
{"name": "AxisLabel", "value": 636},
{"name": "CartesianAxes", "value": 6703},
]... | Python | 1 |
_SHOWNORMAL);
SetForegroundWindow(window);
ShowCursor(1);
}
}
lazy_static! {
static ref FORGE: Mutex<Option<Forge>> = Mutex::new(None);
}
// TODO(tec27): Utilize `settings` to init the window position, then remove this allow
#[allow(dead_code)]
struct Forge {
settings: Settings,
windo... | Rust | 0 |
rgument names whose value will be restored after evaluating any configs.
:type restore_value: list[str]
:param warmup: Warmup time (in ms) to pass to benchmarking, defaults to 25.
:type warmup: int
:param rep: Repetition time (in ms) to pass to benchmarking, defaults to 100.
:type rep: int
"""
... | Python | 1 |
,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub name: String,
pub description: Option<String>,
pub organization_id: Uuid,
pub deleted_at: Option<DateTime<Utc>>,
pub language_code: String,
pub copied_from: Option<Uuid>,
pub content_search_language: Option<String>,
... | Rust | 0 |
of this source tree.
*/
//! Standard functions. Usually imported with `use gazebo::prelude::*`.
//!
//! Contains:
//!
//! * Extension methods for [`str`](str) and slice/[`Vec`](Vec).
//! * Exports the [`Dupe` trait](Dupe).
//! * Defines derive macros such as [`Dupe_`](Dupe_).
//!
//! The derivation macros appended w... | Rust | 0 |
import asyncio
import pytest
import os
import logging
from pydub import AudioSegment
from outspeed.data import AudioData
from outspeed.plugins.silero_vad import SileroVAD, VADState
from outspeed.streams import AudioStream, VADStream
logging.basicConfig(level=logging.DEBUG)
@pytest.mark.asyncio
async def test_run()... | Python | 1 |
riterow = ','.join([str(i) for i in line2write])
# Save to the output file
f_out.write(writerow+'\r'.replace('\r', '')) #\n
# Reset all variables
b_delta_fulfilled = False
current_icustay = parts[0]
min_sofa = int(parts[1])
min_timepoint = int(parts[2... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.