text string | label_name string | labels int64 |
|---|---|---|
# Generated by Django 5.1.3 on 2024-12-21 20:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('surveys', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='survey',
name='end_date',
... | Python | 1 |
If args.log_file is a single file path
if not os.path.isdir(args.log_file):
args.log_file = [args.log_file]
else:
# Assume it's a directory, and search for test_results inside it
args.log_file = [
os.path.join(root, "test_metrics_summary.csv")
for root, _, _ in o... | Python | 1 |
");
RPCNode {
node_type: RPCType::ComparisonExpression as i32,
children: vec![
RPCNode {
node_type: RPCType::TagRef as i32,
children: vec![],
value: Some(RPCValue::TagRefValue(parts[0].as_bytes().to_owned())),
... | Rust | 0 |
(False, None)
yield 'e', name_type_map['Uint'], (0, None), (False, None)
yield 'floats_2', Array, (0, None, (2,), name_type_map['Float']), (False, None)
yield 'f', name_type_map['Uint'], (0, None), (False, None)
yield 'floats_3', Array, (0, None, (8,), name_type_map['Float']), (False, None)
yield 'g', name_ty... | Python | 1 |
unnecessary copy. It'd be nice to get rid of it.
let serialized = pyo3::types::PyBytes::new(
py,
&asn1::write_single(&self.raw.borrow_value().csr_info.spki),
);
py.import("cryptography.hazmat.primitives.serialization")?
.getattr("load_der_public_key")?
... | Rust | 0 |
er,
TxtCtl.Clear,
'#0010201408V#1016F这里有看到那个\n',
'的士兵吧?',
TxtCtl.Enter,
),
)
CloseMessageWindow()
If(
(
(Expr.TestScenaFlags, ScenaFlag(0x0240, 1, 0x1201)),
Expr.Return,
),
'loc_10F1',
)
ChrTal... | Python | 1 |
rical_imputation_strategy 为 'constant' 时,用于填充的值。
返回:
----------
train_df : pd.DataFrame
预处理后的训练集
test_df : pd.DataFrame
预处理后的测试集
"""
print("\n=== [2] 数据预处理 ===")
# ========== 2.1 缺失值处理 ==========
print("\n检查训练集缺失值:")
missing_train = train_df.isnull().sum()
print... | Python | 1 |
import nltk
# Descarga los recursos necesarios para el correcto funcionamiento de la librería nltk
nltk.download('cess_esp')
nltk.download('averaged_perceptron_tagger')
nltk.download('averaged_perceptron_tagger_eng')
nltk.download('punkt')
nltk.download('punkt_tab') | Python | 1 |
w) - 1.
\end{cases}
INPUT:
- ``m`` -- a pair ``[h, w]``, where ``h`` encodes the monomial
and ``w`` is an element of the Weyl group
- ``i`` -- an element of the index set
EXAMPLES::
sage: Y = algebras.YokonumaHecke(4, ['D',4])
sage: m = ... | Python | 1 |
class Intern:
def __init__(self, name='', surname='', address='', mobile_number='', email=''):
self.name = name
self.surname = surname
self.address = address
self.mobile_number = mobile_number
self.email = email
def getdata(self):
self.name = input("Введіть ім'я ... | Python | 1 |
e_Temperature' data in the senegal_1980_2000 DataFrame. It specifies the number of bins as 20, which controls
#how the data is divided into intervals. The 'color' parameter is set to 'blue' to color the bars in the histogram in blue.
plt.title('Temperature Distr... | Python | 1 |
ord:tt, u8; $($val:expr),*) => {
$crate::__encode_bits!($ord, u8 as u8; $($val),*)
};
($ord:tt, Cell<u8>; $($val:expr),*) => {
$crate::__encode_bits!($ord, Cell<u8> as u8; $($val),*)
};
($ord:tt, AtomicU8; $($val:expr),*) => {
$crate::__encode_bits!($ord, AtomicU8 as u8; $($val),*)
};
($ord:tt, u16; $($val... | Rust | 0 |
mask = Conv2d(
conv_dim, conv_dim,
kernel_size=1,
padding=0,
stride=1,
bias=not conv_norm,
norm=get_norm(conv_norm, conv_dim),
activation=F.relu
) # boundary 到 mask 转移的路径
self.mask_deconv = ConvTranspose2d(
... | Python | 1 |
mappings have write-back files
let writeback_file = if flags.contains(MMapFlags::MAP_SHARED) {
if let VMInitializer::LoadFromFile { file, offset } = &initializer {
Some((file.clone(), *offset))
} else {
None
}
} else {
None... | Rust | 0 |
, area.str());
}
}
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
mod peer_connection_outgoing_state;
pub use peer_connection_outgoing_state::*;
mod peer_connection_outgoing_actions;
pub use peer_connection_outgoing_actions::*;
mod peer_connection_outgoing... | Rust | 0 |
}
}
if ret == 0 {
Ok(false)
} else {
Ok(true)
}
}
/// Check if anything is available to read on the socket.
#[inline]
pub fn poll_read(fd: &mut Fd, timeout_ms: i32) -> io::Result<bool> {
poll(fd.pollin_fd(), timeout_ms)
}
/// Check if the socket is available to write.
#[in... | Rust | 0 |
}
}
}
// todo: how do i implement `std::iter::IntoIterator` for this type?
// todo: how do i get `&cache` to alias to `cache.iter()`?
pub fn iter(&self) -> impl Iterator<Item = (&'_ K, &'_ V)> {
let clock = self.clock;
self.map.iter().flat_map(move |(key, record)| {... | Rust | 0 |
from itertools import islice
from test import get_user_session, cassette
from test.resources.documents import create_group_document, delete_all_group_documents
def test_should_iterate_through_documents():
session = get_user_session()
delete_all_group_documents()
with cassette('fixtures/resources/trash/i... | Python | 1 |
uchsia_async::run_singlethreaded(test)]
async fn test_reboot() -> Result<()> {
run_reboot_test(RebootCommand { bootloader: false, recovery: false }).await;
Ok(())
}
#[fuchsia_async::run_singlethreaded(test)]
async fn test_bootloader() -> Result<()> {
Ok(run_reboot_test(RebootCom... | Rust | 0 |
2,
ERL_NIF_TERM_TYPE_FLOAT = 3,
ERL_NIF_TERM_TYPE_FUN = 4,
ERL_NIF_TERM_TYPE_INTEGER = 5,
ERL_NIF_TERM_TYPE_LIST = 6,
ERL_NIF_TERM_TYPE_MAP = 7,
ERL_NIF_TERM_TYPE_PID = 8,
ERL_NIF_TERM_TYPE_PORT = 9,
ERL_NIF_TERM_TYPE_REFERENCE = 10,
ERL_NIF_TERM_TYPE_TUPLE = 11,
ERL_NIF_TERM_TYPE__MISSING_DEFAULT_CASE__READ... | Rust | 0 |
# (c) adarsh-goel
# (c) sudor2spr @Opleech
import os
import time
import string
import random
import asyncio
import aiofiles
import datetime
from WOODcraft.utils.broadcast_helper import send_msg
from WOODcraft.utils.database import Database
from WOODcraft.bot import AngelBot
from WOODcraft.vars import Var
from pyrogram ... | Python | 1 |
class Solution:
def searchRange(self, nums, target):
def findFirst(nums, target):
left, right = 0, len(nums) - 1
first_index = -1
while left <= right:
mid = (left + right) // 2
if nums[mid] == target:
... | Python | 1 |
single_letter("Black", "Yellow", "R")
#validate(14, -1, "NERD", "vertical")
#write_word(14, -1, "NERD", "vertical")
move(14,-1)
single_letter("Black", "Yellow", "N")
move(14,-2)
single_letter("Black", "Yellow", "E")
move(14,-3)
single_letter("Black", "Yellow", "R")
move(14,-4)
... | Python | 1 |
ian_question", 0x100055e);
keysyms.insert("Armenian_paruyk", 0x100055e);
keysyms.insert("Armenian_AYB", 0x1000531);
keysyms.insert("Armenian_ayb", 0x1000561);
keysyms.insert("Armenian_BEN", 0x1000532);
keysyms.insert("Armenian_ben", 0x1000562);
keysyms.insert("Armenian_GIM", 0x1000533);
keysyms.insert("Ar... | Rust | 0 |
bboxLoss, confidenceLoss, backgroundLoss, classScoreLoss)
def bbox_iou(box1, box2):
"""
Computes IoU between two bounding boxes in [left, top, right, bottom] format.
"""
inter_left = torch.max(box1[0], box2[0])
inter_top = torch.max(box1[1], box2[1])
inter_right = torch.min(box1[2], box2[2])
... | Python | 1 |
port: u16,
flags: Option<ConnectPrefs>,
) -> Result<DataStream> {
if addr.to_lowercase().ends_with(".onion") {
return Err(anyhow!("Rejecting .onion address as unsupported."));
}
let flags = flags.unwrap_or_default();
let exit_ports = [flags.wrap_target_por... | Rust | 0 |
None, Some(true)]);
let b = BooleanArray::from(vec![Some(false), None, None, Some(true)]);
test_equal(&a, &b, true);
let b = BooleanArray::from(vec![None, None, None, Some(true)]);
test_equal(&a, &b, false);
let b = BooleanArray::from(vec![Some(true), None, None, Some(true)]);... | Rust | 0 |
;
let file_name2 = super::make_filename(&output_path, &sample_name, &None, 1, 2).unwrap();
assert_eq!(file_name2, output_path.join("sample_1_L001_R2.fastq.gz"));
}
#[test]
fn make_report_filename() {
let output_path = PathBuf::from("test_data/test_output");
let file_name1 ... | Rust | 0 |
u64, Weight> for GasToWeight {
fn convert(a: u64) -> u64 {
a as Weight
}
}
impl module_evm::Config for Test {
type AddressMapping = MockAddressMapping;
type Currency = Balances;
type MergeAccount = Currencies;
type NewContractExtraBytes = NewContractExtraBytes;
type StorageDepositPe... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Задание 24.2a
Скопировать и дополнить класс MyNetmiko из задания 24.2.
Добавить метод _check_error_in_command, который выполняет проверку на такие ошибки:
* Invalid input detected, Incomplete command, Ambiguous command
Метод ожидает как аргумент команду и вывод команды.
Если в выводе не... | Python | 1 |
# a confederação nacional de natação precisa de um programa que leia o ano de nascimento de um atleta e
# mostre a sua categoria de acordo com a idade:
# Até 9 anos - Mirim
# até 14 anos - Infantil
# Até 19 anos - Junior
# Até 25 anos - Sênior
# Acima de 25 anos - Master
from datetime import date
ano = int(input("Digit... | Python | 1 |
nnel();
let actor_ref = ActorRef::local(sender);
let mut ctx = actor::Context::new(receiver, ThreadLocal::new(pid, self.clone()));
// Create our actor argument, running any setup required by the caller.
let arg = arg_fn(&mut ctx).map_err(AddActorError::ArgFn)?;
let actor = new_ac... | Rust | 0 |
:new(x, y, z);
Self{null_sig, null_pk}
}
}
#[derive(Clone)]
pub struct VRFWindow {}
impl PedersenWindow for VRFWindow {
const WINDOW_SIZE: usize = 128;
const NUM_WINDOWS: usize = 2;
}
pub struct VRFParams{
pub group_hash_generators: Vec<Vec<G1Projective>>,
}
impl VRFParams {
pub fn new()... | Rust | 0 |
u + targets[i]*(1-tau))
self.target_actor.set_weights(weights)
weights = []
targets = self.target_critic_1.weights
for i, weight in enumerate(self.critic_1.weights):
weights.append(weight * tau + targets[i]*(1-tau))
self.target_critic_1.set_weights(weights)
... | Python | 1 |
Event, TOutEvent, THandlerBuild>
where
TTrans: Transport<Output = (PeerId, TMuxer)>,
TMuxer: StreamMuxer,
THandlerBuild: HandlerFactory<Handler = THandler>,
THandler: NodeHandler<Substream<TMuxer>, InEvent = TInEvent, OutEvent = TOutEvent> + Send + 'static,
THandler::OutboundOpenInfo: Send + 'static... | Rust | 0 |
_device)
model.train()
inputs = self._prepare_for_class(inputs_dict, model_class, return_labels=True)
loss = model(**inputs).loss
loss.backward()
def test_forward_signature(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
f... | Python | 1 |
").await?;
stdout.write_all(csv_file.as_bytes()).await?;
stdout.flush().await?;
} else {
self.io.write_output("No results").await?;
}
Ok(())
},
"show" => {
let any_results... | Rust | 0 |
95.1% ; Nitrogen (N2) - 2.59%
// Argon (Ar) - 1.94%; Oxygen (O2) - 0.16%; Carbon Monoxide (CO) - 0.06%
// Minor (ppm): Water (H2O) - 210; Nitrogen Oxide (NO) - 100; Neon (Ne) - 2.5;
// Hydrogen-Deuterium-Oxygen (HDO) - 0.85; Krypton (Kr) - 0.3;
// Xenon (Xe) - 0.08
}
}
// pub... | Rust | 0 |
_else(
|| 1080,
|vdim| {
vdim.parse::<u32>().unwrap_or_else(|_| {
eprintln!("Error: Unexpected value. Expected [u32], found {}.", vdim);
process::exit(1);
})
},
);
let w = matches.value_of("WIDTH").map_or_else(
|| 1080,
... | Rust | 0 |
# Copyright 2023 The Magenta 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 agreed to in ... | Python | 1 |
Value(String),
#[error("Error: The downloader \"{0}\" cookies value is empty, but you passed cookies")]
DownloaderCookiesEmptyValue(String),
#[error("Error: The downloader \"{0}\" quality \"{1}\" is not found")]
DownloaderQualityNotFound(String, String),
#[error("Error: The downloader \"{0}\" qualit... | Rust | 0 |
ckForSelection_(Transform, False)
for pathCopy in copiedLayer.paths:
pathCopy.bezierPath.fill()
except:
print(givenLayer)
print(traceback.format_exc())
pass
@objc.python_method
def fillBlackCompo(self, givenLayer):
try:
if len(givenLayer.components) > 0:
for thisCompo in givenLayer... | Python | 1 |
print("🧪 测试模式:跳过数据库连接")
app = create_app(skip_db=True)
# 检查环境变量
debug_mode = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'
port = int(os.environ.get('PORT', 5000))
host = os.environ.get('HOST', '127.0.0.1')
print(f"\n🚀 舍友匹配系统后端启动中...")
print(f"📍 地址: http:... | Python | 1 |
root = Node('g')
root.insert('c')
print(root) | Python | 1 |
fn register() -> Weight { 0 }
fn force_register() -> Weight { 0 }
fn deregister() -> Weight { 0 }
fn swap() -> Weight { 0 }
}
pub trait Config: paras::Config {
/// The overarching event type.
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
/// The aggregated origin type must suppor... | Rust | 0 |
top_left.y = captures.get(3).unwrap().as_str().parse::<usize>().unwrap();
length = captures.get(4).unwrap().as_str().parse::<usize>().unwrap();
width = captures.get(5).unwrap().as_str().parse::<usize>().unwrap();
}
Claim {
id,
top_left: Edge { x: top_l... | Rust | 0 |
m: 15, H: 1, Rn: 31, Rd: 31, }.encode().decode(),
Instruction::MUL_asimdelem_R { Q: 1, size: 3, L: 1, M: 1, Rm: 15, H: 1, Rn: 31, Rd: 31, })
}
#[test]
fn roundtrip_SMULL_asimdelem_L() {
assert_eq!(Instruction::SMULL_asimdelem_L { Q: 1, size: 3, L: 1, M: 1, Rm: 15, H: 1, Rn: 31, Rd: 31, }.encode().d... | Rust | 0 |
bytes(&self) -> usize {
self.pats.iter()
.map(|p| mem::size_of::<P>() + p.as_ref().len())
.sum::<usize>()
+ (4 * self.trans.len())
+ self.out.iter()
.map(|v| vec_bytes() + (usize_bytes() * v.len()))
.sum::<usize>()
+ self.start_bytes.le... | Rust | 0 |
= "application")]
pub mod listener;
/// MQTT handler
#[cfg(feature = "application")]
pub mod mqtt;
/// Missing data requester
#[cfg(feature = "application")]
pub mod requester;
/// Data solidifier
#[cfg(feature = "application")]
pub mod solidifier;
/// Milestone syncer
#[cfg(feature = "application")]
pub mod syncer;
//... | Rust | 0 |
compile it if it already has a working binary in the cache. To avoid this issue, the grammar
//! file can be included in a dummy `const` definition while debugging.
//!
//! ```ignore
//! #[cfg(debug_assertions)]
//! const _GRAMMAR: &'static str = include_str!("path/to/my_grammar.pest"); // relative to this file
//!
//!... | Rust | 0 |
immidiately.
/// To ensure all data is written, the user must call the [`flush`] macro.
///
/// # Examples
/// ```
/// use librustlet::*;
/// use nioruntime_log::*;
///
/// debug!();
///
/// fn test() -> Result<(), Error> {
///
/// // init the rustlet container, in this case with default values
/// rustlet_ini... | Rust | 0 |
mut Vec<Vec<Pixel>>, color: Pixel){
draw_line(x, y, x + h, y, pixels, color);
branch(x, y, h, angle, growth, pixels, color);
}
pub fn branch(x: u32, y: u32, h: u32, angle: f64, growth: u32, pixels: &mut Vec<Vec<Pixel>>, color: Pixel){
if growth <= 1 {
panic!("Growth must be greater than 1!");
}... | Rust | 0 |
let mut read_pos = 0;
macro_rules! get_slice_nonadvancing {
($len: expr) => {
{
if data.len() < read_pos + $len as usize {
return;
}
&data[read_pos..read_pos + $len as usize]
}
}
}
macro_rules! get_slice {
($len: expr) => {
{
let res = get_slice_nonadvancing!($len);
read_po... | Rust | 0 |
# SPDX-License-Identifier: GPL-2.0-or-later
# ############################################################
# Importing - Same For All Render Layer Tests
# ############################################################
import unittest
import os
import sys
from view_layer_common import *
# ############################... | Python | 1 |
�' => {
if i == 0 {
// 行頭に 》があれば、地付きとする。
self.align = Align::Bottom;
} else if i == 1 && c1 == '《' {
// 行頭に 《》があれば、中寄せとする。
self.align = Align::Center;
} else if c1 == '》' && buf_type == token::TokenType::RubyE {
// '》'が2つ続いた
... | Rust | 0 |
x14m22(&self) -> RX14M22_R {
RX14M22_R::new(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 23 - Rx Buffer 14 Mask Bits"]
#[inline(always)]
pub fn rx14m23(&self) -> RX14M23_R {
RX14M23_R::new(((self.bits >> 23) & 0x01) != 0)
}
#[doc = "Bit 24 - Rx Buffer 14 Mask Bits"]
#[inli... | Rust | 0 |
"""
소상공인 진흥공단 OpenAPI
semas(Small Enterprise And Market Service)
1. StoreInfo 클래스: 소상공인시장진흥공단_상가(상권)정보_API
01.지정 상권조회
02.반경내 상권조회
03.사각형내 상권조회
04.행정구역 단위 상권조회
05.단일 상가업소 조회
06.건물단위 상가업소 조회
07.지번단위 상가업소 조회
08.행정동 단위 상가업소 조회
09.상권내 상가업소 조회
10.반경내 상가업소 조회
11.사각형내 상가업소 조회
12... | Python | 1 |
expected => (),
something_else => panic!("Parsed {:?}, Expected Ok(Op {{ inner: Mul({}) }}); Got {:?} instead", input, expected, something_else),
}
}
}
#[test]
fn parse_div() {
let test_cases = [
("/1", 1),
("/12", 12),
("/123... | Rust | 0 |
import jax
import pytest
import exponax as ex
@pytest.mark.parametrize(
"num_spatial_dims,ic_gen",
[
(num_spatial_dims, ic_gen)
for num_spatial_dims in [1, 2, 3]
for ic_gen in [
ex.ic.GaussianRandomField,
ex.ic.RandomDiscontinuities,
ex.ic.RandomGau... | Python | 1 |
atch_idx = next(x_batch_gen)
data_out[cur_batch_idx,:] = self._get_nth_layer_output(model, n_layer, X = cur_batch, train = train)
return data_out.astype(dtype, copy = False)
def _get_nth_layer_output(self, model, n_layer, X, train = 1):
'''
Returns output o... | Python | 1 |
(rel, col) in relations.into_iter().zip(cols) {
assert_eq!(rel.get_column_camel_case(), col);
}
}
#[test]
fn test_get_ref_column_camel_case() {
let relations = setup();
let ref_cols = vec!["CakeId", "Id", "Id"];
for (rel, ref_col) in relations.into_iter().zip(ref... | Rust | 0 |
HP["ENV_NAME"].split("-")[1]
trained_pop, pop_fitnesses = train_on_policy(
env,
env_name,
INIT_HP["ALGO"],
agent_pop,
INIT_HP=INIT_HP,
MUT_P=MUTATION_PARAMS,
swap_channels=INIT_HP["CHANNELS_LAST"],
max_steps=INIT_HP["MAX_STEPS"],
evo_steps=INIT... | Python | 1 |
oblem in enumerate(problem):
if verbose:
print(step_problem.task)
total_steps += 1
prompt = agent.format_prompt(step_problem.task, chat_mode=True)
result = agent.generate_one(prompt, stop=["Human:", "====="])
agent.chat_... | Python | 1 |
fn sodium_init() -> c_int;
fn randombytes_uniform(upper_bound: u32) -> u32;
}
assert!(unsafe{ sodium_init() } >= 0);
unsafe{ randombytes_uniform(upper_bound) }
}
/// Read `input` to EOF
fn read_to_end(mut input: impl Read) -> Vec<u8> {
let mut buf = Vec::new();
let buf_len = input.read_to_end(&mut buf).unwr... | Rust | 0 |
::from_memory();
match pstate.action
{ Action::Help => print_usage(opts)
, Action::Add => {new_rec = new_entry();
wtr.encode(new_rec).ok().expect("CSV Writer error");
()}
, Action::Search(ref s) => ()
, Action::Empty ... | Rust | 0 |
ns.clone()));
(
propose_tx,
signs
.into_iter()
.map(|x| Box::new(x) as Box<Transaction>)
.collect(),
)
}
pub fn finalize_tx<I>(&self, tx: AnchoringTx, signs: I) -> AnchoringTx
where
I: IntoIterator<Item = MsgAn... | Rust | 0 |
um_gpus, checkpoint_name, args.debug,
args.script_name) for s in seq_list]
multiprocessing.set_start_method('spawn', force=True)
with multiprocessing.Pool(processes=args.threads) as pool:
pool.starmap(run_sequence, sequence_list)
else:
... | Python | 1 |
4.);
avx::_mm_maskstore_ps(&mut r as *mut _ as *mut f32, mask, a);
let e = f32x4::new(0., 2., 0., 4.);
assert_eq!(r, e);
}
#[simd_test = "avx"]
unsafe fn _mm256_movehdup_ps() {
let a = f32x8::new(1., 2., 3., 4., 5., 6., 7., 8.);
let r = avx::_mm256_movehdup_ps(a);
... | Rust | 0 |
thread's
//! current collector.
//!
//! ## Setting the Default Collector
//!
//! By default, the current collector is an empty implementation that does
//! nothing. Trace data provided to this "do nothing" implementation is
//! immediately discarded, and is not available for any purpose.
//!
//! To use another collecto... | Rust | 0 |
cmin, cmax, suffix='')
if self.hparams.log_kernel_img and hasattr(self.model, 'get_kc'):
for k in self.model.rbf_suffixes:
kc = self.model.get_kc(k).detach().cpu().numpy()
kw_sq = util_misc.ks_to_kw_sq(self.model.get_ks(k).detach().cpu().numpy(), self.model... | Python | 1 |
(0x01);
cpu.neg8();
assert_eq!(0xFF, cpu.reg.a());
assert!(test_flags(&cpu, SF | HF | NF | CF));
cpu.reg.set_a(0x00);
cpu.neg8();
assert_eq!(0x00, cpu.reg.a());
assert!(test_flags(&cpu, NF | ZF));
cpu.reg.set_a(0x80);
cpu.neg8();
assert_eq!... | Rust | 0 |
)),
}
}
}
impl ToSocketListener for AnySocketAddr {
fn to_listener(&self, conf: &ServerConf) -> Box<ToTokioListener + Send> {
match self {
&AnySocketAddr::Inet(ref inet_addr) => inet_addr.to_listener(conf),
#[cfg(unix)]
&AnySocketAddr::Unix(ref unix_addr) => ... | Rust | 0 |
Element> {
let f: &F = &*(f as *const F);
f(&DOMHTMLOptionElement::from_glib_borrow(this).unsafe_cast())
}
unsafe extern "C" fn notify_selected_trampoline<P, F: Fn(&P) + 'static>(this: *mut webkit2_webextension_sys::WebKitDOMHTMLOptionElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: Is... | Rust | 0 |
R::new((self.bits & 0x7f) as u8)
}
}
impl W {
#[doc = "Bits 0:6 - MSB part of EVT_CNT_OFFSET0\\[39:0\\]
field"]
#[inline(always)]
pub fn evt_cnt_offsetu0(&mut self) -> EVT_CNT_OFFSETU0_W {
EVT_CNT_OFFSETU0_W { w: self }
}
}
<reponame>frol/tokio-tungstenite<filename>src/connect.rs
//! Connect... | Rust | 0 |
v_i);
}
let (c, v) = Self::accumulate_commitments_and_values_individual_opening_challenges(
vk,
comms_to_combine,
values_to_combine,
opening_challenges,
)?;
end_timer!(lc_time);
combined_comms.p... | Rust | 0 |
group
/// let ugroup = "SG1\t16 24 SG2 51_24 16_24";
/// let ugroup_: GroupU<BString, _> = GroupU::new(
/// "SG1".into(),
/// "16 24 SG2 51_24 16_24".into(),
/// (),
/// );
/// ```
#[derive(Default, Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
pub struct GroupU<N, T: OptFields> {
... | Rust | 0 |
return self._delegate.get_node_edges(node, relay_param, node_to_id)
######################################################################
# Pass the parser and an interested renderer to visualizer.
# Here we just the terminal renderer.
viz = relay_viz.RelayVisualizer(mod, {}, TermPlotter(), YourAwesomeParser())
... | Python | 1 |
self.load_last_workspace()
def resizeEvent(self, event: QtGui.QResizeEvent):
# print("Called resizeEvent()")
super().resizeEvent(event)
# Call the method to fit the image to the view whenever the window resizes
if self.scene.items():
pixmap_item = self.scene.items(... | Python | 1 |
_BROWN;
} else if game.recently_got_cheese > 0 {
status = "got cheese!".to_string();
status_color = YELLOW;
} else if game.turbo {
status = "well done! (".to_string() + &game.cat_timer.to_string() + ")";
status_color = BRIGHT_GREEN;... | Rust | 0 |
this test case.
cluster.causet.violetabft_store.violetabft_log_gc_tick_interval = ReadableDuration::secs(60);
let gen_snapshot_fp = "brane_gen_snap";
let fidel_client = Arc::clone(&cluster.fidel_client);
// Disable default max peer count check.
fidel_client.disable_default_operator();
let br... | Rust | 0 |
>>,
}
impl ChainShader {
pub fn new() -> Box<ChainShader> {
Box::new(ChainShader{
shaders: Vec::new()
})
}
pub fn from_shaders(shaders: Vec<Box<Shadable + Send + Sync>>) -> Box<ChainShader> {
Box::new(ChainShader{shaders})
}
pub fn push_shader(&mut self, shader... | Rust | 0 |
Result::Ok(Some(from_raw_parts(
self.buffer.data.offset(oft_start as isize),
n,
)))
}
}
}
pub fn consume(&mut self, n: usize) {
self.read += n;
self.buffer.read.0.store(self.read, Ordering::Release);
... | Rust | 0 |
import random
apr = ("rock", "paper", "scissor")
comp = random.choice(apr)
user = str(input("provide your input from rock, paper, scissor \n"))
user = user.lower()
print(user)
if ((user != "rock") and (user != "scissor") and (user != "paper")):
print(f"incorrect input, kindly try again \n")
exit()
print(f"c... | Python | 1 |
image_storage.seek(0)
itchat.send_image(image_storage, toUserName=receiver)
logger.info("[WX] sendImage url={}, receiver={}".format(img_url, receiver))
elif reply.type == ReplyType.IMAGE: # 从文件读取图片
image_storage = reply.content
image_storage.seek(0)
... | Python | 1 |
_rating_mozilla_observatory(url: &str) -> ScanNew {
Self::check_rating_mozilla_observatory(url)
}
fn strip_url(url: String) -> String {
let mut check_url = url;
// remove query from URL
if let Some(query_start) = check_url.find('?') {
check_url = check_url[..query_st... | Rust | 0 |
{DependencyKind, Version};
use crate::schema::versions;
use crate::util::errors::{std_error_no_send, CargoResult};
static DEFAULT_GIT_SSH_USERNAME: &str = "git";
#[derive(Clone)]
pub enum Credentials {
Missing,
Http { username: String, password: String },
Ssh { key: String },
}
impl Credentials {
fn ... | Rust | 0 |
color: Some(0xFF34eb5e),
footer: None,
image: None,
thumbnail: None,
video: None,
provider: None,
author: None,
fields: (EmbedFields(... | Rust | 0 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import sys
_FILE_PATH = os.path.dirname(os.path.realpath(__file__))
_SYS_PATH = sys.path[:]
try:
_COMMENT_EATER_PATH = os.path.j... | Python | 1 |
from tests import TestCase, create_test_cases
class ExoticOperationCombosTestCase(TestCase):
def test_insert_deleted_object(self):
article = self.Article()
article.name = 'Some article'
article.content = 'Some content'
self.session.add(article)
self.session.flush()
... | Python | 1 |
s,k,a_No,H,log_regs,policy=None,beta_hat_h=None,Lamda=None,beta=None):
states,actions,rewards = hospitals[k]['states'],hospitals[k]['actions'],hospitals[k]['rewards']
# Select actions based on estimated policy
mu_hat,prop_scores = {},{}
rho_prod = [[1]*states[0]['H'].shape[0]]
for h in range(H):
... | Python | 1 |
if no_change_count > min_change_count:
logger.debug(f"NO CHANGE : {iou_scores[i]}")
break
if enable_visualization:
overlay = np.ones((_h, _w, 3), dtype=np.uint8) * 255
for box in merged_bboxes:
x, y, w, h = box
c... | Python | 1 |
import os
from dotenv import load_dotenv
from aiogram import Router
from aiogram.types import Message
from aiogram.filters import Command, CommandObject
from aiogram import Router, F
from aiogram.types import CallbackQuery, FSInputFile
from aiogram.fsm.context import FSMContext
from keyboards import client as k
from ... | Python | 1 |
s)
# Extract wav file for transcription only
wav = extract_for_transcription(video_file, audio_index, duration)
# Transcribe the MP3 to get swear word timestamps
swears = transcribe_audio(wav, output_transcription)
# Remove the wav file as we don't need it anymore
os.remo... | Python | 1 |
64) for file_path, base64 in asset_lib_base64s]
# github_base64s = [(get_plugin_name_from_file(file_path), base64) for file_path, base64 in github_base64s]
# gitlab_base64s = [(get_plugin_name_from_file(file_path), base64) for file_path, base64 in gitlab_base64s]
# asset_lib_base64_dict = {plugin_name: base... | Python | 1 |
l_index, t_start, t_stop):
entity_index = int(self.header["event_channels"][event_channel_index]["id"])
entity_header = self._entity_headers[entity_index]
n = entity_header["n"]
offset = entity_header["offset"]
timestamps = self._memmap[offset : offset + n * 4].view("int32")
... | Python | 1 |
::WepSlots},
game::{
DELTA,
State, Content, GameState, StateSwitch, world::{Level, Statistics},
event::{Event::{self, Key, Mouse}, MouseButton, KeyCode},
}
};
use ggez::{
Context, GameResult,
graphics::Rect,
};
#[allow(clippy::large_enum_variant)]
enum WinButtons {
CampaignM... | Rust | 0 |
hit(&self, player: &Player) -> bool {
let half_size = self.size / 2;
let does_x_match = player.x == self.x;
let player_above_gap = player.y < self.gap_y - half_size;
let player_below_gap = player.y > self.gap_y + half_size;
does_x_match && (player_above_gap || player_below_... | Rust | 0 |
size=6):
"""
print a grid of images
showing any differences in predicted values
images m x n array of pixels, n assumed to be a perfect square
actual_labels m x 1 array of the actual labels
predicted_labels m x 1 of predicted labels
starting_index scalar, where in 1...m t... | Python | 1 |
0x08, 0x2a, 0x44, 0x40, 0x01], "vmovntdqa xmm0, [rax + rax*2 + 0x10]");
}
#[test]
fn test_vex() {
fn test_instr(bytes: &[u8], text: &'static str) {
test_display_under(&InstDecoder::minimal().with_avx(), bytes, text);
test_display_under(&InstDecoder::default(), bytes, text);
test_invalid_un... | Rust | 0 |
::from_hill(hill.clone(), 3, 1);
println!("Hit {} trees for the first task.", solution.trees_hit);
let to_try = vec![(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)];
let mut res = 1;
for (right, down) in to_try {
let sol = Solution::from_hill(hill.clone(), right, down);
println!("For {}, {} hit... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.