text string | label_name string | labels int64 |
|---|---|---|
1, 110.),
ceil_41: (105., -1, 110.),
ceil_42: (107., -1, 110.),
ceil_43: (113., -1, 120.),
ceil_44: (115., -1, 120.),
ceil_45: (117., -1, 120.),
ceil_46: (123., -1, 130.),
ceil_47: (125., -1, 130.),
ceil_48: (127., -1, 130.),
ceil_49: (133., -1, 140.),
ceil_50: (135., -1, 140.),
ceil_51: (137., -1... | Rust | 0 |
#!/usr/bin/python
#coding: utf-8
# -------------------------------------------------------------------
# 宝塔Linux面板
# -------------------------------------------------------------------
# Copyright (c) 2015-2099 宝塔软件(http://bt.cn) All rights reserved.
# -------------------------------------------------------------------... | Python | 1 |
mappings:
mapping = self.all_mappings[self.node.name]
elif self.node.op_type in self.all_mappings:
mapping = self.all_mappings[self.node.op_type]
else:
mapping = default_mapping
# Override spatial mapping by the one defined in the core's dataflows
try... | Python | 1 |
That means that splitting on : yields 1, 3, 4 or 5 fields. Any other number of fields is an
// error
// These contexts are always resources
// Errors will be handled by level above
// TODO: Somewhere along the line the mls low vs high distinction got confused with the sensitivity
// vs category distinction. Since ML... | Rust | 0 |
value))
.field("blocks", &blocks)
.finish()
}
}
struct SlabBuilder<'slab: 'builder, 'builder> {
slab: &'builder mut Slab<'slab>,
seen: HashMap<usize, OpaqueValue<'slab>>,
next_block_index: RefCell<usize>,
}
impl<'s, 'b> SlabBuilder<'s, 'b> {
fn new(slab: &'b mut Slab<'s>) -... | Rust | 0 |
import torch
import torch.nn as nn
class Label_Smoothing_Regression(nn.Module):
def __init__(self, e=0.01, reduction='mean'):
super().__init__()
self.log_softmax = nn.LogSoftmax(dim=1)
self.e = e
self.reduction = reduction
def _one_hot(self, labels, classes, value=1):
... | Python | 1 |
# coding: utf-8
"""
clevermaps-client
CleverMaps REST API provides access to location intelligence and geospatial analytics platform. ### Main capabilities include: - Project and user access management - Multidimensional data model and metrics management - Data upload and exports - Ad-hoc analysis of geospat... | Python | 1 |
source: String::with_capacity(token_iter.original_source.len()),
source_map: SourceMap::default(),
};
ps.feed_tokens(token_iter.clone()).unwrap();
Translator::new().translate(token_iter).unwrap();
}
}
<filename>src/main.rs
use winapi::shared::minwindef::DWORD;
use winapi::shared:... | Rust | 0 |
ando a tecla não esta
if key[pg.K_h] == True:
if not key_pressed_last_frame6:#isso verifica se a tecla esta pressionada no ultimo frame
ptype = 'solid'
print('solid')
key_pressed_last_frame6 = True#isso atualiza o estado
else:
key_pressed_last_frame6 = False #... | Python | 1 |
;
}
extern "C" {
#[link_name = "\u{1}__isoc99_vscanf"]
pub fn vscanf1(__format: *const cty::c_char, __arg: __builtin_va_list) -> cty::c_int;
}
extern "C" {
#[link_name = "\u{1}__isoc99_vsscanf"]
pub fn vsscanf1(
__s: *const cty::c_char,
__format: *const cty::c_char,
__arg: __buil... | Rust | 0 |
port_id: &PortId,
channel_id: &ChannelId,
) -> bool {
if !self.global.filter {
return true;
}
match self.find_chain(chain_id) {
None => false,
Some(chain_config) => chain_config.packet_filter.is_allowed(port_id, channel_id),
}
... | Rust | 0 |
&Metrics,
approval: IndirectSignedApprovalVote,
with_response: impl FnOnce(ApprovalCheckResult) -> T,
) -> SubsystemResult<(Vec<Action>, T)> {
macro_rules! respond_early {
($e: expr) => {{
let t = with_response($e);
return Ok((Vec::new(), t))
}};
}
let block_entry = match db.load_block_entry(&approval.... | Rust | 0 |
nt': KeyInfo(default=''),
'policy': KeyInfo(default='ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon'),
'start-date': KeyInfo(),
'start-time': KeyInfo(),
},
),
),
('system', 'script'): APIData(
unversioned=VersionedAPID... | Python | 1 |
"""
Computes metrics for evaluating simulated evaluation pipelines.
Usage:
from simpler_env.utils.metrics import mean_maximum_rank_violation, pearson_correlation, REAL_PERF
sim_eval_perf = [
your_sim_eval(task="google_robot_move_near", policy=p)
for p in ["rt-1-x", "octo", ...]
]
real... | Python | 1 |
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
return sorted(s)==sorted(t)
| Python | 1 |
gs: { x: U128 }): Promise<void>;");
/// assert_eq!(ts_sig(&parse_str("fn c(x: U128, y: String) -> Vec<Token> {}").unwrap()), "c(args: { x: U128, y: string }): Promise<Token[]>;");
/// assert_eq!(ts_sig(&parse_str("fn d(x: U128, y: String, z: Option<U64>) -> Vec<Token> {}").unwrap()), "d(args: { x: U128, y: string, z: U... | Rust | 0 |
/// let grid = Grid::new(2, 2, 1.0);
/// let sampler = GridSamplerCluster::new((0, 0), (1, 1));
/// assert_eq!(grid.sample(sampler).unwrap(), (4.0, 4));
/// ```
pub fn sample<S, W>(&self, sampler: S) -> Option<(T, W)>
where
S: GridSampler<T, W>,
{
sampler.sample(self)
}
}
im... | Rust | 0 |
# Assignment
import random
# Generate and print 10 random numbers between 1 and 100
for _ in range(10):
print(random.randint(1, 100), end=" ")
print("Developed-By-Aqsa Majeed. ✨🤍") | Python | 1 |
useful so far.
///
/// Additionally, you can use the `tess.inst_slice(range, inst_nb)` construct to also specify
/// the render should be performed with `inst_nb` instances.
pub trait TessSliceIndex<Idx> {
/// Slice a tesselation object and yields a [`TessSlice`] according to the index range.
fn slice(&self, idx: ... | Rust | 0 |
es = include_wast2wasm_bytes!("tests/is_emscripten_false.wast");
let module = compile(wasm_bytes).expect("Not compiled properly");
assert!(!is_emscripten_module(&module));
}
}
#[cfg(feature = "nightly")]
use core::mem::MaybeUninit;
#[cfg(feature = "nightly")]
use crate::{ErrorKind, Read, Write};
#... | Rust | 0 |
from neko_2022_soai_zero.visualization.result_compilers.compiler import compile_alot
from neko_2020nocr.dan.utils import neko_os_Attention_AR_counter
from neko_sdk.ocr_modules.charset.no_filter import get_no_filters
def compile_mjst(root,modnames,workingdir,dev,branch,methods,codenames,threshs,case_sensitive=False,d... | Python | 1 |
e_old_entries():
current_time = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
cursor.execute("insert into opened select * from events where time < ?", (current_time, ))
cursor.execute("delete from events where time < ?", (current_time, ))
conn.commit()
def fetch_and_sort_entries():
... | Python | 1 |
# app/services/dashboard.py
from datetime import date
from sqlalchemy.orm import Session
from app import schemas
from app.crud import games
from app.config import Settings
from app.utils.parsing_helpers import (
calculate_last_10_games_record,
calculate_current_streak,
)
class DashboardService:
def __i... | Python | 1 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
ANSIBLE_METADATA = {'status': ['stableinterface'], 'supported_by': 'community', 'version': '1.1'}
DOCUMENTATION = '''
---
module: hashivault_read_to_file
version_added: "3.8.3"
short_description: Hashicorp Vault read module
description:
- "Reads and deocdes a base64 encoded... | Python | 1 |
import json
import logging
import os
from logging.config import fileConfig
import alembic_postgresql_enum
import boto3
from sqlalchemy import engine_from_config, pool
from sqlmodel import SQLModel
from alembic import context
from tracecat.db import schemas # noqa: F401
alembic_postgresql_enum.set_configuration(
... | Python | 1 |
#!/usr/bin/env python3
"""
Android Instrumentation Test Parser
Given a raw Android Instrumentation log (produced by "adb shell am instrument -r ...") this script
return zero if all tests pass and non-zero if some tests fail. In case of failure, this script
also prints arguments that, if passed to "am instrument", will... | Python | 1 |
as *const $crate::slice::BitSlice<$order, Celled>
)
}
}};
(static $order:ty, $store:ident; $val:expr; $len:expr) => {{
static DATA: $crate::BitArr!(for $len, in $order, $store) =
$crate::bitarr!(const $order, $store; $val; $len);
unsafe { DATA.get_unchecked(.. $len) }
}};
(static $val:expr; $len:e... | Rust | 0 |
.is_valid()
.unwrap()
);
}
#[test]
fn test_invalid_check_digit_taxpayer_identification_number_10_numbers() {
assert!(
create_taxpayer_identification_number("7827004527")
.is_valid()
.unwrap() == false
);
}
... | Rust | 0 |
# test-script for QUTest unit testing harness
# see https://www.state-machine.com/qtools/qutest.html
# preamble...
def on_reset():
expect_pause()
continue_test()
expect_run()
glb_filter(GRP_ALL)
loc_filter(IDS_ALL, -IDS_AO, -IDS_AP)
ao_filter("Table_inst")
current_obj(OBJ_AO, "Table_inst")
... | Python | 1 |
from openai import OpenAI
def chat_with_subtitles(
user_message,
history,
subtitles_text,
deepseek_api_key,
system_prompt
):
"""
与字幕进行对话的核心函数
"""
if history is None:
history = []
user_msg_dict = {"role": "user", "content": user_message}
if not subtitles_text or not... | Python | 1 |
xt_menu: *mut webkit2_webextension_sys::WebKitContextMenu,
hit_test_result: *mut webkit2_webextension_sys::WebKitWebHitTestResult,
f: glib_sys::gpointer,
) -> glib_sys::gboolean
where
P: IsA<WebPage>,
{
let f: &F = &*(f as *const F);
f(... | Rust | 0 |
continue;
}
let output_fact_base = fixed_point_backward_block(analysis, &graph, label, fact_base);
for predecessor in graph.direct_predecessors(label) {
let old_fact = fact_base.entry(predecessor).or_insert_with(F::bottom);
if !old_fact.join(&output_fact_base[&p... | Rust | 0 |
init_ws() {
{
let mut lock = IS_WS_INITIALIZED.lock().unwrap();
if *lock {
return;
}
*lock = true;
}
start_daemon_ws_conn().await;
}
pub async fn start_daemon_ws_conn() {
while let Err(err) = try_ws_conn().await {
send_error(err.into_message());
... | Rust | 0 |
import riemann
from riemann import simple, utils
from riemann.encoding import addresses as addr
riemann.select_network('zcash_sapling_main')
# Needs a 32 byte hash, alice's pubkey, a timeout, and bob's pubkey
htlc_redeem_script = (
'OP_IF '
'OP_SHA256 {secret_hash} OP_EQUALVERIFY ' # noqa: E131
... | Python | 1 |
import os
import shutil
import pickle
import logging
def cleanup_scraper():
"""Reset scraper state by cleaning up Chrome profile and cookies"""
try:
chrome_profile = os.path.join(os.path.dirname(__file__), 'chrome_profile')
if os.path.exists(chrome_profile):
shutil.rmtree(ch... | Python | 1 |
ent: &'a str,
pub hit_descriptions: Vec<HitDescription<'a>>,
}
impl<'a> IndexHit<'a> {
pub fn sort_by_match_proximity(&mut self) {
//Smaller is better!
self.hit_descriptions.sort_by(|x,y|{y.word_info.2.cmp(&x.word_info.2)});
}
}
pub enum PreviewBoundary {
OuterWords,
MaxDistance,
... | Rust | 0 |
mmands[val] = Command::Open(self.commands.len());
self.commands.push(Command::Close(val));
}
None => return Err(CompileError::UnmatchedBracket(i)),
},
',' => self.commands.push(Command::Read),
'.' => self.com... | Rust | 0 |
hted sum of all losses
loss = cls_loss + \
BOX_LOSS_WEIGHT * (center_loss +
heading_class_loss + size_class_loss +
HEAD_REG_WEIGHT * heading_res_norm_loss +
SIZE_REG_WEIGHT * size_res_norm_loss +
... | Python | 1 |
#############################
# Read Input
#############################
from lexer import Lexer
inputFile = open("input.txt", "r")
inputText = inputFile.read()
inputFile.close()
lexer = Lexer(inputText)
tokens = lexer.generate_tokens()
print(list(tokens)) | Python | 1 |
[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query ... | Python | 1 |
"""
This module contains prompt templates for different file types.
"""
# General translation prompt template
DEFAULT_PROMPT = """
You are a professional translator. Translate the following Chinese text into English
while keeping the original meaning. Strictly preserve the original text format,
including line breaks... | Python | 1 |
.unwrap();
cx.set_min_exponent(-(isize::try_from(APD_DATUM_MAX_PRECISION).unwrap()))
.unwrap();
cx
};
static ref CX_AGG: Context<ApdAgg> = {
let mut cx = Context::<ApdAgg>::default();
cx.set_max_exponent(isize::try_from(APD_AGG_MAX_PRECISION - 1).unwrap())
... | Rust | 0 |
u32) << 17)
| ((b as u32) << 8)
| (c as u32)
}
impl Compiler {
pub fn new(name: String) -> Self {
let closure = Closure::new(name.clone());
Compiler {
nvars: 0,
freereg: 0,
vars: Vec::new(),
upvals: Vec::new(),
closure: closure,
line: 1,
name,
nc... | Rust | 0 |
_x => {
return Some(TableIndex::None); // TODO This should be an error
}
}
}
} else {
return None;
}
}
}
}
#[derive(Debug, Clone)]
pub struct ConstantIterator {
table_index: TableIndex,
done: bool,
}
impl ConstantIterator {
pub f... | Rust | 0 |
.inp_tensors[0])
context.update_quantize_dict(fake_unsqueeze_out)
param = cp.ReshapeParameter(shape=cp.BlobShape(dim=unsqueeze_shape))
bottom = [context.get_blob_name(opr.inp_tensors[0])]
top = [context.set_blob_name(fake_unsqueeze_out, fake_unsqueeze_out.name)]
context.add_layer(
cp.LayerPa... | Python | 1 |
mac:ident ! ($($rest:tt)*)) => ($submac!(8, $($rest)*));
(8, $submac:ident ! ($($rest:tt)*)) => ($submac!(9, $($rest)*));
(9, $submac:ident ! ($($rest:tt)*)) => ($submac!(10, $($rest)*));
(10, $submac:ident ! ($($rest:tt)*)) => ($submac!(11, $($rest)*));
(11, $submac:ident ! ($($rest:tt)*)) => ($submac!(12, $($... | Rust | 0 |
mat!("{}", value))?;
Ok(0)
}
}
/// Get a `Terminal` instance whereon terminal related actions can be performed.
pub fn terminal() -> Terminal {
Terminal::new()
}
/// When executed, this command will scroll up the terminal buffer by the given number of times.
///
/// See `crossterm/examples/command.rs`... | Rust | 0 |
ile.colour;
foreground = ConsoleColour::White;
background = match ty {
TextBlue => ConsoleColour::Blue,
TextGreen => ConsoleColour::Green,
TextCyan => ConsoleColour::Cyan,
TextRed => ConsoleColour::Red,
TextPurple => ConsoleColour::Magenta,
TextBrown => ConsoleColour::Brow... | Rust | 0 |
lf.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
def test_sparc_ss20(self):
"""
:avocado: tags=arch:sparc
:avocado: tags=machine:SS-20
"""
tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
def... | Python | 1 |
ub ty: Ty<I>,
}
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
pub enum Polarity {
Positive,
Negative,
}
impl Polarity {
pub fn is_positive(&self) -> bool {
match *self {
Polarity::Positive => true,
Polarity::Negative => false,
}
}
}
<gh_sta... | Rust | 0 |
_SYMBOL_PLAY: &'static [u8; 4usize] = b"\xEF\x81\x8B\0";
pub const LV_SYMBOL_PAUSE: &'static [u8; 4usize] = b"\xEF\x81\x8C\0";
pub const LV_SYMBOL_STOP: &'static [u8; 4usize] = b"\xEF\x81\x8D\0";
pub const LV_SYMBOL_NEXT: &'static [u8; 4usize] = b"\xEF\x81\x91\0";
pub const LV_SYMBOL_EJECT: &'static [u8; 4usize] = b"\x... | Rust | 0 |
32/64-bit`
EVEX_Vpmovqw_xmmm32_k1z_xmm = 2904,
/// `VPMOVQW xmm1/m64 {k1}{z}, ymm2`
///
/// `EVEX.256.F3.0F38.W0 34 /r`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vpmovqw_xmmm64_k1z_ymm = 2905,
/// `VPMOVQW xmm1/m128 {k1}{z}, zmm2`
///
/// `EVEX.512.F3.0F38.W0 34 /r`
///
/// `AVX512F`
///... | Rust | 0 |
matter whether the app is active or inactive
conductor
.activate_app_in_db("id".to_string())
.await
.unwrap();
assert_matches!(
conductor.add_inactive_app_to_db(app.clone()).await,
Err(ConductorError::AppAlreadyInstalled(id))
if id == "id".to_string()
);
}
... | Rust | 0 |
ces from font files."]
pub type FT_Driver = *mut FT_DriverRec_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FT_RendererRec_ {
_unused: [u8; 0],
}
#[doc = " @type:"]
#[doc = " FT_Renderer"]
#[doc = ""]
#[doc = " @description:"]
#[doc = " A handle to a given FreeType renderer. A renderer is a module in"]... | Rust | 0 |
# Conversor de moedas
# Solicita um valor em reais
realValor = float(input("Informe um valor R$: "))
# Define a taxa de conversão
taxaD = 1.15
taxaIene = 1.05
# Converte para dólar e iene
dolar = realValor / taxaD
iene = realValor / taxaIene
# Exibe os valores convertidos
print(f"Valor convertido em dólar: {dolar:.... | Python | 1 |
dPublic_Finish(
esysContext: *mut ESYS_CONTEXT,
outPublic: *mut *mut TPM2B_PUBLIC,
name: *mut *mut TPM2B_NAME,
qualifiedName: *mut *mut TPM2B_NAME,
) -> TSS2_RC;
}
extern "C" {
pub fn Esys_ActivateCredential(
esysContext: *mut ESYS_CONTEXT,
activateHandle: ESYS_TR... | Rust | 0 |
import cv2
import numpy as np
import matplotlib.pyplot as plt
def Otsu(srcImg_path):
img = cv2.imread(srcImg_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
h, w = img.shape[:2]
threshold_t = 0
max_g = 0
for t in range(255):
front = img[img < t]
back = img[img >= t]
... | Python | 1 |
print("Hello and welcome to the Uni_global favorite movies manager!!!")
favorite_movies = []
while True:
command = input("enter: 'add' to add a movie 'remove' to remove a movie 'view' to view all movies 'exit' to exit: ")
if command == "add":
title = input("what is the title of the movie you... | Python | 1 |
en two colours is calculated via the CIE76 formula.)
/// For example, if a user wishes all pixels that are *NOT* blue to be displayed in greyscale, they can selectively specify only the blue pixels to be
/// kept in the photo.
/// # Arguments
/// * `img` - A PhotonImage.
/// * `ref_color` - The `RGB` value of the refer... | Rust | 0 |
频到视频
final_video = final_image_clips.with_audio(final_audio)
else:
final_video = final_image_clips
print("⚠️ 没有音频,输出静音视频")
except Exception as e:
print(f"❌ 音频处理失败: {e}")
final_video = final_image_clips
# 输出最终视频
out_path = os.path.join(project_pat... | Python | 1 |
ude(includeFile))
def standard_imports():
# Write local to global __CONSOLE_VAR_DICT__ for reuse,
exec('%s%s' % ('__CONSOLE_VAR_DICT__["bpy"]=', 'bpy'))
exec('%s%s' % ('__CONSOLE_VAR_DICT__["Blender"]=', 'Blender'))
for ls in (dir(), dir(Blender)):
for __TMP_VAR_NAME__ in ls:
# Execute the local > global ... | Python | 1 |
pub const ERROR_REQUEST_TIMEOUT: u32 = 638u32;
#[doc = "*Required features: 'Win32_NetworkManagement_Rras'*"]
pub const ERROR_RESTRICTED_LOGON_HOURS: u32 = 646u32;
#[doc = "*Required features: 'Win32_NetworkManagement_Rras'*"]
pub const ERROR_ROUTE_NOT_ALLOCATED: u32 = 612u32;
#[doc = "*Required features: 'Win32_Networ... | Rust | 0 |
y(&self) -> Option<&Descriptor> {
self.emergency.as_ref()
}
pub fn voicemail(&self) -> Option<&Descriptor> {
self.voicemail.as_ref()
}
pub fn short_code(&self) -> Option<&Descriptor> {
self.short_code.as_ref()
}
pub fn standard_rate(&self) -> Option<&Descriptor> {
self.standard_rate.as_ref()
}
pub f... | Rust | 0 |
|
// | Reserved |
// | |
// 1G+256M +---------------------------------------------------------------+
// | ... | Rust | 0 |
for pfv in 0..8 {
for pfu in 0..8 {
for longer in 0..2 {
let (vr, ur) = if longer == 0 { (&m, &n) } else { (&n, &m) };
let mut v = VecDeque::from(vr.clone());
for _ in 0..pfv {
v.push_front(1);
}
let ... | Rust | 0 |
=> (SIGBUS, BUS_ADRALN),
// TODO: handle page fault and general protection exceptions
_ => panic!("illegal exception: cannot be converted to signal"),
};
Self { num, code }
}
}
impl Signal for FaultSignal {
fn num(&self) -> SigNum {
self.num
}
fn to_info... | Rust | 0 |
k = np.ones_like(score4k_2)*100
overlay4k[offset_2:h_s, offset_2:w_s] += 100
overlay4k[offset_3:h_s, offset_3:w_s] += 100
overlay4k[offset_4:h_s, offset_4:w_s] += 100
score4k = (score4k_1+new_score4k_2+new_score4k_3+new_score4k_4)/overlay4k
for i in range(6):
score256_1 = concat_scores256(a256_1[:,i... | Python | 1 |
import mysql.connector
# Connect to MySQL
db = mysql.connector.connect(
host="localhost",
user="root",
password="yourpassword",
database="librarydb"
)
cursor = db.cursor()
# Create table
cursor.execute("""
CREATE TABLE IF NOT EXISTS books (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255... | Python | 1 |
# coding: utf-8
# Pandoc
import pandoc
pandoc.main()
| Python | 1 |
pend on Domain")
print(" • Infrastructure layer: Can depend on Domain and Application")
print(" • Presentation layer: Can depend on Domain and Application")
return False
else:
print("✅ All Clean Architecture dependency rules are respected!")
return True
def main():
... | Python | 1 |
new(0.0, 200.0)))
.with(AngularVelocity(0.0))
.with(test::auth::Test(2.5, 5.0))
});
repl::entity::auth::create(world, 0, "test", |builder| {
builder
.with(Position(Point2::new(-900.0, -100.0)))
.with(Velocity(Vector2::new(0.0, 2... | Rust | 0 |
Multiply.clicked.connect(mul)
My_Window.btn_Dive.clicked.connect(div)
My_Window.btn_Sign.clicked.connect(sign)
My_Window.btn_Pow.clicked.connect(pow)
My_Window.btn_Sqrt.clicked.connect(sqrt)
My_Window.btn_Log.clicked.connect(log)
My_Window.btn_Sin.clicked.connect(sin)
My_Window.btn_Cos.clicked.connect(cos)
My_Window.bt... | Python | 1 |
import streamlit as st
from faker import Faker
from faker.providers import BaseProvider, date_time
from .common import st_command_with_default
fake = Faker()
fake.add_provider(date_time)
class StreamlitMediaProvider(BaseProvider):
def image(self, **kwargs):
return st_command_with_default(
st... | Python | 1 |
"""
文案生成路由模块
负责小红书风格文案的生成
"""
from fastapi import APIRouter, HTTPException
import json
import uuid
import logging
import os
import asyncio
from models.schemas import PostRequest, PostResponse, ErrorResponse
from common.ai_models import get_ai_manager, ChatMessage
from utils.json_parser import parse_ai_response
# 配置日... | Python | 1 |
sysinfo:
type_ = sysinfo["mic_type"]
else:
raise SmartDeviceException("Unable to find the device type field!")
else:
raise SmartDeviceException("No 'system' nor 'get_sysinfo' in response")
if "smartplug" in type_.lower() and "children" in sysinfo:... | Python | 1 |
re.registers.set_hl(address - 1);
}
fn load_mem_hl_d8(core: &mut Core, operand: Option<Operand>) {
let address = core.registers.get_hl();
core.memory.borrow_mut().set(address, operand.unwrap().byte);
}
fn load_a_hlp_mem(core: &mut Core, _: Option<Operand>) {
let address = core.registers.get_hl();
core... | Rust | 0 |
ick_filter)==dict and 'field' in list_quick_filter:
field = list_quick_filter['field']
if 'order_by' in list_quick_filter:
field_order_by = list_quick_filter['order_by']
if 'limit' in list_quick_filter:
field_lim... | Python | 1 |
cells
.values()
.filter_map(|(y, x, filled)| if *filled { Some((*y, *x)) } else { None })
.collect();
let mut row_won: bool = true;
let mut col_won: bool = true;
for line in 0..5 {
if !filled.contains(&(y, line)) {
row_won = false;
... | Rust | 0 |
, serde(rename(serialize = "z")))]
pub z: i32,
/// Velocity estimated standard deviation
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
/// Number of satellites used in solution
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub ... | Rust | 0 |
# -*- coding: utf-8 -*-
# vim :set ft=py:
from bloscpack import checksums
def test_checksusm_exist():
assert len(checksums.CHECKSUMS) == 9
checksums_avail = ['None',
'adler32',
'crc32',
'md5',
'sha1',
... | Python | 1 |
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
ocalFlags {}
impl LocalFlags {
pub const ISIG: u32 = 0o0000001;
pub const ICANON: u32 = 0o0000002;
pub const XCASE: u32 = 0o0000004;
pub const ECHO: u32 = 0o0000010;
pub const ECHOE: u32 = 0o0000020;
pub const ECHOK: u32 = 0o0000040;
pub const ECHONL: u32 = 0o0000100;
pub const NOFLSH: ... | Rust | 0 |
# # # Assigning values to variabiles
# # counter = 100 # an integer assignment
# # miles = 1000.0 # an floating assignment
# # name = "johan" # an string assignment
# # # multile Assignment
# # a=b=c=1
# # a,b,c,1,2,'johan'
# # # Python Standard Data type
# # # 1.numbers
# # # 2. string
# # # 3. list
# # # 4.t... | Python | 1 |
"""Provider test utils."""
| Python | 1 |
ent,
system_instruction,
system_program,
sysvar::{
self,
SysvarId,
},
};
use std::{
io::{
ErrorKind,
Write,
},
marker::PhantomData,
ops::{
Deref,
DerefMut,
},
slice::Iter,
string::FromUtf8Error,
};
pub use borsh::{
BorshDe... | Rust | 0 |
else:
eval_list += [{"name": key, "gt": [], "pred": pred_dict[key]}]
logger.info(f"finish loading files, start evaluation...")
process_pool = Pool(args.pool_size)
result_list = process_pool.map(run_eval, eval_list)
result_dict = {i['name']: i for i in result_list}
if args.split !... | Python | 1 |
mut objs_l = Vec::with_capacity(n_left);
let mut objs_r = Vec::with_capacity(n_right);
for &(ref bbox, obj) in &objs {
if bbox_left.intersects(bbox) {
objs_l.push((*bbox, obj));
}
if bbox_right.intersects(bbox) {
... | Rust | 0 |
sition features
device=global_features.device
# TODO: move to the __init__, we add FOV_height//2 because of the padding
offsets_y=torch.arange(-(self.FOV_height//2),(self.FOV_height+1)//2,dtype=torch.int32,device=device)
offsets_x=torch.arange(-(self.FOV_width/... | Python | 1 |
"""``tlz`` mirrors the ``toolz`` API and uses ``cytoolz`` if possible.
The ``tlz`` package is installed when ``toolz`` is installed. It provides
a convenient way to use functions from ``cytoolz``--a faster Cython
implementation of ``toolz``--if it is installed, otherwise it uses
functions from ``toolz``.
"""
from . ... | Python | 1 |
use dprint_core::configuration::*;
use dprint_plugin_typescript::configuration::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn resolve_config(configuration: &js_sys::Map) -> String {
console_error_panic_hook::set_once();
serde_json::to_string(&resolve_to_typescript_config(configuration)).unwrap()
}
#... | Rust | 0 |
,
VerticalAlignment,
};
use abstutil::Cloneable;
use geom::{Distance, Duration, Polygon};
use std::collections::{HashMap, HashSet};
use stretch::geometry::{Rect, Size};
use stretch::node::{Node, Stretch};
use stretch::number::Number;
use stretch::style::{
AlignItems, Dimension, FlexDirection, FlexWrap, JustifyC... | Rust | 0 |
###############################################################################
#
# OpenEduCat Inc
# Copyright (C) 2009-TODAY OpenEduCat Inc(<https://www.openeducat.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License a... | Python | 1 |
));
assert_ok!(
get("/subdir_with_no_index").on(&plaintext_index),
"plaintext file",
"content-type" => "text/plain"
);
// with no index file
let no_index = StaticCompiledHandler::new(include_dir!("examples/files"));
assert_not_handled!(get("/").on(&no_index));
assert_not_handled!(get("/subdir").on(&no_ind... | Rust | 0 |
import pandas as pd
# Load the player_transfer file
player_transfer = pd.read_csv('./data/updated/player_transfers_updated.csv')
# Function to fill missing marketValue for a player
def fill_missing_market_value(player_id, df):
# Get all rows for the player
player_rows = df[df['player_id'] == player_id]
... | Python | 1 |
Condition::LS => "ls",
Condition::CC => "cc",
Condition::CS => "cs",
Condition::NE => "ne",
Condition::EQ => "eq",
Condition::VC => "vc",
Condition::VS => "vs",
Condition::PL => "pl",
Condition::MI => "mi",
... | Rust | 0 |
#[no_mangle]
fn _zluda_very_bad_linker_hack() {
cuInit(0);
}
<reponame>KaiJewson/rust
use super::utils::derefs_to_slice;
use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::source::snippet_with_applicability;
use clippy_utils::ty::is_type_diagnostic_item;
use clippy_utils::{get_parent_expr, hig... | Rust | 0 |
m_train // mb_size):
# _x = Images[idx * mb_size: (idx + 1) * mb_size]
_x = sample_X(Images, mb_size)
_x = np.transpose(_x, [0,2,3,1]) / 127.5 - 1
z_sample = sample_Z(mb_size, Z_dim)
for k in range(disc_steps):
_, D_loss_curr = sess.run([D_so... | Python | 1 |
from kivy.lang import Builder
from kivy.metrics import dp
from kivymd.app import MDApp
from kivymd.uix.menu import MDDropdownMenu
KV = '''
MDScreen:
MDRaisedButton:
id: button
text: "Press me"
pos_hint: {"center_x": .5, "center_y": .5}
on_release: app.menu_open()
'''
class Test(... | Python | 1 |
first = select.next().ok_or(())?;
let attr = first.value().attr(attr).ok_or((attr.to_owned(), first.html()))?;
Self::from_str(attr.trim()).map_err(|err| (attr.trim().to_owned(), stringify!($typ).to_owned(), err.to_string()).into())
}
}
)*
... | Rust | 0 |
r_file(f):
member_count += 1
if m.raw_size[0] >= 0x80:
size = m.size
logging.info(f'found huge member size={size}: {m}')
huge_member_count += 1
logging.info(f'found {member_count} members')
logging.info(f'found {... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.