text string | label_name string | labels int64 |
|---|---|---|
/// Creates a new `SpawnEssentialTaskHandle`.
pub fn new(
essential_failed_tx: TracingUnboundedSender<()>,
spawn_task_handle: SpawnTaskHandle,
) -> SpawnEssentialTaskHandle {
SpawnEssentialTaskHandle {
essential_failed_tx,
inner: spawn_task_handle,
}
}
/// Spawns the given task with the given name.
... | Rust | 0 |
str("--textcols");
let foreground = args.get_bool("--foreground");
if id_len == Some(0) {
id_len = Some(1);
}
if args.get_bool("--list-pal") {
println!(concat!(
"List of palette names their color mappings, which are in the form\n",
"<symbol>:<colors>. Colors are... | Rust | 0 |
await?;
let ret = serde_json::from_str(&contents)?;
Ok(ret)
}
}
impl Cacheable for DownloadLink {}
impl Cacheable for FileDetails {}
impl Cacheable for FileList {}
impl Cacheable for GameInfo {}
impl Cacheable for Md5Search {}
impl Cacheable for ModInfo {}
#[cfg(test)]
mod tests {
use crate::a... | Rust | 0 |
;
Ok(base64::encode(&encrypted_data))
}
pub fn verify(&self, data: &str, signed_data: &str) -> TardisResult<bool> {
let signed_data = base64::decode(signed_data)?;
let result = self.pub_key.verify(
rsa::PaddingScheme::PKCS1v15Sign { hash: None },
TardisFuns::cryp... | Rust | 0 |
# If that l10n module isn't installed, it means the company doesn't use any tax report for that country
# and thus hasn't nor need those tax report tag
is_coa_module_installed = self.env['account.chart.template']._get_chart_template_mapping()[chart_template]['installed']
if not is_coa_modu... | Python | 1 |
import pandas as pd
from src.config import load_config
import matplotlib.pyplot as plt
import seaborn as sns
import os
from collections import Counter
def load_dataset_splits(config):
train = pd.read_csv(config['dataset']['train_path'])
val = pd.read_csv(config['dataset']['val_path'])
test = pd.read_csv(co... | Python | 1 |
CHATBONE_ASSISTANT_APP_PREFIX = "<Chatbone_Assistant>"
CHATBONE_ASSISTANT_APP_POSTFIX = "<Chatbone_Assistant>"
def _make_deployment_name_from_real_import_path(real_import_path :str):
return f"{CHATBONE_ASSISTANT_APP_PREFIX}{real_import_path}{CHATBONE_ASSISTANT_APP_POSTFIX}"
| Python | 1 |
]) + EPSL
record.shigh = float(items[2]) + EPSL
record.slow = float(items[3]) + EPSL
record.sclose = float(items[4]) + EPSL
record.svolume = float(items[5]) + EPSL
record.samount = float(items[6]) + EPSL
record.sholding = float(items[7]) + EPSL
except Exception as ei... | Python | 1 |
from enum import Enum
class KeyboardButtonPollTypeType(str, Enum):
"""
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
Source: https://core.telegram.org/bots/api#keyboardbuttonpolltype
"""
QUIZ = "quiz"
REGULAR = "regul... | Python | 1 |
t Handler {
pub effect: Effect,
pub handler: TypedHir,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Expr {
Literal(Literal),
Match {
input: Box<TypedHir>,
cases: Vec<MatchCase>,
},
Let {
definition: Box<TypedHir>,
body: Box<TypedHir>,
},
Perform(Box<... | Rust | 0 |
from django.db import models
# Create your models here.
from django.db import models
class Engine(models.Model):
name = models.CharField(max_length=100) # Название двигателя
thrust = models.FloatField() # Тяга двигателя в Ньютонах (единица силы)
def __str__(self):
return self.name # Отображени... | Python | 1 |
cross_at = generic::data_const_unsafe::<PocDataHeader>(poc_b).split_at;
assert!(!0 != cross_at);
generic::data_mut_unsafe::<PocDataHeader>(poc_b).split_at = !0;
let poc_b = unsafe { PocData::new(magic, std::mem::transmute(poc_b.as_ptr())) };
if poc_b.header().magic != magic {
panic!("[BFL] spli... | Rust | 0 |
(step.to_f64());
} else {
textbox = textbox.speed(0);
}
let res = ui.add(textbox);
if res.drag_released() || res.lost_focus() {
Some(super::into_fragment(self.value))
} else {
if... | Rust | 0 |
21: "Headbutt",
// 24: "ZenHeadbutt",
27: "Amnesia",
// 30: "Surf",
// 33: "SlackOff",
36: "Psychic",
// 39: "PsychUp",
// 42: "RainDance",
// 45: "HealPulse",
],
});
... | Rust | 0 |
s2.output_vars]))
if symbolic_init or (not non_deterministic):
states = hts.state_vars.intersection(hts2.state_vars)
else:
states = []
eqinputs = TRUE()
eqoutputs = TRUE()
eqstates = TRUE()
for inp in inputs:
eqinputs = And(eqinputs,... | Python | 1 |
t round.
pub const ROUND_LATEST: u64 = u64::max_value();
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct SubmitTxRequest {
pub runtime_id: RuntimeId,
#[serde(with = "serde_bytes")]
pub data: Vec<u8>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GetBlockRequest {
pub runtime_... | Rust | 0 |
under the mouse
fn get_names_under_mouse(mouse: Mouse, objects: &[Object], fov_map: &FovMap) -> String {
let (x, y) = (mouse.cx as i32, mouse.cy as i32);
// create a list with the names of all objects at the mouse's coordinates and in FOV
let names = objects
.iter()
.filter(|obj| obj.pos()... | Rust | 0 |
experts.append(MCPMandatoryExpertAgent(self.graph.llm_manager, tavily_config))
# Bing搜索专家
bing_tools = [t for t in all_tools if 'bing' in t.name.lower()]
if bing_tools:
bing_config = {
"agent_id": "bing_search_expert",
... | Python | 1 |
ket2, &mut msgs).unwrap();
assert_eq!(n, packet2.len());
assert_eq!(msgs.len(), 1);
assert_eq!(
msgs[0],
ProtoMessage::PartialComplete('D', packet2.len() - 1)
);
}
#[test]
fn it_can_parse_a_complete_msg() {
// This is a data row message with a... | Rust | 0 |
recipient_name: Recipient name (optional)
po_number: Purchase order number (optional)
urgent: Mark email as urgent/high priority (optional)
Returns:
String indicating success or error message
"""
try:
# Validate required inputs
... | Python | 1 |
&window,
emulator,
opt.graphics_api,
opt.power_adapter,
#[cfg(feature = "gilrs")]
gamepad_events,
opt.start_paused,
));
// Handle window events
event_loop.run(move |event, _, control_flow| match event {
Event::RedrawRequested(_) => match state.re... | Rust | 0 |
NAME: c_int = 0;
pub const GEN_EMAIL: c_int = 1;
pub const GEN_DNS: c_int = 2;
pub const GEN_X400: c_int = 3;
pub const GEN_DIRNAME: c_int = 4;
pub const GEN_EDIPARTY: c_int = 5;
pub const GEN_URI: c_int = 6;
pub const GEN_IPADD: c_int = 7;
pub const GEN_RID: c_int = 8;
#[repr(C)]
pub struct GENERAL_NAME {
pub typ... | Rust | 0 |
});
}
mem::transmute(labs)
}
// #[inline]
// unsafe fn clamp(r: __m256, g: __m256, b: __m256) -> (__m256, __m256, __m256) {
// let max = _mm256_set1_ps(1.0);
// let min = _mm256_set1_ps(0.0);
// let r = _mm256_max_ps(_mm256_min_ps(r, max), min);
// let g = _mm256_max_ps(_mm256_min_ps(g, max), ... | Rust | 0 |
hour: Hours::H24(1),
minute: 60
},
A2M::HoursAndMinutesMatch
);
}
macro_rules! _set_values_test {
($name:ident, $method:ident, $create_method:ident, $destroy_method:ident, $transactions:expr, $( $value:expr ),+) => {
#[test]
fn $name() {
let trans = $t... | Rust | 0 |
#!/usr/bin/env python
"""
Extract every '#### WORD: <term>' block from
data/storytelling/appreciation_vocab.md into JSON-Lines.
Output -> data/clean_chunks/vocab/appreciation.jsonl
"""
from pathlib import Path
import json
import re
SRC = Path("data/storytelling/appreciation_vocab.md")
DEST = Path("data/clean_chunks/... | Python | 1 |
l in board.iter() {
for c in l.iter() {
print!(
"{} ",
if *c == 0 {
".".to_string()
} else {
c.to_string()
}
);
}
println!("");
}
println!("");
}
pub fn show(... | Rust | 0 |
self.modifier == KeyModifier::NONE {
self.modifier = KeyModifier::ALT;
return self;
}
self.modifier = self.modifier | KeyModifier::ALT;
return self
} else {
self.modifier = self.modifier - KeyModifier::ALT;
return self... | Rust | 0 |
pub(in super::super) fn check_lit(
&self,
lit: &hir::Lit,
expected: Expectation<'tcx>,
) -> Ty<'tcx> {
let tcx = self.tcx;
match lit.node {
ast::LitKind::Str(..) => tcx.mk_static_str(),
ast::LitKind::ByteStr(ref v) => {
tcx.mk_imm_ref(... | Rust | 0 |
"""
References:
* `Foundation 6 Callout <https://get.foundation/sites/docs/callout.html>`_;
""" # noqa: E501
from crispy_forms import layout as crispy_forms_layout
__all__ = [
'Layout', 'UneditableField',
'HTML', 'Div',
'Callout',
]
class Layout(crispy_forms_layout.Layout):
pass
class Unedi... | Python | 1 |
_slice(&[model_properties]));
render_pass.draw_indexed(0..model.indices.len() as u32, 0, 0..1);
}
_ => {}
};
}
drop(render_pass);
... | Rust | 0 |
stlingType::QueenSide)),
_ => Err(ChessError{
msg: format!("unknown pawn promotion type: {}. Only QRKB are allowed.", s),
kind: ErrorKind::IllegalFormat
}),
}
}
}
impl fmt::Display for MoveType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::R... | Rust | 0 |
NFINITY, -1.0),
n2i(3.0, f64::INFINITY)
);
assert_eq2!(
n2i(f64::NEG_INFINITY, -3.0) * n2i(f64::NEG_INFINITY, 3.0),
I::ENTIRE
);
assert_eq2!(
n2i(f64::NEG_INFINITY, -3.0) * n2i(-5.0, f64::INFINITY),
I::ENTIRE
);
assert_eq2!(
n2i(f64::NEG_INFINITY, ... | Rust | 0 |
m, Debug, PartialEq, Clone)]
struct S<F> {
f: F,
}
let s = S { f: 1 };
let rec = Value::Record(
vec![Attr::of("S")],
vec![Item::Slot(Value::text("f"), Value::Int32Value(1))],
);
assert_eq!(s.as_value(), rec);
assert_eq!(S::try_from_value(&rec), Ok(s.clone()));
as... | Rust | 0 |
License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impl... | Rust | 0 |
APH_NODE_TYPE_MEMCPY = 1,
CU_GRAPH_NODE_TYPE_MEMSET = 2,
CU_GRAPH_NODE_TYPE_HOST = 3,
CU_GRAPH_NODE_TYPE_GRAPH = 4,
CU_GRAPH_NODE_TYPE_EMPTY = 5,
CU_GRAPH_NODE_TYPE_COUNT = 6,
}
pub use self::CUgraphNodeType_enum as CUgraphNodeType;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Part... | Rust | 0 |
import subprocess
import re
import serial
import setup_adb_wireless as setup
import threading
SERIAL_PORT = "/dev/tty.usbmodem143101" # Change this to match your Arduino's port (e.g., "/dev/ttyUSB0" on Linux)
import time
BAUD_RATE = 9600
running = True
# try:
# ser = serial.Serial(SERIAL_PORT, BAUD_RATE, timeo... | Python | 1 |
seen[sk][path] = lseen
if prefix not in lseen:
self._helper.raise_issue(self._helper.build_issue(
sigid='ios-detect-libs',
cvss=self._cvss_info,
title='detected library{}'.format(' ref' if ref else ''),
info0=prefix,
... | Python | 1 |
_uint,
) -> *mut ::CMS_ContentInfo;
#[cfg(ossl101)]
pub fn CMS_encrypt(
certs: *mut stack_st_X509,
data: *mut ::BIO,
cipher: *const EVP_CIPHER,
flags: c_uint,
) -> *mut ::CMS_ContentInfo;
#[cfg(ossl101)]
pub fn CMS_decrypt(
cms: *mut ::CMS_ContentInfo,
... | Rust | 0 |
"""empty message
Revision ID: 8dfa1ecb155d
Revises: 0de71d2fd9ce
Create Date: 2024-09-28 14:20:56.547433
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8dfa1ecb155d'
down_revision = '0de71d2fd9ce'
branch_labels = None
depends_on = None
def upgrade():
# ... | Python | 1 |
Controller
#[structopt(short = "c", long = "sc", value_name = "host:port")]
sc: Option<String>,
///Profile name
#[structopt(short = "P", long = "profile")]
pub profile: Option<String>,
/// Output
#[structopt(
short = "O",
long = "output",
value_name = "type",
... | Rust | 0 |
os.mkdir(self.captureDir)
def startLive(self, index):
""" 实时预览图片 """
self.camera = cv.VideoCapture(index)
# 打开相机
if self.camera.isOpened():
self.camera.set(cv.CAP_PROP_FRAME_WIDTH, 640)
self.camera.set(cv.CAP_PROP_FRAME_HEIGHT, 480)
expos... | Python | 1 |
&Record,
cigarpos_list: &Vec<CigarPos>,
vars: Vec<Var>,
ref_seq: &Vec<char>,
target_names: &Vec<String>,
extract_params: ExtractFragmentParameters,
align_params: AlignmentParameters,
) -> Result<Option<Fragment>> {
// TODO assert that every single variant in vars is on the same chromosome
... | Rust | 0 |
PtDebugPrint("grsnDownElevator: finished coming out of elevator")
cam = ptCamera()
cam.enableFirstPersonOverride()
WellTopDefaultCam.value.pushCamera(avatarInElevator.getKey())
upElevatorTopCloseAnim.animation.play()
... | Python | 1 |
_offset', True):
if getattr(self, 'ref_offset_noise', 0.0) > 0.0:
# If ref_offset_noise > 0, add some noise to the offests of reference image (originally all zeros) so
# that the network cannot learn to use only the reference frame embeddings
offsets_base = to... | Python | 1 |
#!/usr/bin/env python3
#
# Copyright (c) 2022, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | Python | 1 |
import time
def stopwatch():
for i in range(0,24):
for j in range(1,60):
time.sleep(1)
print(f"{i:02d}:{j:02d}")
stopwatch()
| Python | 1 |
"""
用户Schema单元测试
专注于测试:
- 数据序列化/反序列化
- 字段验证规则
- 数据转换逻辑
"""
import pytest
from pydantic import ValidationError
from app.domain.schemas.user import (
UserBase, UserCreate, UserLogin, UserResponse,
UserUpdate, PasswordChange, Token, TokenData
)
@pytest.mark.unit
class TestUserBase:
"""用户基础Schema测试"""
... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import generate_2307_wizard
| Python | 1 |
# Copyright (c) 2018,2023 Alexander Todorov <atodorov@MrSenko.com>
# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
import os
import astroid
from pylint import checkers
from pylint.checkers import utils
class EmptyModuleChecker(checkers.BaseChecker):
name = "empty-module-che... | Python | 1 |
SystemServices'*"]
pub union RATE_QUOTA_LIMIT {
pub RateData: u32,
pub Anonymous: RATE_QUOTA_LIMIT_0,
}
impl ::core::marker::Copy for RATE_QUOTA_LIMIT {}
impl ::core::clone::Clone for RATE_QUOTA_LIMIT {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: 'Win32_System_Sys... | Rust | 0 |
")));
}
#[test]
fn path() {
let path: Path = parse::<syn::Path>(quote! { std::convert::TryFrom }).into();
let segments: Vec<_> = vec!["std", "convert", "TryFrom"].into_iter().map(Identifier::from).collect();
assert_eq!(path.segments, segments);
}
#[test]
fn path_from_st... | Rust | 0 |
1,
}
impl From<CLK_DET_SEL_A> for bool {
#[inline(always)]
fn from(variant: CLK_DET_SEL_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `CLK_DET_SEL`"]
pub type CLK_DET_SEL_R = crate::R<bool, CLK_DET_SEL_A>;
impl CLK_DET_SEL_R {
#[doc = r"Get enumerated values variant"]
#[inlin... | Rust | 0 |
new("./textures").join(skybox_name).join(img_filename);
let path = find_asset(path.to_str().unwrap(), app_id);
let texture = load_texture(display, path.as_path(), false)?;
let fb = SimpleFrameBuffer::new(display, self.cubemap.main_level().image(layer))?;
texture.as_surface().blit_whole_color_to(&fb, blit_targ... | Rust | 0 |
kfun::{G, hex};
/// let G_bytes = hex::decode("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798").unwrap();
/// assert_eq!(&G_bytes[..], G.to_bytes().as_ref());
pub fn decode(hex: &str) -> Result<Vec<u8>, HexError> {
if (hex.len() % 2) != 0 {
return Err(HexError::InvalidHex);
}
le... | Rust | 0 |
::Cil(l) => ListSabValue::Cil(l),
RustValue::Mil(m) => ListSabValue::Mil(m),
_ =>{ return Err(self.type_string()); },
};
Ok(v)
}
pub(crate) fn type_string(&self) -> String{
let s = match self{
RustValue::Param(_, _) => "Param",
RustValue::... | Rust | 0 |
ialize(self, params):
if params.get("Items") is not None:
self._Items = []
for item in params.get("Items"):
obj = Workflow()
obj._deserialize(item)
self._Items.append(obj)
self._TotalCount = params.get("TotalCount")
self._Pa... | Python | 1 |
date": {
"title": "Start Date",
"type": "string",
"description": "The date from which you'd like to replicate the data",
"examples": ["2021-01-01T00:00:00Z"],
},
}
errors = spec_linter.validate_schema("path", schema, ["root"])
assert len(errors) == 2
... | Python | 1 |
solid(Color::WHITE).unwrap().as_texture(&texture_creator).unwrap();
let credits_texture = menu_font.render("Credits").solid(Color::WHITE).unwrap().as_texture(&texture_creator).unwrap();
let movement_texture = menu_font.render("Movement: WASD / Arrow Keys").solid(Color::WHITE).unwrap().as_texture(&texture_creat... | Rust | 0 |
E", (0, i), (0, i), font_size),
("FONTSIZE", (1, i), (1, i), font_size),
("TOPPADDING", (0, i), (0, i), 5),
("BOTTOMPADDING", (0, i), (0, i), 5),
("BOTTOMPADDING", (1, i), (1, i), 5),
("BACKGROUND", (0, i), (-1, i), colo... | Python | 1 |
wikipedia.org/wiki/Lp_space
//! [Minkowski]: https://en.wikipedia.org/wiki/Minkowski_distance
use crate::coords::Coordinates;
use crate::distance::Proximity;
use num_traits::real::Real;
use num_traits::zero;
/// A point in L<sup>1</sup> space.
pub use crate::taxi::Taxicab as L1;
/// Compute the L<sup>1</sup> distan... | Rust | 0 |
#
);
test!(
inverse_trigonometric_functions,
r#"
map(asin), map(acos), map(atan) | map(. * 1000000000 | floor / 1000000000)
"#,
r#"
[0,0.5,1]
"#,
r#"
[0,0.523598775,1.570796326]
[1.570796326,1.047197551,0]
[0,0.463647609,0.785398163]
"#
);
test!(
hyperbolic_function... | Rust | 0 |
4: *mut c_void,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lzma_options_lzma {
pub dict_size: u32,
pub preset_dict: *const u8,
pub preset_dict_size: u32,
pub lc: u32,
pub lp: u32,
pub pb: u32,
pub mode: lzma_mode,
pub nice_len: u32,
pub mf: lzma_match_finder,
pub depth: u32,... | Rust | 0 |
let rule = r###"
rule check_rest_api_private {
AWS::ApiGateway::RestApi {
# Endpoint configuration must only be private
Properties.EndpointConfiguration == ["PRIVATE"]
# At least one statement in the resource policy must contain a condition with the key of "aws:sourceVpc" or "aws:sourceVpce"
Propert... | Rust | 0 |
# !/usr/bin/python
# coding: utf8
# @Time : 2018-08-04 19:23
# @Author : Liam
# @Email : luyu.real@qq.com
# @Software: PyCharm
# .::::.
# .::::::::.
# :::::::::::
# ..:::::::::::'
# '::::::::::::'
# .:::... | Python | 1 |
costs(graph, start, stop);
let algo_split = None;
let user_split = self.user_split.clone();
Path {id, nodes, edges, user_split, algo_split, total_dimension_costs}
}
}
<filename>aws_lambda_events/src/generated/clientvpn.rs
use crate::custom_serde::*;
#[derive(Debug, Clone, PartialEq, Deseria... | Rust | 0 |
import sys
sys.path.append('.')
import numpy as np
import torch
import argparse
import logging
from doccer.engines.trainer import GenerationModelTrainer
from doccer.utils.parse_config import load_config
from omegaconf import OmegaConf
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument... | Python | 1 |
Iter::ByRef { iter, project } => match iter.next() {
None => None,
Some((x, _)) => Some(project(x)),
},
GroupValIter::ByVal { iter } => match iter.next() {
None => None,
Some(x) => Some(&x.0),
},
}
}
fn ... | Rust | 0 |
"}
else:
return {'error': f"找不到会话: {target_chat_key}"}
else:
chat.toggle_auto_switch(enabled=True)
return {'msg': f"解锁当前会话 ( ̄▽ ̄)-ok!"}
@cmd.register(route='rg/ext')
def _(option_dict, param_dict, chat:Chat, chat_presets_dict:dict):
ext_info:str = ''
for ext in global_ext... | Python | 1 |
node configuration.
pub const PRIVATE_CONFIG_FILE_NAME: &str = "sec.toml";
/// Name for a encrypted file containing the node master key.
pub const MASTER_KEY_FILE_NAME: &str = "master.key.toml";
/// Default port number used by Exonum for communication between nodes.
pub const DEFAULT_EXONUM_LISTEN_PORT: u16 = 6333;
/... | Rust | 0 |
se<S, Ix2>,
icol: usize,
shift: usize,
) -> A {
let (mut left, mut right) = matrix.multi_slice_mut((s![.., icol], s![.., icol + 1..]));
let mut axis = left.slice_mut(s![icol + shift..]);
let refl_norm = reflection_axis_mut(&mut axis);
if let Some(refl_norm) = refl_norm {
let refl = Refl... | Rust | 0 |
+ self.results.max_results)
.build(),
) {
Ok(new_results) => {
self.results = new_results;
self.results.issues.pop()
}
_ => None,
}
} else {
... | Rust | 0 |
left not in right
else:
raise InterpretorError(f"Operator not supported: {comparator}")
def evaluate_if(if_statement, state, tools):
result = None
if evaluate_condition(if_statement.test, state, tools):
for line in if_statement.body:
line_result = evaluate_ast(line, state, too... | Python | 1 |
'constant' method.
wd (boolean): Whether this variable contributes to weight decay or not.
dtype (tf.dtype): Data type for variable.
Returns:
weights:
"""
if opts == 'gaussian':
weights = tf.random_normal(shape, stddev=stddev, dtype=dtype)
elif opts == 'truncated_normal'... | Python | 1 |
# Generated by Django 5.1.2 on 2025-08-22 15:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bots', '0052_alter_webhookdeliveryattempt_webhook_trigger_type_and_more'),
]
operations = [
migrations.AlterField(
model_name='b... | Python | 1 |
}
}
pub fn encode<T: AsRef<[u8]>>(self, bstring: T) -> String {
match self {
Encoding::QuotedPrintable => encode_q(bstring),
Encoding::Base64 => encode_b(bstring),
}
}
pub fn char(self) -> char {
match self {
Encoding::QuotedPrintable ... | Rust | 0 |
ame: *const c_char) -> ErrorCode {
lode_error!(rustimpl::lodepng_save_file(slice::from_raw_parts(buffer, buffersize), &c_path(filename)))
}
#[no_mangle]
pub unsafe extern "C" fn lodepng_encode(out: &mut *mut u8, outsize: &mut usize, image: *const u8, w: c_uint, h: c_uint, state: &mut State) -> ErrorCode {
*out... | Rust | 0 |
method = 'FSAE'
# model
d_in = 2
d_model = 128
d_state = 1
expand = 2
bidirectional = True
mlp_ratio = 4.
num_encoder_layers = (1, 2)
num_decoder_layers = (2, 1)
num_branches = 4
merge_type = 'add'
dropout = 0.1
# training
loss_types = ['mse', 'fft2_abs']
fft_loss_coefficient = 6
lr = 5e-4
batch_size = 64
sched = 'non... | Python | 1 |
, k3u8ua_x451 as jlcnzh28wym
(mx_qxsn23ry): 0.0 = cmozt04k4ow
@{c4v5wk8rnvn: False, '': m07u2c2taae}
def kpyaj_xectl(jzq9tqd75e6=0j, mvckktghufe: o7w2_fql2er=False, aclstbjij6o=False, hv6u5k93sl8='', an9wv9n_9dh: n498kevd7r3=0.0, q5ivzdqha6r: zpowptqugyb=0, ffzohbk3kt5=b''):
cp0mncokygk = llgu6fwlnl4 = qj2dzeda... | Python | 1 |
import torch
import torch.nn as nn
import torchvision.models as models
class SiameseNetwork(nn.Module):
def __init__(self, network='ResNet-50', in_channels=3, n_features=128):
super(SiameseNetwork, self).__init__()
self.network = network
self.in_channels = in_channels
self.n_featur... | Python | 1 |
import os
import shutil
# This section preps your image and test set in a lmdb database
def DownloadResource(url, path):
'''Downloads resources from s3 by url and unzips them to the provided path'''
#import requests, zipfile, StringIO
import requests, zipfile
from io import BytesIO
print("Downloadi... | Python | 1 |
# SPDX-FileCopyrightText: 2024 DJDevon3
# SPDX-License-Identifier: MIT
# Coded for Circuit Python 8.2.x
"""Fitbit API Example"""
# pylint: disable=no-member
import os
import time
import adafruit_connection_manager
import microcontroller
import wifi
import adafruit_requests
# --- Fitbit Developer Account & oAuth App... | Python | 1 |
_lock_control_mode: DataLockControlValue,
pub languages: Vec<Language>,
#[serde(default)]
pub common_modules: Vec<StringValue>,
#[serde(default)]
pub subsystems: Vec<StringValue>,
#[serde(default)]
pub session_parameters: Vec<StringValue>,
#[serde(default)]
pub roles: Vec<StringValue... | Rust | 0 |
Vars
"DIRENV_DIFF",
"DIRENV_DIR",
"DIRENV_WATCHES",
]
.into_iter()
.for_each(|okay_var| {
found_env_keys.remove(okay_var);
});
assert_eq!(found_env_keys, HashSet::new());
}
<gh_stars>10-100
use std::marker::PhantomData;
use bytes::{Buf, Bytes, BytesMut};
use viz_u... | Rust | 0 |
inal_proof: FinalSNARK<PallasGroup>,
final_instance: RelaxedR1CSInstance<PallasGroup>,
}
#[derive(Clone, Debug, Default)]
pub struct RawVanillaProof<S>
where
S: Debug,
{
pub inverse_exponent: u64,
pub result: Option<State<S>>,
pub intermediates: Option<Vec<State<S>>>,
pub t: u64,
}
impl<S: Deb... | Rust | 0 |
75u64));
document.insert(String::from("active"), DataType::Bool(true));
collection.insert(document.clone());
let results = match collection.find(&String::from("{username:\"johnperry\"}")) {
QueryResult::Data(data) => data,
_ => {
println!("InvalidCommand")... | Rust | 0 |
),
DeriveJunction::hard(159),
DeriveJunction::soft(0),
];
let mut index = 0;
for value in path.into_iter() {
assert_eq!(expects[index], value, "should be correct path");
index = index + 1;
}
} else ... | Rust | 0 |
for i in range(len(x1)):
xx1 = np.maximum(x1[i], x1)
yy1 = np.maximum(y1[i], y1)
xx2 = np.minimum(x2[i], x2)
yy2 = np.minimum(y2[i], y2)
w = np.maximum(0.0, xx2 - xx1 + 1)
h = np.maximum(0.0, yy2 - yy1 + 1)
inter = w * h
ovr = inter / (areas[i] + areas -... | Python | 1 |
import numpy as np
from parakeet import jit
from parakeet.testing_helpers import run_local_tests, expect
int64_mat = np.reshape(np.arange(6), (2,3)).astype('int64')
int32_mat = int64_mat.astype('int32')
float64_mat = int64_mat.astype('float64')
float32_mat = int64_mat.astype('float32')
bool_mat = int64_mat % 2
ma... | Python | 1 |
/graph.rs
use std::collections::HashMap;
use crate::{
layout::{chunk_range::End, ChunkId, LinkIdx, StartIdx},
music::Score,
utils::{Counts, Rotation},
Query,
};
use bit_vec::BitVec;
use itertools::Itertools;
/// An immutable version of [`monument_graph::Graph`] which can be traversed without hash tabl... | Rust | 0 |
include("zlib.py")
include("png.py")
| Python | 1 |
tatus;
mod error;
mod event;
mod event_mode;
mod heap_filter;
mod heap_object_filter;
mod heap_reference_kind;
mod heap_root_kind;
mod iteration_control;
mod jlocation_format;
mod object_reference_kind;
mod param_kind;
mod param_types;
mod phase;
mod primitive_type;
mod resource_exhausted;
mod thread_priority;
mod thre... | Rust | 0 |
ng>,
/// end unix timestamp: files with time before or equals to `ts_end` will match
pub ts_end: Option<String>,
/// collector identifier, e.g. `rrc00` or `route-views2`
pub collector_id: Option<String>,
/// archive project name: `riperis` or `routeviews`
pub project: Option<String>,
/// arc... | Rust | 0 |
>
/// <ul>
/// <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens. </p> </li>
/// <li> <p>The first character must be a letter.</p> </li>
/// <li> <p>Cannot end with a hyphen or contain two consecutive hyphens. </p> </li>
/// </ul>
/// <p>Example: <code>my-cluster-snapshot2</code> </... | Rust | 0 |
from openai import AzureOpenAI, OpenAI
import os
import shutil
import zipfile
import xml.etree.ElementTree as ET
import logging
from typing import Optional
from config import (
OpenAIConfig, AzureOpenAIConfig,
get_openai_config, get_azure_openai_config
)
from prompts import get_translation_messages
# 配置日志
log... | Python | 1 |
from datetime import datetime, timezone
import json
JSON_TEMPLATE = r'''
{
"report_type": "TextFile",
"source_file": "insert",
"report_datetime_utc": "insert",
"report_datetime_local": "insert",
"source_file_metadata": [],
"report_scheme": {
"columns": [
"rawtextcontents"
... | Python | 1 |
= " @param[inout] aIterator A pointer to an iterator. It will be updated to point to next entry on success. To get the"]
#[doc = " first entry, initialize the iterator by setting all its fields to zero (e.g., `memset` the"]
#[doc = " the iterator structure t... | Rust | 0 |
"""
해당 접근토큰발급관리 파일을 그대로 사용하시면 오류 발생할 수 있습니다.
토큰저장 및 발급 함수 등을 참고하시되 본인 환경에 맞게 코드 수정하셔서 사용하시기 바랍니다.
Created on Wed Feb 15 16:57:19 2023
@author: Administrator
"""
import time, copy
import yaml
import requests
import json
import os
import pandas as pd
from collections import namedtuple
from datetime import datetime
... | Python | 1 |
n the size of its parent changes.
const FIT_TO_PARENT = 0x00000200;
/// Specifies whether to select the first child of a container control when the container
/// control is the next control to which the user is navigating.
const SELECT_CHILD = 0x00002000;
/// Specifies... | Rust | 0 |
IFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER`]
/// * [`GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER`]
/// * [`GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER`]
/// * [`GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER`]
pub type UniformBlockPName = GLenum;
///
/// * [`GL_UNIFORM_ARRAY_STRIDE`]
/// * [`GL_UNIFORM_A... | Rust | 0 |
s
.iter()
.cloned()
.chain(
left.variables()
.drain(..)
.filter(|x| !target_variables.contains(x)),
)
.chain(
right
.variables()
.drain(..)
.filter(|x| !target_variables.contai... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.