text string | label_name string | labels int64 |
|---|---|---|
ry>
NEWMAP = 0xC8,
/// <summary>
/// An array is removed from top of the main stack. Its size is put on top of the main stack.
/// </summary>
SIZE = 0xCA,
/// <summary>
/// An input index n (or key) and an array (or map) are removed from the top of the main stack. Puts True on top of main st... | Rust | 0 |
import streamlit as st
import re
bot_msg_container_html_template = '''
<div style='background-color: #FFFFFF; padding: 10px; border-radius: 5px; margin-bottom: 10px; display: flex'>
<div style="width: 20%; display: flex; justify-content: center">
<img src="https://yt3.googleusercontent.com/ixwBtVrollE0Z5n... | Python | 1 |
niveau = self.niveau_var.get()
salle = self.salle_var.get()
Enseigant_id = self.Enseigant_id_var.get()
if not all([jour, heur, Module, salle, Filiere, Enseigant_id, niveau]):
messagebox.showwarning("Champ manquant", "Veuillez remplir tous les champs.", parent=self.mac)
... | Python | 1 |
pend("libdeflate::libdeflate")
if self.settings.os in ["Linux", "FreeBSD"]:
OpenEXRCore.system_libs = ["m"]
# OpenEXR::OpenEXR
OpenEXR = self._add_component("OpenEXR")
OpenEXR.libs = [f"OpenEXR{lib_suffix}"]
OpenEXR.requires = [
self._conan_comp("OpenEXRC... | Python | 1 |
g_height, seg_width = label_reader.read_image_dims(seg_data)
if height != seg_height or width != seg_width:
raise RuntimeError('Shape mismatched between image and label.')
# Convert to tf example.
example = build_data.image_seg_to_tfexample(
image_data, filenames[i], height... | Python | 1 |
from typing import List, Tuple, Set
Board = List[List[int]]
Coord = Tuple[int, int]
class SudokuEnvironment:
def __init__(self, board: Board):
if len(board) != 9 or any(len(row) != 9 for row in board):
raise ValueError("Board phải là 9x9.")
self.board = [row[:] for row in board]
d... | Python | 1 |
from __future__ import division as __division__
import numpy as __np__
import matplotlib.pyplot as __plt__
from mpl_toolkits.mplot3d import Axes3D
import field
import traceray
import surface
import cal_tools
# test ray.py and traceray.py
# define rays
l1 = __np__.linspace(-5,5,10)
Pos1 = []
for i in l1:
for j in l... | Python | 1 |
(BigDecimal::from(10)).is_ok());
}
#[test]
fn test_add_happy() {
let mut vm = test_vm_num!(4, 5);
let res = vm.eval_instruction(&Instruction::Add);
assert!(res.is_ok());
assert_eq!(
BigDecimal::from(9),
vm.stack.pop_num().expect("should have been a number")
)
}
#[test]
fn test_add_... | Rust | 0 |
(&buffer[..]).unwrap();
assert_eq!(decoded, response);
}
// Decode a response that only has a non-zero length indicating follow-up
// headers, but it is too short to hold the expected header. This should
// return an Error and thus panic on unwrap.
#[test]
#[should_panic(expected = "inv... | Rust | 0 |
@name.setter
def name(self, name):
self._name = name.lower()
| Python | 1 |
(
get_id(stream_name)?
.split(COMPOUND_ID_SEPARATOR)
.map(String::from)
.collect(),
)
}
pub fn get_category(stream_name: &str) -> String {
let (category, _) = split(stream_name);
category
}
pub fn is_category(stream_name: &str) -> bool {
!stream_name.contain... | Rust | 0 |
.placeholders['batch2'], dtype=tf.int64),
[self.batch_size, 1])
self.neg_samples, _, _ = (tf.nn.fixed_unigram_candidate_sampler(
true_classes=labels,
num_true=1,
num_sampled=FLAGS.neg_sample_size,
unique=True,
range_max=len(self.degrees... | Python | 1 |
range(0, 4):
nodes[target].send_tx(tx)
next_nonce += 1
if epoch_id not in seen_epochs:
seen_epochs.add(epoch_id)
if height - 1 in blocks_by_height:
prev_block = blocks_by_height[height - 1]
assert prev_block['result']['header']['epoch_id'... | Python | 1 |
_start_matches("std::option::Option")
.trim_start_matches("option::Option")
.trim_start_matches("Option")
.trim_start_matches('<')
.trim_end_matches('>')
} else {
&ty_string
};
match inner_ty {
"String" | "string::String" | "std::string::Strin... | Rust | 0 |
op_context.clone();
match Client::build("ws://127.0.0.1:8081".parse().unwrap())
.with_custom_api_callback::<ExampleApi, _>(move |response| {
if let Ok(Response::CounterValue(count)) = response {
update_counter_label(&client_context, count);
}
... | Rust | 0 |
import json
import os
import pandas as pd
from sklearn.model_selection import KFold
# k_folder
def get_k_fold(csv_dir, k=5, shuffle=True, out_path='../data'):
assert os.path.exists(csv_dir)
assert k >= 2
os.makedirs(out_path, exist_ok=True)
df = pd.read_csv(csv_dir)
kfold = KFold(k, shuffle=shuff... | Python | 1 |
_func.connect(self.__signal_slot, Qt.ConnectionType.QueuedConnection)
self.taskmanager: TaskManager # 调用时赋值
self.task_type: str # 调用时赋值
self.taskid: int # 调用时赋值
@property
def is_stopped(self) -> bool:
return self.taskmanager.is_finished(self.task_type, self.taskid) or is_exit... | Python | 1 |
sampler=dict(
type='IoUNegPiecewiseSampler',
num=128,
pos_fraction=0.5,
neg_piece_fractions=[0.8, 0.2],
neg_iou_piece_thrs=[0.55, 0.1],
neg_pos_ub=-1,
add_gt_as_proposals=False,
return_i... | Python | 1 |
Register"]
pub pwm_oov: crate::Reg<pwm_oov::PWM_OOV_SPEC>,
#[doc = "0x48 - PWM Output Selection Register"]
pub pwm_os: crate::Reg<pwm_os::PWM_OS_SPEC>,
#[doc = "0x4c - PWM Output Selection Set Register"]
pub pwm_oss: crate::Reg<pwm_oss::PWM_OSS_SPEC>,
#[doc = "0x50 - PWM Output Selection Clear ... | Rust | 0 |
]);
/// let c: [u8; 16] = pack_i16_to_i8_m128i(a, b).into();
/// assert_eq!(c, [255_u8, 2, 253, 4, 251, 6, 249, 8, 9, 10, 11, 12, 13, 242, 15, 240]);
/// ```
#[must_use]
#[inline(always)]
#[cfg_attr(docs_rs, doc(cfg(target_feature = "sse2")))]
pub fn pack_i16_to_u8_m128i(a: m128i, b: m128i) -> m128i {
m128i(unsafe { ... | Rust | 0 |
T)> {}
struct DedupWithCount<I>
where
I: Iterator,
I::Item: PartialEq,
{
iter: I,
peek: Option<I::Item>,
}
impl<I> DedupWithCount<I>
where
I: Iterator,
I::Item: PartialEq,
{
fn new(mut iter: I) -> Self {
DedupWithCount {
peek: iter.next(),
iter,
}
... | Rust | 0 |
impl ResponseWithCodeAndLog for ResponseCheckTx {
fn set_code(&mut self, new_code: u32) {
self.code = new_code;
}
fn add_log(&mut self, entry: &str) {
self.log += entry;
}
}
impl ResponseWithCodeAndLog for ResponseDeliverTx {
fn set_code(&mut self, new_code: u32) {
self.co... | Rust | 0 |
{
decent_toml_rs_alternative::parse_toml(contents)
.map_err(crate::CargoMSRVError::ParseToml)
.map(From::from)
}
}
impl TryFrom<TomlMap> for CargoManifest {
type Error = crate::CargoMSRVError;
fn try_from(map: TomlMap) -> Result<Self, Self::Error> {
let minimum_rus... | Rust | 0 |
& mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
... | Rust | 0 |
import torch
class Diffusion:
def __init__(self, time_steps=1000, beta_start=0.0001, beta_end=0.02, device='cpu'):
self.betas = torch.linspace(beta_start, beta_end, time_steps).float().to(device)
self.alphas = 1. - self.betas
self.alphas_cumprod = torch.cumprod(self.alphas, dim=0)
... | Python | 1 |
# 前提是配置并在指定端口的Chorme浏览器中登录微博, 然后不要关闭浏览器, 运行此脚本既可自动获取并更新cookie
# 如何配置指定端口的Chorme, 见以下教程
# https://euclid-jie.gitbook.io/gitbookdemo/pa-chong-xiang-guan/selenium-pa-chong-xiang-guan#id-5-tuo-guan-zhi-ding-duan-kou-de-liu-lan-qi
from selenium import webdriver
import requests
from bs4 import BeautifulSoup
from .Set_header ... | Python | 1 |
>= position_x
&& click_x < position_x + size_x
&& click_y >= position_y
&& click_y < position_y + size_y
{
Some(self.handler.clone())
} else {
None
}
}
}
pub fn parse_bar(args: impl Iterator<Item = String>) -> Result<Config, Strin... | Rust | 0 |
from PyQt4 import QtCore, QtGui
class MultiFileDialog(QtGui.QFileDialog):
def __init__(self, *args, **kwargs):
super(MultiFileDialog, self).__init__(*args, **kwargs)
self.setOption(QtGui.QFileDialog.DontUseNativeDialog, True)
self.setFileMode(QtGui.QFileDialog.ExistingFiles)
def accep... | Python | 1 |
rmat_REFRESH_VERTEXELEMENTFORMAT_VECTOR4:
Refresh_VertexElementFormat = 3;
pub const Refresh_VertexElementFormat_REFRESH_VERTEXELEMENTFORMAT_COLOR:
Refresh_VertexElementFormat = 4;
pub const Refresh_VertexElementFormat_REFRESH_VERTEXELEMENTFORMAT_BYTE4:
Refresh_VertexElementFormat = 5;
pub const Refresh_Ver... | Rust | 0 |
oats(invoice_root.xpath(rule.get("target_xpath"), namespaces=NS))
actual = sum(sum_vals)
expected = sum(target_vals)
else:
sum_vals = _to_floats(invoice_root.xpath(rule.get("sum_xpath"), namespaces=NS))
... | Python | 1 |
ally, let's tumble through tumbling windows. Tumbling windows divide our data into distinct, non-overlapping intervals of a given length.
#
# Let's divide the time series into tumbling windows of 5 hours each to see how our chocolate consumption varies over distinct periods.
# +
result = table.windowby(
table.time... | Python | 1 |
@require_torch_accelerator_with_training
def test_training(self):
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()
model = self.block_class(**init_dict)
model.to(torch_device)
model.train()
output = model(**inputs_dict)
if isinstance(output, Tuple):
output = output... | Python | 1 |
variant="primary", visible=True
)
close_denoise_button = gr.Button(
value=process_info(process_name_denoise, "close"), variant="primary", visible=False
)
with gr.Accordion(label="0c-" + i18n("语音识别工具")):
with gr.Row():
... | Python | 1 |
# Copyright 2021 James McCauley
#
# 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 applicable law or agreed to in writi... | Python | 1 |
from sqlalchemy import CheckConstraint, Column, Float, Index, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from Service.config import Base
class DBSeverityVotes(Base):
__tablename__ = 'severity_votes'
project_id = Column(Integer, ForeignKey('projects.id', ondelete='CASCA... | Python | 1 |
turns:** If the window was previously visible or not.
pub fn show_window(hwnd: HWND, command: SW) -> bool {
unsafe { ShowWindow(hwnd, command as _) }.into()
}
/// A class atom from [RegisterClassExW](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclassexw)
#[derive(Debug, Clone, Copy, ... | Rust | 0 |
uest| &mut m.igate,
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<
_,
::protobuf::types::ProtobufTypeBool,
>(
"skip_default_hooks",
|m: &ConnectModulesRequest| &m.skip_default_hooks,
... | Rust | 0 |
&mut dyn VirtualCpu) -> std::io::Result<()> {
panic!("opcode EOR (Eor) not implemented!");
// Ok(())
}
}
/// EorAbsY: EOR absolute, indexed by Y
pub struct EorAbsY { }
impl Instruction for EorAbsY {
fn opcode (&self) -> &'static str { "EOR"}
fn hexcode(&self) -> Byte { 0x59 }
fn execut... | Rust | 0 |
161135839, -87.081773601},
{0xd31ac1fe07a4fe6d, "uded3zh7nmz6", 59.497006264, 27.504893955},
{0x09ce479d626e95fa, "1774g7c2eubz", -71.21463971, -119.386548919},
{0x0aabc854d82873e7, "1bpwhp6s51ty", -88.904791225, -90.523773913},
{0x95bbf9abd62be7e8, "kqxzmbyq5gmy", -7.15791765, 22.409875... | Rust | 0 |
Manager>>,
stop_commands: Vec<ButtplugDeviceCommandMessageUnion>,
}
impl ButtplugProtocol for Vibratissimo {
fn new_protocol(
name: &str,
message_attributes: DeviceMessageAttributesMap,
) -> Box<dyn ButtplugProtocol> {
let manager = GenericCommandManager::new(&message_attributes);
Box::new(Self ... | Rust | 0 |
oinbase_v1::*;
pub use consensus_group_failure_v1::*;
pub use consensus_group_v1::*;
pub use create_htlc_v1::*;
pub use dc_coinbase_v1::*;
pub use gen_gateway_v1::*;
pub use gen_price_oracle_v1::*;
pub use oui_v1::*;
pub use payment_v1::*;
pub use payment_v2::*;
pub use pending_txn_status::*;
pub use poc_receipts_v1::*... | Rust | 0 |
def select_topk_candidates(self, distances, n_level_bboxes, mask_gt):
mask_gt = mask_gt.repeat(1, 1, self.topk).bool()
level_distances = torch.split(distances, n_level_bboxes, dim=-1)
is_in_candidate_list = []
candidate_idxs = []
start_idx = 0
for per_level_distances, per_level_boxes in zip(leve... | Python | 1 |
stars>0
use core::ptr::NonNull;
use acpi::AcpiTables;
use x86_64::PhysAddr;
use crate::once::Once;
use super::memory::phys_to_virt;
#[derive(Clone, Copy, Debug)]
pub struct AcpiHandlerImpl {}
impl acpi::AcpiHandler for AcpiHandlerImpl {
unsafe fn map_physical_region<T>(
&self,
physical_address:... | Rust | 0 |
circuit = reader
.get_circuit(&first_circuit.circuit_id)
.expect("Unable to fetch 1st circuit");
assert_eq!(fetched_circuit, Some(first_circuit.clone()));
let service = fetched_circuit
.expect("Unable to get 1st circuit")
.roster
.get(0)
.expect("Unable to get se... | Rust | 0 |
str_start, PoolString, EMPTY_STRING,
TOO_BIG_CHAR,
};
use crate::xetex_synctex::{synctex_start_input, synctex_terminate};
use crate::xetex_texmfmp::{
getmd5sum, gettexstring, is_new_source, make_src_special, maketexstring, remember_source_info,
};
use crate::xetex_xetexd::*;
use bridge::{ttstub_issue_warning, t... | Rust | 0 |
import pytest
from django.test import override_settings
from sentry.metrics.middleware import (
BadMetricTags,
_filter_tags,
add_global_tags,
get_current_global_tags,
global_tags,
)
def test_filter_tags_dev():
with override_settings(SENTRY_METRICS_DISALLOW_BAD_TAGS=True):
_filter_tags... | Python | 1 |
true)
} else if let Some(v) = src.strip_prefix('+') {
(v, false)
} else {
(src, false)
};
let (radix, digits) = match val.get(0..2) {
Some("0x") | Some("0X") => (16, &val[2..]),
Some("0o") | Some("0O") => (8, &val[2..]),
Some(... | Rust | 0 |
: Vec<CodeableConcept>,
) -> &'a mut ClinicalImpressionBuilder {
self.value["prognosisCodeableConcept"] =
json!(val.into_iter().map(|e| e.value).collect::<Vec<_>>());
return self;
}
pub fn prognosis_reference<'a>(
&'a mut self,
val: Vec<Reference>,
) -> &'a m... | Rust | 0 |
&mut handler, CONTRACT, 1000).unwrap();
assert_eq!(storage_meter.available_storage(), 1000);
assert_ok!(storage_meter.charge(1000));
assert_eq!(storage_meter.available_storage(), 0);
assert_ok!(storage_meter.charge(100));
assert_eq!(storage_meter.available_storage(), 0);
... | Rust | 0 |
{
Ok(config) => config,
Err(e) => panic!(
"Unable to read the config file [{}]: {}",
config_file,
e.to_string()
),
};
let input_format = config
.lookup("input.format")
.map_or(DEFAULT_INPUT_FORMAT, |x| {
x.as_str().expect("i... | Rust | 0 |
= dst.join(file_name);
let _ = fs::remove_file(&dst);
let _ = fs::copy(src, dst);
}
_ => {}
}
}
}
fn env_os(key: impl AsRef<OsStr>) -> Result<OsString> {
let key = key.as_ref();
env::var_os(key).ok_or_else(|| Error::NoEnv(key.to_owned()))
}
<... | Rust | 0 |
e6=\xf3\x9a|\x1b_\x07\xb8\xf1,\
\xab\xfc\xc7LZ\xce\x08\x0e\xe7M\xc2\x1e ^\x8ce\
\xb4\xde\xe4p\x11\x0fB\x84g%\xd9D\xabgU\xda\
\x91\x16V\xa8\xb9r\x00\xda\xe6 km\x80\x8c\xa7\xcd\
\x19\x81\xc3I\xbaNG]Z\xe7\xbd\xaa\x97\x0a\xdad\
\x11\xba\xb6w\xcc\xcc\x99\x09\x85\xcd)\x19\xf4\xb4\x5c\x1f\
p\xc7m\x00\x05\x5c\x9b$\x7f\xb5B\xb2... | Python | 1 |
flow = ControlFlow::Poll;
match event {
Event::WindowEvent { event, .. } => match event {
WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
_ => {}
},
Event::MainEventsCleared => {
factory.maintain(&mut families)... | Rust | 0 |
ernetes.io/force-ssl-redirect: "true"
kubernetes.io/ingress.class: contour
kubernetes.io/tls-acme: "true"
name: ingress-test
spec:
rules:
- host: ingress.test.com
http:
paths:
- backend:
service:
name: ingress-test
port:
number: 80
pa... | Rust | 0 |
gister_dumper(float, FloatBinaryDumper)
adapters.register_dumper(Int2, Int2Dumper)
adapters.register_dumper(Int4, Int4Dumper)
adapters.register_dumper(Int8, Int8Dumper)
adapters.register_dumper(IntNumeric, IntNumericDumper)
adapters.register_dumper(Oid, OidDumper)
# The binary dumper is current... | Python | 1 |
_corners_helper(center_preds, heading_preds, size_preds)
overlap = rbbox_iou_3d_pair(corner_preds.detach().cpu().numpy(), corner_gts.detach().cpu().numpy())
iou2ds, iou3ds = overlap[:, 0], overlap[:, 1]
iou2d_mean = iou2ds.mean()
iou3d_mean = iou3ds.mean()
io... | Python | 1 |
case_byte <= z
{
Some(lower_case_byte)
}
else
{
None
}
},
IanaRegisteredIso639Alpha3Code,
Right,
|index, byte| LanguageExtensionSubtagParseError::InvalidIanaRegisteredIso639Alpha3Code(Alpha::error::<{Self::length}>(index, byte))
)
}
#[unroll_for_loops]
#[inline(always)]
... | Rust | 0 |
# Contents of unit/log_handler.py
'''Copyright (c) 2024 Jaron Cheng'''
import logging
def get_logger(module_name: str, level: int = logging.DEBUG) -> logging.Logger:
"""
Configures and returns a logger for the specified module.
Args:
module_name (str): The name of the module requesting the logger... | Python | 1 |
;
/// An interface for filtering events.
pub trait Filterer: std::fmt::Debug + Send + Sync {
/// Called on (almost) every event, and should return `false` if the event is to be discarded.
///
/// Checking whether an event passes a filter is synchronous, should be fast, and must not block
/// the thread. Do any exp... | Rust | 0 |
新版本"""
url = f"{version.project.node.url}/addversion.json"
if not version.egg_file:
raise Exception("egg_file is not set")
files = {"egg": version.egg_file.open()}
data = {"project": version.project.name, "version": version.version}
resp = requests.post(url, data=data, files=files, auth=_aut... | Python | 1 |
start: u64, end: u64, len: u64, expected_limits: Vec<u64>) {
let series = LimitSeries::new(start.into(), end.into(), len);
let actual_limits = series.into_iter().map(|limit| limit.0).collect::<Vec<_>>();
assert_eq!(actual_limits, expected_limits);
}
#[test]
fn examples() {
... | Rust | 0 |
_exp|: {}, dof: {dof}, chi^2: {chisq}, p-value: {pvalue}",
// counts_exp.dim()
// );
//
// pvalue
// }
#[cfg(test)]
mod test {
use super::*;
use crate::{
dice::{DieDistr, DieKind},
prop::small_rng,
};
use approx::assert_relative_eq;
use claim::{assert_gt, assert_lt};... | Rust | 0 |
Result<Vec<u8>, &'static str> {
let preprocessed_code = get_preprocessed_code(&self.code)?;
let origins = self.get_origins();
let mut byte_code: Vec<u8> = Vec::new();
let mut current_address: u16 = 0;
let mut current_byte_index: usize = 0;
for line in preprocessed_code... | Rust | 0 |
f.min_filter = Some(min);
for output in &mut self.outputs {
Self::adjust_output_level(self.max_filter, self.min_filter, &mut self.max_level_in_use, &mut self.min_level_in_use, output);
}
self
}
pub fn with_max_level_override(mut self, max: log::LevelFilter) -> Self {
... | Rust | 0 |
lf) -> &mut IndexSlice<I, [A]> {
IndexSlice::new_mut(&mut self.raw)
}
}
impl<I: Idx, A> core::ops::Deref for IndexVec<I, A> {
type Target = IndexSlice<I, [A]>;
#[inline]
fn deref(&self) -> &IndexSlice<I, [A]> {
IndexSlice::new(&self.raw)
}
}
impl<I: Idx, A> core::ops::DerefMut for ... | Rust | 0 |
c,
H: FnMut(Req, NextCallbackFut<Req, S>) -> BoxFuture<'static, S> + Send + 'static,
{
let key = InterceptorKey::of::<Req, S>();
let mediator = self.inner.clone();
// FIXME: Find a way to prevent using async in the builder
// We block the thread to keep the api signature con... | Rust | 0 |
import os
import platform
import subprocess
import sys
def install_dependencies():
"""Install required dependencies for building"""
print("Installing build dependencies...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "nuitka"])
subprocess.check_call([sys.executable, "-m", "pip", "in... | Python | 1 |
if i%100 == 0:
train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_:batch[1], keep_prob:1.0})
s = "step %d, train accuracy %g" %(i, train_accuracy)
print s
# if i%2000 == 0:
# with open('out.txt','a') as f:
# f.write(s + "\n"... | Python | 1 |
s specified, then all scopes will be removed and no default scope will be used either.
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
/// function for details).
///
/// Usually there is more than one suitable scope to authorize an operation, some of which... | Rust | 0 |
!(relevant_libs.count(), 0);
}
fn add_upstream_rust_crates(
sess: &Session,
rlibs: &mut Vec<PathBuf>,
codegen_results: &CodegenResults,
crate_type: CrateType,
) {
let (_, data) = codegen_results
.crate_info
.dependency_formats
.iter()
.find(|(ty, _)| *ty == crate_typ... | Rust | 0 |
>)
{
self.visit = Visit::In;
}
}
}
}
true
}
None => false,
}
}
}
impl<'a, K, V> std::iter::Iterator for Iter<'a, K, V> ... | Rust | 0 |
sh = get_old_model_hash(shared.sd_model.sd_checkpoint_info.filename)
r = get_keyword_for_model(model_hash, model_ckpt, return_entry=True)
if r is None:
return {"keywords": [], "model": model_ckpt, "hash": model_hash, "match_source": "no match"}
kws = [x.strip() for x in r[0].split('|... | Python | 1 |
if True:
import sys
sys.path.append('../../../')
import dash
from dash import html
import feffery_antd_components as fac
app = dash.Dash(__name__)
app.layout = html.Div(
[
fac.AntdTable(
columns=[
{
'title': '字段1',
'd... | Python | 1 |
2/", StatusCode::OK),
("/resource1?p1=1&p2=2", StatusCode::OK),
("/resource1/?p1=1&p2=2", StatusCode::NOT_FOUND),
("/resource2?p1=1&p2=2", StatusCode::NOT_FOUND),
("/resource2/?p1=1&p2=2", StatusCode::OK)
];
... | Rust | 0 |
# 문자열로 이루어진 계산식이 주어질 때, 이 계산식을 후위 표기식으로 바꾸어 계산하는 프로그램을 작성하시오.
# 예를 들어
# “3+(4+5)*6+7”
# 라는 문자열로 된 계산식을 후위 표기식으로 바꾸면 다음과 같다.
# "345+6*+7+"
# 변환된 식을 계산하면 64를 얻을 수 있다.
# 문자열 계산식을 구성하는 연산자는 +, * 두 종류이며 문자열 중간에 괄호가 들어갈 수 있다.
# 이 때 괄호의 유효성 여부는 항상 옳은 경우만 주어진다.
# 피연산자인 숫자는 0 ~ 9의 정수만 주어진다.
# [입력]
# 각 테스트 케이스의 첫 번째 줄에... | Python | 1 |
#builder_ident {
#(#fidents: None,)*
#(#opt_fidents: None,)*
#(#each_owners: ::std::default::Default::default(),)*
}
}
}
#[derive(Debug)]
pub struct #builder_ident {
#(#fidents: ::std:... | Rust | 0 |
)
await margins.render(slide1, left=5.25, top=1.5, width=4.5, height=2.8)
# Cash Flow
cashflow = AreaChart(
categories=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
series={
"Operating": [8.2, 7.5, 9... | Python | 1 |
imizer,
**config.auto_lr)
optimizer = build_optimizer(model, config.optimizer)
lr_scheduler = build_lr_scheduler(config, optimizer, train_dataloader, lr_scale_ratio)
timestamp = time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime())
if accelerator.is_main_process:
... | Python | 1 |
EnumWindows(Some(callback), 0i64) };
let lock = CLIENTS.clone();
let vec = lock.lock().unwrap();
vec.clone()
}
fn get_base_name(pid: u32) -> OsString {
// Get an executable name from process ID.
const BUF_LEN: usize = 64;
let h_process = unsafe { kernel32::OpenProcess(0x0400 | 0x0010, 0, pid.to... | Rust | 0 |
import pandas as pd
import os
import streamlit as st
# Initialize or load analytics data
analytics_file = "analytics.csv"
if os.path.exists(analytics_file):
df = pd.read_csv(analytics_file)
else:
df = pd.DataFrame(columns=["intent", "count"])
df.to_csv(analytics_file, index=False)
def update_analytics(i... | Python | 1 |
,
is_composio_managed=getattr(item, 'is_composio_managed', True),
restrict_to_following_tools=getattr(item, 'restrict_to_following_tools', []),
toolkit_slug=getattr(item, 'toolkit_slug', toolkit_slug or '')
)
auth_configs.append... | Python | 1 |
_key.generate_public_key();
let s = format!("{}", public_key);
let public_key2: PublicKey = (&s).into();
assert_eq!(32, public_key.len());
assert_eq!(format!("{}", public_key), format!("{}", public_key2))
}
#[test]
fn test_signature() {
let message = String::from("... | Rust | 0 |
"""Empty init."""
from .mesh_conversion_cli import cli # noqa: F401 | Python | 1 |
_working_is
except:
DanMu_danmu_working_is = False
if not DanMu_danmu_working_is:
obs.script_log(obs.LOG_INFO, "发送弹幕")
# 弹幕切分
if not send_danmu_msg_list_clock:
danmu_msg_list_split = split_of_list(danmu_msg, list(emoji_face_list_dict_elements.keys()))
... | Python | 1 |
/// An ITCH protocol message. Refer to the protocol spec for interpretation.
#[derive(Debug, Clone, PartialEq)]
pub struct Message {
pub tag: u8,
pub stock_locate: u16,
pub tracking_number: u16,
pub timestamp: u64,
pub body: Body,
}
/// The message body. Refer to the protocol spec for interpretatio... | Rust | 0 |
CARD = 1,
D3DSWAPEFFECT_FLIP = 2,
D3DSWAPEFFECT_COPY = 3,
D3DSWAPEFFECT_OVERLAY = 4,
D3DSWAPEFFECT_FLIPEX = 5,
}}
ENUM!{enum D3DPOOL {
D3DPOOL_DEFAULT = 0,
D3DPOOL_MANAGED = 1,
D3DPOOL_SYSTEMMEM = 2,
D3DPOOL_SCRATCH = 3,
}}
pub const D3DPRESENT_RATE_DEFAULT: ::DWORD = 0x00000000;
STRUCT!... | Rust | 0 |
rte_sctp_hdr))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rte_sctp_hdr>())).src_port as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(rte_sctp_hdr),
"::",
stringify!(src_port)
)
);
assert_eq!(
... | Rust | 0 |
-10
use hyper::body::Bytes;
use std::path::Path;
#[derive(Clone)]
pub struct DockerResponse {
pub status: u16,
pub body: Bytes,
}
impl DockerResponse {
pub fn body_as_string(&self) -> String {
String::from_utf8(
self.body.to_vec()
).unwrap()
}
pub fn save_to_file(&self, p... | Rust | 0 |
s sent by the client or browser as the origin of the request. It is set through an `Origin` header. * **Access-Control-Allow-Methods**: This specifies the allowed options for requests from that domain. This will generally be all available methods. * **Access-Control-Expose-Headers**: This will contain the headers t... | Python | 1 |
if i > 0 {
write!(fmt, " ")?;
part.fmt(fmt)?;
}
}
Ok(())
}
Frame::Ping => write!(fmt, "PING"),
Frame::Pong => write!(fmt, "PONG"),
Frame::NoRes => write!(fmt, "NoRes"),... | Rust | 0 |
from interbotix_ux_modules.arm import InterbotixManipulatorUX
import math
# This script makes the end-effector perform pick, pour, and place tasks
#
# To get started, open a terminal and type 'roslaunch interbotix_uxarm_control uxarm_control.launch robot_model:=uxarm6 use_gripper:=true robot_ip:=<robot_ip>'
# Then cha... | Python | 1 |
from django.urls import path
from onlineshop.views import OrderView
urlpatterns = [
path('order/', OrderView.as_view(), name='order'),
]
| Python | 1 |
ze, Deserialize)]
struct SafeKeeperRequest {
/// Sender's node identifier (looks like we do not need it for TCP streaming connection)
sender_id: NodeId,
/// start position of message in WAL
begin_lsn: Lsn,
/// end position of message in WAL
end_lsn: Lsn,
/// restart LSN position (minimal LS... | Rust | 0 |
= 16;
pub const IXGBE_LSECTXCTRL_EN_MASK: u32 = 0x00000003;
pub const IXGBE_LSECTXCTRL_DISABLE: u32 = 0x0;
pub const IXGBE_LSECTXCTRL_AUTH: u32 = 0x1;
pub const IXGBE_LSECTXCTRL_AUTH_ENCRYPT: u32 ... | Rust | 0 |
retain=True)
except KeyboardInterrupt:
logger.info("Получен сигнал прерывания. Завершение работы...")
process.terminate()
client.publish("nvidia-smi/availability", "offline", qos=1, retain=True)
client.loop_stop()
break
except Exception as e:
... | Python | 1 |
detail_url",
"themes",
"platforms",
"original_release_date",
"image",
"id",
"guid",
"expected_release_year",
"expected_release_quarter",
"expected_release_month",
"expected_release_day",
"developers",
"deck",
// "description", // mostly html ... | Rust | 0 |
'L') => {
let horizontal = Horizontal {
x0: x - value,
x1: x,
y,
rightward: false,
steps,
};
segments.push(Segment::Horizontal(horizontal));... | Rust | 0 |
ted collection.
///
/// This use-cases of this method are broadly similar to those of [`Iterator::flatten`].
///
/// The output type of this parser is `Vec<T>`, where the original parser output was
/// `impl IntoIterator<Item = impl IntoIterator<Item = T>>`.
fn flatten<T, Inner>(self) -> Map<Sel... | Rust | 0 |
boxes.append([x, y, int(width), int(height)])
confidences.append(float(confidence))
classIDs.append(classID)
centers.append((centerX, centerY))
# apply non-maxima suppression to suppress weak, overlapping bounding
# boxes
idxs = ... | Python | 1 |
def allclose(A, B, rtol=1e-05, atol=1e-08):
if len(A) != len(B):
return False
for x, y in zip(A, B):
if abs(x-y) > atol + rtol * max(abs(x), abs(y)):
return False
return True
| Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.