text string | label_name string | labels int64 |
|---|---|---|
),
/// Cannot open tap interface
OpenTap(net_util::TapError),
/// Cannot allocate IRQ.
AllocateIrq,
/// Cannot configure the IRQ.
Irq(io::Error),
/// Cannot allocate PCI BARs
AllocateBars(pci::PciDeviceError),
/// Cannot register ioevent.
RegisterIoevent(io::Error),
///... | Rust | 0 |
})
.collect(),
},
),
args: Vec::new(),
expr: app(
span,
symbols.symbol("import!"),
vec![project(span, symbols, import)],
),
metadata: Default::default(),
typ: None,
resolved_t... | Rust | 0 |
}
button { "Submit" }
}
};
page::page(host, title, desc, lang, content)
}
#[post("/hello", data = "<user_input>")]
fn hello(user_input: Form<HelloForm>) -> Markup {
html! {
#content {
p { "Hello " (user_input.name) "! This is HTMX." }
}
}
}
#[catch... | Rust | 0 |
a_glass_c_front.dds", 0x5802_3C3C, 0x42E4_1475),
(r"textures\tx_a_glass_c_side.dds", 0x5802_3C3C, 0x4C29_F38B),
(r"textures\tx_a_glass_emerald.dds", 0x5802_3C3C, 0x79D6_527D),
(r"textures\tx_a_glass_shield.dds", 0x5802_3C3C, 0xAF54_259E),
(r"textures\tx_a_glass_h_back.dds", 0x5802_3C3C, 0xBEDC_1F60)... | Rust | 0 |
let cpr_type_str = format!("{}", return_t);
let mut upper_cpr_type_str = if let true = is_string_numeric(&cpr_type_str[1..]) {
cpr_type_str.to_uppercase()
} else {
cpr_type_str
};
if upper_cpr_type_str == "bool" {
upper_cpr_type_str = "Bool".to_string();
}
let getter... | Rust | 0 |
import uvicorn
from app.params import API_PORT, DEBUG
if __name__ == "__main__":
uvicorn.run("api_server.app:app", host="0.0.0.0", port=API_PORT, reload=DEBUG) | Python | 1 |
tSizeAvg,
cicBwdSegmentSizeAvg,
cicFwdBytesBulkAvg,
cicFwdPacketBulkAvg,
cicFwdBulkRateAvg,
cicBwdBytesBulkAvg,
cicBwdPacketBulkAvg,
cicBwdBulkRateAvg,
cicSubflowFwdPackets,
cicSubflowFwdBytes,
cicSubflowBwdPackets,
cicSubflowBwdBytes,
cicFWDInitWinBytes,
cicBwdInitWinBytes,
cicFwdActDataPkts,
cicFwd... | Python | 1 |
)]
pub fn gen_u32(&mut self) -> u32 {
self.state ^= self.state << 13;
self.state ^= self.state >> 17;
self.state ^= self.state << 5;
self.state
}
#[inline(always)]
pub fn gen_bits(&mut self, bits: u32) -> u32 {
self.gen_u32() & ((1 << bits) - 1)
}
#[inli... | Rust | 0 |
warning(f"无法获取租户 {tenant['resource_name']} 的网关访问数据")
continue
domains = body["data"]["result"]
total_domains_found += len(domains)
for domain in domains:
# 提取路由名称和带宽使用量
route = domain["metri... | Python | 1 |
f not participant_data or participant_data.get("completed") != "N":
# state = schema.procedure_navigator.ProcedureNavigatorStateEnum.done
navigator.subscribe(participant_id=participant.id,
procedure_step_id=participant.current_procedure_step,
... | Python | 1 |
import os
import subprocess
import sys
from typing import List, Optional
def build_executable() -> None:
"""
Build an executable for inspektor.py using PyInstaller.
This function:
1. Checks if PyInstaller is installed and installs it if needed
2. Builds a standalone executable with appropriate opt... | Python | 1 |
unsafe { ::std::mem::zeroed() }
}
}
#[doc = " CREATE CAST Statement"]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct CreateCastStmt {
pub type_: NodeTag,
pub sourcetype: *mut TypeName,
pub targettype: *mut TypeName,
pub func: *mut ObjectWithArgs,
pub context: Co... | Rust | 0 |
e!(f, "C"),
Object(name) => write!(f, "L{};", name.display()),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeDescriptor<'a> {
dimensions: u8,
base: BaseType<'a>,
}
impl<'a> TypeDescriptor<'a> {
pub fn new(base: BaseType<'a>, dimensions: u8) -> TypeDescriptor {
... | Rust | 0 |
;
use na::dimension::{U2, U4};
use na::OMatrix;
use na::{DefaultAllocator, RealField};
use nalgebra as na;
use adskalman::ObservationModel;
// observation model -------
pub struct PositionObservationModel<R: RealField>
where
DefaultAllocator: Allocator<R, U4, U4>,
DefaultAllocator: Allocator<R, U2, U4>,
... | Rust | 0 |
sert(0, '.');
self.map[i*2].insert(0, '#');
self.map[i*2+1].insert(0, '?');
}
self.map[height-1].insert(0, '?');
self.map[height-1].insert(0, '#');
pos.0 += 2;
self.offset.0 += 2;
}
fn push_col_east_if_needed(&mut self, pos: &(usize, usize)) {
... | Rust | 0 |
::sync::Lazy<&'static str> =
once_cell::sync::Lazy::new(|| unsafe {
CStr::from_ptr(nm_sys::NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK)
.to_str()
.unwrap()
});
pub static SETTING_WIRELESS_HIDDEN: once_cell::sync::Lazy<&'static str> =
once_cell::sync::Lazy::new(|| unsafe {
... | Rust | 0 |
Sha256;
use bitcoin::hash_types::{Txid, BlockHash, WPubkeyHash};
use bitcoin::secp256k1::{Secp256k1,Signature};
use bitcoin::secp256k1::key::{SecretKey,PublicKey};
use bitcoin::secp256k1;
use ln::{PaymentHash, PaymentPreimage};
use ln::msgs::DecodeError;
use ln::chan_utils;
use ln::chan_utils::{CounterpartyCommitment... | Rust | 0 |
count = 0
for number in range(1, 10):
if number % 2 == 0:
count += 1
print(number)
print(f"We have {count} even numbers")
def fizz_buzz(input):
if (input % 3 == 0) and (input % 5 == 0):
return "Fizzbuzz"
if input % 3 == 0:
return "Fizz"
if input % 5 == 0:
re... | Python | 1 |
import math
N = int(input())
L = []
for _ in range(N):
place, degree = input().split()
degree = float(degree)
L.append(degree)
L.sort()
GAP = []
for i in range(N-1):
gap = L[i+1] - L[i]
GAP.append(gap)
GAP.append(L[0] - (L[-1] - 360))
print(math.ceil(4320*(360-max(GAP))/360)) | Python | 1 |
from __future__ import annotations
import typing
from microbootstrap.console_writer import ConsoleWriter
from microbootstrap.instruments.instrument_box import InstrumentBox
from microbootstrap.instruments.logging_instrument import LoggingInstrument
from microbootstrap.instruments.opentelemetry_instrument import Opente... | Python | 1 |
.expect("user supplied illegal RPC name");
Request {
http: req,
}
}
/// Get a reference to the message
pub fn get_ref(&self) -> &T {
self.http.body()
}
/// Get a mutable reference to the message
pub fn get_mut(&mut self) -> &mut T {
sel... | Rust | 0 |
# Django's forms system seems to have limited use for our API, since:
# - Django doesn't seem to have JSON field validators.
# - There's no clean way to specify the error 'source' as a JSON pointer.
# The cleanest way would have been to raise ValidationErrors like
# "This field is required. | /images/2", then parse... | Python | 1 |
0. , 2.48539 ],
[ 0.240735, 0.543833, 0.325711, 0.196303, 6.45428 , 0.103604,
3.87344 , 0.42017 , 0.133264, 0.398618, 0.428437, 1.086 ,
0.216046, 0.22771 , 0.381533, 0.786993, 0.291148, 0.31473 ,
2.48539 , 0. ]])
WG01_freqs = {
'A': 0.08662790... | Python | 1 |
from tensorflow.keras.datasets import cifar10
# Load CIFAR-10 dataset
(X_train, y_train), (X_test, y_test) = cifar10.load_data()
# Display some images from the dataset
fig, axes = plt.subplots(2, 5, figsize=(10, 5))
for i, ax in enumerate(axes.flatten()):
ax.imshow(x_train[i])
ax.set_title(f'Label: {y_trai... | Python | 1 |
<Vec<_>, _>>()?,
R_vec: from
.R
.iter()
.map(|R| {
CompressedEdwardsY::from_slice(&R.key)
.decompress()
.ok_or(ConversionError::InvalidPoint)
})... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
celery 任务示例
本地启动celery命令: python manage.py celery worker --settings=settings
周期性任务还需要启动celery调度命令:python manage.py celerybeat --settings=settings
"""
import datetime
from celery import task
from celery.schedules import crontab
from celery.task import periodic_task
from common.log im... | Python | 1 |
# Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from onnx.reference.op_run import OpRun
class OpRunExperimental(OpRun):
op_domain = "experimental"
| Python | 1 |
_rdf_lib[i])
def test_read_file_multival_array_as_set_behavior(neo4j_driver, neo4j_connection_parameters):
"""When importing the data, if a triple will add the same value to a multivalued property it won't be added"""
auth_data = neo4j_connection_parameters
prefixes = {'music': Namespace('neo4j://graph.sc... | Python | 1 |
scroll_x: Option<f32>, // Not Implemented
pub overflow_y: Option<bool>,
pub overflow_x: Option<bool>, // Not Implemented
// Border
pub border_size_t: Option<f32>,
pub border_size_b: Option<f32>,
pub border_size_l: Option<f32>,
pub border_size_r: Option<f32>,
pub border_color_t: Option<Color>,
pub border_color... | Rust | 0 |
: CommandError) -> Self {
Error::CommandError(e)
}
}
impl From<datamodel::error::ErrorCollection> for Error {
fn from(e: datamodel::error::ErrorCollection) -> Self {
Error::DatamodelError(e)
}
}
<filename>examples/barchart_svg.rs
fn main() {
let b1 = plotlib::barchart::BarChart::new(5.3... | Rust | 0 |
) as usize);
let tau = transcript.challenge_vector(b"challenge_tau", num_rounds_x);
// compute the initial evaluation table for R(\tau, x)
let mut poly_tau = DensePolynomial::new(EqPolynomial::new(tau).evals());
let (mut poly_Az, mut poly_Bz, mut poly_Cz) =
inst.multiply_vec(inst.get_num_cons(), z... | Rust | 0 |
.path()
.strip_prefix(&mount.uri_path)
.map(|subpath| {
// Make sure that subpath never starts with `/`.
(subpath.trim_start_matches('/').to_owned(), mount)
})
})
// We want the "most specific" mount, so the lon... | Rust | 0 |
ggez::graphics::queue_text(
ctx,
&text,
ggez::mint::Point2 {
x: coord.x as f32 * self.cell_width,
y: coord.y as f32 * self.cell_height,
},
Some(cell.foreground.to_f32_... | Rust | 0 |
let mut pool: SizedPool16<u8> = SizedPool16::new();
/// assert_eq!(sized_pool::count(&pool), &0);
///
/// sized_pool::push(&mut pool, 10); // index position 0
/// assert_eq!(sized_pool::count(&pool), &1);
///
/// sized_pool::push(&mut pool, 20); // index position 1
/// assert_eq!(sized_pool::... | Rust | 0 |
_SUBPASS_CONTENTS_INLINE: VkSubpassContents = 0;
pub const VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS: VkSubpassContents = 1;
pub const VK_SUBPASS_CONTENTS_MAX_ENUM: VkSubpassContents = 2147483647;
pub type VkSubpassContents = ::std::os::raw::c_uint;
pub const VK_ACCESS_INDIRECT_COMMAND_READ_BIT: VkAccessFlagBits = ... | Rust | 0 |
from pygfx.utils.bounds import Bounds
import numpy as np
def test_points0():
# Zero points -> no bounds
points = np.zeros((0, 3), float)
b = Bounds.from_points(points)
assert b is None
def test_points1():
# Single point, bounds without volume
points = np.array([(0, 0, 0)], float)
b = B... | Python | 1 |
import cocotb
import pytest
from pyuvm import *
@cocotb.test()
async def test_01_uvm_transaction_accept_time(dut):
"""
Test uvm_transaction accept time
"""
tr0 = uvm_transaction()
tr1 = uvm_transaction()
tr0.accept_tr(None)
await cocotb.triggers.Timer(100, "ns")
tr1.accept_tr(None)
... | Python | 1 |
import torch
print(torch.cuda.is_available())
print(torch.__version__)
print(torch.cuda.get_device_name(0) if torch.cuda.is_available() else "No CUDA device available")
print(torch.cuda.current_device() if torch.cuda.is_available() else "No current CUDA device")
print(torch.cuda.device_count() if torch.cuda.is_availab... | Python | 1 |
import os
import subprocess
import hashlib
class SecurityAudit:
def __init__(self, system_path):
self.system_path = system_path
def perform_security_audit(self):
# Implement security audit mechanism using various tools and techniques (e.g., vulnerability scanning, penetration testing)
... | Python | 1 |
an be divided by ORPHAN_RATE_TARGET_RECIP.
pub(crate) const GENESIS_EPOCH_LENGTH: u64 = 1_000;
// o_ideal = 1/40 = 2.5%
const ORPHAN_RATE_TARGET: RationalU256 = RationalU256::new_raw(U256::one(), u256!("40"));
const MAX_BLOCK_INTERVAL: u64 = 48; // 48s
const MIN_BLOCK_INTERVAL: u64 = 8; // 8s
// cycles of a typical ... | Rust | 0 |
last_status_log > 300: # Every 5 minutes
remaining_time = self.power_manager.estimate_remaining_time(power_state)
charging_status = self.power_manager.get_charging_status(power_state)
logger.info(f"Power: {power_state.bat... | Python | 1 |
= "1.3.6.1.4.1.311.10.3.4.1";
#[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"]
pub const szOID_EMBEDDED_NT_CRYPTO: &str = "1.3.6.1.4.1.311.10.3.8";
#[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"]
pub const szOID_ENCLAVE_SIGNING: &str = "1.3.6.1.4.1.311.10.3.42";
#[doc = "*Required fe... | Rust | 0 |
name=f"{_DATASETNAME}_source",
version=SOURCE_VERSION,
description=f"{_DATASETNAME} source schema",
schema="source",
subset_id=f"{_DATASETNAME}",
),
NusantaraConfig(
name=f"{_DATASETNAME}_nusantara_pairs_multi",
version=SOURC... | Python | 1 |
!(act_value, exp_value);
}
}
}
use regex::Regex;
pub const RAW_FLAG: &str = "--raw=";
pub const CAFILE_FLAG: &str = "--cafile=";
pub trait ArgDetection {
fn is_raw_flag(&self) -> bool;
fn is_cafile_flag(&self) -> bool;
fn is_flag(&self) -> bool;
fn is_header(&self) -> bool;
fn is_item(... | Rust | 0 |
6 = self.fig2.add_subplot(4, 1, 3, frameon=False).plot([x for x in range(len(self.sensorDat[5]))], self.sensorDat[5], 'g')
self.cs2.draw()
self.cs2.get_tk_widget().grid(row=0, column=1, rowspan=4, sticky=E)
self.Gyrox['text'] = str(self.sensorDat[3][-1])+"*"
self.Gyroy['text'] =... | Python | 1 |
Ok(true)
} else {
Ok(false)
}
}
}
impl AsRef<Path> for BlockDeviceTarget {
fn as_ref(&self) -> &Path {
self.path.as_ref()
}
}
#[async_trait]
impl SnapshotWriteTarget for BlockDeviceTarget {
// ensures existing size >= length, but otherwise leaves untouch... | Rust | 0 |
fn test_overlay_opacity() {}
#[test]
fn test_relative_luminance() {
let colour_black = Rgb::new(0, 0, 0);
let colour_blue = Rgb::new(0, 0, 255);
let colour_white = Rgb::new(255, 255, 255);
let colour_yellow = Rgb::new(255, 255, 0);
assert_eq!(relative_luminance(&col... | Rust | 0 |
Sized + Copy + Clone {}
/// 2x2 Matrix trait for all types of T
pub trait Matrix2x2<T: NumEx, V2: Vector2<T>>: Matrix<T> {
#[inline(always)]
fn new(m00: T, m01: T, m10: T, m11: T) -> Self {
Self::from_cols(V2::new(m00, m01), V2::new(m10, m11))
}
fn from_cols(x_axis: V2, y_axis: V2) -> Self;
... | Rust | 0 |
import pytest
from spacy.tokens import Doc
from ...util import apply_transition_sequence
@pytest.mark.issue(309)
def test_issue309(en_vocab):
"""Test Issue #309: SBD fails on empty string"""
doc = Doc(en_vocab, words=[" "], heads=[0], deps=["ROOT"])
assert len(doc) == 1
sents = list(doc.sents)
a... | Python | 1 |
lt keyword-values for the arguments with
which the function will be called
"""
Context.__init__(self)
self._function = function
self._defaults = defaults
self._str = "%s, defaults: %s" % (self._function, self._defaults)
getargspec = inspect.getargspec if ... | Python | 1 |
_platforms.contains_key(r) {
return Err(HMError::Regular(hmek::IncorrectPlatformError {
dependency: String::from(r),
platform: our_os,
target_platform: wrong_platforms.get(r).cloned().unwrap(),
}));
} else {
... | Rust | 0 |
# lists_dicts_files.py
# Day 4: Lists, Dictionaries, and File Handling Examples (18 examples)
# =====================
# 📌 LISTLAR (LISTS)
# =====================
# 1. Do'stlar ro'yxatini yaratish
friends = ['John', 'Alex', 'Danny', 'Sobirjon', 'Vanya']
print(" Dastlabki do'stlar:", friends)
# 2. Ro'yxatga yangi do... | Python | 1 |
_season=2024)
# Get games data
print("Scraping games data...")
games_df = scraper.get_all_games()
if games_df is not None:
print(f"Found {len(games_df)} games")
# Compute rolling statistics
print("\nComputing rolling statistics...")
games_df = scraper.comput... | Python | 1 |
domains = DomainsMap::new();
let mut domain = Domain::new("wonderland");
let mut account = Account::new(ALICE_ID.clone());
account.signatories.push(ALICE_KEYS.public_key.clone());
domain.accounts.insert(ALICE_ID.clone(), account);
let asset_definition_id = AssetDefinitionId::new... | Rust | 0 |
', '؝', 'ଛ', '𘬔', 'અ', ' ̄', '⎉', '𝐶',
'🤀', '\u{16af1}', 'ﶯ', 'ݝ', 'ꬬ', 'Ⱏ', 'ú', '⧄', '\u{1b00}', 'Ꮕ', '▜',
'𐰷', '𛄑', '𝙠', 'ሽ', 'ꛂ', '冷', '𝩻', '\u{1da0f}', '𖹊', 'ﭩ', 'ⱶ',
'𛅸', '🅓', 'ᡯ', '𛅴', '⓾', '𞢎', '𝐩', '𝚒', '葉', '𝅄', 'ଥ', 'ѽ',
'𛇠', '𝞜', 'ᑪ', '༝', 'ߢ', 'ۯ', 'ꛒ', 'ꨃ', '𑨭', '𛰃', '𛁰'... | Rust | 0 |
[auto_impl(&, &mut)]
pub trait GetRef<'a, L> {
type Item;
/// Get an immutable reference to the value at `location`.
fn get_ref(&'a self, location: L) -> Self::Item;
}
#[auto_impl(&, &mut)]
pub trait GetRefUnchecked<'a, L> {
type Item;
/// Get an immutable reference to the value at `location`. Do... | Rust | 0 |
tion_keys:
dequeued_workflows += dbos._sys_db.start_queued_workflows(
queue,
GlobalParams.executor_id,
GlobalParams.app_version,
key,
)
else:
... | Python | 1 |
ol()==element]
local_nbrs = [len(atom.GetNeighbors()) for atom in local_elements] #this should support multi metal element core
non_terminal.append(any(nbr_number > 1 for nbr_number in local_nbrs) if local_nbrs else True) # makes sure that if other element filtered for is not is ... | Python | 1 |
of the stack
^, pow : do a power between the 2 values of the stack
== Trigonometry
sin : calculate the sinus of the last value
cos : calculate the cosinus of the last value
== Variables
pi : push pi to the stack
e : push e to the stack
== Misc
sum : sum the stack
mean ... | Rust | 0 |
{
let validated_data = validate_data(data).unwrap();
validated_data
.vaults
.iter()
.map(|vid| get_vault_info(ledger, component, vid))
.collect::<Vec<(Address, Decimal)>>()
})
.collect()
}
fn get_account_vaults<'a,... | Rust | 0 |
tags) they are are converted to the specified byte"]
#[doc = " order."]
#[doc = ""]
#[doc = " \\param[in,out] data EXIF data"]
#[doc = " \\param[in] order byte order"]
pub fn exif_data_set_byte_order(data: *mut ExifData, order: ExifByteOrder);
}
extern "C" {
#[doc = " Return the MakerNote data ... | Rust | 0 |
in_loop_body(e, break_label, cont_label, None, body, emit_block)?;
let i1 = emit_expr::emit_jmpz(e, env, cond, break_label)?.instrs;
Ok(InstrSeq::gather(vec![
i1,
instr::label(start_label),
i2,
instr::label(cont_label),
i3,
instr::label(break_label),
]))
}
fn... | Rust | 0 |
robot in enumerate(self.airbot_players):
jn = robot.joints_num
robot.set_joint_position_target(
action[jn * index : jn * (index + 1)],
[arm_vel],
use_planning,
)
time.sleep(sleep_time)
if get_obs:
obs = self... | Python | 1 |
capacity(n);
p.iter().enumerate().for_each(|(i, j)| match j {
None => to_join.push(Agg::Solo(i)),
Some(j) => match p[*j] {
None => to_join.push(Agg::Solo(i)),
Some(p_i) => {
if p_i != i {
to_join.push(Agg::Solo(... | Rust | 0 |
nonoverlapping(
bytes.as_ptr(),
(pmap.start + offset).as_mut_ptr(),
bytes.len(),
);
self.unmap_area(pmap);
self.free_virtual_area(area);
Some(())
}
/// Write a value into the process memory space
pub unsafe fn process_write_value<T>(
... | Rust | 0 |
interrupt_is_disable(&self) -> bool {
*self == MR0I_A::INTERRUPT_IS_DISABLE
}
}
#[doc = "Write proxy for field `MR0I`"]
pub struct MR0I_W<'a> {
w: &'a mut W,
}
impl<'a> MR0I_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MR0I_A) -> &'a mut W... | Rust | 0 |
optimal_route.index(m) == optimal_route.index(k) + 1):
print(f"Found a dropped edge in optimal_route for instance {i}!")
mean_optimal_obj = np.mean(optimal_objs)
optimal_objs_dict[problem_size] = mean_optimal_obj
# use 2 decimal places
... | Python | 1 |
s")
anomaly_score_rank = 0
for src_fp in sorted_samples_fps[:128]:
src_file_path_parts = src_fp.split("/")
lroc_img_id, img_id = src_file_path_parts[-2], src_file_path_parts[-1]
dst_fp = os.path.join(
dst_fp_root, f"{anomaly_score_rank:04d}__{lroc_img... | Python | 1 |
{
screen.render_to(&mut canvas);
canvas = match matrix.swap(canvas) {
Ok(c) => c,
Err(_) => {
rt.shutdown_background();
break;
}
};
tokio::time::sleep(Duration::from_millis(1000 / opt.fps)).await
}
Ok(())
}
// h... | Rust | 0 |
from abc import ABC
import numpy as np
import tensorflow as tf
from nsma.problems.problem import Problem
class ExtendedProblem(Problem, ABC):
def __init__(self, n: int):
Problem.__init__(self, n)
self.__objectives_hessians = np.empty(0)
self.__filtered_lb_for_ini = np.array([-2.0e19] *... | Python | 1 |
threshold_range = [0, 1]
threshold1.ThresholdRange = threshold_range
# Show data in view
_ = paraview.simple.Show(threshold1, renderView1, "UnstructuredGridRepresentation")
# Hide data in view
paraview.simple.Hide(dtiff, renderView1)
paraview.simple.SaveState(file + ".pvsm")
def open_parav... | Python | 1 |
u32;
#[doc = "*Required features: 'Win32_Networking_WinInet'*"]
pub const INTERNET_DIAL_SHOW_OFFLINE: u32 = 16384u32;
#[doc = "*Required features: 'Win32_Networking_WinInet'*"]
pub const INTERNET_DIAL_UNATTENDED: u32 = 32768u32;
#[repr(C)]
#[doc = "*Required features: 'Win32_Networking_WinInet', 'Win32_Foundation'*"]
#... | Rust | 0 |
',
'has_mounts': False
}
except Exception as e:
return {
'status': False,
'msg': '检测云存储挂载失败: {}'.format(str(e)),
'has_mounts': False
}
class main(projectBase):
def __init__(self):
self.__pa... | Python | 1 |
'''
look for wire[7:0] ABC = PREV+1;
and make module that turns number of state into string.
'''
def help_main(Env):
Mod = Env.Current
List0 = []
for Net in Mod.nets:
Dir,Wid = Mod.nets[Net]
if (Dir == 'wire') and( Wid == (7,0)) and allCapital(Net):
List0.append(Net)
Di... | Python | 1 |
# Umgesetzt in Python 3.8
# Import, um die Punktescharen auf dem Bildschirm plotten zu können
import matplotlib.pyplot as plt
# Definierung des Aussehens des auf dem Bildschirm erscheinenden Koordinatensystem
plt.xlim(-600, 500)
plt.ylim(-600, 500)
ax = plt.gca()
ax.set_aspect('equal', adjustable='box')
plt.draw()
x... | Python | 1 |
# Copyright (c) 2023, Haruka Kiyohara, Ren Kishimoto, HAKUHODO Technologies Inc., and Hanjuku-kaso Co., Ltd. All rights reserved.
# Licensed under the Apache 2.0 License.
from scope_rl.ope.weight_value_learning.base import BaseWeightValueLearner
from scope_rl.ope.weight_value_learning.augmented_lagrangian_learning_dis... | Python | 1 |
b1enr.modify(|_, w| w.canen().enabled()); // can time enb
let mut clock = rcc
.configure()
.sysclk( 48.mhz())
.freeze(&mut ctx_dev.FLASH);
let gpioa = ctx_dev.GPIOA.split(&mut clock);
let gpiob = ctx_dev.GPIOB.split(&mut clock);
let usr_led = gpiob.pb3.into_push_pull_output(&c... | Rust | 0 |
# Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Stock available to promise",
"version": "17.0.1.0.0",
"author": "Numérigraphe, Sodexis, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logi... | Python | 1 |
ig["target_league"]})',
'skill': 'Fireball',
'ascendancy': 'Infernalist',
'dps': 1200000,
'ehp': 6800,
'cost': 25,
'rating': 8.8,
'league': config['target_league'],
'archetype': '法师',
... | Python | 1 |
writer.add_scalar("test_reward", rewards, frame_idx)
writer.add_scalar("test_steps", steps, frame_idx)
if best_reward is None or best_reward < rewards:
if best_reward is not None:
print("Best reward updated: %.3f -> %.3f" % (... | Python | 1 |
32;
#[doc = "*Required features: 'Win32_Networking_WebSocket'*"]
pub const WEB_SOCKET_PING_PONG_BUFFER_TYPE: WEB_SOCKET_BUFFER_TYPE = -2147483643i32;
#[doc = "*Required features: 'Win32_Networking_WebSocket'*"]
pub const WEB_SOCKET_UNSOLICITED_PONG_BUFFER_TYPE: WEB_SOCKET_BUFFER_TYPE = -2147483642i32;
#[doc = "*Require... | Rust | 0 |
# Copyright 2022 netease. All rights reserved.
# Author zhaochaochao@corp.netease.com
# Date 2023/4/10
# Brief Project stop tools.
import os.path
# from common import utils
class GrpsProjectStopper(object):
"""Grps project stopper."""
def __init__(self):
"""Init."""
self.__grps_server_wo... | Python | 1 |
> {
if let Some(c) = input.chars().next() {
if c == 'y' || c == 'Y' {
commands::teardown::exec(config, arg_matches)?;
}
}
}
Err(e) => {
io::stderr().wri... | Rust | 0 |
chema_repo.delete_by_id(fxt_empty_label_schema.id_))
return fxt_empty_label_schema
@pytest.fixture
def fxt_label_schema_factory(
fxt_ote_id,
fxt_classification_labels,
fxt_detection_labels,
fxt_empty_detection_label,
fxt_segmentation_labels,
fxt_empty_segmentation_label,
fxt_rotated_de... | Python | 1 |
elf.assertEqual(
with_draw,
'<html><div><body><div class="header"><h1>This is h1 content</h1></div><div class="main-content"><p escaped-attribute="hi">This is a paragraph</p><button role="button">Test events</button><ul><li>List Content 1</li><li>List Content 2</li><ul><li>Sublist Content 1</li>... | Python | 1 |
ss[1:])
firstHostAddress_output = "First Host IP Address for this Subnet: " + convertToDecimal(firstHostAddress)
# Calculate the broadcast address for the subnet
subnetBroadcastAddress = (convertToBinary(subnetNetAddress))[:-numHostBitsPerSubnet] + '1' * numHostBitsPerSubnet
subnetBroadcastAddress_outp... | Python | 1 |
lude::*;
use reqwest::header::{self, HeaderMap, HeaderValue};
use reqwest::Client;
pub use rocket_client_addr::ClientRealAddr;
pub use errors::ReCaptchaError;
use fairing::ReCaptchaFairing;
pub use verification::ReCaptchaVerification;
use verification::ReCaptchaVerificationInner;
use validators::prelude::*;
use val... | Rust | 0 |
dataset.df
df["generated"] = completions
df["pathology"] = np.array(pathologies_test)
df["predicted"] = [c[TARGET_FIELD] for c in completions]
def get_ddx_arr(ddx_arr):
if not isinstance(ddx_arr, list):
# if model doesn't predict an array, this can happen
# we return an empty list, which will lead... | Python | 1 |
import os
from dotenv import load_dotenv
from langchain_huggingface import HuggingFaceEndpoint
class HuggingFaceLLM:
"""
Wrapper for HuggingFace Endpoint using LangChain-HuggingFace.
Validates environment config and prevents runtime errors due to missing provider/model.
"""
def __init__(self, temp... | Python | 1 |
error::NotSupportedError::new(),
))
}
pub fn raw_window_handle(&self) -> RawWindowHandle {
let mut handle = AndroidNdkHandle::empty();
if let Some(native_window) = ndk_glue::native_window().as_ref() {
handle.a_native_window = unsafe { native_window.ptr().as_mut(... | Rust | 0 |
loop:
tmp = sp.call('clear',shell=True)
while True:
priceTracker = PriceTracker()
priceTracker.get_current_price()
if onlyPrice:
priceTracker.print_price()
else:
priceTracker.get_user_data()
priceTracker.calculate_profit()
... | Python | 1 |
import os
import argparse
parser = argparse.ArgumentParser(description='generate namelist')
# parser.add_argument('--base_dir', type=str, required=True, help='data directory.')
# parser.add_argument('--result_file', type=str, required=True, help="result file.")
args = parser.parse_args()
# base_dir = args.base_dir
# r... | Python | 1 |
g.progressbar_set_range(resources::IDC_PGB1, 0, 100);
dlg.progressbar_set_pos(resources::IDC_PGB1, 0);
} else {
dlg.progressbar_set_pos(
resources::IDC_PGB1,
... | Rust | 0 |
#!/opt/conda/envs/point-cloud/bin/python
# 实现voxel滤波,并加载数据集中的文件进行验证
import argparse
import os
import numpy as np
import open3d as o3d
from pyntcloud import PyntCloud
def get_voxel_grid_classifier(points, leaf_size):
""" Get a function for 3D point -- voxel grid assignment
Parameters:
points(pandas... | Python | 1 |
;
if rows <= 0 || oo.is_none() {
return Err(RsbpError::NotFound);
}
if let Some(o) = oo {
db.ul.add(&UndoEntry::tb_ort(Some(&o), Some(b)));
}
Ok(b)
}
/// Delete a dataset.
pub fn delete(db: &mut DbContext, b: &TbOrt) -> Result<()> {
let oo = get2(db, b)?;
let rows = diesel::... | Rust | 0 |
import os
import sys
import socket
import re
if __name__ == "__main__":
# get host from environment
host = os.getenv("HOST")
if not host:
print("No HOST supplied from environment")
sys.exit(-1)
# get port from environment
port = int(os.getenv("PORT","0"))
if port == 0:
... | Python | 1 |
['text'])
print(user_file)
return average_sentiment, average_polarity, average_subjectivity, average_post_time_gap, nb_topics, tweet_list['text'].size
def get_all_indicator_users(self):
average_sentiment = []
average_polarity = []
average_subjectivity = []
average_t... | Python | 1 |
# 声明:本代码仅供学习和研究目的使用。使用者应遵守以下原则:
# 1. 不得用于任何商业用途。
# 2. 使用时应遵守目标平台的使用条款和robots.txt规则。
# 3. 不得进行大规模爬取或对平台造成运营干扰。
# 4. 应合理控制请求频率,避免给目标平台带来不必要的负担。
# 5. 不得用于任何非法或不当的用途。
#
# 详细许可条款请参阅项目根目录下的LICENSE文件。
# 使用本代码即表示您同意遵守上述原则和LICENSE中的所有条款。
from abc import ABC, abstractmethod
from typing import Dict, Optional
from playwright.asy... | Python | 1 |
b, 0xb6, 0x2a, 0x93, 0x19, 0x1b, 0xcf, 0x16, 0x12, 0x3a, 0x37,
0x1a, 0x6, 0x68, 0x2b, 0x77, 0x36, 0x8e, 0xe3, 0x72, 0x66, 0xa7, 0xee, 0x47, 0x7a, 0xcc,
0xcc, 0x31, 0x30, 0xd8, 0x9e, 0x74, 0x1d, 0xb0, 0x3a, 0xf2, 0x74, 0xe3, 0x85, 0xec, 0x85,
0x44, 0x10, 0xce, 0xd4, 0x36, 0x40, 0xff, 0x4c, 0x4c, ... | Rust | 0 |
Addr::new(self.address, self.port)
}
pub fn get() -> Option<Self> {
let args: Vec<String> = std::env::args().collect();
let mut opts = Options::new();
opts.optflag("h", "help", "Print this help message");
opts.optopt(
"l",
"listen-address",
"The IP address Sail will listen for incoming connections ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.