text string | label_name string | labels int64 |
|---|---|---|
import tkinter as tk
def check_even_odd():
try:
num = int(entry.get())
if num % 2 == 0:
result_label.config(text=f"{num} is an even number.")
else:
result_label.config(text=f"{num} is an odd number.")
except ValueError:
result_label.config(text="Please en... | Python | 1 |
ion']}")
choice = int(input("选择攻击方法编号: "))-1
method = attack_methods[choice]
print(f"\n启动 {method['name']} 攻击...")
threads = []
for _ in range(THREAD_COUNT):
t = threading.Thread(target=attack_handler, args=(
attack_functions[method['name']],
target_ip,
... | Python | 1 |
hdr_t,
pub ufs: Union_Unnamed53,
}
impl ::std::clone::Clone for Struct_x86_avx_state {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_x86_avx_state {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
pub struct Union_Unnamed53 {
pub _bindg... | Rust | 0 |
let post_deletions_path = dirs::post_compaction_deletions_path(
&server.opts.dir,
&compaction_key,
segment_meta.deletion_id,
);
let data = common::read_or_empty(post_deletions_path).await?;
let response = ReadSegmentDeletionsResponse {
data,
..Default::default()
};
... | Rust | 0 |
file("assets/old-self-syntax.txt");
let mut old_in_old_syntax = vec![];
stderr_unwrap(&old_in_old,
parse(&old_syntax, &old_in_old, &mut old_in_old_syntax));
let old_in_old_syntax = bootstrap::convert(&old_in_old_syntax, &mut vec![])
.unwrap();
assert_eq!(old_syntax, old_in_old_syntax);
... | Rust | 0 |
", "ETH-USD", "ADA-USD", "BNB-USD"]
symbols.extend(crypto)
# Check CSV directory for additional symbols
try:
csv_dir = self.data_sources_config.get('csv_data', {}).get('data_directory', './data/csv')
csv_path = Path(csv_dir)
if csv_path.exists():
... | Python | 1 |
: transaction_id,
"product_id": product_id,
"product_name": product["name"],
"product_category": product["category"],
"customer_id": customer_id,
"customer_segment": customer_segment,
"quantity": quantity,
"unit_price": round(unit_price... | Python | 1 |
t_bitwise_and1() {
let bitset1 = BitSet::from_u64(0xDEAD_BEEF);
let bitset2 = BitSet::from_u64(0xDEA0_0EEF);
let expected = BitSet::from_u64(0xDEA0_0EEF);
let result = bitset1 & bitset2;
assert_eq!(result, expected);
}
#[test]
fn test_bitset_bitwise_and2() {
let bitset1 = BitSet::from_u64(0xF0... | Rust | 0 |
[0:3].set(state.ets[1:4]).at[3].set(model_output), # counter != 1
state.ets, # counter 1
),
cur_sample=jax.lax.select(
state.counter != 1,
sample, # counter != 1
state.cur_sample, # counter 1
),
)
st... | Python | 1 |
import pytest
from posthog.test.base import BaseTest
from unittest.mock import MagicMock
from posthog.schema import ErrorTrackingIssueFilter, PropertyOperator
from posthog.models.property.util import property_to_django_filter
class TestPropertyUtil(BaseTest):
def test_property_to_django_filtering(self):
... | Python | 1 |
tom(format!("{}", err)))?,
})
},
}))
}
}
use super::*;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
impl EdgeTypeVocabulary {
fn compute_hash(&self) -> u64 {
let mut hasher = DefaultHasher::new();
self.hash(&mut hasher);
... | Rust | 0 |
class Solution:
def addBinary(self, a: str, b: str) -> str:
return f"{int(a, 2) + int(b, 2):b}" | Python | 1 |
mage_size": [0, 0, w, h],
# 标注文件名称
"ann_path": path,
# 原始图片路径
"raw_image_path": path,
# 实例的序号
"instance_nm": None,
# 多边形的点集
"polygon_points": [],
"resized_polygon_points": [],
# 缩水多边形的点集
"shrink_polygon_points": [],
"re... | Python | 1 |
from .lasot import Lasot
from .got10k import Got10k
from .tracking_net import TrackingNet
# from .imagenetvid import ImagenetVID
# from .coco import MSCOCO
# from .coco_seq import MSCOCOSeq
# from .got10k_lmdb import Got10k_lmdb
# from .lasot_lmdb import Lasot_lmdb
# from .imagenetvid_lmdb import ImagenetVID_lmdb
# fro... | Python | 1 |
"""
🎨 Echo Integration Module
Integrates will detection with Echo composition for beautiful consciousness expression.
"""
from .echo_composer import EchoWillComposer
__all__ = ['EchoWillComposer']
| Python | 1 |
d);
}
let rrr = instruction.modrm_rrr.num & 0b111;
instruction.operands[0] = mem_oper;
instruction.opcode = match rrr {
0 => Opcode::PREFETCHNTA,
1 => Opcode::PREFETCH0,
2 => Opcode::PREFETCH1,
3 => Opcode::P... | Rust | 0 |
exture { .. },
..
})
| Framebuffer::External(())
| Framebuffer::None => context.hidden_window.as_ref().unwrap().get_dc(),
}
}
}
/// Returns a unique ID representing a context.
///
/// This ID is unique to all curren... | Rust | 0 |
form_query.get(*actor) {
for (entity, potion_transform) in potion_query.iter() {
let distance = transform.translation.distance_squared(potion_transform.translation);
if distance < 4096.0 {
if let Ok(mut target) = target_query.get_mut(*actor) {
... | Rust | 0 |
# making the last block of the base model trainable, consisting of 6 layers
config["number_of_trainable_base_layer_blocks"] = 1
tf_model = get_tf_model(config, data, class_map)
assert sum([l.trainable for l in tf_model.layers]) == 13
# making all layers of the base model trainable
c... | Python | 1 |
ctory of this distribution and at https://raw.githubusercontent.com/lemonrock/ucx/master/COPYRIGHT. No part of ucx, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2016 The developers of ucx. See the COPYRIGHT file in... | Rust | 0 |
control-allow-headers: *"),
"Headers missing in {}", response.headers);
}
#[test]
fn should_allow_application_json_utf8() {
// given
let server = serve_hosts(vec!["parity.io".into()]);
// when
let req = r#"{"jsonrpc":"2.0","id":1,"method":"x"}"#;
let response = request(server,
&format!("\
POST / HTTP/1.1\... | Rust | 0 |
messagebox.showerror("Ошибка", "Введите текст для поиска.")
# return
# #### 📜 Початок логування:
# self.log_text.insert(tk.END, f"🔍 Поиск текста: '{search_text}' в архивах папки: {folder}\n")
# self.log_text.see(tk.END)
# ### 🔍 Пошук .edz файлів:
# edz_files = [f for ... | Python | 1 |
a = Int64Array::from(vec![1, 2, 3, 4, 5]);
let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(a)]);
assert!(!batch.is_ok());
}
#[test]
fn create_record_batch_record_mismatch() {
let schema = Schema::new(vec![Field::new("a", DataType::Int32, false)]);
let a = ... | Rust | 0 |
String,
timestamp: u64
) -> ProgramResult {
let account_info_iter = &mut accounts.iter();
let spouse1_account = next_account_info(account_info_iter)?;
let spouse2_account = next_account_info(account_info_iter)?;
let solbond_account = next_account_info(account_info_i... | Rust | 0 |
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from sklearn.metrics import pairwise_distances
from ...tools import linear, power
from .. import HHG
from ..hhg import hoeffdings
class TestFastHHGStat:
@pytest.mark.parametrize("n, obs_stat", [(10, 1.0), (50, 1.0), (100, 1.0)])
@... | Python | 1 |
import net
from terminal import FG, RESET
client = net.TCPClient(net.common.LOCALHOST, 65432)
@client.register
def on_connect():
print("Connected")
@client.register
def on_disconnect():
print("Disconnected")
@client.register
def on_packet(packet: net.common.Packet):
print(f"Packet: {packet.data.decode(... | Python | 1 |
pwm_disable(SERVO_PWM_CHIP, SERVO_PWM_CHANNEL)
pwm_unexport(SERVO_PWM_CHIP, SERVO_PWM_CHANNEL)
pwm_disable(ACTUATOR_PWM_CHIP, ACTUATOR_PWM_CHANNEL)
pwm_unexport(ACTUATOR_PWM_CHIP, ACTUATOR_PWM_CHANNEL)
if gpiod_chip: gpiod_chip.close()
except Exception as e: print(f"An error occurred... | Python | 1 |
cret, salt1 || salt2)
// encrypt(key, demPlaintext) → ciphertext
// Encrypts a plaintext to produce a ciphertext, which may be longer than the plaintext.
// The plaintext is restricted to being a multiple of the AES block size (16 bytes) in length.
self.salt_enc = enc_aes256_c... | Rust | 0 |
resnet18-hand': True,
'densenet121-body': True
}
for net in poseNet_models:
if poseNet_models[net]:
try:
jetson_inference.poseNet(net)
downloaded = downloaded + net + ', '
except:
failed = ... | Python | 1 |
OrConstParamId {
assert_eq!(idx.ui, chalk_ir::UniverseIndex::ROOT);
let interned_id = salsa::InternKey::from_intern_id(salsa::InternId::from(idx.idx));
db.lookup_intern_type_or_const_param_id(interned_id)
}
pub fn to_placeholder_idx(db: &dyn HirDatabase, id: TypeOrConstParamId) -> PlaceholderIndex {
le... | Rust | 0 |
opy_from(vel_surface_observed)
vel_ssa_observed.add(-1, vel_sia_observed)
(designFunctional, stateFunctional) = PISM.invert.ssa.createTikhonovFunctionals(ssarun)
eta = config.get_number("inverse.tikhonov.penalty_weight")
solver_gn = PISM.InvSSATikhonovGN(ssarun.ssa, zeta, vel_ssa_observed, eta, de... | Python | 1 |
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
from .models import Laboratorio, Producto
from .forms import ProductoForm
from laboratorio.models import Laboratorio, DirectorGeneral, Producto
# Create yo... | Python | 1 |
vy_render::RenderPlugin::default());
#[cfg(feature = "bevy_sprite")]
group.add(bevy_sprite::SpritePlugin::default());
#[cfg(feature = "bevy_pbr")]
group.add(bevy_pbr::PbrPlugin::default());
#[cfg(feature = "bevy_ui")]
group.add(bevy_ui::UiPlugin::default());
#... | Rust | 0 |
e(filename, elements):
with open(filename, 'r') as file:
content = file.read()
for element in elements:
if element not in content:
return False
return True
def set_ic_proxy_and_address(context, new_addr, proxy_mode):
"""
set the proper proxy addresse... | Python | 1 |
Y).contains(&value) {
Ok(Quality::from_f32(value))
} else {
Err(QualityOutOfBounds)
}
}
}
/// Represents an item with a quality value as defined in
/// [RFC7231](https://tools.ietf.org/html/rfc7231#section-5.3.1).
#[derive(Clone, PartialEq, Debug)]
pub struct QualityItem<T> ... | Rust | 0 |
def test_time_indices(self):
for t in [0, 50, 99]:
self.check_over_forward(time_step=t)
| Python | 1 |
of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the s... | Rust | 0 |
iter::once((content.as_bytes(), Some(format))))?;
let (config, build_warnings) = builder.build_with_warnings()?;
load_warnings
.into_iter()
.chain(build_warnings)
.for_each(|warning| {
warn!("{}", warning);
});
Ok(config)
}
pub fn get_hostname() -> std::io::Res... | Rust | 0 |
can be found in the LICENSE file.
use crate::generated::css_classes::C;
use seed::{prelude::*, *};
/// A loading interstitial. Needs to be kept in sync with
/// iml-gui/entries/templates/loading_page.hbs
/// to ensure a consistent loading experience.
pub fn view<T>() -> Node<T> {
div![
class![
... | Rust | 0 |
_insert(1) {
2 => {
two_count += 1;
}
3 => {
two_count -= 1;
three_count += 1;
}
4 => {
... | Rust | 0 |
words, panicking of the given function make
/// the forest lose any guarantee of correctness and availability.
///
/// If you want to refer the forest even when panic happens, use panic-safe
/// version [`remove_hooked_panic_safe`][`Self::remove_hooked_panic_safe`].
///
/// # Panics
///
... | Rust | 0 |
import random
rangen = open('random_generations.txt', 'w')
#opens the files to write into
translate = {
'w': 'water',
'r': 'road',
'g': 'grass',
'l': 'log',
's': 'stone'
}
for z in range(200):
randoms = []
if z % 3 == 0:#I want there to be more land than water or road since that makes more... | Python | 1 |
arint32_size(len) + len;
};
if let Some(v) = self.totalonly {
my_size += 3;
}
if let Some(v) = self.ids_only {
my_size += 3;
}
if let Some(v) = self.return_vote_data {
my_size += 3;
}
if let Some(v) = self.return_tags {
... | Rust | 0 |
d(1)] = kapture.PoseTransform()
rigs_kapture, reconstructed_images, reconstructed_trajectories = import_colmap_rig_json(
rigs_colmap=colmap_rigs, images=images, trajectories=trajectories)
self.assertEqual([(0, get_camera_kapture_id_from_colmap_id(0)),
(0, get_camera... | Python | 1 |
s:
It is possible to explode multiple columns only if these columns have
matching element counts.
Arguments:
columns: Column names. The underlying columns being exploded must be of the `List` data type.
*more_columns: Additional names of columns to explode, speci... | Python | 1 |
# occasionally include input image
if np.random.choice([0, 1], p=[0.995, 0.005]) and self.mode == 'train':
nearest_pose_ids[np.random.choice(len(nearest_pose_ids))] = id_render
src_rgbs = []
src_cameras = []
for id in nearest_pose_ids:
src_rgb = imageio.imread(... | Python | 1 |
parser: self.parser,
}
}
}
pub struct TelegramSource<S>
where
S: Storage + Send + Sync,
{
pub(super) collector: Arc<RwLock<TgClient>>,
pub(super) files_directory: String,
pub(super) storage: S,
pub(super) parser: CloneableBoxedParser,
}
impl<S> TelegramSource<S>
where
S: Sto... | Rust | 0 |
:Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tasks_stop](tasks_stop) module"]
pub type TASKS_STOP = crate::Reg<u32, _TASKS_STOP>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _TAS... | Rust | 0 |
self.assertTrue(torch.equal(p1, p2))
# Reset repo
delete_repo(token=TOKEN, repo_id=self.org_repo_id)
# Push to hub via save_pretrained
with tempfile.TemporaryDirectory() as tmp_dir:
model.save_pretrained(tmp_dir, push_to_hub=True, token=TOKEN, repo_id=self.org_repo... | Python | 1 |
_point
})
});
return Box::new(iterator);
}
}
<filename>src/bin/server_handler/handlers/did_change_text_document.rs<gh_stars>1-10
use crate::server_handler::*;
pub struct DidChangeTextDocumentNotificationHandler;
impl NotificationHandler for DidChangeTextDocumentNotificatio... | Rust | 0 |
se,
ignored: false,
};
assert_eq!(s.to_line(), String::from("[master 3845e7a]"));
}
#[test]
fn test_to_line_dirty() {
let s = GitStatus {
oid: String::from("3845e7a3c3aadaaebb2d1b261bf07a9357d35a79"),
branch: String::from("master"),
up... | Rust | 0 |
ported".format(style))
if root:
with msc_dir(root):
retcode = subprocess.call(cmd, shell=True)
else:
retcode = subprocess.call(cmd, shell=True)
assert retcode == 0, "Failed to unpack the folder {}->{}({}): {}".format(
path, dst, style, retcode
)
return dst
get_b... | Python | 1 |
def busca(cartas_principe, cartas_princesa) -> bool:
cp = sorted(cartas_principe)
pr = sorted(cartas_princesa)
vitorias_possiveis = 0
for carta_p in cp:
for carta_pr in pr:
if carta_p > carta_pr:
vitorias_possiveis += 1
usado_princesa = [False] * 3
... | Python | 1 |
ut_dict = {
"image_features": image_features,
"text_features": text_features,
"logit_scale": self.clip_model.logit_scale.exp()
}
# Include logit_bias if it is present in the CLIP model
if hasattr(self.clip_model, 'logit_bias') and self.clip_model.logit_bias i... | Python | 1 |
Address) -> TestResult {
let s = address.to_string();
let address_dec: Address = s.parse().unwrap();
TestResult::from_bool(address == address_dec)
}
fn address_serde_human_readable_encode_decode(address: Address) -> TestResult {
let s = serde_yaml::to_st... | Rust | 0 |
str(content) {
Ok(c) => c,
Err(e) => bail!(e)
};
set_default!(config.language_code, "en".to_string());
set_default!(config.highlight_code, false);
set_default!(config.generate_rss, false);
set_default!(config.rss_limit, 20);
set_default!(config.ge... | Rust | 0 |
BootfsFactory as u32 => {
ZbiType::StorageBootfsFactory
}
zbi_type if zbi_type == ZbiType::Cmdline as u32 => ZbiType::Cmdline,
zbi_type if zbi_type == ZbiType::Crashlog as u32 => ZbiType::Crashlog,
zbi_type if zbi_type == ZbiType::Nvram as u32 => ZbiType::... | Rust | 0 |
::Formatter;
use std::hash::Hash;
use std::mem::MaybeUninit;
use std::str::FromStr;
use std::str::SplitN;
use super::date::Date;
use super::date::DateParseError;
use super::parser::Event;
use super::parser::FieldEvent;
use super::parser::PullEventParser;
use super::parser::PullEventParserError;
use super::LanguageSubta... | Rust | 0 |
import unittest
from prototype import *
class Oveja_test(unittest.TestCase):
def test_clase_oveja(self):
oveja = OvejaConcretePrototype('Dolly', 'droper')
self.assertIsInstance(oveja, OvejaConcretePrototype)
def test_get_nombre(self):
oveja = Oveja('kevin', 'castellana')
s... | Python | 1 |
ttention_mask,
"re_obj_token_type_ids": batch_obj_token_type_ids,
"re_obj_start_labels": batch_obj_start_labels,
"re_obj_end_labels": batch_obj_end_labels,
}
sbj_obj_rel_res = {
"re_rel_input_ids": batch_rel_token_ids,
"re_rel_attention_mask":... | Python | 1 |
# coding: utf-8
"""
Qualtrics Survey API
The Qualtrics Survey endpoints give you access to the structure of the surveys you create. Surveys have a complex structure, and you are encouraged to become familiar with the structure using your brand's Qualtrics page to build surveys at first. Then you can query t... | Python | 1 |
t_pin(stm32f303xc::gpio::PinId::PD01).unwrap(),
58 => &gpio_ports.get_pin(stm32f303xc::gpio::PinId::PC12).unwrap(),
59 => &gpio_ports.get_pin(stm32f303xc::gpio::PinId::PC10).unwrap(),
60 => &gpio_ports.get_pin(stm32f303xc::gpio::PinId::PA14).unwrap(),
61 => &gpio_ports.ge... | Rust | 0 |
from flask import request, jsonify
from html import escape
from datetime import datetime
from functools import wraps
from models.models import Employee
from models.employee_model import get_employee
def retrieve_validate_employee_data_for_update(func):
@wraps(func)
def wrapper(employeeid, *args, **kwargs):
... | Python | 1 |
replay_data[replay_taskid]['x']
ytrain = replay_data[replay_taskid]['y']
if i + batch_per_task <= task_data_num:
index = r[i : i + batch_per_task]
else:
index = r[i:]
... | Python | 1 |
}
None => None,
}
}
fn bounding_box(&self) -> Option<AABB> {
match self.hitable.bounding_box() {
Some(bbox) => Some(AABB {
min: bbox.min + self.offset,
max: bbox.max + self.offset,
}),
None => None,
}
}
... | Rust | 0 |
{
self,
dpi::PhysicalSize,
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{self, Fullscreen, Icon},
ContextBuilder, GlProfile, WindowedContext,
};
use log::trace;
#[cfg(target_os = "linux")]
use glutin::platform::unix::WindowBuilderExtUnix;
use super::settings::Wind... | Rust | 0 |
;
if hex == "" {
Vec::new()
} else {
hex::decode(hex).expect("Expect input to valid hex")
}
}
pub fn bytes_to_hex(input: &[u8]) -> String {
if input.is_empty() {
String::from("0x")
} else {
hex::encode(input)
}
}
pub fn hex_to_byte32(input: &str) -> Result<Byte3... | Rust | 0 |
"""Provider credentials schema used for unit test."""
from typing import Dict, Tuple
test_credentials: Dict[str, Tuple[str, str]] = {
"benzinga": ("token", "MOCK_TOKEN"),
"alpha_vantage": ("apikey", "MOCK_API_KEY"),
"fmp": ("apikey", "MOCK_API_KEY"),
"polygon": ("apiKey", "MOCK_API_KEY"),
"nasdaq"... | Python | 1 |
def prob(data):
# Calculate the frequency of each character in the data
freq = {}
for char in data:
if char in freq:
freq[char] += 1
else:
freq[char] = 1
return freq # Return raw frequencies
def getting_binary(freq):
# Start with the dictionary of frequenci... | Python | 1 |
�', '𝥮', 'ꩣ', '꩜', '𔔧', '🡵',
'𑆩', 'ꀝ', '𛋶', 'ㅶ', '࠰', '\u{18af5}', '𘧂', 'ᮛ', '߸', '\u{1fb8a}', '➹',
'𔕳', '𝕸', 'ᡞ', '𒃙', '𒁜', '𝀻', '𓊱', '掩', '🐄', 'ᘷ', '𒐙',
'ꤌ', 'Ἰ', '🍟', '𑘥', '𛂿', '🚲', 'ﭫ', 'ڭ', 'ఒ', 'ⵆ', '\u{103e}',
'\u{18bb5}', '༶', '⎳', '𐄊', '𐭧', '𐫌', '𓁟', 'ꋒ', '\u{e010b}', '😗'... | Rust | 0 |
r = index_filter
file_path = Path(file_path)
try:
self.writer = WRITER[index_format.lower()](file_path)
except KeyError:
raise ValueError(f"Format '{index_format}' is not supported.")
if not append and file_path.exists():
file_path.unlink()
... | Python | 1 |
mat(time.time()-host_start_time)
# local_sdb_client = boto3.client('sdb', region)
# for i in range(1):
# resp = local_sdb_client.get_attributes(
# DomainName=domain_name,
# ItemName=item_name,
# AttributeNames=['hw_addr', 'ip'],
# ConsistentRead=Tru... | Python | 1 |
end, log_recv) = sync_channel(5);
let (response_send, response_recv) = sync_channel(5);
$mock.read.set_result(Err(UartError::IoError {
cause: ::std::io::ErrorKind::TimedOut,
description: "Mock Timeout".to_owned(),
}));
let oem = OEM6 {
conn: Arc::new... | Rust | 0 |
a NiDkg variant
UnsupportedAlgorithmId(AlgorithmId),
/// Precondition error: The key encryption key was not found.
KeyNotFoundError(KeyNotFoundError),
/// Precondition error: The key encryption key could not be parsed. Was the
/// correct algorithm ID used?
MalformedSecretKeyError(MalformedSec... | Rust | 0 |
d<Xc @@ s\ d d l m Z d d l m Z d d l m Z m Z d d l m Z d d d d g Z d
S( i ( t absolute_importi ( t InstallRequirement( t RequirementSett Requirements( t parse_requirementsR R R R N(
t
__future__R t req_installR... | Python | 1 |
"""
Strimko problem in cpmpy.
From
360: A New Twist on Latin Squares
http://threesixty360.wordpress.com/2009/08/04/a-new-twist-on-latin-squares/
'''
The idea is simple: each row and column of an nxn grid must contain
the number 1, 2, ... n exactly once (that is, the grid must form a
Latin square), and each "stream" (c... | Python | 1 |
Err(..) => continue,
};
return Ok(Some(Match::Constant(c)));
}
}
Ok(None)
}
/// Load a document from the given bytes.
pub(crate) fn load_bytes(&mut self, writer: &mut IndexWriter, bytes: &[u8]) -> Result<()> {
let doc: Doc = load_bytes(b... | Rust | 0 |
BIDDEN),
("ref_mlcube_owner", status.HTTP_403_FORBIDDEN),
("eval_mlcube_owner", status.HTTP_403_FORBIDDEN),
("data1_owner", status.HTTP_403_FORBIDDEN),
("data2_owner", status.HTTP_403_FORBIDDEN),
("other_user", status.HTTP_403_FORBIDDEN),
(None, st... | Python | 1 |
ct_team_name = random_project_name + " Team"
list_team_members_command = 'az devops team list-member --team "' + default_project_team_name + '" --output json --detect false'
list_team_members_output = self.cmd(list_team_members_command).get_output_in_json()
assert len(list_team_membe... | Python | 1 |
from typing import List
import heapq
class Solution:
def minimumTime(self, grid: List[List[int]]) -> int:
if grid[0][1]>1 and grid[1][0]>1 :
return -1
m,n = len(grid), len(grid[0])
min_heap = [(0,0,0)]
visited = set()
while min_heap:
time, ro... | Python | 1 |
import tkinter
from tkinter import *
from tkinter import ttk
from tkinter import filedialog as fb
import buttons_and_boxes as bb
'''
This is a excel parser which can parse data from one or many excel files to one another
'''
class myParser:
def __init__(self):
''''''
'''
Main window and ... | Python | 1 |
reated before 7.3.
"""
block = [ (node.filename, node.linenumber, line, subblock) ]
l = renpy.parser.Lexer(block)
l.advance()
renpy.exports.push_error_handler(l.error)
try:
pf = parsers.parse(l)
if pf is None:
l.error("Could not find user-defined statement at runti... | Python | 1 |
#
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley with assistance from asn1ate v.0.6.0.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Attribute Certificate Policies Extension
#
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc4476.... | Python | 1 |
import pymysql
# Establish the connection
con = pymysql.connect(host="localhost",user="root",password="admin123",db="test_sql")
# creates a cursor object, which is used to interact with the database.
cur=con.cursor()
# create table
# cur.execute("create table resturant(order_id int primary key,dis_name varc... | Python | 1 |
n this test read_timeout is ignored and the timeout used by
send_command should be calculated from global_delay_factor/delay_factor/max_loops
"""
nc = net_connect_newconn
# Force it into Netmiko 3.x compatibility mode
nc.delay_factor_compat = True
allowed_percentage = 0.5
if not fast_cli:
... | Python | 1 |
_tensor
return torch.cat(prediction_ls).argmax(dim=2)
### Stride Utils
def get_stride(seq_len):
"""
Stride to use given a sequence length
Added to ensure we use the same stride across the query
"""
max_len = seq_len - 2
stride = int(max_len * 0.5)
return stride
### Model loa... | Python | 1 |
<MyStructure foo="example">
<bar>examplebar</bar>
</MyStructure>"#;
assert_eq!(
deserialize_xml_attribute(xml).expect("valid"),
XmlAttribute {
foo: "example".to_string(),
bar: "examplebar".to_string()
}
);
}
<reponame>andrewhickman/grpc-client
#![windows_subsy... | Rust | 0 |
ec_nanos() as u64);
assert_eq!(latency.as_secs(), 0);
finished_writes += 1;
}
}
}
data_handle.wait_for_all_appends().unwrap();
let num_secs = args.round_ms / 1000;
(avg_latency.val(), finished_writes / num_secs as u64)
}
#[inline(never)]
fn regular_... | Rust | 0 |
"""Adhocracy frontend customization package."""
import os
import version
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
requires = ['adhocracy_frontend',
... | Python | 1 |
or while reading response from chain-abci: {}", err))?;
match EnclaveResponse::decode(&mut result_buf.as_ref()) {
Ok(EnclaveResponse::GetSealedTxData(Some(sealed_logs))) => {
let txids = decryption_request.body.txs.clone();
let view_key = decryption_request.body.view_key;
... | Rust | 0 |
ype(thing.doomednum() as u32) {
color = match thing_type.category {
idchoppers::universe::ThingCategory::PlayerStart => "green",
idchoppers::universe::ThingCategory::Monster => "red",
idchoppers::universe::ThingCategory::Miscellaneous => "gray",
... | Rust | 0 |
},
"containers": [{"image": "gcr.io/google_containers/pause:2.0", "name": "with-node-affinity"}],
},
"apiVersion": "v1",
"metadata": {"name": "with-node-affinity"},
}
def pod_with_pod_affinity():
return {
"kind": "Pod",
"spec": {
"affinity... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
import mysql.connector
mydb = mysql.connector.connect(host="localhost",username="root",password="",database="agritech")
mycursor = mydb.cursor()
sql="select *from fertilizer"
mycursor.execute(sql)
resultset=mycursor.fetchall()
dhd=[]
dvl=[]
yvl=[]
for x in resultset:... | Python | 1 |
target_amp_factor,
current_ts,
start_ramp_ts,
stop_ramp_ts,
);
let expected = if tick >= MIN_RAMP_DURATION {
target_amp_factor
} else {
initial_amp_factor - (amp_range * tick as u64 / MIN... | Rust | 0 |
per_second::to_tera_bytes_per_second(88e12);
assert_approx_eq!(11264.0, result, 0.01);
}
/// Need to convert to parameterized tests
#[test]
fn it_convert_knownkibibits_per_second_to_tera_bytes_per_second_3() {
let result: f64 = data_transfer_rate::kibibits_per_second::to_tera_bytes_per_second(9000000.0);
ass... | Rust | 0 |
}",
signature, total, e_path
);
eprintln!(" {}", s);
poss_missing += 1;
continue;
}
Err(_) => {
poss_missing += 1;
continue;
}
};
let inx = c.state(... | Rust | 0 |
];
struct Stopwatch {
name: String,
start: f64,
}
impl Stopwatch {
fn start(name: &str) -> Stopwatch {
console!(log, format!("start {}", name));
Stopwatch {
name: name.to_owned(),
start: Date::now(),
}
}
}
impl Drop for Stopwatch {
fn drop(&mut self... | Rust | 0 |
oc = "Possible values of the field `DCOC_SIGN_SCALE_IDX`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DCOC_SIGN_SCALE_IDXR {
#[doc = "1/8"]
_00,
#[doc = "1/16"]
_01,
#[doc = "1/32"]
_10,
#[doc = "1/64"]
_11,
}
impl DCOC_SIGN_SCALE_IDXR {
#[doc = r" Value of the field as raw bi... | Rust | 0 |
import warnings
import matplotlib.font_manager
from matplotlib.pyplot import figure
import numpy as np
import seaborn as sns
from arch import arch_model
import arch.data.sp500
warnings.simplefilter("ignore")
sns.set_style("whitegrid")
sns.mpl.rcParams["figure.figsize"] = (12, 3)
data = arch.data.sp500.load()
market... | Python | 1 |
layer_output[layer_output_name], layer_output_name, layer_output_dir
)
self.input_cntr += 1
def save_layer_output_names(layer_output_names: list, dir_path: str):
"""
This function saves layer-output names into a json file.
:param layer_output_names: Dictionary of layer-name ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.