text string | label_name string | labels int64 |
|---|---|---|
#!/usr/bin/env python
import logging as _logging
import os
_logger = _logging.getLogger(__name__)
master_host = "***REMOVED***"
master_user = "***REMOVED***"
master_password = "***REMOVED***"
master_db = "***REMOVED***"
slave_host = "127.0.0.1"
slave_user = "reader"
slave_password = "falcon"
slave_db = "falcon"
my... | Python | 1 |
import random
from hangman_words import word_list
chosen_word= random.choice(word_list)
word_lenght = len(chosen_word)
end_of_game = False
lives = 6
from hangman_art import logo
print(logo)
display = []
for _ in range(word_lenght):
display += "_"
while not end_of_game:
guess = input("Guess a letter: ").low... | Python | 1 |
import time
while True:
try:
duration = int(input("Enter the duration: "))
unit = input("Choose unit (h for hours, m for minutes, s for seconds): ").lower()
if unit == 'h':
duration *= 3600
elif unit == 'm':
duration *= 60
e... | Python | 1 |
sing PR #{pr.pr_number}: Missing attribute {e}")
continue
# Ensure we have at least some PR details
if not pr_details:
logging.error(f"No valid PR details could be extracted for {author}")
return f"""# Performance Review: {author}
**Period:** {date_range}
## Err... | Python | 1 |
= Pin::new(&mut self.inner).poll_read(ctx, buf);
if let Poll::Ready(Ok(len)) = r {
self.ctx.inc_read_bytes(len as usize);
};
r
}
}
impl futures::AsyncSeek for InputStreamInterceptor {
fn poll_seek(
mut self: Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
... | Rust | 0 |
topology.get_segments().get(util::TOPOLOGY_KEY_NODE),
Some(&DEFAULT_NODE_NAME.to_owned()), // Expect &String not &str
"topology not match",
);
// Test publish volume
let target_path = NODE_PUBLISH_VOLUME_TARGET_PATH;
let vol_id = NODE_PUBLISH_VOLUME_I... | Rust | 0 |
pub use kind::{MetricKind, MetricKindMask};
mod histogram;
pub use histogram::Histogram;
#[cfg(feature = "summary")]
mod summary;
#[cfg(feature = "summary")]
pub use summary::Summary;
pub mod layers;
#[cfg(test)]
mod test_util;
use stdweb::web::{document, INode, IElement, IEventTarget, Element, Document, window};
u... | Rust | 0 |
!= sd::NRF_SUCCESS
{
defmt::error!("sd_ble_uuid_vs_add() failed!");
return false;
}
let uuid = sd::ble_uuid_t {
type_: self.base_uuid_type,
uuid: ROVER_SERVICE_UUID,
};
if unsafe {
sd::sd_ble_gatts_service_... | Rust | 0 |
mut(&follower_id) {
followees.remove(&followee_id);
}
}
}
/**
* Your Twitter object will be instantiated and called as such:
* let obj = Twitter::new();
* obj.post_tweet(userId, tweetId);
* let ret_2: Vec<i32> = obj.get_news_feed(userId);
* obj.follow(followerId, followeeId);
* obj.unfoll... | Rust | 0 |
late_uri, template_id)
elif module.params.get("system_query_options") is not None:
# Fetch all the templates based on Name
query_param = _get_query_parameters(module.params)
template_path = template_uri
else:
# Fetch all templates
... | Python | 1 |
>"
end_string = "</trace>"
if start_string not in input_string:
return ""
input_string = input_string[input_string.index(start_string) + len(start_string):]
if end_string not in input_string:
return ""
input_string = input_string[:input_string.index(end_st... | Python | 1 |
used when there is an external correlation
/// mechanism (e.g. the Token in CoAP) that enables Party U to correlate
/// `message_1` and `message_2`. type = 2 is used when there is an
/// external correlation mechanism that enables Party V to correlate
/// `message_2` and `message_3`. type = 3 i... | Rust | 0 |
let (tx, rx) = mpsc::channel();
let smc = SMCListener::new(tx);
let notary_addr_bytes: [u8; 20] = [0x22, 0xFF, 0x31, 0x10, 0xA2,
0x82, 0xc1, 0x19, 0x77, 0x36,
0xb3, 0xfC, 0xe3, 0x4a, 0xD4,
... | Rust | 0 |
assert_float_absolute_eq!(x_val, x[i]);
}
for (i, w_val) in w_should.iter().enumerate() {
assert_float_absolute_eq!(w_val, w[i]);
}
}
#[test]
fn golub_welsch_50_alpha_42_beta_23() {
let (x, w) = GaussJacobi::nodes_and_weights(50, 42.0, 23.0);
let ... | Rust | 0 |
elf == EVOBS_SEL_A::AUXIO10
}
#[doc = "Checks if the value of the field is `AUXIO9`"]
#[inline(always)]
pub fn is_auxio9(&self) -> bool {
*self == EVOBS_SEL_A::AUXIO9
}
#[doc = "Checks if the value of the field is `AUXIO8`"]
#[inline(always)]
pub fn is_auxio8(&self) -> bool {
... | Rust | 0 |
}
/// Creates a new `BufferUtils`.
#[cfg(not(feature = "egl"))]
pub fn new(log: Logger) -> Self {
Self { log }
}
/// Returns the dimensions of an image stored in the buffer.
#[cfg(feature = "egl")]
pub fn dimensions(&self, buffer: &WlBuffer) -> Option<(i32, i32)> {
// T... | Rust | 0 |
spirits_count, question_count = list(map(int, input().split()))
bands = []
spirits_history = {}
for x in range(1, spirits_count+1):
bands.append({x})
spirits_history[x] = 1
for _ in range(question_count):
question = tuple(map(int, input().split()))
if question[0] == 1:
band_a, band_b = None, ... | Python | 1 |
&OrdZSet<_, _>| println!("outq: {}", zs.len()));
})
.unwrap();
let graph = monitor.visualize_circuit();
fs::write("galen.dot", graph.to_dot()).unwrap();
root.step().unwrap();
});
hruntime.join().unwrap();
}
use vid_dup_finder_lib::*;
/// Example usage of Vid Dup Find... | Rust | 0 |
, PartialEq)]
pub enum FontFamily<S = &'static str> {
/// This is a system-dependent font family in the given generic category.
Generic(GenericFontFamily),
/// This is a specific font family referred to by its PostScript name.
Named(S),
}
impl<S> FromStr for FontFamily<S> {
type Err = <GenericFont... | Rust | 0 |
}
code => {
let headers = response.headers().clone();
let body = response.into_body()
.take(100)
.to_raw().await;
Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}",
cod... | Rust | 0 |
class Solution:
def addDigits(self, num: int) -> int:
return 0 if num == 0 else 1 + (num - 1) % 9
| Python | 1 |
}
_ => TokenizerCommand::Continue(RuleCategory::LineComment, true),
}
}
}
pub struct RuleBlockComment;
impl Rule for RuleBlockComment {
fn process(character: &CodeCharacter, characters: &[CodeCharacter]) -> TokenizerCommand {
match character.category {
CodeCharacterCate... | Rust | 0 |
::Debug for MessageBox {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for MessageBox {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRe... | Rust | 0 |
FsContextState {
/// The current working directory.
cwd: NamespaceNode,
// See <https://man7.org/linux/man-pages/man2/umask.2.html>
umask: FileMode,
}
/// The file system context associated with a task.
///
/// File system operations, such as opening a file or mounting a directory, are
/// performed ... | Rust | 0 |
8> {
let scope = self
.scopes
.pop()
.expect("fatal error: leave_scope called on empty scopes");
self.scope_index -= 1;
// pop the last local symbol table
self.symbol_tables.pop_front();
scope.instructions
}
}
#[cfg(test)]
mod tests {
... | Rust | 0 |
(options.dataDir, 'data')
installLogsDir = os.path.join(installDataDir, 'logs')
print("Install data dir: ", installDataDir, file=sys.stderr)
print("Install logs dir: ", installLogsDir, file=sys.stderr)
cmd = "mkdir -p " + installLogsDir
runCommand(cmd)
# copy in data template
os.chdir(proj... | Python | 1 |
click_desk_book_menu(ctx, button, point, t)
{
// メニューをクリックしていない場合はfalseをクリックして終了
println!("not clicked");
return false;
}
if let Some(index) = self.on_desk_menu.desk_book_menu_last_clicked() {
if let Some(book_info) = self.on_desk_menu.get_desk_me... | Rust | 0 |
from collections.abc import Callable
from typing import Union
import pyrogram
from pyrogram.filters import Filter
import pypoligram
from pypoligram.filters import ALL
from pypoligram.filters import Filter as PFilter
class OnCallbackQuery:
def on_callback_query(
self: Union["OnCallbackQuery", PFilter, Filter, Non... | Python | 1 |
import os
import sys
import webbrowser
from time import sleep as sleep_sheep
# Executing ping with input host
# using systems functionality (only linux)
def ping(host):
instr = "ping -c 1 %s" %(host)
response = os.system(instr)
return response == 0
# Finite state loop if
# computer re-connects to network
# ... | Python | 1 |
# -*- coding: UTF-8 -*-
#/**
# * Software Name : pycrate
# * Version : 0.4
# *
# * Copyright 2018. Benoit Michau. ANSSI. P1sec.
# *
# * This library is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
# * License as published by the Free Software Foundation; e... | Python | 1 |
ure_matrix = np.nan_to_num(feature_matrix, nan=0.0, posinf=10.0, neginf=-10.0)
# 2. 多重共線性の除去(強制モードではスキップ)
if not force_all_components and remove_collinearity and n_features > 2:
# 既存のコードと同じ処理
corr_matrix = np.corrcoef(feature_matrix.T)
corr_matrix = np.nan_to_num(cor... | Python | 1 |
# Copyright 2024 Leonin League
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Python | 1 |
for i in 0..settings.error_predictions {
score += (score - ws[i]).abs();
}
score
};
let step = |ws: &[f64], i: usize| {
settings.elasticity * if i + 1 < settings.error_predictions {
// Use next error prediction level for change.
ws[i + 1]
} els... | Rust | 0 |
}
}
if print { print!("\n"); }
}
if print { print!("\n"); }
if print && z >= slices_to_print { print = false };
}
if print { print!("\n"); }
result
}
use std::{
collections::HashSet,
convert::{From, Into, TryFrom},
fmt,
hash::Hash,
}... | Rust | 0 |
us",
lines=10
),
title="QA Dataset Generator",
description="""A DATASET GENERATOR DEVELOPED BY CHOUDHRY SHEHRYAR.
This tool will:
1. Process your document (PDF or text)
2. Split it into manageable chunks
3. Generate high-quality QA pairs
4. Validate the generated pairs
5. Sa... | Python | 1 |
es for main execution, like argparse, traceback
import argparse
import traceback # Ensure traceback is imported here too
parser = argparse.ArgumentParser(description="Retrieve OMOP Concepts using RAG with OpenAI Embeddings.")
parser.add_argument("query", type=str, help="The input word, phrase, or descr... | Python | 1 |
icense
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
// tag::description[]
//! Use to derive parsing for parsing struct.
// end::description[]
#![recursion_limit = "128"]
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::Span;
use syn::parse_macro_input;
use quote::quote... | Rust | 0 |
"DNS resolver: host {:?} resolved to {:?}",
req.hostname(),
req.addrs()
);
if req.addr.is_unresolved() {
Poll::Ready(Err(ConnectError::NoRecords))
} else {
Poll::Ready(Ok... | Rust | 0 |
lst_in = ['# x o', 'x # x', 'o o #']
pole = [i.split() for i in lst_in]
def is_free(lst):
return any('#' in e for e in lst)
print(is_free(pole)) | Python | 1 |
oteImportError::DuplicateStatement => Error::<T>::DuplicateStatement,
}
}
}
#[derive(RuntimeDebug, PartialEq, Eq)]
struct ImportUndo {
validator_index: ValidatorIndex,
valid: bool,
new_participant: bool,
}
struct DisputeStateImporter<BlockNumber> {
state: DisputeState<BlockNumber>,
now: BlockNumber,
new_part... | Rust | 0 |
> Option<fb::Vector<'a, u32>> {
self._tab.get::<fb::ForwardsUOffset<fb::Vector<'a, u32>>>(
LockFundsTransactionBuffer::VT_MAXFEE,
None,
)
}
#[inline]
pub fn deadline(&self) -> Option<fb::Vector<'a, u32>> {
self._tab.get::<fb::Fo... | Rust | 0 |
e"),
"initQuota": obj.get("initQuota"),
"quotaType": obj.get("quotaType"),
"enableAlbumTool": obj.get("enableAlbumTool"),
"enableTts": obj.get("enableTts"),
"ttsSpeakerIdx": obj.get("ttsSpeakerIdx"),
"ttsSpeakerWav": obj.get("ttsSpeakerWav"),
... | Python | 1 |
ication():
data = deepcopy(Data)
visitor = AtomicSimplificationVisitor(default_visitors())
atom = Atom.model_validate(data)
simplified = atom.simplify_visit(visitor)
assert simplified.continua[1].sigma.unit == u.Unit("m2")
assert simplified.continua[1].sigma[-1].value == pytest.approx(
... | Python | 1 |
**{f'mixamorig:RightHandIndex{i}': lambda e: Euler((e.x, e.y, e.z)) for i in range(1, 5)},
**{f'mixamorig:RightHandMiddle{i}': lambda e: Euler((e.x, e.y, e.z)) for i in range(1, 5)},
**{f'mixamorig:RightHandRing{i}': lambda e: Euler((e.x, e.y, e.z)) for i in range(1, 5)},
**{f'mixam... | Python | 1 |
break;
}
if &haystack[i..slice_end] == needle {
found_indices.push(i);
}
}
found_indices
}
/*
More efficient solution (Rabin-Karp Algorithm (RK)):
To get to a more efficient time complexity, we can implement RK and calculate
a hash for the string slice. The ha... | Rust | 0 |
ways)]
fn from(variant: CTSLOC_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `CTSLOC`"]
pub type CTSLOC_R = crate::R<u8, CTSLOC_A>;
impl CTSLOC_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CTSLOC_A> {
use crate::... | Rust | 0 |
d3\x18\x84\xf6\x88\x8c\xc5u\xca\
Lq\x86\xecf\xe6*\x22\x9f]\x9afq\xba&\x22\
e\x86'\xdc\xb8\x97y\xb4Z^x\x0dd\xb7}i\
]\xb5\x96\x89\xb8\xda\x92\xa4\xeb\x139\xcf5\x1d\x91\x0d\
j\x14\xe9*\xac\x9b\x92\x15\x19d>\xc3\xb6\xcc\x85_\
h7\x0a\x04kJ\x81\xd6\x14\x08 \xeb\x04D2j\
3\xb8ab_\x10L\xaej\x98\xa2\x12\xcdQv\xcc\
\xcd\xf5\x04M[... | Python | 1 |
#[macro_use]
static mut MARKER : bool = false;
#[entry]
fn main() -> ! {
// used when invoking C code to configure system clock
unsafe { HAL_Init(); }
unsafe { SystemClock_Config(); }
unsafe { MX_GPIO_Init(); }
unsafe { amy_func(); }
unsafe { amy_delay(); }
/*
if let (Som... | Rust | 0 |
127..165 '{ ...f(); }': ()
133..146 '(&o).as_ref()': Option<&u32>
134..136 '&o': &Option<u32>
135..136 'o': Option<u32>
152..153 'o': Option<u32>
152..162 'o.as_ref()': Option<&u32>
"###
);
}
#[test]
fn infer_generic_chain() {
assert_snapshot!(
infer(r#"
struct A<T> {
... | Rust | 0 |
results() {
let (tx, _rx) = channel(1);
let host = Arc::new("anVubmxpa2VzdGVh.com".to_string());
assert!(matches!(
PassiveTotal::default().run(host, tx).await.err().unwrap(),
VitaError::SourceError(_)
));
}
}
<reponame>gregxy/mudfish
use regex::Regex;
const R... | Rust | 0 |
x_steps = args['train_steps'])
# Create exporter to save out the complete model to disk
exporter = tf.estimator.LatestExporter(name = 'exporter', serving_input_receiver_fn = serving_input_fn)
# Create eval spec to read in our validation data and export our model
eval_spec = tf.estimator.EvalSpec(
... | Python | 1 |
let offset = rng.gen_range(std::u32::MIN, std::u32::MAX);
mob_spawn_location.set_offset(offset.into());
// Set mob direction
let mut direction = mob_spawn_location.rotation() + PI / 2.0;
// Set mob position
mob.set_position(mob_spawn_location.position());
// Fix direction
direction += rn... | Rust | 0 |
_equal(self._output_source, iterreduce(self._input_source, self._callable))
class MapReduceDriver(BaseDriver):
"""Stub driver for Map operations"""
def __init__(self, mapper, reducer):
BaseDriver.__init__(self, None)
if inspect.isclass(mapper):
mapper = self._... | Python | 1 |
me> {
for client in self.clients.iter() {
if client.iface_id == iface_id {
return Some(client.last_roam_time);
}
}
None
}
/// Sets the last roam scan time on the iface, or does nothing if an iface with the provided
/// ID is not found.
pub... | Rust | 0 |
assert_eq!(account.userdata, default_account.userdata);
assert_eq!(account.owner, default_account.owner);
assert_eq!(account.executable, default_account.executable);
assert_eq!(account.loader, default_account.loader);
}
fn reserve_signature_with_last_id_test(
bank: &Bank,
... | Rust | 0 |
import pytest
from fast_healthchecks.models import HealthcheckReport, HealthCheckResult
pytestmark = pytest.mark.unit
def test_healthcheck_result() -> None:
hcr1 = HealthCheckResult(
name="test",
healthy=True,
)
assert str(hcr1) == "test: healthy"
hcr2 = HealthCheckResult(
na... | Python | 1 |
ute the request, returning a future resolving to a [`Response`].
///
/// [`Response`]: crate::response::Response
pub fn exec(self) -> ResponseFuture<Channel> {
let http = self.http;
match self.try_into_request() {
Ok(request) => http.request(request),
Err(source) => ... | Rust | 0 |
le_debugging", Some("1"));
}
if cfg!(not(feature = "comments")) {
c.define("exprtk_disable_comments", Some("1"));
}
if cfg!(not(feature = "break_continue")) {
c.define("exprtk_disable_break_continue", Some("1"));
}
if cfg!(not(feature = "sc_andor")) {
c.define("exprtk_dis... | Rust | 0 |
tra/x_bar_chroma',x_tra_bar_chroma)
np.save('../../musegan_lpd/data/chroma_sequence/val/x_bar_chroma',x_val_bar_chroma)
np.save('../../musegan_lpd/data/chroma_sequence/tra/y_bar_chroma',y_tra_bar_chroma)
np.save('../../musegan_lpd/data/chroma_sequence/val/y_bar_chroma',y_val_bar_chroma)
###############################... | Python | 1 |
ts` interface.
#[dbus_proxy(interface = "org.freedesktop.DBus.Debug.Stats")]
trait Stats {
/// GetStats (undocumented)
fn get_stats(&self) -> Result<Vec<HashMap<String, OwnedValue>>>;
/// GetConnectionStats (undocumented)
fn get_connection_stats(&self, n1: &str) -> Result<Vec<HashMap<String, OwnedValue... | Rust | 0 |
Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn... | Rust | 0 |
ut_ptr(&mut self) -> BitPtr<Mut, T, O> {
self.as_mut_bitptr()
}
/// Produces a range of bit-pointers to each bit in the bit-slice.
///
/// This is a standard-library range, which has no real functionality for
/// pointer types. You should prefer [`.as_bitptr_range()`] instead, as it
/// produces a custom struc... | Rust | 0 |
#!/usr/bin/env python3
"""
Simple script to run the roast agent tests.
"""
from tests.roast_agent_test import run_roast_tests
if __name__ == "__main__":
print("=== Running Roast Agent Tests ===")
print("This will generate comedy roast questions for sample celebrities in English and Estonian")
print("=" * 7... | Python | 1 |
; qed.")
.to_num();
(U256::MAX >> 24) * frac
}
impl<T: Config> MessageOriginInfo for Pallet<T> {
type Config = T;
}
#[cfg(test)]
mod test {
use super::*;
use crate::mock::{
elapse_seconds, new_test_ext, set_block_1, setup_workers, take_events, take_messages,
worker_pubkey, Event as TestEvent, Or... | Rust | 0 |
type glTexCoord4d_t = unsafe extern "system" fn(s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble);
/// glTexCoord4dv
/// * `v` group: CoordD
pub type glTexCoord4dv_t = unsafe extern "system" fn(v: *const [GLdouble; 4]);
/// glTexCoord4f
/// * `s` group: CoordF
/// * `t` group: CoordF
/// * `r` group: CoordF
/// * ... | Rust | 0 |
th as u16,
height: height as u16,
interlaced: false,
palette: Some(pal_rgb),
buffer: buffer.into(),
})?;
Ok(())
}
}
<reponame>idan-at/napi-rs
use napi::bindgen_prelude::*;
#[napi]
pub fn create_external(size: u32) -> External<u32> {
External::new(si... | Rust | 0 |
.retry_delay)
if not try_all and results:
return results
if not results:
error = locals().get("error", "Unknown error")
raise Exception(f"All wrappers failed, latest error: {error}")
self.index = starting_index
return results
@staticmet... | Python | 1 |
PER_PIXEL);
}
}
Ok(())
}
fn scene14() -> io::Result<()> {
const ASPECT_RATIO: f64 = 3.0 / 2.0;
const IMAGE_WIDTH: i32 = 1200;
const IMAGE_HEIGHT: i32 = (IMAGE_WIDTH as f64 / ASPECT_RATIO) as i32;
const SAMPLES_PER_PIXEL: i32 = 500;
const MAX_DEPTH: i32 = 50;
let world = Hittab... | Rust | 0 |
'''
Cuidados com os dados mutáveis
= -> copiando o valor (imutáveis)
= -> aponta para o mesmo valor na memória (mutável)
'''
# Copiando valor
nome = 'Alexandre'
noutra_variavel = nome
print(nome)
nome = 'Aaaaaaa'
print(nome)
print(noutra_variavel)
'''
Copiando a lista A para a lista B e
mudando os valores de... | Python | 1 |
break;
}
}
y += slice_size;
if y >= sq.size() {
break;
}
}
for i in 0..squares.len() {
let permutations = squares[i].permute();
for rule in rules.iter() {
for p in permutations.iter() {
if *p == ... | Rust | 0 |
)
})
),
),
JoinImplementation::DeltaQuery(inputs) => {
writeln!(f, "DeltaQuery")?;
for (pos, inputs) in inputs.iter().enumerate() {
writeln!(
f,
"| | delta %{... | Rust | 0 |
ent.access_token == 'testaccess'
@mock.patch('intuitlib.utils.Session.request')
def test_send_request_session_bad(self, mock_post):
mock_resp = self.mock_request(status=400, content={'access_token': 'testaccess'})
mock_post.return_value = mock_resp
session = requests.Session()
... | Python | 1 |
n_mask=input_mask,
token_type_ids=segment_ids,
labels=label_ids)
tmp_eval_loss = outputs.loss
logits = outputs.logits
logits = logits.detach().cpu().numpy()
... | Python | 1 |
_eq!(9e-10, result, 0.01);
}
/// Need to convert to parameterized tests
#[test]
fn it_convert_knownkilo_bytes_per_second_to_tera_bytes_per_second_2() {
let result: f64 = data_transfer_rate::kilo_bytes_per_second::to_tera_bytes_per_second(140000000.0);
assert_approx_eq!(0.14, result, 0.01);
}
/// Need to con... | Rust | 0 |
movie details"),
)
.arg(
Arg::with_name("database")
.short("db")
.long("database")
.default_value("val: &'a str"),
)
.get_matches();
let cli = true;
if let Some(update_matches) = matches.subcommand_matches("update") {
... | Rust | 0 |
x); // [B C D A 15 19]
// [Round 2]
md4round2!(a, b, c, d, 0, 3, x); //[A B C D 0 3]
md4round2!(d, a, b, c, 4, 5, x); //[D A B C 4 5]
md4round2!(c, d, a, b, 8, 9, x); //[C D A B 8 9]
md4round2!(b, c, d, a, 12, 13, x); //[B C D A 12 13]
md4round2!(a, b, c, d, 1, 3, x);... | Rust | 0 |
import os
import logging
class Config:
## 管理员邮件
MAIL_USERNAME = 'username'
MAIL_PASSWORD = 'Pa$sw0rd'
MAIL_USE_TLS = True
MAIL_SERVER = 'smtp.163.com'
MAIL_PORT = '465'
FLASKY_MAIL_SENDER = 'flaskyserver@163.com'
FLASKY_ADMIN = 'flaskyadmin@163.com'
FLASKY_MAIL_SUBJECT_PREFIX = '服务器... | Python | 1 |
# TODO: Write the code for a small game
# The game should work as follows:
# - The computer selects a word from a list of words
# - The computer scrambles the word and shows it to the user
# - The user has to guess the word and has three guesses
# - The user gets feedback on whether their guess is correct or not
# - Th... | Python | 1 |
mpl CheckCode {
pub fn new(code: String, owner: String) -> CheckCode {
CheckCode {
code,
owner,
}
}
pub fn to_db_and_email(&self, email: &str) -> Result<CheckStatus, CheckStatus> {
if let Err(_) = smtp::check_email(email) {
return Err(CheckStatus:... | Rust | 0 |
"""
Plugin for ResolveURL
Copyright (C) 2020 gujal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | Python | 1 |
ser_liquidity_account,
&fee_receiver_keypair,
&payer,
&user_accounts_owner,
)
.await
.unwrap_err(),
TransactionError::InstructionError(
8,
InstructionError::Custom(LendingError::InvalidConfig ... | Rust | 0 |
simultaneously does he conclude that the Dockerfile has successfully built the project:
Static Criterion: The Dockerfile must effectively execute the build commands of {build_system_name}.
Dynamic Criterion: The execution message must include content indicative of the build process.
Based on the aforementioned criteria... | Python | 1 |
, i16, i16, i16, i16, i16,
);
// / MIPS-specific 128-bit wide vector of 4 packed `i32`.
pub struct v4i32(
i32, i32, i32, i32,
);
// / MIPS-specific 128-bit wide vector of 2 packed `i64`.
pub struct v2i64(
i64, i64,
);
// / MIPS-specific 128-bit wide vector of 16 packed `u8`.
... | Rust | 0 |
}
}
}
active_cubes
}
pub fn solve17a(data: String) -> usize {
let mut active_cubes_3d = parse(data, 3);
for _ in 0..6 {
active_cubes_3d = step(active_cubes_3d, 3);
}
active_cubes_3d.len()
}
pub fn solve17b(data: String) -> usize {
let mut active_cubes_4d = parse(data, ... | Rust | 0 |
btn.set_tooltip_text(Some("Take a sample of a portion of the screen"));
let win_c = win.clone();
btn.connect_clicked(move |_| {
if let Err(err) = sample::take_screen_sample() {
let msg = format!("Failure: {:?}", err);
let dialog = MessageDialogBuilder... | Rust | 0 |
def searchMatrix( matrix, target):
# n=len(matrix)
# m=len(matrix[0])
# def eachrow(arr,target):
# k=len(arr)
# i,j=0,k-1
# while i<=j:
# mid=(i+j)//2
# if arr[mid]==target:
# return True
# elif arr[mid]<target:
# i... | Python | 1 |
#
# MIT No Attribution
#
# Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
#
# 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 restric... | Python | 1 |
from google.cloud.firestore_v1.base_query import BaseQuery
from google.cloud.firestore_bundle.types import BundledQuery
def limit_type_of_query(query: BaseQuery) -> int:
"""BundledQuery.LimitType equivalent of this query."""
return (
BundledQuery.LimitType.LAST
if query._limit_to_last
... | Python | 1 |
| q_prime_poly * *x_2 + &poly)
}
})
.unwrap();
let q_prime_blind = Blind(C::Scalar::random(&mut rng));
let q_prime_commitment = params.commit(&q_prime_poly, q_prime_blind).to_affine();
transcript.write_point(q_prime_commitment)?;
let x_3: ChallengeX3<_> = transcript.squeez... | Rust | 0 |
runc_int() {
let a = f32x4::from([1.1, 2.5, 3.7, 4.0]);
let expected = i32x4::from([1, 2, 3, 4]);
let actual = a.trunc_int();
assert_eq!(expected, actual);
//
let a = f32x4::from([-1.1, -2.5, -3.7, -4.0]);
let expected = i32x4::from([-1, -2, -3, -4]);
let actual = a.trunc_int();
assert_eq!(expected, a... | Rust | 0 |
codes)
.prop_map(Address)
}
proptest! {
#[test]
fn ua_roundtrip(
network in select(vec![Network::Main, Network::Test, Network::Regtest]),
ua in arb_unified_address(),
) {
let encoded = ua.encode(&network);
let decoded = Address... | Rust | 0 |
logger.info(f"创建新的分析输出目录:{analysis_dir}")
else:
logger.info(f"使用已存在的分析输出目录:{analysis_dir}")
# 构建完整的输出文件路径
output_file = os.path.join(analysis_dir, f"{video_name}_analysis.md")
logger.info(f"[{current_index}/{total_videos}] 输出目录: {analysis_dir}")
... | Python | 1 |
import os
import sys
import qtpy
if qtpy.API != 'pyqt5':
print("ERROR: You must use the PyQt5 bindings in order to use the custom \n"
"widgets in QtDesigner.")
sys.exit()
os.environ['DESIGNER'] = 'true'
from qtpyvcp.utilities.logger import initBaseLogger
LOG = initBaseLogger("qtpyvcp-designer",
... | Python | 1 |
from builtins import range
from mdp.nodes import OnlineCenteringNode, OnlineTimeDiffNode
from ._tools import *
def test_online_centering_node():
node = OnlineCenteringNode()
x = mdp.numx_rand.randn(1000, 5) + mdp.numx_rand.uniform(-3,3,5)
node.train(x)
assert_array_almost_equal(node.get_average()[0], ... | Python | 1 |
def detect_ascending_channel(data):
# Look for an Ascending Channel pattern in the data
for i in range(1, len(data) - 1):
# Check if the current high and low are higher than the previous high and low
if data['high'][i] > data['high'][i-1] and data['low'][i] > data['low'][i-1]:
for j ... | Python | 1 |
MP_VBIASW::_3 => 3,
TX_PA_BUMP_VBIASW::_4 => 4,
TX_PA_BUMP_VBIASW::_5 => 5,
TX_PA_BUMP_VBIASW::_6 => 6,
TX_PA_BUMP_VBIASW::_7 => 7,
}
}
}
#[doc = r" Proxy"]
pub struct _TX_PA_BUMP_VBIASW<'a> {
w: &'a mut W,
}
impl<'a> _TX_PA_BUMP_VBIASW<'a> {
#[doc = r... | Rust | 0 |
uild_embed(data)
hourly_counts = await fetch_daily_online_counts(bot.db_pool)
image_path = save_daily_online_graph(hourly_counts)
embed.set_image(url=f"attachment://{ONLINE_DAILY_GRAPH_FILENAME}")
snapshot_data = {
"data": data,
... | Python | 1 |
from __future__ import annotations
from typing import Optional
from playwright.sync_api import Page, expect
from shiny.playwright import controller
from shiny.run import ShinyAppProc
def test_slider_app(page: Page, local_app: ShinyAppProc) -> None:
def check_case(
id: str,
*,
value: tup... | Python | 1 |
code"] >= HTTP_500_INTERNAL_SERVER_ERROR:
self.metrics.inc_requests_exceptions_count(
method=method,
path=path,
exception_type="UNSET",
)
exemplar: dict[str, str] | None = None
if self.include_exemplar:... | Python | 1 |
text = "abcdefghijklmnop"
for letter in text:
print(letter)
i = 0
while i < len(text):
print(text[i])
i +=1
i = len(text) - 1
while i >= 0:
print(text[i], end="")
i -= 1
print()
i = 0
while i< len(text):
print(text[len(text)-i-1], end="")
i += 1
| Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.