text string | label_name string | labels int64 |
|---|---|---|
t(Event::Start(root))?;
writer.write_event(Event::End(BytesEnd::borrowed(element_name.as_bytes())))?;
Ok(String::from_utf8(write_buf)?)
}
}
#[derive(Clone, Debug, Deserialize, Default, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct IndexedEndpoint {
#[serde(rename = "Binding")]
pub bindi... | Rust | 0 |
k",
activebackground="#45a049", activeforeground="white", command=start_download)
download_button.pack(pady=10)
# 状态标签
status_label = tk.Label(root, text="等待中...", fg="purple", bg="#f0f0f0", font=("Arial", 20, "italic"))
status_label.pack(pady=10)
# 添加超链接标签
def open_link(event):
webbro... | Python | 1 |
ss_x
loss += loss_cr
self.model_backward_and_update(loss)
loss_summary = {
'loss_x': loss_x.item(),
'acc': acc,
'loss_cr': loss_cr.item()
}
if (self.batch_idx + 1) == self.num_batches:
self.update_lr()
return loss_summary... | Python | 1 |
}
files.sort_unstable();
for file in files {
println!("{:?}", file);
self.run_single(file.as_path(), producer)?;
processed.push(file);
}
if !self.config.mode_polling_dir {
break;
}
}
... | Rust | 0 |
writer,
X_ELEM_MINOR,
&self.spec_version.minor.to_string().as_bytes(),
)?;
spec_version.end(writer)?;
text_element(
writer,
X_ELEM_URL_BASE,
&self.url_base.to_string().as_bytes(),
)?;
self.device.write(writ... | Rust | 0 |
A::default();
act.service_started(ctx);
act
})
} else {
Supervisor::start(|ctx| {
let mut act = A::default();
act.service_started(ctx);
act
... | Rust | 0 |
"') # TODO create csv dialect!
header = True
atoms = []
types = dict()
if parent is not None:
for atom_type in parent.phase.project.atom_types:
if not atom_type.name in types:
types[atom_type.name] = atom_type
for row in atl_reade... | Python | 1 |
option. This file may not be copied, modified, or distributed
// except according to those terms.
use robo6502::{Cmos, Cpu, NmiLength, Nmos, Status, Sys};
use self::common::*;
mod common;
#[test]
fn hijack() {
hijack_impl(test_cpu_nmos());
hijack_impl(test_cpu_cmos());
}
fn hijack_impl<C: Cpu>(cpu: C) {
... | Rust | 0 |
::Value = ciborium::de::from_reader(cbor_slice).unwrap();
let mut cv = CBORValidator::new(&cddl, cbor, enabled_features);
cv.validate()
}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "cbor")]
#[cfg(not(feature = "additional-controls"))]
/// Validate CBOR slice from a given CDDL document string
pub fn valid... | Rust | 0 |
import re
def slugify(name: str) -> str:
"""Transforme une chaîne en identifiant safe pour les fichiers"""
return re.sub(r'[^a-z0-9]+', '_', name.lower()).strip("_") | Python | 1 |
n
while len(trainIndices) < budget and len(pool) >= step_size:
if not bootstrapped:
boot_s = BootstrapFromEach(t)
newIndices = boot_s.bootstrap(pool, y=y_pool, k=bootstrap_size)
bootstrapped = True
else:
newIndices = active... | Python | 1 |
.modified_bodies);
Some(result)
}
/// Iterates through all the rigid-bodies on this set.
pub fn iter(&self) -> impl Iterator<Item = (RigidBodyHandle, &RigidBody)> {
self.bodies.iter().map(|(h, b)| (RigidBodyHandle(h), b))
}
/// Iterates mutably through all the rigid-bodies on this ... | Rust | 0 |
if left <= m:
s, t, i = s, m, i << 1
if right > m:
s, t, i = m + 1, t, (i << 1) | 1
return ans
stack = [(0, self.n - 1, 1)]
ans = self.cover_initial
while stack:
s, t, i = stack.pop()
if left <= s an... | Python | 1 |
: Option<CodegenConfig>,
ignore_errors: bool,
) {
let parser_config = match parser_config {
Some(parser_config) => parser_config,
_ => ParserConfig::default(),
};
let writer_config = match writer_config {
Some(writer_config) => writer_config,
_ => BasicHtmlWriterConfig::d... | Rust | 0 |
from sqlalchemy import func
class Paginator:
def __init__(self, query):
self.query = query
self.data = None
self.page = None
self.limit = None
def paginate(self, page: int, page_size: int, max_per_page=500):
"""分页查询"""
if page_size is None:
page_siz... | Python | 1 |
})
} else {
return Err(StdError::generic_err(format!(
"User does not permissions to change tiers!"
)));
}
}
pub fn try_withdrawl<S: Storage, A: Api, Q: Querier>(
deps: &mut Extern<S, A, Q>,
env: Env,
tier: i8,
round: u32
) -> StdResult<HandleResponse> {
let user_... | Rust | 0 |
TODO 現局面で この手を指せるか試してみる。
// 例えば 味方の駒の上に駒を動かすような動きは イリーガル・タッチ として弾く。
// 新規に テープを作る。ムーブ1つだけ。
//let mut recorder = CassetteTapeEditor::new_cassette_tape_editor();
//recorder.put_1note(&rmove, comm);
//recorder.reset_caret... | Rust | 0 |
Json;
use anyhow::Result;
use crate::models::playlist::Playlist;
use crate::models::video::Video;
use crate::ApiKey;
#[get("/v1/search/channel?<q>")]
pub fn channel(youtube_manager: State<YoutubeManager>, q: String, _api_key: ApiKey) -> Result<Json<Vec<Channel>>> {
youtube_manager.search_channel(q)
.map(|l... | Rust | 0 |
"Failed to get connections for memory",
memory_id=current_memory.id,
error=str(e),
)
continue
# Sort memories by activation strength
core_memories.sort(
key=lambda m: activation_strengths.get(m.id, 0.0), reverse=True
... | Python | 1 |
}
else if (fTemp >= (65536.0 * 65536.0))
{
uResult = 0xFFFFFFFFu32;
}
else {
uResult = (fTemp as u32);
}
Result.vector4_u32[ElementIndex] = uResult;
}
return Result;
}
#[cfg(_XM_ARM_NEON_I... | Rust | 0 |
i32::from_radix_10_signed(b"0042"));
/// ```
///
/// # Return
///
/// Returns a tuple with two numbers. The first is the integer parsed or zero, the second is the
/// index of the byte right after the parsed number. If the second element is zero the slice
/// did not start with an ASCII dig... | Rust | 0 |
();
let reconcile = winner.map(move |entry| *entry_handle.write().unwrap() = entry);
reconcile.into_actor(self).wait(ctx);
}
}
impl Actor for Node {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Context<Self>) {
// Reconcile periodically
ctx.run_interval(sel... | Rust | 0 |
mut self) {
let r = rand::thread_rng().gen_range(1, 3);
for _ in 0..r {
match self.body_direction {
BodyDirection::Right => self.body_right(),
BodyDirection::Left => self.body_left(),
}
}
}
fn update_bullets(&mut self) {
se... | Rust | 0 |
meta_part_*.jsonl.gz", filename_stub, lang);
// warning: does not (actually) check if for part n, both txt.gz and jsonl.gz exists.
let text_paths = glob::glob(&filename_txt_stub)?;
let meta_paths = glob::glob(&filename_meta_stub)?;
//chain both text and meta files and move them all
... | Rust | 0 |
'static,
U: Encoder + Decoder,
{
factory: F,
_t: PhantomData<(T,)>,
}
impl<T, U, F> IntoFramed<T, U, F>
where
T: AsyncRead + AsyncWrite,
F: Fn() -> U + Send + Clone + 'static,
U: Encoder + Decoder,
{
pub fn new(factory: F) -> Self {
IntoFramed {
factory,
_t:... | Rust | 0 |
to the hook method (method object)
@param menuEntry entry to be shown in the context menu (QString)
"""
self.addHookMethod(key, method)
self.hooksMenuEntries[key] = QString(menuEntry)
def removeHookMethod(self, key):
"""
Public method to remove a hook method ... | Python | 1 |
wrap(),
"Test"
);
}
#[test]
fn multi_byte_to_wide_char_utf8() {
assert_eq!(
multi_byte_to_wide_char(
CP_UTF8,
MB_ERR_INVALID_CHARS,
b"\xD0\xA2\xD0\xB5\xD1\x81\xD1\x82"
).unwrap(),
"Тест"
);
}
#[test]
fn multi_byte_to_wide_char_invalid() {... | Rust | 0 |
const ADDRESS: u16 = 0x55;
#[embassy::task]
async fn ctrl_demo(
mut i2c: I2C<
pac::I2C0,
(
Pin<bank0::Gpio0, FunctionI2C>,
Pin<bank0::Gpio1, FunctionI2C>,
),
>,
) {
controller::run_demo(&mut i2c).await.expect("Demo failed")
}
#[embassy::task]
async fn prph_... | Rust | 0 |
t<(Vec<u8>, Vec<u8>), ()>;
fn next(&mut self) -> Option<Self::Item> {
self.iter.next()
}
}
impl StdError for UnknownRequest {
fn description(&self) -> &str {
"no known valid response for the given request"
}
}
impl fmt::Display for UnknownRequest {
fn fmt(&self, f: &mut fmt::Format... | Rust | 0 |
tion(TopDefinition):
def resolve(self) -> dict[str, Optional[dict[str, Any]]]:
try:
check_expression(self.name)
name = self.context.resolve(self.name)
if not isinstance(name, str):
typ = type(name).__name__
raise ResolveError(
... | Python | 1 |
issue_number(self, field):
field = self._clean_field_str(field, optional=True, max_length=10)
return re.sub(r'\b00?', '', field)
# -- UnionMangas fields
def clean_field_unionmangas_manga_status(self, field):
status = {
'Ativo': 'O',
'Completo': 'C',
}
... | Python | 1 |
("blue")),
SpreadsheetCell::Float(10.12),
];
// Caveat: types known at AOT
// Else use TRAIT
println!("row: {:#?}", row);
}
// UTF-8 Encoded Text with Strings
// Core type is `str` - string slice
// String is collection type in std, growable, mutable, owned... | Rust | 0 |
args {
None => (),
Some(box_args) => {
// Unwrap params.
let box_args = box_args.as_any().downcast_ref::<FillCsvArg>().unwrap();
// Initialize reader with specified file from path.
let f = File::open(&box_args.filepath);
let mut ... | Rust | 0 |
import os
import sys
import folder_paths
ROOT_PATH = os.path.join(folder_paths.get_folder_paths("custom_nodes")[0], "ComfyUI-UVR5")
MODULE_UVR5_PATH = os.path.join(ROOT_PATH, "uvr5")
sys.path.append(ROOT_PATH)
sys.path.append(MODULE_UVR5_PATH)
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__al... | Python | 1 |
pl InterfaceNumber {
pub(crate) fn new(index: u8) -> InterfaceNumber {
InterfaceNumber(index)
}
}
impl From<InterfaceNumber> for u8 {
fn from(n: InterfaceNumber) -> u8 {
n.0
}
}
/// A handle for a USB string descriptor that contains its index.
#[derive(Copy, Clone, Eq, PartialEq)]
#[cf... | Rust | 0 |
nnerPercentage = store.prizeRank;
}
Proposal::MinAmountValidator => {
state.validatorMinAmountToAllowClaim = store.amount.clone();
}
Proposal::HolderFeePercentage => {
state.holdersMaxPercentageReward = store.amount.u128() as u8
}
_ => {
... | Rust | 0 |
or::PURPLE)
.mid_top_with_margin_on(ids.notify_canvas, 100.0)
.label("Dismiss")
.w_h(80.0, 40.0)
.set(ids.notify_button, ui)
.was_clicked() {
notification_diag.is_open = false;
}
}
if *app_state =... | Rust | 0 |
aceback)
class TestBytecodeTestCase(BytecodeTestCase):
def test_assert_not_in_with_op_not_in_bytecode(self):
code = compile("a = 1", "<string>", "exec")
self.assertInBytecode(code, "LOAD_CONST", 1)
self.assertNotInBytecode(code, "LOAD_NAME")
self.assertNotInBytecode(code, "LOAD_NAM... | Python | 1 |
)?;
println!("part A: {:?}", lowest_risk(map.view()));
println!("part B: {:?}", lowest_risk(grow_map(map.view()).view()));
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
fn input() -> Array2<u32> {
let lines = [
"1163751742",
"1381373672",
"2136511328... | Rust | 0 |
is::VorbisStream;
use std::io;
#[allow(non_snake_case)]
fn main() {
let AO = ao::AO::init();
let driver = match AO.get_driver("wav") {
Some(d) => d,
None => {
println!("Failed to open AO 'wav' driver");
return;
}
};
// stdin -> VorbisStream -> AOAutoSink... | Rust | 0 |
/// # Panics
///
/// This function panics in debug if `library_name` contains a '\0' character or "nul" often
/// referred,this it's perfectly safe otherwise because the underlying foreign function only
/// read from `library_name` and cannot deallocate it,the string will be truncated althought.
#[i... | Rust | 0 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django import forms
from django.utils.translation import uget... | Python | 1 |
ply(&self, token_id: TokenId) -> U128;
// Returns the total supplies of the tokens given by token_ids in a decimal string representation.
fn total_supply_batch(&self, token_ids: Vec<TokenId>) -> Vec<U128>;
}
<reponame>tncheng/hotstuff<gh_stars>10-100
use crate::config::Committee;
use crate::mempool::{Consensus... | Rust | 0 |
resp) = resp {
config.auth_info.api_token = Some(resp.to_owned());
save_config(config_path, &config).unwrap_or_else(|err| {
log::error!("Failed to save api token to config: {}", err)
});
}
print_response... | Rust | 0 |
ew(&mut env);
restorer.unset_var(&key_exported);
assert_eq!(restorer.get().var(key_exported), None);
restorer.unset_var(&key_existing);
assert_eq!(restorer.get().var(key_existing), None);
restorer.set_exported_var(key_exported, "some other exported value", true);
restore... | Rust | 0 |
num_images = len(img_metas)
all_cls_scores = torch.cat([
s.permute(0, 2, 3, 1).reshape(
num_images, -1, self.cls_out_channels) for s in cls_scores
], 1)
all_labels = torch.cat(labels_list, -1).view(num_images, -1)
all_label_weights = torch.cat(label_weig... | Python | 1 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a dependency on a bundle causes the whole bundle to be built.
"""
import TestGyp
import sys
if sys.platform == 'darwin'... | Python | 1 |
FcPattern, _0: *mut FcResult) -> *mut FcPattern,
pub fn XftFontOpenInfo (_2: *mut Display, _1: *mut FcPattern, _0: *mut XftFontInfo) -> *mut XftFont,
pub fn XftFontOpenName (_2: *mut Display, _1: c_int, _0: *const c_char) -> *mut XftFont,
pub fn XftFontOpenPattern (_1: *mut Display, _0: *mut FcPattern) -> ... | Rust | 0 |
try:
uploaded_file.seek(0) # Reset file pointer
df = pd.read_excel(uploaded_file, sheet_name=0)
except Exception as e2:
st.error(f"❌ Error reading Excel file: {str(e)}")
st.info("💡 Please ensure your ... | Python | 1 |
from typing import Union
import discord
from grief.core import commands
from grief.core.i18n import Translator
from .starboard_entry import StarboardEntry
_ = Translator("Starboard", __file__)
class StarboardExists(commands.Converter):
async def convert(self, ctx: commands.Context, argument: str) -> Starboard... | Python | 1 |
class Vehicle:
def __init__(self,mileage:int,max_speed = 150):
self.mileage = mileage
self.max_speed = max_speed
self.gadgets = list()
# Test code
car = Vehicle(20)
print(car.max_speed)
print(car.mileage)
print(car.gadgets)
car.gadgets.append('Hudly Wireless')
print(car.gadgets) | Python | 1 |
os.system(f'rm -rf {fileName}')
return True
def check_ld_libc(version):
"""
检测是否存在ld-linux-aarch64.so.1、libc.musl-aarch64.so.1动态依赖文件
"""
if "ld-linux-aarch64.so.1" in (os.listdir('/lib')):
print("🗣已存在arm64-ld依赖\n")
pass
else:
if download(version, "l... | Python | 1 |
ssage_handler=MyMessageHandler())
while True:
try:
consumer.run()
except KeyboardInterrupt:
pass
except ConnectionClosed:
continue
except Exception as e:
print("consumer exited for exception " + str(e))
break
print("clean... | Python | 1 |
#!/usr/bin/python
# -*- coding = utf-8 -*-
#---------------------------------------------------------------------
# Name: tashkeel
# Purpose: Arabic automatic vocalization. #
# Author: Taha Zerrouki (taha.zerrouki[at]gmail.com)
# Created: 2015-03-25
# Copyright: (c) Taha Zerrouki 2011 # Lice... | Python | 1 |
Starting test.");
let whitelist = create_list_from_vec(vec![
"GPSLatitude",
"GPSLongitude",
"GPSAltitude",
"ExifImageWidth",
"ExifImageHeight",
"FlightYawDegree",
"AbsoluteAltitude",
"RelativeAltitude",
"... | Rust | 0 |
impl CudnnError {
/// Converts the `CudnnError` into the corresponding raw variant.
pub fn into_raw(self) -> sys::cudnnStatus_t {
match self {
CudnnError::NotInitialized => sys::cudnnStatus_t::CUDNN_STATUS_NOT_INITIALIZED,
CudnnError::AllocFailed => sys::cudnnStatus_t::CUDNN_STAT... | Rust | 0 |
!(result, Ok(Ok(addr)));
}
#[tokio::test]
async fn add_single_bidirectional_and_send_ok() {
let key = SchemeHostPort::new(Scheme::Wss, "host".to_string(), 42);
let (tx, rx) = oneshot::channel();
let req = PendingRequest::Bidirectional(BidirectionalRequest::new(tx));
let addr = RoutingAddr::remote(2);
... | Rust | 0 |
import numpy as np
import os
pastas = os.listdir('/home/ml1/Desktop/runs/segment')
k = 0
r = 1
for i in pastas :
# definição das pastas onde estão os labels obtidos do predict YOLO
pasta = '/home/ml1/Desktop/runs/segment/' + i
range_predict = len(os.listdir(pasta+'/labels'))
first = [136,111,128... | Python | 1 |
y {
/// Specification of the desired behavior for this NetworkPolicy.
pub spec: NetworkPolicySpec,
/// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
pub metadata: ObjectMeta,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub st... | Rust | 0 |
ndex {
if let Some(op) = self.vals.get(name) {
return EntIndex::BuiltInVal(*op);
} else if let Some(m) = self.types.get(name) {
return EntIndex::BuiltInType(*m);
} else {
unreachable!();
}
}
}
<gh_stars>0
use std::convert::TryInto;
use wasm_bindgen... | Rust | 0 |
5),
max_value: Some(ScalarValue::Int64(Some(21))),
min_value: Some(ScalarValue::Int64(Some(-4))),
null_count: Some(0),
},
ColumnStatistics {
distinct_count: Some(1),
max_value: Some(Scalar... | Rust | 0 |
_instruction::{InstructionType, PayInstruction, write_batch_file};
/// `fix` subcommand
#[derive(Command, Debug, Default, Options)]
pub struct FixCmd {
#[options(help = "waypoint to set")]
waypoint: Option<Waypoint>,
#[options(help = "migrate account json")]
account: bool,
#[options(help = "fix ope... | Rust | 0 |
.await;
let serializer = &mut make_ten(async { AnalyzerDispatchSerializer::default() }).await;
let s3_emitter = &mut s3_event_emitters_from_env(&env, time_based_key_fn).await;
let s3_payload_retriever = &mut make_ten(async {
S3PayloadRetriever::new(
|region_str| grapl_config::env_he... | Rust | 0 |
Material>, With<Hourglass>>,
handles: Res<TextureAssets>,
) {
let data = players.q0().single().expect("No data for the player");
let coins = data.coins;
let level = data.shop_level;
let mut coins_text = texts.q0_mut().single_mut().expect("Coins text not found.");
coins_text.sections[0].value = ... | Rust | 0 |
source: String,
#[clap(from_global)]
verbosity: tracing::Level,
#[clap(from_global)]
quiet: bool,
#[clap(from_global)]
json: bool,
#[clap(from_global)]
api_key: Option<String>,
}
#[async_trait]
impl TurronCommand for PublishCmd {
async fn execute(self) -> Result<()> {
let s... | Rust | 0 |
# for x in range (1,10):
# while True:
# list = {1,3,6 "mahmut"}
for x in range (101):
if x % 2 == 0:
print(x,"Sayısı Çifttir.")
else:
print(x,"Sayısı Tektir.")
| Python | 1 |
ne[3])
y = float(line[4])
z = float(line[5])
atom_pos = [x,y,z]
atoms_positions.append(atom_pos)
atom_names.append(atom_name)
f.close()
return list_systems
def parse_modified_params(params_file, ignore_sensitivity=1):
# sect... | Python | 1 |
tern "C" {
pub fn cudnnCreateActivationDescriptor(
activationDesc: *mut cudnnActivationDescriptor_t,
) -> cudnnStatus_t;
}
extern "C" {
pub fn cudnnSetActivationDescriptor(
activationDesc: cudnnActivationDescriptor_t,
mode: cudnnActivationMode_t,
reluNanOpt: cudnnNanPropagati... | Rust | 0 |
def __init__(self, model_config, nc=80, anchors=None, custom_head=None,
width_mul=None, depth_mul=None, is_lite=False):
"""
:param model_config:
"""
nn.Module.__init__(self)
self.yaml = None
self._is_lite = is_lite
head_config = {'nc': nc, 'anchors': anchors if anchors is not Non... | Python | 1 |
serialize = "{http://xmlgw.companieshouse.gov.uk}CorporateName",
deserialize = "{http://www.govtalk.gov.uk/CM/envelope}CorporateName"
))]
pub corporate_name: String,
#[serde(rename(
serialize = "{http://xmlgw.companieshouse.gov.uk}Address",
deserialize = "{http://www.govtalk.go... | Rust | 0 |
le time_delay > 0 :
try:
response = requests.get(url=url, headers=self._get_header)
time_delay = int(response.headers.get('retry-after', 0))
time_threshold-=time_delay
time.sleep(time_delay)
if time_threshold <= 0:
... | Python | 1 |
#!/usr/bin/python3
def test_transfer(accounts, nft):
"""transfer events"""
tx = nft.transfer(accounts[2], 1000, {"from": accounts[1]})
assert "Transfer" in tx.events
expected = {"from": accounts[1], "to": accounts[2], "amount": 1000}
assert tx.events["Transfer"] == expected
assert "TransferR... | Python | 1 |
import os
import sys
sys.path.append(os.getcwd())
from scripts.constants import LOGODDS_DIR
import json
import pandas as pd
from nltk.corpus import stopwords
import itertools
from scripts import language_analysis_utils
from gensim.models import Phrases
from gensim.models.phrases import Phraser
from gensim.parsing.prep... | Python | 1 |
xeb\xba\x16\
\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\xea\xba\x16\xeb\
\xba\x16\xeb\xba\x17\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\xeb\xbb\
\x16\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\xeb\xba\x16\
\xeb\xba\x16\xeb\xba\x16\xeb\xbb\x18\xeb\xbb\x19\xeb\xbc\x1b\xec\
\xbd \xec\xbe\x22\xec\xbf'\xed\xc1.\xed\xc2... | Python | 1 |
import streamlit as st
st.title("Aircraft General")
with st.expander("Engines"):
st.write("Williams International FJ44-4A QPM turbofan engines")
with st.expander("Maximum continuous thrust"):
st.write("3,420 lbs")
with st.expander("Maximum takeoff thrust"):
st.write("3,600 lbs")
ac_wheelbase = "3... | Python | 1 |
ta.len() > 20);
let offset = u32::from_le_bytes([data[8], data[9], data[10], data[11]]) as usize;
let size = u32::from_le_bytes([data[12], data[13], data[14], data[15]]) as usize;
let data = &data[offset..offset + size];
let signature = Bits::new(data).read_bits(0, 32) as... | Rust | 0 |
from colorama import Fore
from threading import Lock
from datetime import datetime
from ctypes import windll
from pystyle import Center,Colors,Colorate
lock = Lock()
class Console:
@staticmethod
def printsc(content: str):
lock.acquire()
print(f"{Fore.LIGHTBLACK_EX}[{Fore.LIGHTBLUE_EX}Hes... | Python | 1 |
.len();
let mut buf = Vec::new();
buf.extend(format!("${}\r\n", length).as_bytes());
buf.extend(s.as_bytes());
buf.extend(b"\r\n");
buf
}
}
)*
};
}
#[macro_export]
macro_rules! im... | Rust | 0 |
# Created on Mar 6, 2020
#
# @author: ballance
from vsc.model.expr_model import ExprModel
from vsc.model.expr_fieldref_model import ExprFieldRefModel
from vsc.model.expr_array_subscript_model import ExprArraySubscriptModel
class ExprIndexedFieldRefModel(ExprModel):
"""Indexed-path mechanism to access a field"""... | Python | 1 |
def circleArea(r):
print(2*3.14*r) | Python | 1 |
> P0.29
#![deny(warnings)]
#![no_std]
#![no_main]
use defmt_rtt as _;
use nrf52840_hal as _;
use panic_probe as _;
use nrf52840_hal::gpio::{Floating, Input, Pin};
struct State {
input_pin: Pin<Input<Floating>>,
puller_pin: Option<Pin<Input<Floating>>>,
}
#[defmt_test::tests]
mod tests {
use cortex_m::a... | Rust | 0 |
("Failed to read line");
let response = response.trim().to_string().to_lowercase();
response
}
fn get_float_input(prompt: &str) -> f64 {
print!("{}", prompt);
io::stdout().flush().unwrap();
let mut response = String::new();
io::stdin()
.read_line(&mut response)
.expect("Faile... | Rust | 0 |
# Copyright (c) 2023 Gengshan Yang, Carnegie Mellon University.
from lab4d.utils.quat_transform import (
dual_quaternion_apply,
dual_quaternion_inverse,
dual_quaternion_to_quaternion_translation,
)
def get_bone_coords(xyz, bone2obj):
"""Transform points from object canonical space to bone coordinates
... | Python | 1 |
,
num_color: [1,1,1,1,1,1],
num_vary_x: 3,
num_vary_y: 3,
corner_type_color_template: [[0; 4]; 4],
};
let mut template_w = -2;
let mut template_h = -2;
unsafe {
stbhw_get_template_size(
&mut config,
... | Rust | 0 |
# League: списък от Team обекти, метод top_scorer() (връща играча с най-много голове в лигата)
from team import Team
class League:
def __init__(self):
self.list_teams: list[Team] = []
def add_team(self, current_team=object) -> None:
self.list_teams.append(current_team)
def top_scorer(self... | Python | 1 |
"""Test coverage verification for Redis backend module."""
from pathlib import Path
import pytest
def test_import_all_redis_modules():
"""Test that all Redis backend modules can be imported successfully."""
try:
# Core module imports
# Verify __all__ exports
import fastex.limiter.bac... | Python | 1 |
[
// The ideal size lies within the constraints
(bc(0.0, 0.0, 100.0, 100.0), 1.0, 50.0, Size::new(50.0, 50.0)),
(bc(0.0, 10.0, 90.0, 100.0), 1.0, 50.0, Size::new(50.0, 50.0)),
// The correct aspect ratio is available (but not width)
// min height
... | Rust | 0 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
class IapAccount(models.Model):
_inherit = 'iap.account'
sender_name = fields.Char(help="This is the name that will be displayed as the sender of the SMS.", readonly=True)
def action_open_regis... | Python | 1 |
o=zoneinfo.ZoneInfo("Europe/Berlin"),
)
)
== 14 * 60
)
with pytest.raises(ValueError):
Cron(cron="* * * * 65", tz="UTC")
@pytest.mark.asyncio
async def test_or_trigger_state():
trigger = OrTrigger(triggers=[Once(), Once()])
assert trigger.should_trigger() is True
... | Python | 1 |
output_tokens = getattr(response.usage, "completion_tokens", 0)
# Extract reasoning tokens from completion_tokens_details
completion_token_detail = getattr(response.usage, "completion_tokens_details", None)
if completion_token_detail:
reaso... | Python | 1 |
// Do not recurse into nested items.
}
}
<reponame>niclashoyer/drogue-embedded-timer<filename>src/delay.rs
use embedded_time::Timer;
use embedded_time::duration::{Duration, Milliseconds, Microseconds};
use embedded_time::fixed_point::FixedPoint;
use embedded_hal::blocking::delay::{DelayMs, DelayUs};
use co... | Rust | 0 |
main() {
return f();
}"#
);
<filename>src/video.rs
extern crate htmlescape;
extern crate serde;
use crate::config::Config;
use crate::http::Query;
use htmlescape::decode_html;
use serde::{Deserialize, Serialize};
use serde_json;
use std::collections::HashMap;
use std::error::Error;
pub struct Request<'a> {
pub... | Rust | 0 |
RpcMessage::ChangeSettingsRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ChangeSettingsRequest>>("RpcMessage::ChangeSettingsRequest", pos),
RpcMessage::RecordBVHRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RecordBVHRequest>>("RpcMessage::RecordBVHRequest", pos),
... | Rust | 0 |
will not hold in general
during autoregressive generation. As a result, we define this plan specifically for usage during generation.
Args:
model (nn.Module): Model to generate plan for
Returns:
Dict[str, Any]: The tensor parallel plan for Llama4 model.
"""
plan = {
"decode... | Python | 1 |
"""
return self._VideoTemplate
@VideoTemplate.setter
def VideoTemplate(self, VideoTemplate):
self._VideoTemplate = VideoTemplate
@property
def AudioTemplate(self):
r"""音频流配置参数,当 AudioStreamSwitch 为 on,该字段必填。
:rtype: :class:`tencentcloud.teo.v20220901.models.Audio... | Python | 1 |
"""
图像放大参数数据模型
"""
from dataclasses import dataclass
@dataclass
class ScaleUpParams:
"""图像放大参数基类"""
scale_factor: float = 2.0
algorithm: str = "bilinear"
def __post_init__(self):
"""参数验证"""
if self.scale_factor <= 1.0:
raise ValueError("放大倍数必须大于1.0")
if self.s... | Python | 1 |
let old = self.0;
unsafe {
*(&self.0 as *const _ as *mut _) = new;
}
Ok(old)
}
}
pub fn compare_exchange(
&self,
current: usize,
new: usize,
_success: Ordering,
_failure: Ordering,
) -> Result<usize, usize> {... | Rust | 0 |
ut().emit(s3, true);
while app.wait() {
if let Some(mes) = r3.recv() {
if mes {
get_name.hide();
if let Ok(new_name) = get_name.set_input(lang) {
return match reader_base
.change_name(ind, unsafe { new_name.get_uncheck... | Rust | 0 |
sh Commissioning"]
#[doc = " OpenThread | 0x1900 - 0x19FF | OpenThread specific"]
#[doc = " Server | 0x0A0 - 0x0AF | ALOC Service Server"]
#[doc = " RCP | 0x0B0 - 0x0FF | RCP specific"]
#[doc = " Interface | 0x100 - 0x1FF ... | Rust | 0 |
let data = b"\x00\x01\x02\x03";
let custom = b"My Tagged Application";
let output = b"\x20\xC5\x70\xC3\x13\x46\xF7\x03\xC9\xAC\x36\xC6\x1C\x03\xCB\x64\xC3\x97\x0D\x0C\xFC\x78\x7E\x9B\x79\x59\x9D\x27\x3A\x68\xD2\xF7\
\xF6\x9D\x4C\xC3\xDE\x9D\x10\x4A\x35\x16\x89\xF2\x7C\xF6\xF5\x95\x1F\x0... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.