text string | label_name string | labels int64 |
|---|---|---|
import mysql
import mysql.connector
from random import randint
from helpers import posts_entrys
from helpers.doadmin import get_database
from datetime import datetime
def get_user_notis(username):
all_noti = []
mydb = get_database()
mycursor = mydb.cursor(buffered=True)
mycursor.execute("""
... | Python | 1 |
def test_only_cross_attention(self):
torch.manual_seed(0)
constructor_args = self.get_constructor_arguments(only_cross_attention=
False)
attn = Attention(**constructor_args)
self.assertTrue(attn.to_k is not None)
self.assertTrue(attn.to_v is not None)
forward_args = self.get_forward_argu... | Python | 1 |
,
concat!(
"Offset of field: ",
stringify!(fido_dev_transport),
"::",
stringify!(tx)
)
);
}
pub type fido_dev_transport_t = fido_dev_transport;
pub const fido_opt_t_FIDO_OPT_OMIT: fido_opt_t = 0;
pub const fido_opt_t_FIDO_OPT_FALSE: fido_opt_t = 1;
pub... | Rust | 0 |
ARM64_PSTATE_DAIFCLR = 31,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum arm64_vas {
ARM64_VAS_INVALID = 0,
ARM64_VAS_8B = 1,
ARM64_VAS_16B = 2,
ARM64_VAS_4H = 3,
ARM64_VAS_8H = 4,
ARM64_VAS_2S = 5,
ARM64_VAS_4S = 6,
ARM64_VAS_1D = 7,
ARM64_VAS_2D = ... | Rust | 0 |
test_blob_try_from() {
let bytes = hex::decode(TEST_HEX).unwrap();
let blob = Blob::try_from(TEST_HEX);
assert!(blob.is_ok());
assert_eq!(bytes, blob.unwrap().as_ref());
}
}
<reponame>peferron/air-quality<gh_stars>10-100
#[derive(Deserialize)]
pub struct Response {
pub status: ... | Rust | 0 |
import tkinter as tk
from tkinter import ttk
class ClipboardManager:
def __init__(self, root):
self.root = root
self.root.title("Clipboard Manager")
self.clipboard_history = []
self.current_clipboard_content = ""
self.setup_ui()
self.poll_clipboard()
def setup_u... | Python | 1 |
from __future__ import annotations
from .base import TelegramObject
class ChatMember(TelegramObject):
"""
This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
- :class:`aiogram.types.chat_member_owner.ChatMemberOwner`
- :class... | Python | 1 |
0)
print('The total number of parameters: ' + str(num_para))
print('The parameters of Model {}: {:4f}M'.format(model._get_name(), num_para * type_size / 1000 / 1000))
print('-' * 90)
if __name__ == "__main__":
model=SuperResModel(
in_channels=1,
model_channels=64,
out_channels=... | Python | 1 |
d)-1 and word[i+1] == second:
new_word.append(first+second)
i += 2
else:
new_word.append(word[i])
i += 1
new_word = tuple(new_word)
word = new_word
if len(word) == 1:
break... | Python | 1 |
ldl1strm", rw = _PREFETCH_READ, locality = _PREFETCH_LOCALITY0))]
#[cfg_attr(test, assert_instr("prfm pldl3keep", rw = _PREFETCH_READ, locality = _PREFETCH_LOCALITY1))]
#[cfg_attr(test, assert_instr("prfm pldl2keep", rw = _PREFETCH_READ, locality = _PREFETCH_LOCALITY2))]
#[cfg_attr(test, assert_instr("prfm pldl1keep", ... | Rust | 0 |
import pickle
import numpy as np
import torch
from loss_landscape_anim import __version__
from loss_landscape_anim.loss_landscape import LossGrid
from pytest import fixture
from torch.utils.data import TensorDataset
SEED = 180224
def test_version():
assert __version__ == "0.1.9"
@fixture
def test_model():
... | Python | 1 |
scapeDefault { .. }")
}
}
#[cfg(test)]
mod tests {
//! Note that most of these tests are not testing `AsciiExt` methods, but
//! test inherent ascii methods of char, u8, str and [u8]. `AsciiExt` is
//! just using those methods, though.
use super::AsciiExt;
use char::from_u32;
#[test]
... | Rust | 0 |
# -*- coding: utf-8 -*-
import re
import sys
from collections import defaultdict
from . import confusables
from .utils import dump, get, u
try:
import click
except ImportError:
print('Install this package with the [cli] extras to enable the CLI.')
raise
@click.group()
def cli():
pass
@cli.command(... | Python | 1 |
import cv2 as cv
import numpy as np
##Hough Circle Detection Distance Function
dist = lambda x1, y1, x2, y2: (x1 - x2)**2 + (y1 - y2)**2 ##We will use the swuare of the distance to compare
## Opening the webcam on laptop
videoCapture = cv.VideoCapture(0, cv.CAP_DSHOW)
prevCircle = None
##Check if the camera was op... | Python | 1 |
wrapper,)
NODE_CLASS_MAPPINGS = {
"StreamDiffusionConfig": StreamDiffusionConfig,
"StreamDiffusionSampler": StreamDiffusionSampler,
"StreamDiffusionPrebuiltConfig": StreamDiffusionPrebuiltConfig,
"StreamDiffusionLoraLoader": StreamDiffusionLoraLoader,
"StreamDiffusionAdvancedConfig": StreamDiffusio... | Python | 1 |
#!/usr/bin/env python
import os
import sys
import shutil
import tempfile
import random
import time
random.seed(7)
count = 0
total = int(sys.argv[1])
inbox_path = os.path.abspath(sys.argv[2])
default_cluster_cores = 4
default_cluster_mem = 500
default_disk = 5000
default_jobs = 200
default_max_seq = 100
tmpdir = tempf... | Python | 1 |
},
local_defs: &program.local_defs,
fnc_defs: &program.fnc_defs,
params: &program.params,
exprs: &program.exprs,
};
for def in &program.defs {
infer_ctx.infer_def(*def);
}
for stmt in &program.stmts {
infer_ctx.infer_stmt(*stmt);
}
if le... | Rust | 0 |
# Problem: Coin Change II - Leetcode 518
# Problem link: https://leetcode.com/problems/coin-change-II/
# Difficulty: Medium
# Date : 11/10/2024
# Problem Understanding:
# We have an amount and a list of coins.
# We need to return the number of combinations that make up that amount.
# We can use each coin an unlimite... | Python | 1 |
expr.span,
&None);
check_boxed_closure(fcx,
expr,
ty::RegionTraitStore(region, ast::MutMutable),
decl,
... | Rust | 0 |
shape)
lr = mx.lr_scheduler.FactorScheduler(step=args.lr_sched_delay,
factor=args.lr_sched_factor)
optimizer = mx.optimizer.NAG(
learning_rate = args.lr,
wd = 0.0001,
momentum=0.95,
lr_scheduler = lr)
optim_state = optimizer.create_state(0, img)
logging.inf... | Python | 1 |
import io
import sys
import re
import base64
from threading import Thread
import PIL
import gradio as gr
import torch
from transformers import TextIteratorStreamer, StoppingCriteria, StoppingCriteriaList
from deepseek_vl2.serve.app_modules.gradio_utils import (
cancel_outputing,
delete_last_conversation,
... | Python | 1 |
# Copyright 2020 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import torch as th
import numpy as np
import matplotlib.pyplot as plt
from typing import NoReturn, Union
default_font = "Times New Roman"
default_dpi = 200
default_fmt = "jpg"
def plot_feature(feat: Union[np.ndarray, th.Ten... | Python | 1 |
traits/serde_adapters/trait.SerializerAdapter.html
// A struct separate from CDR_serializer is needed, because the neme to_writer is already taken
pub struct CDRSerializerAdapter<D, BO = LittleEndian>
where
BO: ByteOrder,
{
phantom: PhantomData<D>,
ghost: PhantomData<BO>,
}
impl<D,BO> no_key::SerializerAdapter<... | Rust | 0 |
from odmantic import Model, Reference, EmbeddedModel
from bson import datetime
from typing import Optional, List
class Profile(EmbeddedModel):
firstname: str
lastname: str
middlename: str
date_signed: datetime.datetime
age: int
occupation: str
birthday: datetime.datetime
address: s... | Python | 1 |
.conv(x) #(1,64,32,32)
out = spatial_att * inputs
out = self.conv(out) #(1,64,32,32)
return out
'''end'''
#########################################################
###2.测试ASKCResUNet
if __name__ == '__main__':
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") # 让torch判断是否... | Python | 1 |
{
/// The device was not created with the required device extensions.
#[error("required extensions are not enabled")]
MissingRequiredExtensions,
#[error("the requested format is not supported")]
UnsupportedFormat,
#[error("the buffer was created with an invalid size")]
InvalidSize,
#... | Rust | 0 |
][0] * m[0][0] + self[0][1] * m[1][0],
self[0][0] * m[0][1] + self[0][1] * m[1][1],
self[1][0] * m[0][0] + self[1][1] * m[1][0],
self[1][0] * m[0][1] + self[1][1] * m[1][1])
}
}
impl Index<usize> for Matrix2x2 {
type Output = [FloatScalar];
fn index(&self, index: usize... | Rust | 0 |
from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index'),
path('<str:room_name>/',views.room,name='room'),
] | Python | 1 |
Vec<_> = primes().take(20).collect();
assert_eq!(
first_20,
vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
);
}
}
<gh_stars>0
// Copyright 2016 <NAME>.
// Portions Copyright (c) 2016, Google Inc.
//
// Permission to use, copy, modify, and/or... | Rust | 0 |
al("negative"),
)
.finally(Expr::val("zero")),
Alias::new("polarity"),
)
.from(Glyph::Table)
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT (CASE WHEN ("glyph"."aspect" > 0) THEN 'positive' WHEN ("glyph".... | Rust | 0 |
TopicFilter` into the buffer. If the `sub` option is set to `false`, it will
/// not write the `sub_options` only topic name.
fn write_topic_filter_ref(
&mut self,
sub: bool,
topic_filter: &TopicFilter<'a>,
) -> Result<(), BufferError> {
self.write_string_ref(&topic_filter.fi... | Rust | 0 |
a = int(input())
if ( a % 3 == 0 or a % 5 == 0 ):
print("1")
else :
print("0") | Python | 1 |
import os
import openai
import streamlit as st
from llama_index.core import VectorStoreIndex
from llama_index.core import StorageContext
from llama_index.core import load_index_from_storage
PERSIST_DIR = "../../Index/VectorStoreIndex/"
# Title
st.title("💬 My Second Chatbot:")
st.title("Talking to my Documents!")
# ... | Python | 1 |
read_u16();
assert_eq!(read, u16::from_le_bytes([val[0], val[1]]));
}
}
#[test]
fn test_buffer_read_u32() {
let mut buffer = Buffer::default();
let val = 12345u64.to_le_bytes();
buffer.copy_from_slice(&val[..]);
buffer.reset_available(64);
for va... | Rust | 0 |
state.creep_memory_remove(TARGET);
debug!("failed to unload {:?}", error);
error
})
}
fn find_unload_target<'a>(state: &mut CreepState) -> Option<Reference> {
read_unload_target(state).or_else(|| {
find_container(state).unwrap_or_else(|e| {
debug!("Failed to find unl... | Rust | 0 |
from django.db import models
import requests
class MyModel(models.Model):
field1 = models.CharField(max_length=100)
field2 = models.IntegerField()
@classmethod
def insert_data(cls):
response = requests.get('https://api.example.com/data')
data = response.json()
for item in data... | Python | 1 |
}
url.query_pairs_mut().append_pair("api-version", operation_config.api_version());
if let Some(skip_token) = skip_token {
url.query_pairs_mut().append_pair("$skipToken", skip_token);
}
let req_body = bytes::Bytes::from_static(azure_core::EMPTY_BODY);
req_builder = req_builder.header(http::h... | Rust | 0 |
"""
Active learning for continuous data, using the max variance criterion to select new points
"""
import sys
sys.path.append('../')
import argparse
import numpy as np
from scipy.stats import norm
from importlib import import_module
from bayesian_benchmarks.data import get_regression_data
from bayesian_benchmarks.d... | Python | 1 |
t str1, &str2);
println!("concatenated string is {:?}", str1);
str1 = join_words_orig(str1, &str2);
println!("concatenated string is {:?}", str1);
}
fn two_words() -> (String, String) {
(format!("fellow"), format!("Rustaceans"))
}
/// Concatenate `suffix` onto the end of `prefix`.
fn join_words_orig(m... | Rust | 0 |
assert!(context.resolve_variable(&Path::single(Identifier("local"))).is_some());
}
#[test]
fn context_function() {
let mut context = SymbolContext::new();
context.inclusions.insert(Identifier("std"));
context.functions.insert(Path::single(Identifier("local")));
context.functions.insert(Path(vec![Identifier... | Rust | 0 |
if self.smooth:
draw.aalines(surf, fg, False, [p1, p2, p3])
else:
draw.lines(surf, fg, False, [p1, p2, p3])
#---------------------------------------------------------------------------
class CheckBox(CheckControl, CheckWidget):
pass
#-----------------------... | Python | 1 |
"""JWT Token 类"""
from typing import Tuple, Optional, Callable, NoReturn, Dict
from ...core.tools import web
from ...core.tools import time
from ...core.tools import encrypt
from . import const
from . import settings
class Token:
"""Token 计算与生成器"""
def __init__(self, secret: str):
"""
Toke... | Python | 1 |
wait\"
id = 20
next-id = 21
opecode = \"ScheduleCheck\"
background = \"SightBackground1\"
[scenario-group.tachie-data]
right = \"KosuzuTachie1\"
[[scenario-group]]
type = \"wait\"
id = 21
next-id = 22
opecode = \"ShowAd\"
background = \"SightBackground1\"
[[scenario-group]]
type = \"choice\"
header_text = \"... | Rust | 0 |
Discord bot.
#![feature(format_args_capture)]
#![allow(non_snake_case)]
use std::{
future::Future,
pin::Pin
};
use hartex_core::error::HarTexResult;
pub mod guildconf;
pub mod whitelist;
/// # Typealias `PendingFuture`
///
/// Represents a pending future that is yet to return.
///
/// ## Generic Paramete... | Rust | 0 |
st {
const ERROR: &'static str = "Bitcoin RPC returned an error";
pub fn new(wallet_config: WalletConfig) -> Self {
let client = Client::new(
&(wallet_config.btc_rpc_address),
Auth::UserPass(
wallet_config.btc_rpc_user.clone(),
wallet_config.btc_r... | Rust | 0 |
# -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... | Python | 1 |
from .. import Provider as GeoProvider
class Provider(GeoProvider):
# Source:
# https://latitude.to/map/pl/poland/cities/
land_coords = (
("52.22977", "21.01178", "Warszawa", "PL", "Europe/Warsaw"),
("51.75", "19.46667", "Łódź", "PL", "Europe/Warsaw"),
("50.06143", "19.93658", "K... | Python | 1 |
semver::RustcVersion;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::{sym, Span};
declare_clippy_lint! {
/// ### What it does
/// Checks for manual implementations of the non-exhaustive pattern.
///
/// ### Why is this bad?
/// U... | Rust | 0 |
0), color=text_color, axis=ax, unit=unit))
elif ax == "y":
objects.append(Text(name=row[x_col], text=row[y_col], z_scale=z_scale, location=(x_position, -.251, 5.0), color=text_color, axis=ax, unit=unit))
x_position += 1
return objects
def animated_bar(data, x_col, y_col, dynam... | Python | 1 |
def hanoi (N, start, end, mid):
if(N <= 20):
if N == 1:
print(start, end) # base case
return
else:
hanoi(N-1,start, mid, end)
print(start,end)
hanoi(N-1, mid, end, start)
else:
return
N = int(input())
print(2**N-1)
hanoi(N,... | Python | 1 |
th, args.output_path)):
# If it doesn't exist, create it
os.mkdir(os.path.join(root_path, args.output_path))
if not os.path.exists(out_path_recons):
# If it doesn't exist, create it
os.mkdir(out_path_recons)
# *********************************************************************... | Python | 1 |
pandas.read_csv(file_path)
partitions = data_shard.rdd.glom().collect()
for par in partitions:
assert len(par) <= 1
def negative(df, column_name):
df[column_name] = df[column_name] * (-1)
return df
shard2 = data_shard.transform_shard(negative, "sale_p... | Python | 1 |
rite_u16::<LittleEndian>(self.attribute_count)?;
w.write_u16::<LittleEndian>(self.id_index)?;
w.write_u16::<LittleEndian>(self.class_index)?;
w.write_u16::<LittleEndian>(self.style_index)?;
Ok(())
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ResXmlAttribute {
pub ... | Rust | 0 |
id: xous::names::GID_COM_BATTSTATS_EVENT as usize,
arg1: raw_stats[0],
arg2: raw_stats[1],
arg3: 0,
arg4: 0,
})
},
Opcode::Wf200Rev => Message::BlockingScalar(ScalarMessage {
... | Rust | 0 |
", key),
KeyErr::UnparsableValueForKey(key) =>
write!(f, "Unable to parse vaue for key '{}'", key),
KeyErr::RegexCaptureFailure(key) =>
write!(f, "Unable to capture value for key: '{}'", key),
KeyErr::InvalidBase64Value =>
write!(f, "Un... | Rust | 0 |
OfsDelta { .. } => OFS_DELTA,
RefDelta { .. } => REF_DELTA,
}
}
pub fn is_delta(&self) -> bool {
match self {
Header::OfsDelta { .. } | Header::RefDelta { .. } => true,
_ => false,
}
}
pub fn is_base(&self) -> bool {
!self.is_delta()... | Rust | 0 |
ut AlignedSlice<<Self as AlignOf>::AlignOf>) -> &mut Self {{
// This is safe because Structure{spec} is repr(transparent) around
// this same type:
unsafe {{&mut *(slice as *mut AlignedSlice<aligned_bytes::A{alignment}> as *mut Structure{spec})}}
}}
}}
impl ToOwned fo... | Rust | 0 |
etup_flags & ModuleSetupFlags.AUTOTUNE.value:
args.append(to_uint8_bytes(module_setup.autotune.mode))
args.append(to_uint8_bytes(module_setup.autotune.threshold_dBm))
if setup_flags & ModuleSetupFlags.PERANTPOWER_EX.value:
for i in range(32):
args.append(to_int8_bytes(module_setu... | Python | 1 |
// subscription.release()?;
// new_temp_lob
let clob = conn.new_temp_lob(Clob)?;
let chunk_size = clob.get_chunk_size()?;
assert_eq!(chunk_size, 8132);
// new_var
let var = conn.new_var(Varchar, Bytes, 5, 256, false, false)?;
let sib = var.get_size_in_bytes()?;
assert_eq!(sib, 1024);
... | Rust | 0 |
.expect("Unable to build `CreateContractRegistryAction`");
// Check that the non purged circuit is still working
node_a
.scabbard_client()
.expect("Unable to get second node's ScabbardClient")
.submit(
&control_service_id_a,
vec![scabbard_batch],
... | Rust | 0 |
e_str("string value")}.filter(&filter));
}
#[test]
fn test_filter_parse_cpm_eq_uri() {
let filter = &Filter::try_from("uri == `/uri/`").unwrap();
assert!(dict! {"uri" => Value::make_uri("/uri/")}.filter(&filter));
}
#[test]
fn test_filter_parse_cpm_eq_date() {
let filter = &Filter::try_from("date == 2020-... | Rust | 0 |
def encrypt(text, shift):
result = ""
for char in text:
if char.isalpha():
shift_amount = shift % 26
code = ord(char) + shift_amount
if char.islower():
if code > ord('z'):
code -= 26
result += chr(code)
e... | Python | 1 |
from . import models
def _l10n_in_reports_post_init(env):
for company in env['res.company'].search([('chart_template', '=', 'in')]):
ChartTemplate = env['account.chart.template'].with_company(company)
ChartTemplate._load_data({
'res.company': ChartTemplate._get_in_res_company_enterpris... | Python | 1 |
{
let mut stack: Vec<char> = Vec::new();
let mut valid = true;
for ch in line.chars() {
if "({[<".contains(ch) {
stack.push(ch);
}
else {
if stack.pop().unwrap() != *closing.get(&ch).unwrap() {
valid = false... | Rust | 0 |
ways)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
self.w
}
}
#[doc = "HIGH - Z JTAG reset. Indicates whether the reset was the result of HIGH-Z reset from JTAG.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, Part... | Rust | 0 |
import numpy as np
def extractNccFeature(img, Loca, half_sz=None):
if half_sz is None:
half_sz = [12, 12]
elif len(half_sz) <= 1:
half_sz = [half_sz[0], half_sz[0]]
else:
half_sz = half_sz[0:2]
half_sz = np.round(half_sz).astype(int)
half_sz[half_sz < 1] = 1
nc = img.s... | Python | 1 |
curring_application_charge_id.to_string()),
);
self.client
.post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Updates the capped amount of an active recurring application charge.
*
* This function performs a `PUT` to the `/ad... | Rust | 0 |
context.save()?;
let mut command = apps
.docker()?
.mount(Self::WORKSPACE_DOCKER_DIR, context.workspace_root())?
.mount(Self::BUILD_DOCKER_DIR, context.build_root())?
.work_dir(Self::BUILD_DOCKER_DIR)?
.run("cmake");
// Add the comma... | Rust | 0 |
'metadata': {}
}
return content
def split_lines(text):
"""Split lines on '\n' or '\r', preserving the ending (end-of-line/line-feed or carriage-return)."""
# lines_and_endings will alternate between the line content and a line separator (end-of-line or carriage-return),
# We loop over these puttin... | Python | 1 |
DEPTH_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
// VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
// VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
// VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BOUND... | Rust | 0 |
day-min_day)))
#MAE/=(60*((max_day-min_day)))
MSE_MAE_arr=np.array(MSE_MAE_arr)
print("MSE:",MSE_MAE_arr[:,0].sum()/len(MSE_MAE_arr))
print("MAE:",MSE_MAE_arr[:,1].sum()/len(MSE_MAE_arr))
#train['price'].plot(legend=True,label='TRAIN')
test['price'].plot(legend=True,label='TEST',figsize=(6,4))
test_predictions.plot(... | Python | 1 |
ssage["role"] == "user":
message["content"] = translated_user_message
break
body = {**body, "messages": messages}
return body
async def outlet(self, body: dict, user: Optional[dict] = None) -> dict:
print(f"outlet:{__name__}")
messages = body["messa... | Python | 1 |
self.switch_to_content_frame()
element = self.find_element_by_css(f'td[title="{self.semester_code}"]')
self.double_click(element)
self.switch_back_to_main_frame()
def fetch_courses(self):
"""
this function would select all the courses rows and save data needed from e... | Python | 1 |
import asyncio
import json
import logging
from aio_pika import Message, connect
from aio_pika.abc import (
AbstractChannel,
AbstractConnection,
AbstractExchange,
AbstractIncomingMessage,
AbstractQueue,
)
from .backoff import before_execution
from core.settings import RabbitMQSettings
from rpc.dc i... | Python | 1 |
😔")
await asyncio.sleep(60)
await k.delete()
try:
await query.message.reply_to_message.delete()
except:
pass
@Client.on_callback_query(filters.regex(r"^Upi"))
async def upi_payment_info(client, callback_query):
cmd = callback_query.message
b... | Python | 1 |
import uuid
from app import db
from datetime import datetime
from .base_model import BaseModel
from .place import Place
from .user import User
class Review(BaseModel):
"""Review Table Format"""
__tablename__ = 'reviews'
text = db.Column(db.Text, nullable=False)
rating = db.Column(db.Integer, nullable=... | Python | 1 |
e_deployment_target(self, operator, target):
orig_environ = os.environ
os.environ = orig_environ.copy()
self.addCleanup(setattr, os, 'environ', orig_environ)
if target is None:
if os.environ.get('MACOSX_DEPLOYMENT_TARGET'):
del os.environ['MACOSX_DEPLOYMENT_T... | Python | 1 |
list))
);
}
<reponame>Protowalker/endbasic
// EndBASIC
// Copyright 2021 <NAME>
//
// 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
... | Rust | 0 |
GlobalPriorityCreateInfoEXT.html)
///
/// Struct Extends: [`VkDeviceQueueCreateInfo`]
VkDeviceQueueGlobalPriorityCreateInfoEXT {
/// * **Values:** [`VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT`]
sType: VkStructureType,
/// * **Optional:** true
pNext: *const c_void,
globalPri... | Rust | 0 |
available fields see [wpsr](wpsr) module"]
pub type WPSR = crate::Reg<u32, _WPSR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _WPSR;
#[doc = "`read()` method returns [wpsr::R](wpsr::R) reader structure"]
impl crate::Readable for WPSR {}
#[doc = "Write Protection Status Register"]
pub mod wpsr;
#[doc = "Receive Po... | Rust | 0 |
python_file = example_dir / f"{example_name}.py"
python_file.write_text(result.python_code)
# Save Shell file
shell_file = example_dir / f"{example_name}.sh"
shell_file.write_text(result.shell_code)
# Save Requests file if curl examples were found
if result.requ... | Python | 1 |
import os
import bpy
import subprocess
def test_generate_example_gltf_files():
auto_export_operator = bpy.ops.export_scenes.auto_gltf
stored_settings = bpy.data.texts[".gltf_auto_export_settings"]
print("export settings", stored_settings.as_string())
auto_export_operator(
direct_mode = True,
... | Python | 1 |
#=========================================================================
# adapters_test
#=========================================================================
import pytest
import random
from copy import deepcopy
from fractions import gcd
from pymtl import *
from pclib.ifcs import InValRdyBundle,... | Python | 1 |
","Light"]},
"9": {"Physics": ["Motion","Force and Laws of Motion","Gravitation","Work and Energy","Sound"],
"Chemistry": ["Matter in Our Surroundings","Is Matter Around Us Pure","Atoms and Molecules","Structure of the Atom"],
"Biology": ["The Fundamental Unit of Life","Tissues","Diversity in Li... | Python | 1 |
_z1x=None, vu9s1qa77st=0.0, rdvuochctw6: yicm_dsrz6c=False, h7zkwabx3dn=''):
raise e215r89xvqo
dz4vcvrpae_ = b''
global hglpbb0at83
pass
0.0
'# swamp_constitution_multisystem -> capacitors_ticks_chairmen'
'# swamp_constitution_multisystem -> capacitors_ticks_chairmen'
from dgsr67dbwcd im... | Python | 1 |
fn: u64,
/// The userspace of address of the encrypted region.
pub(crate) uaddr: &'a [u8],
/// Indicates that this page is part of the IMI of the guest.
pub(crate) imi_page: bool,
/// Encoded page type.
pub(crate) page_type: PageType,
/// VMPL3 permission mask.
pub(crate) vmpl3_perms... | Rust | 0 |
2023"
]
for pattern in date_patterns:
match = re.search(pattern, release_date_text)
if match:
groups = match.groups()
if len(gr... | Python | 1 |
grad_sds_unconditional(
self, x, model, timesteps, scale, guidance_scale=1.0, mult=1.0
):
timesteps = torch.tensor([timesteps], dtype=torch.long, device=x.device)
with torch.no_grad():
# add noise
noise = torch.randn_like(x)
noisy_x = self.noise_schedule... | Python | 1 |
from datetime import datetime, timedelta
def analyze_heartbeat_log():
with open('hblog.txt', 'r') as file:
rows = file.readlines()
filtered_log = []
for row in rows:
if 'TSTFEED0300|7E3E|0400' in row:
filtered_log.append(row)
timestamps = []
for line in filtered_log:... | Python | 1 |
import re
from buildbot.schedulers.basic import AnyBranchScheduler
from twisted.internet import defer
from twisted.python import log
class GitHubPrScheduler(AnyBranchScheduler):
def __init__(self, *args, stable_builder_names, **kwargs):
super().__init__(*args, **kwargs)
self.stable_builder_names =... | Python | 1 |
e = 28672;
#[doc = " \\brief Restricted range of the unit of the channel based on the space given"]
pub const vx_channel_range_e_VX_CHANNEL_RANGE_RESTRICTED: vx_channel_range_e = 28673;
#[doc = " \\brief The image channel range list used by the <tt>\\ref VX_IMAGE_RANGE</tt> attribute of a <tt>\\ref vx_image</tt>."]
#[d... | Rust | 0 |
ars;
use crate::hooks;
/// Returns true if an error was printed
pub fn deploy(opt: &Options) -> Result<bool> {
// === Load configuration ===
let mut patch = None;
if opt.patch {
debug!("Reading manual patch from stdin...");
let mut patch_str = String::new();
io::stdin()
... | Rust | 0 |
]
)
else:
raise APIException("Invalid ID type!")
# Now, fetch the users, and filter out scores belonging to orphaned users
id_to_cards: Dict[UserID, List[str]] = {}
retval: List[Dict[str, Any]] = []
for userid, record in records:
... | Python | 1 |
"""
// @author: ComPleHN
// @file: tab.vue
// @time: 2025/5/29 10:44
// @description: 本文件是对于echarts的 分页组件 图表的测试
"""
# ---------------------------------------------- Tab - Tab_base ----------------------------------------------
from pyecharts import options as opts
from pyecharts.charts import Bar, Grid, Line, Pie, Tab
... | Python | 1 |
nNote: \nThe PC.15/PF.12~13/PG.0~1,5~8/PH.0~3,12~15 pin is ignored."]
pub struct DBEN2_W<'a> {
w: &'a mut W,
}
impl<'a> DBEN2_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DBEN2_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Px.n... | Rust | 0 |
voice.osc.tick(t, &input, &mut output);
// If this oscillator is playing, then add it to the output
// signal
if voice.playing {
outputs[0] += output[0];
}
}
}
}
}
#[cfg(not(test))]
fn main() {
use... | Rust | 0 |
acer(address: String) -> ProtocolResult<()> {
set_boxed_tracer(Box::new(MetricTracer::new(address)))
.map_err(|_| ConsensusError::Other("failed to init tracer ".to_string()).into())
}
<filename>src/schematic/traits/manual_scaler_test.rs
use k8s_openapi::api::{apps::v1 as apps, batch::v1 as batch};
use crate... | Rust | 0 |
t to make a hole
let drop_idx = drop as usize % input_segments.len();
let drop = &mut input_segments[drop_idx];
file.as_file_mut()
.drill_hole(drop.range.start, drop.range.end)
.expect("drilled hole");
drop.segment_type = SegmentType::Hole;
combine_segm... | Rust | 0 |
se crate::settings::AppSettings;
use crate::web_handler::start_web_server;
mod console;
mod services;
mod settings;
mod thread_helper;
mod web_handler;
mod mime_type_mapper;
fn main() {
let mut console_enabled = true;
for arg in args() {
if arg.eq("--no-console") {
console_enabled = false... | Rust | 0 |
"""
AI导演模块 - 智能剪映操控和自动化编辑。
本模块通过大模型API实现智能视频编辑决策,
自动生成剪映草稿并执行复杂的编辑操作。
"""
import json
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Optional, Union
from ..llm.base import BaseLLMClient, GenerationParams
from ..utils.logging import get_logger
from ..video.draft import JianYingDraf... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.