text string | label_name string | labels int64 |
|---|---|---|
node_to_comment(node: SyntaxNode) -> Value {
Value::Comment(node.token_text())
}
fn node_to_string(node: SyntaxNode) -> Value {
let mut string = node.token_text();
if string.starts_with("\"\"\"") {
string = strip_start_end(string, 3);
} else if string.starts_with('\"... | Rust | 0 |
xpression >>
(ast::InlineExpression::VariantExpression(variant_expression))
) | do_parse!(
call_expression: call_expression >>
(ast::InlineExpression::CallExpression(call_expression))
) | do_parse!(
identifier: identifier >>
(ast::InlineExpression::Identifier(identifier))... | Rust | 0 |
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
import mysql.connector
from tkinter import messagebox
import login
import tkinter as tk
from AboutDevelopers import aboutDevelopers_page
from Faculty_Mark_attendance import faculty_mark_attendance
from Faculty_attendance_View import faculty_attendance_view... | Python | 1 |
assert!(
is_match,
"Typecheck failure. Wanted {}, got {:?}.",
expected_type, value
);
let _v: serde_json::Value = value.try_into().unwrap();
... | Rust | 0 |
# import argparse
import h5py
import numpy as np
import scipy.sparse as sp
from scipy.spatial import cKDTree
# def import_class(name):
# try:
# components = name.split('.')
# module = __import__(components[0])
# for c in components[1:]:
# module = getattr(module, c)
# exce... | Python | 1 |
action can be run multiple times and produces a future.
pub trait Action {
/// The future that this action produces.
type Future: Future<Item=Self::Item, Error=Self::Error>;
/// The item that the future may resolve with.
type Item;
/// The error that the future may resolve with.
type Error;
... | Rust | 0 |
(), yl, y, &[Color(col), Caption(&s), LineWidth(1.0)]);
}
}
}
let mut fg = fb.build("level_analysis_theory_rebal");
draw_graph(
&format!("Rebal Level Comparisons with {} Objects", num_bots),
&mut fg,
&res1,
true,
0,
);
draw_graph(
... | Rust | 0 |
#!/usr/bin/env python
'''
Developer: Changming Yue, yuechangming10@gmail.com
perform symmetrization for tight-binding Hamiltonian abtained by
wannier110. For equivalent atoms, local axices should be set in
wannier110.win file.
'''
import datetime,sys,io
import numpy as np
from poswansymop_datas import *
from read_ha... | Python | 1 |
"""Specification parser implementations for the SpecEval framework."""
from .markdown import MarkdownParser
from .jsonl import JsonlParser
__all__ = [
"MarkdownParser",
"JsonlParser",
]
| Python | 1 |
usize),
}
pub fn cli_options() -> clap::App<'static, 'static> {
fn is_usize(s: String) -> Result<(), String> {
s.as_str()
.parse::<usize>()
.map(|_| ())
.map_err(|e| format!("{:?}", e))
}
clap_app! { exp00002 =>
(about: "Run experiment 00002. Requires `s... | Rust | 0 |
)
except:
response_payload = None
http_response = {
"payload": response_payload,
"headers": dict(response.headers),
"status": response.status_code,
}
_LOGGER.debug(
... | Python | 1 |
# -*- coding: utf-8 -*-
# Автор: Гусев Илья
# Описание: Модуль создания стихотворений.
from typing import Optional
from allennlp.data.vocabulary import Vocabulary
from rulm.language_model import LanguageModel
from rupo.main.vocabulary import StressVocabulary
from rupo.generate.transforms import PoemTransform
class... | Python | 1 |
1px solid #CCCCCC; /* 设置表头边框 */
# # # # # # # # # # # # font-weight: bold; /* 设置表头字体加粗 */
# # # # # # # # # # # # font-size: 14px; /* 设置表头字体大小 */
# # # # # # # # # # # # }
# # # # # # # # # # # # """
# # # # # # # # # # # # # ====================== 程序代码(保持不变)======================
# # # # # # ... | Python | 1 |
ne in `a` is shifted by the same indexed `u64` lane in
/// `count`.
/// ```
/// # use safe_arch::*;
/// let a = m128i::from([100_u64, 110]);
/// let count = m128i::from([1_u64, 2]);
/// let out: [u64; 2] = shr_each_u64_m128i(a, count).into();
/// assert_eq!(out, [100_u64 >> 1, 110 >> 2]);
/// ```
/// * **Intrinsic:**... | Rust | 0 |
Res, c: Er) -> TestResult {
let cbor_a = minicbor::to_vec(&a.0).unwrap();
let cbor_b = minicbor::to_vec(&b.0).unwrap();
let cbor_c = minicbor::to_vec(&c.0).unwrap();
assert!(minicbor::decode::<Response>(&cbor_a).is_err());
assert!(minicbor::decode::<Error>(&cbor_a).is_err());
... | Rust | 0 |
re Terminal: Clone + Debug + Eq + Hash
{
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{:?}", self.0)
}
}
/// Creates a new ´TerminalMatcher´.
macro_rules! terminal_matcher {
($name: expr, $($pattern: pat => $result: expr),*) => {{
use $crate::parser::grammar::symbol::TerminalMatc... | Rust | 0 |
order.write_xlsx(self.exp_name, total_results)
def _test_process(self, save_pre):
loader = self.te_loader
pres = [AvgMeter() for _ in range(256)]
recs = [AvgMeter() for _ in range(256)]
meanfs = AvgMeter()
maes = AvgMeter()
tqdm_iter = tqdm(enumerate(loader), total... | Python | 1 |
writer.write_packet(&pcap).unwrap();
/// }
/// ```
#[derive(Debug)]
pub struct PcapWriter<T: Write> {
pub header: PcapHeader,
writer: T,
}
impl<T: Write> PcapWriter<T> {
/// Create a new `PcapWriter` from an existing writer in BigEndian.
///
/// It Automatically writes this default global pcap he... | Rust | 0 |
"name": "paypal",
"ref": "credentials/paypal"
}
],
"collections": [
{
"name": "sponsorships",
"ref": "public/subscriptions/sponsorships",
"order_by": "cost",
"desc": True
}
]
... | Python | 1 |
bits / GROUP_SIZE;
// If the number of significant bits is not a multiple of GROUP_SIZE,
// we'll need to add one more group to hold the last few bits.
if number_of_significant_bits % GROUP_SIZE != 0 {
n += 1;
}
... | Rust | 0 |
(Deserialize))]
#[derive(Debug)]
struct UdsTask {
uds: String,
}
#[cfg(feature = "json")]
#[derive(Debug, Deserialize)]
#[serde(untagged)]
enum Task {
Tcp(TcpTask),
#[cfg(unix)]
Uds(UdsTask),
}
#[inline]
fn exec(sources: Vec<&str>) -> Result<(), Box<dyn Error>> {
let mut iter = sources.into_iter()... | Rust | 0 |
-> Point {
Point(self.0 - other.0, self.1 - other.1)
}
}<filename>src/books/book_sys.rs
extern crate fltk;
extern crate yaml_rust;
use crate::{
books::{book::Book, date::Date, the_book::TheBook, ResultSelf},
reading::{read_base::ReaderBase, reader::Reader},
Lang,
};
use std::{
borrow::*,
... | Rust | 0 |
/// C++ method: <span style='color: green;'>```const char* i18n::phonenumbers::UnicodeText::const_iterator::utf8_data() const```</span>
///
///
pub fn utf8_data(&self) -> *const libc::c_char {
unsafe { ::ffi::libphonenumber_sys_c_i18n_phonenumbers_UnicodeText_const_iterator_utf8_dat... | Rust | 0 |
# Initial small spike
small_spike = self.create_custom_spike(1.5, 60.0)
events.append(self.workload_generator.trigger_traffic_spike(small_spike))
# Model deployment after 2 minutes
deployment = self.create_deployment_scenario("gpt-4-optimized", 75.0)
time.sleep(120) # W... | Python | 1 |
tr, Any]:
"""Get current logging configuration status."""
mode = detect_logging_mode()
log_dir = Path("logs")
return {
"mode": mode,
"log_directory": str(log_dir.absolute()) if log_dir.exists() else None,
"log_files": {
"main": str(log_dir / "voiceover-mage.log") if ... | Python | 1 |
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Field Service Activity",
"summary": """Field Service Activities are a set of actions
that need to be performed on a service order""",
"version": "17.0.1.1.0",
"category": "... | Python | 1 |
ement_commands.append("set_property LOC GTHE4_CHANNEL_X0Y3 [get_cells -hierarchical -filter {{NAME=~*pcie_usp_i/*gthe4_channel_gen.gen_gthe4_channel_inst[3].GTHE4_CHANNEL_PRIM_INST}}]")
# Ethernet / Etherbone ---------------------------------------------------------------------
if with_ethernet or with... | Python | 1 |
# Copyright (c) Facebook, Inc. and its affiliates.
from detectron2.data import transforms as T
from .transforms.custom_augmentation_impl import EfficientDetResizeCrop
def build_custom_augmentation(cfg, is_train, scale=None, size=None, \
min_size=None, max_size=None):
"""
Create a list of default :class:`A... | Python | 1 |
.about("Print the query data for the top N clients")
.arg(Arg::with_name("topn")
.short("-n")
.long("--topn")
.value_name("INT")
.default_value("25")
.help("Print this many clients")
)
)
.su... | Rust | 0 |
{
sandbox.recv(&prevote);
}
let block = sandbox.create_block_skip();
let block_hash = block.object_hash();
let our_precommit = sandbox.create_precommit(
ValidatorId(0),
Height(1),
Round(1),
propose_hash,
block_hash,
sandbox.time().into(),
... | Rust | 0 |
th = if is_extended {
decode_length_determinent(data, None, None, false)?
} else {
decode_length_determinent(data, lb, ub, false)?
};
let mut out = String::new();
if length > 0 {
let length = length * num_bits;
if length > 16 {
data.decode_align()?;
... | Rust | 0 |
from ticton import TicTonAsyncClient
from ticton.callbacks import (
OnTickSuccessParams,
OnRingSuccessParams,
OnWindSuccessParams,
)
import asyncio
import os
from dotenv import load_dotenv
import logging
import redis
from mariadb_connector import Alarm, update_alarm_to_db
from tonsdk.utils import Address
f... | Python | 1 |
f::DCH>>) {
debug!("new incoming data channel");
let _ = self.tx_incoming.try_send(DataStream {
inner: data_channel,
rx_inbound: self
.pending
.take()
.expect("`data_channel_handler` was just called synchronously in the same thread"... | Rust | 0 |
_ok, assert_noop,
};
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill,
};
impl_outer_origin! {
pub enum Origin for Test where system = frame_system {}
}
mod kitties {
// Re-export needed for `impl_outer_event!`.
pub use super::super::*;
}
impl_outer_event! {
pub enum Event for ... | Rust | 0 |
ONE_INT_RAW_R(crate::FieldReader<bool, bool>);
impl TOUCH_DONE_INT_RAW_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
TOUCH_DONE_INT_RAW_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TOUCH_DONE_INT_RAW_R {
type Target = crate::FieldReader<bool, bool>;
#[inline... | Rust | 0 |
d);
slope[total].y = ((f1.x * (f3.z - f2.z) - f2.x * f3.z + f3.x * f2.z + (f2.x - f3.x) * f1.z)
/ d);
zoff[total] = ((f1.x * (f3.y * f2.z - f2.y * f3.z) + f1.y * (f2.x * f3.z - f3.x * f2.z) +
(f3.x * f2.y - f2.x * f3.y) * f1.z) / d);
p1[total] = f1.xy;
p2[total] = f2.xy;
p3... | Rust | 0 |
83648_i64);
}
#[test]
fn test_assign_long_overflow_err() {
assert_err!("A& = 2147483648", "Overflow", 1, 1);
assert_err!("A& = -2147483649", "Overflow", 1, 1);
}
}
}
<reponame>FreeMasen/mail_slot<filename>src/mac/client.rs
use crate::Error;
use mach::{
bo... | Rust | 0 |
ailError> {
let mut rng = OsRng {};
let key = match attributes.xtype {
SecretKeyType::Curve25519 => {
let sk = x25519_dalek::StaticSecret::new(&mut rng);
SecretKey::Curve25519(sk.to_bytes())
}
SecretKeyType::Aes128 => {
... | Rust | 0 |
import json
import seaborn as sns
class Style():
def __init__(self, label, color, marker, hatch):
self.label = label
self.color = color
self.marker = marker
self.hatch = hatch
self.index_history = None
# Hatches are set but overwritten by the definition in line 30ff.
styles... | Python | 1 |
m_logger::Config::default());
yew::start_app::<Converter>();
}
use crate::{EnumeratedDevice, EnumerationError};
use pico_common::Driver;
pub trait EnumResultHelpers {
fn missing_drivers(&self) -> Vec<Driver>;
fn devices_and_errors(self) -> (Vec<EnumeratedDevice>, Vec<EnumerationError>);
}
impl EnumR... | Rust | 0 |
ddle.allclose
def allclose_pd(x, y, rtol=1e-05, atol=1e-08, equal_nan=False, name=None):
pprint(x.numpy())
pprint(y.numpy())
return paddle_raw_all_close(x, y, rtol=rtol, atol=atol, equal_nan=equal_nan, name=name)
paddle.allclose = allclose_pd
numpy_raw_all_close = numpy.allclose
... | Python | 1 |
ment
//! let (lop, index) = flare::for_(flare::range(Some(0u32), Some(count))); // loop branch
//! lop.attach(flare::println("{}").arg(index)); // print out index
//! func.attach(lop); // the loop should run in the function
//! func.attach(flare::println("End.")); // print end
//! func.gen_ast()... // create the Rust s... | Rust | 0 |
import nltk
def test_iterating_returns_an_iterator_ordered_by_frequency():
samples = ["one", "two", "two"]
distribution = nltk.FreqDist(samples)
assert list(distribution) == ["two", "one"]
| Python | 1 |
-> bool {
self.gamepads.contains(gamepad)
}
/// Iterates over registered [Gamepad]s
pub fn iter(&self) -> impl Iterator<Item = &Gamepad> + '_ {
self.gamepads.iter()
}
/// Registers [Gamepad].
fn register(&mut self, gamepad: Gamepad) {
self.gamepads.insert(gamepad);
... | Rust | 0 |
_no_sigverify");
validator_config.dev_halt_at_slot = value_t!(matches, "dev_halt_at_slot", Slot).ok();
validator_config.voting_disabled = matches.is_present("no_voting");
validator_config.rpc_config.enable_validator_exit = matches.is_present("enable_rpc_exit");
validator_config.rpc_config.drone_addr ... | Rust | 0 |
ush('1');
}
//字符串翻转
result.chars().rev().collect()
}
/// 力扣(69. x 的平方根) https://leetcode-cn.com/problems/sqrtx/
/// 二分查找,注意相乘溢出
pub fn my_sqrt(x: i32) -> i32 {
let mut left = 0;
let mut right = x;
let mut ans = -1;
while left <= right {
let mid = left + (right - left) / 2;
i... | Rust | 0 |
seat_plan.push(false);
}
}
for boarding_pass in boarding_passes {
let row = find_row(&boarding_pass.seat);
let column = find_column(&boarding_pass.seat);
let seat_id = row * 8 + column;
seat_plan[seat_id] = true;
}
return seat_plan;
}
fn main() {
let args:... | Rust | 0 |
alpha.shape[0]
)))
in_alpha_flag = np.array(np.zeros(in_image_flag.shape), dtype=bool)
for idx, (x, y) in enumerate(pts2d_tmp2[:, :2]):
if in_image_flag[idx] and alpha[y, x, 0] > 0:
in_alpha_flag[idx] = True
... | Python | 1 |
= frappe.get_doc("Holiday List", holiday_list)
holiday_list.holidays = []
holiday_list.save()
onboarding = frappe.new_doc("Employee Onboarding")
onboarding.job_applicant = applicant.name
onboarding.job_offer = job_offer.name
onboarding.date_of_joining = onboarding.boarding_begins_on = getdate()
onboarding.comp... | Python | 1 |
blend_attachment_3, *color_blend_attachment_4];
let color_blend_info = Rc::new(vk::PipelineColorBlendStateCreateInfo::builder()
.logic_op_enable(false)
.logic_op(vk::LogicOp::COPY) // optional
.attachments(&color_blend_attachments_array)
.blend_constants([0.0, 0.... | Rust | 0 |
0x7A00_0000,// Psubq_mm_mmm64
0x0730_0036, 0x7A00_0000,// Psubq_xmm_xmmm128
0x0740_00B7, 0x0F00_0001,// VEX_Vpsubq_xmm_xmm_xmmm128
0x0740_00B7, 0x1100_0001,// VEX_Vpsubq_ymm_ymm_ymmm256
0x0740_00B7, 0x2D00_0002,// EVEX_Vpsubq_xmm_k1z_xmm_xmmm128b64
0x0740_00B7, 0x2D00_0002,// EVEX_Vpsubq_ymm_k1z_ymm_ymmm256b64
0... | Rust | 0 |
String::from(&input) + &tail.to_string());
if sum[0] as i32 + sum[1] as i32 + (sum[2] >> 4) as i32 == 0 {
break;
}
tail += 1;
};
assert_eq!(tail, 346386);
println!("Day 4: Part 1: the lowest number is {}", tail);
tail = 1;
loop {
let sum = md5::comput... | Rust | 0 |
Rotation,
pub Scale: Vec3
}
impl Enemy {
#[allow(non_snake_case)]
pub fn new(ObjectIdentifier: EnemyType) -> Self {
Enemy {
Scale: Enemy::type_scale(&ObjectIdentifier),
ObjectIdentifier,
Position: Vec3::from(0.0),
Rotation: Rotation::zero(),
}
}
pub fn set_type(&mut self, enemy_type: EnemyType) ... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from .h2rbox import H2RBoxDetector
from .h2rbox_v2 import H2RBoxV2Detector
from .refine_single_stage import RefineSingleStageDetector
__all__ = ['RefineSingleStageDetector', 'H2RBoxDetector', 'H2RBoxV2Detector']
| Python | 1 |
92..223
Isr6 = 0x160,
/// In-Service Register bits 224..255
Isr7 = 0x170,
/// Interrupt Request Register bits 0..31
Irr0 = 0x200,
/// Interrupt Request Register bits 32..63
Irr1 = 0x210,
/// Interrupt Request Register bits 64..95
Irr2 = 0x220,
/// Interrupt Request R... | Rust | 0 |
} else {
*byte = Some(i);
}
} else {
self.state = State::Search;
}
}
}
}
i += 1;
}
if sio.input(0).finish... | Rust | 0 |
e at a specified magnification.
Args:
image (openslide.OpenSlide): Whole-slide image opened with openslide.
magnification (float): Desired magnification.
Returns:
image_at (np.ndarray): Image at given magnification.
"""
# get image info
down_factors = im... | Python | 1 |
pp_classes = pp_roi.gt_classes
pp_scores = pp_roi.scores
elif name == "gt":
pp_boxes = pp_roi.gt_boxes
pp_classes = pp_roi.gt_classes
else:
raise ValueError(f"Unknown name for probe roi bbox '{name}'")
device = pp_classes.device
... | Python | 1 |
pp: &App, model: &mut Model, dt: MouseScrollDelta, _phase: TouchPhase) {
model.cam_controller.process_scroll(&dt);
}
fn key_pressed(_app: &App, model: &mut Model, key: Key) {
model.cam_controller.process_keyboard(key, ElementState::Pressed);
}
fn key_released(_app: &App, model: &mut Model, key: Key) {
mod... | Rust | 0 |
r is entered into bullet points
passBox = Entry(window, textvariable=password_var, font=('Arial', 12), show='•', width=27)
passBox.place(relx=0.37, rely=0.4, relheight=0.06, relwidth=0.48)
# Re-type label and text box
repassLabel = Label(window, text="Re-type Password:")
repassLabel.config(font=("Arial... | Python | 1 |
_vec(),
vout,
script_sig: script_sig.clone(),
sequence: match sequence {
Some(v) => v,
None => u32::MAX,
},
satoshis: None,
unlocking_script: None,
}
}
#[cfg_attr(all(target_arch = "wasm32", feature ... | Rust | 0 |
tcp_record = v4_record(query.name().clone(), Ipv4Addr::new(127, 0, 0, 2));
let udp_message = message(query.clone(), vec![udp_record.clone()], vec![], vec![]);
let tcp_message = message(query.clone(), vec![tcp_record], vec![], vec![]);
let mut reactor = Runtime::new().unwrap();
let udp_nameserver = mo... | Rust | 0 |
t_instances.labels = torch.LongTensor([0])
sample.gt_instances = gt_instances
one_gt_losses = cascade_rpn_head.loss(feats, [sample])
for loss in one_gt_losses.values():
loss = sum(loss)
self.assertGreater(
loss.item(), 0,
'cls loss, or box... | Python | 1 |
}
Not(t) => {
if let Some(x) = map.get(t) {
if *x {
return true;
}
} else {
map.insert(t.clone(), false);
}
}
}
}
false
}
fn negator(x: PropS... | Rust | 0 |
and extrahead. Returns (network, out_channels)
"""
def make_layer(layer_cfg):
nonlocal in_channels
# Possible patterns:
# ( 256, 3, {}) -> conv
# ( 256,-2, {}) -> deconv
# (None,-2, {}) -> bilinear interpolate
# ('cat',[],{}) -> concat the subnetworks in... | Python | 1 |
shì"),
('嬖', "bì"),
('嬗', "shàn,chán"),
('嬘', "suì"),
('嬙', "qiáng"),
('嬚', "liǎn"),
('嬛', "huán,xuān,qióng,xuán"),
('嬜', "xīn"),
('嬝', "niǎo"),
('嬞', "dǒng"),
('嬟', "yì,yǐ"),
('嬠', "cān"),
('嬡', "ài"),
('嬢', "niáng"),
('嬣', "níng"),
('嬤', "mā"),
('嬥', "ti... | Rust | 0 |
= astar.result_indies.len() as i16 - 3;
while index >= 0 {
let temp_vector_x = self.nodes[astar.result_indies[index as usize + 1]].column
as i16
- self.nodes[astar.result_indies[index as usize]].column as i16;
let temp_vector_y = ... | Rust | 0 |
d::fmt::Formatter) -> Result<(), std::fmt::Error> {
write!(f, "{}", self.0)
}
}
impl Error for RunError {}
struct SystemdLaunchNotification {}
impl fairing::Fairing for SystemdLaunchNotification {
fn info(&self) -> fairing::Info {
fairing::Info { name: "systemd launch notifier", kind: fairing... | Rust | 0 |
,
loop_vars=[i_time, outputs, tf.Variable([])],
shape_invariants=[i_time.get_shape(),
outputs.get_shape(),
tf.TensorShape([None])])
outputs = tf.stack(tensor_list, axi... | Python | 1 |
;
use northwind_user::domain::user::{Login, LoginResponse, UpdateUserModel, User, UserCreation};
use northwind_user::domain::jwt_processor::JwtProcessor;
use northwind_core::errors::AppError;
use northwind_user::domain::user_repository::UserRepository;
// Route: POST "/v1/login"
pub async fn login(
data: web::Data... | Rust | 0 |
bbsix" : "𝟞",
"\\bbseven" : "𝟟",
"\\bbeight" : "𝟠",
"\\bbnine" : "𝟡",
"\\sanszero" : "𝟢",
"\\sansone" : "𝟣",
"\\sanstwo" : "𝟤",
"\\sansthree" : "𝟥",
"\\sansfour" : "𝟦",
"\\sansfive" : "𝟧",
"\\sanssix" : "𝟨",
"\\sansseven" : "𝟩",
"\\sanseight" : "𝟪",
"\\sa... | Python | 1 |
# Sorting a List in Ascending Order
numbers = [10, 3, 7, 1, 9, 4, 2, 8, 5, 6]
numbers.sort()
print(numbers)
#[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# Sorting a List in Descending Order
numbers.sort(reverse=True)
print(numbers)
#[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
# Built-In Function sorted - it does not update the original li... | Python | 1 |
import pytest
from app import statsd_client
from app.clients.sms import SmsClient, SmsClientResponseException
@pytest.fixture
def fake_client(notify_api):
class FakeSmsClient(SmsClient):
name = "fake"
def try_send_sms(self):
pass
fake_client = FakeSmsClient(notify_api, statsd_cl... | Python | 1 |
"""Add navigation buttion that scroll to top of page."""
from pathlib import Path
from typing import Optional
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.config import Config
from sphinx.locale import get_translation
__version__ = "0.2.0"
here = Path(__file__).parent
locale_dir = he... | Python | 1 |
we really don't want to paramentize
// ToJavaNativeArgument and ToJavaNativeArgumentTuple with lifetimes
// as then it's impossible to use these traits as bounds
// on HKTB-ed closure type in native method wrappers below.
// TODO(monnoroch): clean this up once TODOs below are resolved.
... | Rust | 0 |
import numpy as np
from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc
from ._tools import csgraph_to_dense, csgraph_from_dense,\
csgraph_masked_from_dense, csgraph_from_masked
DTYPE = np.float64
def validate_graph(csgraph, directed, dtype=DTYPE,
csr_output=True, dense_output=True,... | Python | 1 |
ame>zhouyuexie/color-convert<gh_stars>1-10
extern crate color_convert;
pub mod common;
#[cfg(test)]
mod tests {
use color_convert::color::{Color};
use color_convert::handles::rgb;
use common::init_color;
#[test]
fn test_handle_rgb() {
let rgb_vec = vec!["rgb( 81 , 89% , 10%)", "rgba(81%,89%,10%,0.5)", "rgba(81... | Rust | 0 |
import basic_corridor
return basic_corridor.Scenario_BasicCorridor(useName, params["xoff"], withDefaultDemand)
elif which == "BasicNet":
from . import basic_net
return basic_net.Scenario_BasicNet(useName, params["rot"], withDefaultDemand)
elif which == "RealWorld":
from . import... | Python | 1 |
}
}
Ok(NetBig {
conv_layer1,
rnn_layer1,
rnn_layer2,
rnn_layer3,
out_layer,
})
}
}
impl Net for NetBig {
fn predict(&mut self, chunk: &[f32]) -> Array<f32, Ix2> {
let scaled_data = Array::from_shape_vec(
... | Rust | 0 |
{
let coordinates = input.coordinates.clone();
// let y_max = *coordinates.iter().map(|(_x,y)|y).max().unwrap();
// println!("ymax is {}", y_max);
//
let (_axis, fold) = *input.folds.get(0).unwrap();
let result = fold_paper(
&coordinates.into_iter().collect::<HashSet<_, _>>(),
f... | Rust | 0 |
e.status_code != 200:
st.error(f"Google API Error {response.status_code}: {response.text}")
return []
results = response.json().get("results", [])[:limit]
return [place["name"] for place in results]
def generate_itinerary_with_openrouter(city, days, attractions, openrou... | Python | 1 |
"""Constants for EOS Sauna Appy."""
from logging import Logger, getLogger
from datetime import timedelta
LOGGER: Logger = getLogger(__package__)
NAME = "EOS Sauna Appy"
DOMAIN = "eos_sauna_appy"
VERSION = "0.1.0"
ATTRIBUTION = "Data provided by EOS Sauna HTTP API"
# Platforms
PLATFORMS = ["sensor", "switch", "light"... | Python | 1 |
import unittest
import numpy as np
import torch
from torch import optim
from TTS.vocoder.models.wavegrad import Wavegrad
#pylint: disable=unused-variable
torch.manual_seed(1)
use_cuda = torch.cuda.is_available()
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class WavegradTrainTest(unittes... | Python | 1 |
й.",
},
"zh": {
"label": "LoRA 作用模块(非必填)",
"info": "应用 LoRA 的模块名称。使用英文逗号分隔多个名称。",
},
"ko": {
"label": "LoRA 모듈 (선택 사항)",
"info": "LoRA를 적용할 모듈의 이름. 모듈 간에는 쉼표(,)로 구분하십시오.",
},
"ja": {
"label": "LoRA モジュール(オプション)",... | Python | 1 |
import os
from glob import glob
from datetime import datetime
import sys
import argparse
import re #for pattern matchin
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('date_time')
parser.add_argument('id')
parser.add_argument('nDir') # nr of directories on the t2 (counting from 0), f.e. n... | Python | 1 |
ot_5_3")
}
#[test]
fn tdot_5_9() -> Result<(), Error> {
test("tdot_5_9")
}
#[test]
fn tdot_5_18() -> Result<(), Error> {
test("tdot_5_18")
}
#[test]
fn tdot_5_36() -> Result<(), Error> {
test("tdot_5_36")
}
#[test]
fn lrom_8x8() -> Result<(), Error> {
test("lrom_8x8")
}
#[test]
fn brom_8x256() -> R... | Rust | 0 |
])
.unwrap();
let array: ListArray<i32> = array.into();
(data, schema, vec![Box::new(array) as Box<dyn Array>])
}
fn case_basics() -> (String, Schema, Vec<Box<dyn Array>>) {
let data = r#"{"a":1, "b":2.0, "c":false, "d":"4"}
{"a":-10, "b":-3.5, "c":true, "d":null}
{"a":100000000, ... | Rust | 0 |
from scapy.all import IP, TCP, UDP, send
from rich import print
import random
from .banner import print_banner
print_banner()
def SendTcpPacket(target_ip, target_port):
src_ip = ".".join([str(random.randint(1, 254)) for _ in range(4)])
src_port = random.randint(1024, 65535)
# Create TCP SYN packet
... | Python | 1 |
BLE,
true => FIFO_NOT_AVA_FLAG_A::NOT_AVAILABLE,
}
}
#[doc = "Checks if the value of the field is `AVAILABLE`"]
#[inline(always)]
pub fn is_available(&self) -> bool {
*self == FIFO_NOT_AVA_FLAG_A::AVAILABLE
}
#[doc = "Checks if the value of the field is `NOT_AVAILABLE... | Rust | 0 |
xopt = opt.minimize(likelihood, x0, args, method='L-BFGS-B',
options={'maxiter':maxiter,'disp': None}, callback = callback)
else:
#x0 = [10., 10.] # the starting point
#xmin = [1., 1.] # the bounds
#xmax = [11., 11.]
# rewrit... | Python | 1 |
frame: &mut [u8]) {
let w = framebuffer.var_screen_info.xres as usize;
let h = framebuffer.var_screen_info.yres as usize;
for star in self.stars.iter_mut() {
let star_data = star.tick(w, h);
if star_data.0 < w && star_data.1 < h {
Starfield::draw_star(sta... | Rust | 0 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | Python | 1 |
type SworkerAnchor = SworkerPubKey;
/// sworker signature, little-endian-format, 64 bytes vec
pub type SworkerSignature = Vec<u8>;
/// sworker enclave code
pub type SworkerCode = Vec<u8>;
/// Work report empty workload/storage merkle root
pub type MerkleRoot = Vec<u8>;
/// File Alias for a file
pub type FileAlias =... | Rust | 0 |
from collections import deque
# Define the matrix map of the city
city_map = [
[0, 0, 11, 16, 0, 0, 0, 0, 4, 0, 14, 5, 0, 0],
[3, 1, 13, 0, 0, 14, 11, 0, 0, 15, 12, 15, 0, 0],
[17, 15, 17, 10, 11, 0, 7, 1, 1, 14, 0, 9, 0, 0],
[8, 0, 0, 13, 2, 12, 0, 8, 0, 0, 9, 13, 19, 5],
[4, 0, 2, 3, 8, 0, 0, 17... | Python | 1 |
IN-Standard-D")]
EnInStandardD,
#[serde(rename = "en-IN-Wavenet-A")]
EnInWavenetA,
#[serde(rename = "en-IN-Wavenet-B")]
EnInWavenetB,
#[serde(rename = "en-IN-Wavenet-C")]
EnInWavenetC,
#[serde(rename = "en-IN-Wavenet-D")]
EnInWavenetD,
#[serde(rename = "en-GB-Standard-A")]
En... | Rust | 0 |
in screen
if app.game_state == GameState::Win {
let area = centered_rect(26, 5, chunks[1]);
let winner_message = get_win_message(&app.secret);
let message = Paragraph::new(winner_message)
.block(Block::default().title("You win!").borders(Borders::ALL));
f.render_widget(Cl... | Rust | 0 |
ng_http_response_dump_body_to_file(
response: qiniu_ng_http_response_t,
path: *const qiniu_ng_char_t,
err: *mut qiniu_ng_err_t,
) -> bool {
let response: &mut Response = response.into();
if let Err(ref e) = response
.clone_body()
.and_then(|body| {
OpenOptions::new()
... | Rust | 0 |
# Copyright (c) 2017 The University of Manchester
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 1 |
from .client import * # type: ignore # noqa: F403
from .models import * # type: ignore # noqa: F403
| Python | 1 |
nned_margin_project_quater(project, year, element_name)
margin_plan = {'commitment': 0, 'reserve': 0, 'potential': 0}
if margin_sum:
margin_plan = margin_sum.copy()
if not project.is_correction_project:
if acc_fact_wo_distributions >= sum.get('comm... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.