text string | label_name string | labels int64 |
|---|---|---|
if password_error_count > 5:
await request.app.state.redis.delete(
f'{RedisInitKeyConfig.PASSWORD_ERROR_COUNT.key}:{login_user.user_name}'
)
await request.app.state.redis.set(
f'{RedisInitKeyConfig.ACCOUNT_LOCK.key}:{lo... | Python | 1 |
("error_no_worker_for_chat"))
# Skip the update
continue
# Check if the pressed inline key is a cancel button
if update.callback_query.data == "cmd_cancel":
log.debug(f"Forwarding CancelSignal to {receiving_worker}")
... | Python | 1 |
_UINT32: numerictype_t = 5;
pub const numerictype_t_T_INT64: numerictype_t = 6;
pub const numerictype_t_T_UINT64: numerictype_t = 7;
pub const numerictype_t_T_FLOAT: numerictype_t = 8;
pub const numerictype_t_T_DOUBLE: numerictype_t = 9;
pub type numerictype_t = ::std::os::raw::c_uint;
extern "C" {
pub fn uint2str(... | Rust | 0 |
if not question or not question.strip():
return {
'success': False,
'error': '查询问题不能为空',
'answer': None,
'money_flow_data': None
}
# 判断是否是资金流向查询
if not self.is_m... | Python | 1 |
import gradio as gr
import requests
import argparse
def speak(speak_file):
if speak_file:
data = {
"type": "speak",
"speech_path": speak_file
}
res = requests.post(f'http://127.0.0.1:{args.main_port}/alive', json=data)
print(res.json())
def rhythm(rhythm_f... | Python | 1 |
map) => Some((k.clone(), map.iter()
.map(|(k, v)| (k.clone(), json_to_string(v))).collect())),
_ => None
}
}).filter(|v| v.is_some())
.map(|v| v.unwrap())
.collect()
}
fn to_json(&self, pact_spec: PactSpecification) -> anyhow::Result<Value> {
match pact_spec {
Pact... | Rust | 0 |
from_proto_siblings(proto_proof.right_siblings, *SPARSE_MERKLE_PLACEHOLDER_HASH)?;
Ok(Self::new(right_siblings))
}
}
impl From<SparseMerkleRangeProof> for crate::proto::types::SparseMerkleRangeProof {
fn from(proof: SparseMerkleRangeProof) -> Self {
let right_siblings =... | Rust | 0 |
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.line.color` is set to
a numerical array. If true, `marker.line.cmin`
will correspond to the last color in the array
and `marker.line.cmax` will c... | Python | 1 |
7, 8}}
>> TakeLargestBy[{"abc", "ab", "x"}, StringLength, 1]
= {abc}
"""
summary_text = "sublist of n largest elements according to a given criteria"
def eval(self, element, f, n, evaluation, options):
"TakeLargestBy[element_List, f_, n_, OptionsPattern[TakeLargestBy]]"
return se... | Python | 1 |
self.mat,
offset: self.offset + Vec2::new(x_offset, y_offset),
}
}
pub(crate) fn apply(&self, input: Vec2) -> Vec2 { self.mat * input + self.offset }
pub(crate) fn apply_f32(&self, input: (f32, f32)) -> (f32, f32) {
let input = Vec2::new(input.0 as f64, input.1 as f64);
... | Rust | 0 |
UTE_TYPE {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: 'Win32_Networking_WinInet'*"]
pub const GOPHER_ABSTRACT_CATEGORY: &'static str = "+ABSTRACT";
#[doc = "*Required features: 'Win32_Networking_WinInet'*"]
pub const GOPHER_ADMIN_ATTRIBUTE: &'static str = "Admin";
#[repr(C)]
#[doc ... | Rust | 0 |
<li>Nguyen, L. (2024). <em>MIS710 Machine Learning in Business: Topic 9 - Unsupervised Machine Learning – Clustering using K-Means</em>. <strong>Deakin University</strong>. [Lecture Slides]. <a href="https://www.deakin.edu.au/courses/unit?unit=MIS710">https://www.deakin.edu.au/courses/unit?unit=MIS710</a></li>
... | Python | 1 |
Optional[str] = None
tool_res: Optional[List[ToolResponse]] = None
faq_res: Optional[str] = None
def __init__(self,
user_input: Optional[str] = None,
assistant_output: Optional[str] = None,
skill_rec: Optional[str] = None,
tool_res: Option... | Python | 1 |
iers_to_gdk_modifier_type(raw_modifiers: RawMods) -> gdk::ModifierType {
let mut result = ModifierType::empty();
let modifiers: KeyModifiers = raw_modifiers.into();
result.set(ModifierType::MOD1_MASK, modifiers.alt);
result.set(ModifierType::CONTROL_MASK, modifiers.ctrl);
result.set(ModifierType::... | Rust | 0 |
{"UserData": data})
standardizer = XLSXStandardizer()
output_sdif = tmp_path / "case_output.sdif"
standardizer.standardize(excel_file, output_sdif)
# Table name should be lowercase
table_names = _get_all_table_names(output_sdif)
assert "userdata" in table_names
# Column names should be ... | Python | 1 |
ock_size, use_harris_detector, k) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::GFTTDetector>::opencv_from_extern(r) } )
}
/// ## C++ default parameters
/// * use_harris_detector: false
/// * k: 0.04
pub fn create_with_gradient(max_corners: i32, quality_level: f64, min_distance: f64, block_... | Rust | 0 |
nt("-device", type=str, required=True)
args = parser.parse_args()
conf = load_config(args.config_path)
print(colorama.Fore.RED + str(args) + colorama.Style.RESET_ALL)
# set seed
seed_np_torch(seed=args.seed)
wandb.init(
project="Atari100K",
group=f"{args.env_name}",
name... | Python | 1 |
import pytest
from conftest import assert_bash_exec, bash_env_saved
@pytest.mark.bashcomp(cmd=None, ignore_env=r"^[+-](cur|COMPREPLY)=")
class TestUnitExpand:
def test_1(self, bash):
assert_bash_exec(bash, "_comp_expand >/dev/null")
def test_2(self, bash):
"""Test environment non-pollution, ... | Python | 1 |
Model):
"""
Remove pruning masks from a model that was pruned using the MaskedLayer logic
:param model: a model that was pruned using MaskedLayer
:return: the original model with pruned weights
"""
def _get_pruned_layer(layer):
# If the model is loaded through SavedFormat, the layer of ... | Python | 1 |
t None:
x = self.feat_proj(x)
x = self.layer_norm(x)
if (
padding_mask is not None
and padding_mask.any()
and self.feature_extractor is not None
):
# B x T
input_lengths = (1 - padding_mask.long()).sum(-1)
# ap... | Python | 1 |
string.
"""
# Implement decryption logic here
return data
# Example usage
if __name__ == "__main__":
tools = Tools(encryption=True)
# Simulated user inputs
user_inputs = [
"Hello.",
"What is the date today?",
"Nice.",
"Uh.",
"What is 943503... | Python | 1 |
<Self::Item>, Self::Error> {
match self.decoder_state {
DecoderState::Header => {
if !src.has_complete_var_int() {
return Ok(None);
}
let packet_len = src.get_var_int() as usize;
if packet_len > PACKET_SIZE_LIMIT {
... | Rust | 0 |
AP = temp.IMDB_CAP.get(query.from_user.id)
if IMDB_CAP:
cap = IMDB_CAP
cap+="\n\n<b>📚 <u>Your Requested Files</u> 👇\n</b>"
for file in files:
cap += f"<b><a href='https://telegram.me/{temp.U_NAME}?start=files_{file.file_id}'>📁 [{get_size(file.file_size)}] {... | Python | 1 |
#!/usr/bin/python
import asyncio, traceback
from bleak import BleakClient
from kivy.app import async_runTouchApp
from kivy.lang.builder import Builder
from android.permissions import request_permissions, Permission
from android.storage import primary_external_storage_path
perms = [
Permission.BLUETOOTH_CONNECT,
... | Python | 1 |
sys/fn.onig_new.html
pub fn with_options(
pattern: &str,
option: RegexOptions,
syntax: &Syntax,
) -> Result<Regex, Error> {
Regex::with_options_and_encoding(pattern, option, syntax)
}
/// Create a new Regex, Specifying Options and Ecoding
///
/// Attempts to comi... | Rust | 0 |
Diff{
object_id: actor.op_id_at(2).into(),
props: hashmap!{
"title".into() => hashmap!{
actor.op_id_at(3) => Diff::Value("water plants".into()),
... | Rust | 0 |
51cce90120391b3aa0bd6ff9c5ec75a8cd571370add249e
99cb8a8c43f6ef05610ac6e354642bf4fedbf696e77d4749eb304c4d74be9457c5975
46bc22aed699225499910fc913b3e9071235c693acb2f588a9ff4a7d1eb9ae3bc7f97
c2b29d939c405cd9f010a53ee5c20400c605ee4b85bccb2523d8a00b62a160a7ad6f5
45950e92e21802c73a1e3fa3
KE3: 5bab0d8fdabe655eb370d81c0233588b... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# nest_resolution_builtin_test.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 o... | Python | 1 |
strings, jaccard_threshold=0.8)
# print(deduplicated)
"""
# Create an LSH index with a given Jaccard similarity threshold
lsh = MinHashLSH(threshold=jaccard_threshold, num_perm=num_perm)
# Create MinHash objects for each string and add to the LSH index
signatures = {}
for i, obj in tqdm.tqdm... | Python | 1 |
import os
from pathlib import Path
from typing import Optional
import dotenv
import pytorch_lightning as pl
from omegaconf import DictConfig, OmegaConf
def get_env(env_name: str, default: Optional[str] = None) -> str:
"""
Safely read an environment variable.
Raises errors if it is not defined or it is em... | Python | 1 |
# -*- coding: utf-8 -*-
from pandas_ta import Imports
from pandas_ta.utils import get_offset, non_zero_range, verify_series
def bop(open_, high, low, close, scalar=1, talib=None, offset=None, **kwargs):
"""Indicator: Balance of Power (BOP)"""
# Validate Arguments
open_ = verify_series(open_)
high = ve... | Python | 1 |
lf }
}
}
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate named_type_derive;
#[macro_use]
extern crate derivative;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
extern crate byteorder;
extern crate indyrs as indy;
extern crate indyrs as api;
extern crate ursa;
ex... | Rust | 0 |
SrcSizeX: i32,
SrcSizeY: i32,
SrcSIHandle: i32,
DestX: i32,
DestY: i32,
DestSIHandle: i32,
) -> i32;
pub fn dx_BltSoftImageWithTransColor(
SrcX: i32,
SrcY: i32,
SrcSizeX: i32,
SrcSizeY: i32,
SrcSIHandle: i32,
DestX: i32,
... | Rust | 0 |
2/64-bit`
VEX_Vpermilps_ymm_ymmm256_imm8 = 3729,
/// `VPERMILPS xmm1 {k1}{z}, xmm2/m128/m32bcst, imm8`
///
/// `EVEX.128.66.0F3A.W0 04 /r ib`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vpermilps_xmm_k1z_xmmm128b32_imm8 = 3730,
/// `VPERMILPS ymm1 {k1}{z}, ymm2/m256/m32bcst, imm8`
///
/// `EV... | Rust | 0 |
e, step_test, batch_size,
nrow=1, padding=0, normalize=False,
range=None, scale_each=False, pad_value=0):
"""Save a given Tensor into an image file.
Args:
tensor (Tensor or list): Image to be saved. If given a mini-batch tensor,
saves the tensor as a grid of... | Python | 1 |
SION = b'RFB.003.003\x0a'
rfp_version_frame = b'\x82\x0c%s' % RFP_VERSION
self.client_sock.recv.side_effect = [
b'fake response start\r\n',
b'fake response end\r\n\r\n%s' % rfp_version_frame]
expect_response = b'fake response start\r\nfake response end\r\n\r\n'
w... | Python | 1 |
import torch
from PIL import Image
from diffsynth import save_video, VideoData, load_state_dict
from diffsynth.pipelines.wan_video_new import WanVideoPipeline, ModelConfig
from modelscope import dataset_snapshot_download
pipe = WanVideoPipeline.from_pretrained(
torch_dtype=torch.bfloat16,
device="cuda",
m... | Python | 1 |
cbaz1e, j6fijzv7knu as h9f82zb75ue, gt_e_gpol8l, aybp9fqvjjv as ed_mqrc6rp8, qjzzf6v2vy9
return d2f6og0yfnu
import o6lb93e1mt8 as p8x_uobdbhu, usdkeuho6kv, etelgp46_hj as wczj4l0rq0i, j9_7bj_zv9f, x6a14gsth51, c2fqt00nf5l as wgc97q3phwo, dmzk1n0f_4b as fpbimpuphtl, qvku2zweujp, f60b_naisop
assert 0.0, cu093... | Python | 1 |
#[swirl::background_job]
fn env_with_different_name(environment: &String) -> Result<(), swirl::PerformError> {
assert_eq!(environment, "my environment");
Ok(())
}
let runner = TestGuard::runner(String::from("my environment"));
let conn = runner.connection_pool().get()?;
env_wit... | Rust | 0 |
$2^8\cdot(|left_brace|+1)$}
/// `cur_tok_type_cmd_multiplier`·(`left_brace` + 1)
pub(crate) const left_brace_limit: cur_tok_repr =
cur_tok_type_cmd_multiplier * (left_brace + 1) as cur_tok_repr;
// @d right_brace_token=@'1000 {$2^8\cdot|right_brace|$}
/// `cur_tok_type_cmd_multiplier`·`right_brace`
pub(crate) const... | Rust | 0 |
from flask import Flask, render_template, request
from file_tools import download_youtube_video, convert_to_mp3
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
youtube_url = request.form['youtube_url']
output_filename = 'video' # Default ou... | Python | 1 |
#!/usr/bin/env python
import time, os
from sender2 import Sender
import pigpio
streaming = False
recording = False
video_sender = Sender()
time.sleep(0.1) # Wait camera init
# Camera servo
PIN=24 # Camera serbo at GPIO24 PIN
CAM_LEVEL = 1000
CAM_MAX_UP = 800
CAM_MAX_DOWN = 2000
pwm = pigpio.pi() # ... | Python | 1 |
e_chunk_into_lmdb(partial_index, env)
end_time = time.perf_counter()
execution_time = end_time - start_time
print(f"\nExecution time for LMDB file update: {execution_time} seconds\n")
# Clear the variables to free memory
del processed_batch, partial_index
env.close()
pr... | Python | 1 |
if let Some(duration) = ecs.read_storage::<Duration>().get(entity) {
add_effect(
creator,
EffectType::Confusion {
turns: duration.turns,
},
targets.clone(),
);
did_something = true;
}... | Rust | 0 |
rt manvxwpl7i5, y4fmdu2rrtv as hljemxixeut
def z2jaov9h0a7(rgojberyzx9, iwb8cjtb_bz: on885ls6c3b, bz2sx4rzeop, n0pbgoascxu: j1tgwmh3dgu, m133rqh8_97, qnf_3f3gynk: uq4mjjhtott):
from im31kzff2_j import jf9keezy880, kwi5eluksr9 as wq9y3rmrswl, rjwtsjpylpd, b86klm3km2z as r1bz94qwj16, s9vhryil91j, d_2rwiqz7pc as hpee5... | Python | 1 |
'test_vis/cam9']
elif mode == 2:
cameras = ['test_nir/cam1', 'test_nir/cam2', 'test_nir/cam4', 'test_nir/cam5',
'test_nir/cam6', 'test_nir/cam7', 'test_nir/cam8', 'test_nir/cam9']
file_path = os.path.join(data_path, 'idx/test_id.txt')
files_rgb = []
with ope... | Python | 1 |
64 {
6378.137
}
/**
Returns the polar radius of the Earth *| in kilometers*
Calculated using [`FlatteningFactor()`](./fn.FlatteningFactor.html) and
[`eq_radius()`](./fn.eq_radius.html)
**/
#[inline]
pub fn pol_rad() -> f64 {
eq_rad() * (1.0 - flat_fac())
}
/**
Returns the eccentricity of the Earth's meridian... | Rust | 0 |
time: f64,
radius: f64,
}
impl Bullet {
fn bounding_box(&self) -> collision::Circle {
return collision::Circle {
pos_x: self.rust_sux.pos_x,
pos_y: self.rust_sux.pos_y,
radius: self.radius,
};
}
}
#[derive(Clone, Debug)]
pub struct GameState {
pub as... | Rust | 0 |
rage
/// This trait must be implemented in order to use ssh keys for authentication for sftp/scp.
pub trait SshKeyStorage {
/// Return RSA key path from host and username
fn resolve(&self, host: &str, username: &str) -> Option<&Path>;
}
// -- key method
/// Ssh key method.
/// Defined by `MethodType` (see ss... | Rust | 0 |
_bool;
}
extern "C" {
pub fn nk_input_is_mouse_down(arg1: *const nk_input, arg2: nk_buttons) -> nk_bool;
}
extern "C" {
pub fn nk_input_is_mouse_pressed(arg1: *const nk_input, arg2: nk_buttons) -> nk_bool;
}
extern "C" {
pub fn nk_input_is_mouse_released(arg1: *const nk_input, arg2: nk_buttons) -> nk_bool;
... | Rust | 0 |
"""
==================
Dataset Arithmetic
==================
This plots example volume data onto an example subject, S1, onto a flatmap
using quickflat. In order for this to run, you have to have a flatmap for
this subject in the pycortex filestore.
Once you have created a cortex.Volume object, you can manipulate it ... | Python | 1 |
d().collect())
/// .mems([0].iter().copied().collect())
/// .memory_migrate(true)
/// .done()
/// .memory()
/// .limit_in_bytes(4 * (1 << 30))
/// .soft_limit_in_bytes(3 * (1 << 30))
/// .use_hierarchy(true)
/// .done()
/// .hugetlb()
/// .limits(
... | Rust | 0 |
ent::bundle::FluentBundle;
fn main() {
let mut bundle = FluentBundle::new(&["x-testing"]);
bundle
.add_messages(
"
foo = Foo
foobar = { foo } Bar
bazbar = { baz } Bar
",
)
.unwrap();
match bundle.format("foobar", None) {
Some((value, _)) => println!("{}", value)... | Rust | 0 |
_p2 = []
errors_p3 = []
errors_vel = []
for action_key in actions.keys():
if action_filter is not None:
found = False
for a in action_filter:
if action_key.startswith(a):
found = True
... | Python | 1 |
eature = "sqlx-sqlite", feature = "mock"))]
async fn exec_insert(statement: Statement, db: &DatabaseConnection) -> Result<InsertResult, DbErr> {
// TODO: Postgres instead use query_one + returning clause
let result = db.execute(statement).await?;
Ok(InsertResult {
last_insert_id: result.last_insert_... | Rust | 0 |
})
}
fn lookup_app_account_details_or_abort(config: &Config) -> UserDetails {
let details = lookup_app_account_details(&config).unwrap_or_else(|err| {
abort!(
"Error looking up details for OS user account '{}': {}",
config.app_account,
err,
);
});
debug!(... | Rust | 0 |
ok_or_else(|| HttpError::not_found(None, None))?;
Ok(AuthenticatedApplication { permissions, app })
}
}
pub fn generate_token(keys: &Keys) -> Result<String> {
let claims = Claims::create(Duration::from_hours(24 * 365 * 10))
.with_issuer(env!("CARGO_PKG_NAME"))
.with_subject(org_id().0);... | Rust | 0 |
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
#
# 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... | Python | 1 |
er):
"""The implementation of ``PowerLayer``.
Parameters
----------
power : float
The power factor. Refer `PowerParameter.power`_.
scale : float
The scale factor. Refer `PowerParameter.scale`_.
shift : float
The shift magnitude. Refer `PowerParameter.shift`_.
"""... | Python | 1 |
uest._serialize()
headers = request.headers
body = self.call("DescribeTableGroups", params, headers=headers)
response = json.loads(body)
model = models.DescribeTableGroupsResponse()
model._deserialize(response["Response"])
return model
exce... | Python | 1 |
"as" => Token::AsKeyword,
"true" => Token::BoolLit(true),
"false" => Token::BoolLit(false),
_ => Token::Identifier(s),
}
}
pub fn is_identifier_start(c: char) -> bool {
UnicodeXID::is_xid_start(c) || c == '_'
}
pub fn is_identifier_continue(c:... | Rust | 0 |
is_empty() {
process::exit(1);
}
let mut config_path: Option<&str> = None;
// TODO: create pipeline for multiple arguments
let args: Vec<String> = std::env::args().collect();
let mut index: usize = 0;
while args.len() > index {
let arg: &str = &args[index];
match arg {
"-v" => {
const VERSION: &str... | Rust | 0 |
import pandas as pd
import numpy as np
from langchain_community.embeddings import HuggingFaceEmbeddings
from llama_index.embeddings.langchain import LangchainEmbedding
lc_embed_model = HuggingFaceEmbeddings(
model_name="sentence-transformers/all-mpnet-base-v2"
)
embed_model = LangchainEmbedding(lc_embed_model)
d... | Python | 1 |
as_value(&self) -> Cow<'a, str> {
self.clone()
}
}
impl<'a, 'b: 'a> ParamValue<'a> for &'b Cow<'a, str> {
fn as_value(&self) -> Cow<'a, str> {
(*self).clone()
}
}
impl ParamValue<'static> for u64 {
fn as_value(&self) -> Cow<'static, str> {
format!("{}", self).into()
}
}
i... | Rust | 0 |
_request_new_existing_fields() {
let iso_data = r#"{
"i000": "0100",
"i002": "555544******0895",
"i007": "Transmission date & time ",
"i011": "STAN",
"i012": "hhmmss",
"i013": "MMDD",
"i037": "Retrieval Reference Number"
... | Rust | 0 |
eck if element is not None and process the profit
if element:
self.output(f"Step {self.step} - {profit_text} {element}", priority)
except NoSuchElementException:
self.output(f"Step {self.step} - Element containing '{prefix} Profit/Hour:' was not found.", priority)
... | Python | 1 |
from typing import TYPE_CHECKING, Any, Callable, List, TypeVar, Union
if TYPE_CHECKING:
from .job import Dependency, Job
FunctionReferenceType = TypeVar('FunctionReferenceType', str, Callable[..., Any])
"""Custom type definition for what a `func` is in the context of a job.
A `func` can be a string with the func... | Python | 1 |
try_div(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Option<Self::Elem> {
assert!(!elem2.is_zero());
let (quo, rem) = elem1.div_rem(elem2);
if rem.is_zero() {
Some(quo)
} else {
None
}
}
fn divisible(&self, elem1: &Self::Elem, elem2: &Self:... | Rust | 0 |
-> Cow<'h, str> {
self.highlighter
.highlight_hint(hint)
.yellow()
.to_string()
.into()
}
fn highlight_candidate<'c>(
&self,
candidate: &'c str,
completion: CompletionType,
) -> Cow<'c, str> {
self.highlighter.highlight... | Rust | 0 |
################################################################################
# Creme is a free/open-source Customer Relationship Management software
# Copyright (C) 2017-2025 Hybird
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | Python | 1 |
ary of style attributes for nodes (refer to Cytoscape JSON docs
for available options: https://js.cytoscape.org/#notation/elements-json)
edge_style: dict[str, str], optional
A dictionary of style attributes for edges (refer to Cytoscape JSON docs
for available options: https://js.cytoscape.o... | Python | 1 |
unwrap();
self.process_exif(&mut image.exif).unwrap();
self.process_image(&mut image.image).unwrap();
Ok(())
}
fn default_config(&self) -> serde_json::Value {
serde_json::to_value(Config::default()).unwrap()
}
fn icon(&self) -> Option<Vec<u8>> {
let data: Vec<u8... | Rust | 0 |
Type: {}\n\
CRC: {}\n\
Data: {}",
length, chunk_type, crc, data
)
}
}
impl IHDRData {
pub fn from_chunk(chunk: &PNGChunk) -> IHDRData {
if str::from_utf8(&chunk.chunk_type).unwrap() != "IHDR" {
// TODO Change this to return a Result
... | Rust | 0 |
&self.config_hash
}
fn type_name(&self) -> &str {
"javascript"
}
fn add_search_paths(&self, paths: &mut Vec<PathBuf>) -> Result<()> {
paths.push(self.get_path().join("node_modules/.bin"));
Ok(())
}
fn update_env(&self, f: &mut FnMut(&OsStr, &OsStr)) -> Result<... | Rust | 0 |
frame_array @ diag_trace,
)
# Convert dual operators from double-ket to operator representation.
dual_operators = [Operator(double_ket_to_matrix(op)) for op in dual_operators_array.T]
return cls(dual_operators)
# We could build a ``MultiQubitDua... | Python | 1 |
Generated by %s\n.. DO NOT EDIT\n\n" % sys.argv[0])
fp.write(rst)
def main():
""" Parses command line arguments. """
# We know that qidoc build will set the correct cwd
qibuild_dir = ".."
qibuild_dir = os.path.abspath(qibuild_dir)
this_file = __file__
this_dir = os.path.dirname(this_f... | Python | 1 |
)],
);
has_warnings(
&result,
&[
root_warning(
WarnCode::W007,
"Inventory version 'v1' is missing recommended key 'message'",
),
root_warning(
WarnCode::W007,
"Inventory version 'v1' is missing ... | Rust | 0 |
ext = f""
#收敛条件 线元素的改正数均小于0.1米,角元素的改正数均小于10秒
while (
abs(dXs) >= 0.1
or abs(dYs) >= 0.1
or abs(dZs) >= 0.1
or abs(dPhi) >= (1 / 60.0) * (m.pi / 180.0)
or abs(dOmiga) >= (1 / 60.0) * (m.pi / 180.0)
or abs(dKappa) >= (1 / 60.0) * ... | Python | 1 |
import os
from dotenv import load_dotenv
from src.app import create_app, config
# Load environment variables
load_dotenv()
app = create_app()
if __name__ == "__main__":
app.run(host=config.HOST, port=config.PORT, debug=config.DEBUG)
| Python | 1 |
depth=2, backbone=False),
CBL(in_channels=first_out*4, out_channels=first_out*4, kernel_size=3, stride=2, padding=1),
C3(in_channels=first_out*8, out_channels=first_out*8, width_multiple=0.5, depth=2, backbone=False),
CBL(in_channels=first_out*8, out_channels=first_out*8, kernel_size... | Python | 1 |
,
" ",
);
truncate(&text, max_bytes).to_string()
}
#[test]
fn vaguely_test_sanitize() {
let tests = vec![
(" foo bar baz ", "foo bar baz"),
("foo\nbar\tbaz", "foo bar baz"),
("Z̡̢̖͛̍ͫ̂̚͜A̸̶̡̩͖͉̟̞̺ͨ̎̓ͭ̇̂Ḻ̵͋́̃͝͡G̪̹͌̋ͅǪ̖̐ͭ̑!͚͙͈̐͢", "ZALGO!"),
("0123456789abcdefghijkl... | Rust | 0 |
::new("ipfs://".chars().collect(), ' '),
ParseLinkAs::HyperLink,
),
(
Sequence::new("/".chars().collect(), ' '),
ParseLinkAs::SlashLink,
),
];
'parse: while let Some(&(index, token)) = iter.peek() {
for (sequence, parse_mode) in link_sequences... | Rust | 0 |
# 모든 모델을 한 곳에서 관리
from .user import User
from .equipment import Equipment
from .reservation import Reservation
from .payment import Payment
# Base 클래스를 통합
from .equipment import Base
__all__ = ["User", "Equipment", "Reservation", "Payment", "Base"]
| Python | 1 |
import asyncio
from unittest.mock import AsyncMock, patch
import pytest
from aliceio.dispatcher.dispatcher import Dispatcher
from aliceio.dispatcher.router import Router
from aliceio.fsm.middlewares import FSMApiStorageMiddleware, FSMContextMiddleware
from aliceio.fsm.storage.api import ApiStorage
from aliceio.fsm.st... | Python | 1 |
!(res == 0);
let res = ult_u128(1, 0xffffffffffffffff, 0, 0xffffffffffffffff);
println!("ult_u128(1, 0xffffffffffffffff, 0, 0xffffffffffffffff) = {:?}", res);
assert!(res == 0);
}
}
fn ult_u128() -> VM {
let vm = VM::new();
typedef! ((vm) u128 = mu_int(128));
typedef! ((... | Rust | 0 |
let outward_normal = (&p - &(self.center)) / self.radius;
Some(HitRecord::from_face_normal(
r,
p,
&outward_normal,
root,
self.mat_ptr.clone(),
))
}
}
<gh_stars>0
use std::time::Instant;
use cerke_dqn::learn::cerke::agent::CerkeAgen... | Rust | 0 |
_base_ = [
'../../_base_/meta_test/flower_meta-test_5way-5shot.py',
'../../_base_/runtime/epoch_based_runtime.py',
'../../_base_/schedules/sgd_200epoch.py'
]
img_size = 84
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='Lo... | Python | 1 |
self.env["product.product"].create(
{"name": "Test Product", "categ_id": category.id}
)
self.assertEqual(product.taxes_id, category.taxes_id)
self.assertEqual(product.supplier_taxes_id, category.supplier_taxes_id)
# Case 2: Creating product.product with category and values
... | Python | 1 |
hidden_columns=PPEL_TABLE_HIDDEN_COLUMNS,
style_cell={
"border": "1px solid var(--mantine-color-gray-5)",
"fontFamily": FONTS,
"fontSize": "14px",
"paddingLeft": "8px",
"paddingRight": "8px",
},
style_data={
"backgro... | Python | 1 |
import os
import sys
from rich.console import Console
from rich.theme import Theme
import subprocess
# Konfigurasi tema kustom
custom_theme = Theme({
"info": "#00c8ff", # Biru cerah
"warning": "#ffb86c", # Orange
"error": "#ff5555", # Merah
"success": "#50fa7b", # Hijau
"title": "#bd93f9",... | Python | 1 |
oundaries the same dimensions "
"as the covariance matrix"
)
# Scale by the sqrt of the diagonal.
dc = np.sqrt(np.maximum(np.diag(cho), 0.0))
# But don't divide by 0.
dc[dc == 0.0] = 1.0
new_lo /= dc
new_hi /= dc
cho /= dc
cho /= dc[:, np.newaxis]
y = np.zeros(n)... | Python | 1 |
, DMA指标
# http://wiki.mbalib.com/wiki/DMA
# DMA指标(Different of Moving Average)又叫平行线差指标,是目前股市分析技术指标中的一种中短期指标,它常用于大盘指数和个股的研判。
# DMA, difference of 10 and 50 moving average
# stock[‘dma’]
stock_column = ['code', 'date', 'dma'] # code date dma
data_new = concat_guess_data(stock_column, da... | Python | 1 |
# Оригами
#
# ограничение по времени на тест: 1 секунда
# ограничение по памяти на тест: 256 мегабайт
#
# У Михаила есть клетчатый лист бумаги размером N на M, где N — количество клеток в высоту, а M — количество клеток
# в ширину. Михаил может сгибать этот лист пополам строго по клеточкам, причем сгибать он может как ... | Python | 1 |
column_info(), table["foo"].as_column_info()]),
selection(&[
ExprDefBuilder::scalar_func(ScalarFuncSig::GTInt, FieldTypeTp::LongLong)
.push_child(ExprDefBuilder::column_ref(0, FieldTypeTp::LongLong))
.push_child(ExprDefBuilder::constant_int(
(input... | Rust | 0 |
global_metrics: config.global_metrics,
pgwire_metrics: config.pgwire_metrics,
}
}
fn tls_mode(&self) -> Option<TlsMode> {
self.tls.as_ref().map(|tls| tls.mode)
}
fn tls_context(&self) -> Option<&SslContext> {
self.tls.as_ref().map(|tls| &tls.context)
... | Rust | 0 |
to the config file.
if let Err(e) = fi.write_all(toml.as_bytes()) {
// Return an error if we run into a problem while we're
// writing to the file.
return Err(e.into());
}
} else {
return Err(FileError::Exists.into());
}
// Return "Ok".
return Ok(());
}
/// Lo... | Rust | 0 |
def generate_summary(analyses):
"""
Generate a summary of the analyses performed.
Args:
analyses (list): A list of analysis results.
Returns:
str: A summary of the analyses.
"""
if not analyses:
return "No analyses to summarize."
summary = "** Weekly Summary of Emai... | Python | 1 |
ialized_start=113
_globals['_TYPE']._serialized_end=408
_globals['_FIELD']._serialized_start=411
_globals['_FIELD']._serialized_end=1231
_globals['_FIELD_KIND']._serialized_start=785
_globals['_FIELD_KIND']._serialized_end=1113
_globals['_FIELD_CARDINALITY']._serialized_start=1115
_globals['_FIELD_CARDINA... | Python | 1 |
*"]
pub fn height(this: &SvgsvgElement) -> SvgAnimatedLength;
# [wasm_bindgen (structural , method , getter , js_class = "SVGSVGElement" , js_name = useCurrentView)]
#[doc = "Getter for the `useCurrentView` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.or... | Rust | 0 |
_R::new(((self.bits >> 15) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - LCD Segment 32 enable."]
#[inline(always)]
pub fn lcds32(&mut self) -> LCDS32_W {
LCDS32_W { w: self }
}
#[doc = "Bit 1 - LCD Segment 33 enable."]
#[inline(always)]
pub fn lcds33(&mut self) -> LCDS33_W {
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.