text string | label_name string | labels int64 |
|---|---|---|
from ..imagelist import ImageList
from ..office31 import Office31
from ..officehome import OfficeHome
from ..visda2017 import VisDA2017
from ..officecaltech import OfficeCaltech
from .imagenet_caltech import ImageNetCaltech
from .caltech_imagenet import CaltechImageNet
from common.vision.datasets.partial.imagenet_calte... | Python | 1 |
c, _terminal_enum) =
tokenize::value(
&variant_name,
non_object,
acc.clone(),
)?;
acc = new_acc;
Ok(quote!(#variant_name_tokens(#variant_body_tokens... | Rust | 0 |
ap()
.iter()
.map(|(address, height)| TupleHeightRecord(address.clone(), *height))
.collect();
let interval = self.interval;
RecordForWal {
test_id,
node_record,
alive_record,
wal_record,
commit_record,
... | Rust | 0 |
_is_period_index_1(remaining_bytes);
if is_period
{
Self::parse_octet_0_to_9::<{Three}>(remaining_bytes)
}
else
{
let (possible_octet3_byte2, is_period) = InternetProtocolVersion4AddressParser::get_byte_and_check_if_it_is_period_index_2(remaining_bytes);
if is_period
{
Self::parse_octet_10_to_... | Rust | 0 |
is set to the round of the highest committed block."
)
.unwrap()
});
/// The counter corresponds to the version of the last committed ledger info.
pub static LAST_COMMITTED_VERSION: Lazy<IntGauge> = Lazy::new(|| {
register_int_gauge!(
"libra_consensus_last_committed_version",
"The counter ... | Rust | 0 |
fig.update_layout(
title="Most Busy Days",
xaxis_title="Days",
template="plotly_dark", # Dark theme for better contrast
width=700, # Reduce overall chart width
height=500, # Adjust height
plot_bgcolor="#0D0F12", # Extracted dark shade from image
paper_bgc... | Python | 1 |
al_ready = _patching_status.and_conditions([
(y_type[0] == "binary" and not (y_score.ndim == 2 and y_score.shape[1] > 2),
"y_true type is not one-dimensional binary.")
])
_patching_status.write_log()
if y_type[0] == "multiclass" or (
y_type[0] == "binary" and y_score.ndim == 2 a... | Python | 1 |
Ak8963Sensitivity::Opt16bit,
Ak8963SampleRate::Opt100Hz,
).unwrap();
mpu.disable_bypass()?;
Ok(DigitalMotionProcessor {
i2c_dev,
mpu,
mag,
debug: false,
})
}
pub fn set_debug(&mut self, debug: bool) {
... | Rust | 0 |
}
self.command(cmd).await?;
Ok(())
}
/// Repeat... repeats
///
/// Takes RepeatSetting enum which defines what kind of repeat you need
pub async fn repeat(&self, setting: RepeatSetting) -> Result<(), Error> {
let mut cmd = self.cmd("Repeat");
cmd.add_param("sta... | Rust | 0 |
|
|
|
___|___
");
}
2 => {
println!("
_______
|/ |
| (_)
| \\|/
| |
|
|
___|___
");
}
1 => {
println!("
_______
|/ |
| (_)
| ... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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... | Python | 1 |
= 1;
let mut n_live_queries = uint256_ops::to_usize(&ctx[map::MM_N_UNIQUE_QUERIES]);
// Add 0 at the end of the queries array to avoid empty array check in readNextElment.
ctx[map::MM_FRI_QUERIES_DELIMITER] = uint256_ops::get_uint256("0");
// Rather than converting all the values from Montgomery to standard f... | Rust | 0 |
#!/usr/bin/env python2
# Copyright (c) 2001-2009 XORP, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, Version 2, June
# 1991 as published by the Free Software Foundation. Redistribution
# and/or modification of this program under th... | Python | 1 |
gs is not None:
patch["tags"] = tags
if private is not None:
patch["private"] = bool(private)
if not patch:
return {"message": "Nothing to update."}
resp = await client.patch(f"items/{item_id}", json=patch)
return resp.json()
@mcp.tool(annotations={"readOnlyHint": True})
asyn... | Python | 1 |
.size(), 0);
assert_eq!(fixture.storage.remaining(), SOURCE_ENCODER_BLOCK_SIZE_IN_BITS);
let encoding = fixture.storage.build();
let vec = encoding.block;
assert_that!(&vec, len(SOURCE_ENCODER_BLOCK_SIZE_IN_BITS / 8));
assert_eq!(vec, vec![0, 0, 0, 0, 0, 0, 0, 0]);
}
#[r... | Rust | 0 |
return false;
}
} else if op == "get" {
if let Some(n) = Self::next(&args, &mut i) {
let key: K = n
.parse()
.expect(&format!("Expected a(n) {}", std::any::type... | Rust | 0 |
// g^2^(r-m-1)
let mut t0 = g;
for _ in 0..(r-m-1) {
t0.square();
}
// g^2^(r-m)
let mut t1 = t0;
t1.square();
x.mul_assign(&t0);
b.mul_assign(&t1);
g = t1;
r = m;
}
}
fn sqrt_for_one_mod_sixteen<'a, 'b, E: Eleme... | Rust | 0 |
e this:
# masks, scale = pad_masks(masks[:, 0, :, :], 1)
# boxes = scale_boxes(boxes.tensor, scale)
def pad_masks(masks, padding):
"""
Args:
masks (tensor): A tensor of shape (B, M, M) representing B masks.
padding (int): Number of cells to pad on all sides.
Returns:
The padded ma... | Python | 1 |
""" what is operator in python?
python has many types of operator for different types of operation.
1. Arithmetic operators
2. Assignment operators
3. Comparison operators
4. Logical operators
5. Identity operators
6. Membership operators
7. Bitwise operators
Example:
"""
a=10
b=5
c=a+b
print(c) # it will print the a... | Python | 1 |
------------------------------------------------------------------- #
# UNetResNet34 options
# ---------------------------------------------------------------------------- #
_C.MODEL_2D.UNetResNet34 = CN()
_C.MODEL_2D.UNetResNet34.pretrained = True
# --------------------------------------------------------------------... | Python | 1 |
ha) if alpha is not None else 0.0
attack_params: Dict[str, Any] = {"eps": eps_val}
if attack_name.lower() == "pgd":
attack_params.update({"alpha": alpha_val, "steps": steps or 10})
elif attack_name.lower() == "fgsm":
attack_params.update({"steps": ste... | Python | 1 |
box::<Matrix<M, O>>();
let mut c = zero_box::<Matrix<N, O>>();
bencher.iter(|| blis::matmul(black_box(&a), black_box(&b), black_box(&mut c)));
}
#[cfg(feature="mkl")]
#[bench]
fn bench_matmul_mkl(bencher: &mut Bencher) {
mkl_init();
let a = zero_box::<Matrix<N, M>>();
let b = zero_box::<Matrix<M,... | Rust | 0 |
fill_bytes(&mut seed);
Self::new_from_seed(&seed)
}
/// Produces a new instance of a [VerifiableServer] using a supplied set of bytes to
/// represent the server's private key
pub fn new_with_key(key: &[u8]) -> Result<Self, InternalError> {
let sk = CS::Group::from_scalar_slice(&Generic... | Rust | 0 |
` struct, which is a
// wrapper that exposes a `&[T]` as a `PointBuffer`.
// We can also clear the buffer, removing all points
poly_buffer_mut.clear();
}
{
// Lastly, there are even more specialized traits that define the actual memory layout of the buffer:
// `Interlea... | Rust | 0 |
*const libc::iovec,
iovcnt: libc::c_int, offset: libc::off_t
) -> libc::ssize_t
}
}
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pub(super) use libc::{preadv64v2 as libc_preadv2, pwritev64v2 as libc_pwritev2};
#[cfg(any(target_os = "ios", target_os = "macos"))]
pub(super) use readwrite_... | Rust | 0 |
they say they are. Only if not doing an override of win index,
// which we know likely wont match bidder info and is simply checking below that you arent stealing a prize.
if overwrite_win_index.is_none() {
if let Some(up_win_index_unwrapped) = up_win_index {
let winner = Au... | Rust | 0 |
<()>(header, None, &self.sender);
self.closed = true;
}
Ok(())
}
}
#[inline]
fn send_binary<D: Data>(header: MessageHeader, msg: Option<D>, sender: &Sender<Bytes>) {
SLAB.with(|slab| {
let mut slab = slab.borrow_mut();
let capacity = header.required_bytes();
... | Rust | 0 |
0)
OP_07()
Jump("loc_32B1")
label("loc_32A2")
RunExpression(0x0, (scpexpr(EXPR_PUSH_LONG, 0xFF), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
Jump("loc_32B1")
label("loc_32B1")
Jump("loc_2E46")
label("loc_32B6")
RunExpression(0x0, (scpexpr(EXPR_PUSH_LONG, 0x0), scpexpr(EXPR_STUB), ... | Python | 1 |
let mut rnd = XorShiftRng::from_seed(rnd.gen());
let n = Normal::new(0.0, 1.0).unwrap();
let model = NNModel::with_unit_initializer(
NNUnits::new(2, (4,Box::new(FReLU::new())), (4,Box::new(FReLU::new())))
.add((1,Box::new(FSigmoid::new()))),
TextFileInputReader::new("data/initial_n... | Rust | 0 |
thread: &mut VMThread<A>,
src1: Value,
src2: Value,
dest: &mut Value
) -> Result<(), UncheckedException> {
debug_assert!(!src1.is_null());
debug_assert!(!src2.is_null());
if !src1.is_value() || !src2.is_value() {
if !src1.is_container() && !src2.is_container() {
let dyn1: *m... | Rust | 0 |
pty() {
opaque_errors.iter().for_each(|e| {
println!(
"An opaque type crossed the FFI boundary as a value: {:?}",
e
)
});
panic!();
}
let args: Vec<String> = env::args().collect();
let target = args[1].as_str();
let mut ou... | Rust | 0 |
DEFAULT_CUSTOM_OPS
}
}
/// `Custom` is used to define OCaml types that wrap existing Rust types, but are owned by the
/// garbage collector
///
/// A custom type can only be converted to a `Value` using `IntoValue`, but can't be converted from a
/// value. Once the Rust value is owned by OCaml it should be ac... | Rust | 0 |
opts| {
AggregateOptions::builder()
.hint(opts.hint)
.max_time(opts.max_time)
.collation(opts.collation)
.selection_criteria(opts.selection_criteria)
.read_concern(opts.read_concern)
.build()
});
... | Rust | 0 |
# Copyright 2016-2017 LasLabs Inc.
# Copyright 2017-2018 Tecnativa - Jairo Llopis
# Copyright 2018-2019 Tecnativa - Alexandre Díaz
# Copyright 2021 ITerra - Sergey Shebanin
# Copyright 2023 Onestein - Anjeel Haria
# Copyright 2023 Taras Shabaranskyi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
... | Python | 1 |
alar;
use generic_array::GenericArray;
use rand::{CryptoRng, Rng};
use sha2::Digest;
use sha2::Sha512;
use std::hash::{Hash, Hasher};
use super::dleq;
use crate::key::PublicKeyError;
type Point = RistrettoPoint;
/// VRF Secret Key
#[derive(Clone)]
pub struct SecretKey {
secret: Scalar,
public: Point,
}
impl... | Rust | 0 |
6, t7)
}
// fixed-point combinator for Fn(&T1, &T2, &T3, &T4, &T5, &T6, &T7, &T8) -> R
trait Apply8<T1, T2, T3, T4, T5, T6, T7, T8, R> {
fn apply(&self, f:
&dyn Apply8<T1, T2, T3, T4, T5, T6, T7, T8, R>,
t1: &T1, t2: &T2, t3: &T3, t4: &T4, t5: &T5, t6: &T6, t7: &T7, t8: &T8)... | Rust | 0 |
std, *panicking, *begin_panic];
pub static ref BEGIN_PANIC_FMT: [Symbol; 3] = [*std, *panicking, *begin_panic_fmt];
pub static ref BINARY_HEAP: [Symbol; 4] = [*alloc, *collections, *binary_heap, *BinaryHeap];
pub static ref BORROW_TRAIT: [Symbol; 3] = [*core, *borrow, *Borrow];
pub static ref BTREEMAP: ... | Rust | 0 |
String,
expected_offer_weight: String,
}
let mut test_cases: Vec<TestCase> = Vec::new();
test_cases.push(TestCase {
expected_error: true,
start_time: start_time - 1,
expected_ask_weight: Default::default(),
expected_offer_weight: Default::default(),
});
tes... | Rust | 0 |
self.entry_value;
self.clear_highlight_text();
self.draw(display);
// rprintln!("Display - ends well");
Some(Ok(self.value))
}
_ => {
// rprintln!("Display - ends badly");
self.set_value(self.backup_... | Rust | 0 |
gene_num, 1) * self.max_recombination_rate
joblib.dump(recombination_rate, recombination_rate_file)
return recombination_rate
def init_population(self):
"""
Initialize population
"""
initial_donor_pop_file = os.path.join(self.tmp_path, "initial_donor_pop.pkl"... | Python | 1 |
"""sd_multi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | Python | 1 |
from typing import List
class Solution:
def romanToInt(self, s: str) -> int:
# Dictionary mapping Roman numerals to their integer values
roman_dict = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000... | Python | 1 |
['BTC', 1579542435], # 1500s before first entry
['ETH', 1579543935], # exact match
['XRP', 1579543935], # no data in DB, no data is returned
['GBP', 1579543935], # exact match
],
'target_asset': 'USD',
'only_cache_period': 1000... | Python | 1 |
import subprocess
import os
from datetime import datetime
def main():
now = datetime.now()
# dd/mm/YY H:M:S
dt_string = now.strftime("%m-%d-%Y_%H:%M:%S")
# Create the directory if it doesn't exist
if not os.path.exists("profiles"):
os.makedirs("profiles")
# Write the profiles to a... | Python | 1 |
Eq => (2, 1),
IsZero => (1, 1),
And => (2, 1),
Or => (2, 1),
Xor => (2, 1),
Not => (1, 1),
Byte => (2, 1),
ShL => (2, 1),
ShR => (2, 1),
SAR => (2, 1),
Keccak256 => (2, 1),
Add... | Rust | 0 |
# Importation
import os
import pygame
pygame.init()
#---------------------------------------------------------------------------------------------
WIDTH, HEIGHT = 750, 700
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Space Shooter Game")
# Color
WHITE_COLOR = (255, 255, 255)
BLACK_COLOR... | Python | 1 |
(C)] #[derive(Clone, Copy, Debug)]
pub struct IActionProgressDialog;
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub struct IHWEventHandler;
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub struct IHWEventHandler2;
#[repr(C)] #[derive(Clone, Copy, Debug)]
pub struct IQueryCancelAutoPlay;
#[repr(C)] #[derive(Clone, Copy, Debug... | Rust | 0 |
NE_ALIEN_INCREASE = 0.6 # 60% alien count increase at milestones
# ==================== End Game System ====================
UPGRADE_STOP_SCORE = 10000 # Score at which upgrades stop appearing
HEALTH_BOOST_INTERVAL = 500 # Every 500 points after 10000
HEALTH_BOOST_MULTIPLIER = 0.3 # 30% health increase p... | Python | 1 |
7', 'tricycle_008', 'tricycle_009', 'tricycle_010', 'tricycle_011', 'tricycle_016', 'tricycle_017', 'tricycle_019', 'tricycle_023', 'tricycle_027', 'tricycle_032', 'tricycle_035', 'tricycle_037', 'truck_004', 'truck_007', 'truck_008'
]
sequence_info_list = []
for i in range(len(sequence_list)):... | Python | 1 |
let number_of_octopi = simulator.get_number_of_octopi();
let mut previous_number_flashed = 0;
let mut step = 1;
let mut part_1_result = 0;
let mut part_2_result = 0;
while (previous_number_flashed != number_of_octopi) || (step < 100) {
previous_number_flashed = simulator.next().unwrap();... | Rust | 0 |
rackingPixel()
assert pixel.generate_image_url() is None
@override_settings(GOOGLE_ANALYTICS_TRACKING_ID='UA-123456-1')
def test_site_config_override(self):
site_config = SiteConfigurationFactory.create(
site_values=dict(
GOOGLE_ANALYTICS_ACCOUNT='UA-654321-1'
... | Python | 1 |
weight_up = state_dict[up_key].to(
curr_layer.weight.data.device, curr_layer.weight.data.dtype)
if weight_up.ndim == 2:
curr_layer.weight.data += 1/8 * alpha * \
torch.mm(weight_up, weight_down)
else:
assert weight_up.ndim == 4
curr... | Python | 1 |
Result<Self> {
#nom_read(bytes)
}
}
}
}
fn generate_nom_read(encoding: &Encoding) -> TokenStream {
match encoding {
Encoding::Unit => unreachable!(),
Encoding::Primitive(primitive, span) => generage_primitive_nom_read(*primitive, *span),
Encoding::Byt... | Rust | 0 |
ver.find_element(by = By.ID , value= "output").text
if Text :
# Stop recognizing by clicking the stop button.
driver.find_element(by = By.ID , value= "end").click()
# If the input language is English , return the Modified Query.
... | Python | 1 |
le と Tweet型に Summaryトレイトを実装した
// ここで引数の item の summarizeメソッドを呼ぶ関数notify を定義することができる
// ただし引数item は Summaryトレイトを実装している型であるとする
// このようなことをするためには impl Trait構文を使うと良い
pub fn notify(item: &impl Summary) {
println!("速報[{}]", item.summarize());
}
// 引数item には具体的な型の代わりに implキーワードとトレイト名を指定している
... | Rust | 0 |
TRANSFER: str = "TRANSFER"
source: ForeignKey[Account] = ForeignKey(
to=Account,
on_delete=RESTRICT,
related_name="out_transactions",
db_index=True,
)
destination: ForeignKey[Account] = ForeignKey(
to=Account,
on_delete=RESTRICT,
related_name="in_tra... | Python | 1 |
class Solution:
def lengthAfterTransformations(self, s: str, t: int) -> int:
c_old = [0]*26
for c in s:
c_old[ord(c)-97] += 1
c = [0] * 26
while t:
c = [0] * 26
for i in range(26):
if i == 25:
c[0] += c_old[i] %... | Python | 1 |
///
/// Can handle data stored a 1, 2, 4 or 8 bytes, so long as the value
/// is small enough to be returned in a `u32`.
///
/// ```
/// # use yatlv::{FrameParser, FrameBuilder, FrameBuilderLike, Result};
/// # fn main() -> Result<()> {
/// # let mut frame_data = Vec::new();
/// # {
... | Rust | 0 |
mut doprocdump = 0;
loop {
let mut c = getc();
if c < 0 {
break;
}
if c == C(b'P') {
// Process listing.
// procdump() locks cons.lock indirectly; invoke later
doprocdump = 1;
} else if c == C(b'U') {
// Kill line.
... | Rust | 0 |
d4\xb0\xd0\x10-a<\x8bd\xbfA\x1c1\xc5E`\
\xd2\x89Dq\xe0\x07\x02\xc9\xe7R\x02\x08\x0f\x99M\x96\
\x1a\xa3\xcd\x0fd2\x83\x8cQ\xf9D\xacS\xd5\xe3v\
\x91}\xc2\x0b\xf8~\x1d\xff;d\xed}\xd4\xa8\xcb\x9b\
\xc0kY;\xf4ww@\xda\x8b\x88\xc0\xff\xf5\x1d\xe6\
\xbb\xcfYa\x1f\xddj\x82!\x1dm!\x91\xc5\xd4\x9a\
\xe0wM\x1c;]\xca\x9asY\xe1\xdf\... | Python | 1 |
}
}
for y in 0..height {
let src_y_off = y * src_y_stride;
let dst_y_off = (y + pad_size) * dst_y_stride;
for x in 0..width {
let src_off = src_y_off + x * x_stride;
let dst_off = dst_y_off + (x + pad_size) * x_stride;
for c in 0..x_stride {
... | Rust | 0 |
from django.contrib.auth.models import User
from rest_framework import generics
from core.serializers.register_serializer import RegisterSerializer
class RegisterView(generics.CreateAPIView):
queryset = User.objects.all()
serializer_class = RegisterSerializer | Python | 1 |
import re
import pickle
#[1365976818.828652] 16 bytes from 8888::212:7402:2:202: icmp_seq=1 ttl=63 time=61.2 ms
re_ping_info = re.compile(".*ttl=([0-9]+) time=([0-9,\.]+) ms\n")
re_log_time = re.compile("(\d+):(\d+):.*")
def parse_ping(pingfilepath):
pingfile = open(pingfilepath, 'r')
pingdata = pingfile.read... | Python | 1 |
ut_bg, &[]);
cpass.set_bind_group(1, &data.inner.as_gpu().pre_cull_bg, &[]);
cpass.set_bind_group(2, uniform_bg, &[]);
cpass.dispatch(dispatch_count, 1, 1);
cpass.set_pipeline(&cull_pass.prefix_sum_pipeline);
let mut stride = 1_u32;
let mut iteration = 0;
while s... | Rust | 0 |
N x T x D or B x 1 x T x D
pad_mask = pad_mask.unsqueeze(1).expand(-1, n_sz, -1).reshape(b_sz * n_sz, t_sz)
# BN x T
feat_final = feat_final.reshape(b_sz * n_sz, t_sz, -1)
# BN x T x D
layer_hiddens = []
if self.config.encoder_layers > 0:
get_hidden_tmp = (
... | Python | 1 |
p_user_data: *mut c_void,
) -> usize {
let cur = p_user_data as *mut Cursor<&[u8]>;
let dst = std::slice::from_raw_parts_mut(p_buffer as *mut u8, p_nb_bytes);
let n = (*cur).read(dst);
n.expect("Failed to read from buffer") // nothing can be done here
}
unsafe exter... | Rust | 0 |
import reflex as rx
config = rx.Config(
app_name="ourportfolios",
plugins=[
rx.plugins.TailwindV3Plugin(),
rx.plugins.sitemap.SitemapPlugin()],
)
| Python | 1 |
};
}
}
// Add a rectangle
pub fn push(&mut self, rect: Rect<f32>, color: Rgb) {
self.inner.push((rect, color));
}
}
/// Create a rectangle that starts on the left of `start` and ends on the right
/// of `end`, based on the given flag and size metrics.
fn create_rect(
s... | Rust | 0 |
data_aug_scales = [512, 640, 800,1024]
data_aug_max_size = 1024
data_aug_scales2_resize = [600,800]
data_aug_scales2_crop = [600, 600]
data_aug_scale_overlap = None
| Python | 1 |
icing'*"]
pub const TXTLOG_VERBOSE: u32 = 6u32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const TXTLOG_VERY_VERBOSE: u32 = 7u32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const TXTLOG_WARNING: u32 = 2u32;
#[doc = "*Required featur... | Rust | 0 |
on
Constitution,
/// KK, Körperkraft, strength
Strength,
/// GS, Sozialstatus, socialstatus
SocialStatus,
/// MR, Magieresistenz, magicrestistance
MagicResistance,
/// INI, Initiative
Initiative,
/// AT, Attacke, nahkampf, combat, closecombat
CloseCombat,
/// PA, Parrieren, parry
Parry,
/// FK, Fernkampf,... | Rust | 0 |
SegmentData::Raw(data) = self {
*self = parse_pg_segment_data(
&mut SliceReader::new(data.as_slice()),
&mut parser.app_parser_storage,
)?;
Ok(())
} else {
panic!("PgSegmentData must be raw before finishing")
}
}
}
#[macr... | Rust | 0 |
from __future__ import annotations
import os
from typing import Any, Dict
from fastapi import APIRouter, HTTPException, Query
from pydantic import BaseModel
# 相対 import(pytest / uvicorn 両対応)
from ..services.open_meteo import OpenMeteoClient as _OpenMeteoClient
from ..utils import datetime_utils as dtmod
# tests で m... | Python | 1 |
"PCC", log1p=False)
val_mre = model.score(X, imputed_data.clone(), ~valid_mask, metric="MRE", log1p=False)
test_RMSE = model.score(X, imputed_data.clone(), ~test_mask, "RMSE", log1p=False)
test_pcc = model.score(X, imputed_data.clone(), ~test_mask, "PCC", log1p=False)
test_mre = model.sc... | Python | 1 |
"""Tests for pylab tools module.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2011, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------... | Python | 1 |
#!/usr/bin/env python
from pwn import *
#context.log_level = 'debug'
io = process(['./sentosa'], env={'LD_PRELOAD':'./libc-2.23.so'})
libc = ELF('libc-2.23.so')
def start_proj(length, name, price, area, capacity):
io.sendlineafter("Exit\n", '1')
io.sendlineafter("name: ", str(length))
io.sendlineafter("... | Python | 1 |
{
reporter: context.try_build()?,
recorder,
loopback: Vec::new(),
})
}
}
impl<R: Reporter> Reporter for RecordedMonolithicLocalPartition<R> {
impl_report!(speciation(&mut self, speciation: MaybeUsed<R::ReportSpeciation>) {
self.recorder.record_speciation(spe... | Rust | 0 |
11001;
assert_eq!(UNIFORM_REPRESENTATIVE_2[c], 0b10101010);
}
#[bench]
fn bench_local_binary_pattern(b: &mut Bencher) {
let image = GrayImage::from_fn(100, 100, |x, y| Luma([x as u8 % 2 + y as u8 % 2]));
b.iter(|| for y in 0..20 {
for x in 0..20 {
let pat... | Rust | 0 |
L1` is the
/// luminance of the brighter color and `L2` is the luminance of the darker
/// color both in sRGB linear space. A higher contrast ratio is generally
/// desireable.
///
/// For more details, visit the following links:
///
/// [Success Criterion 1.4.3 Contrast (Minimum) (Level AA)](https://www.w3.org/WAI/WCA... | Rust | 0 |
0B2AA,
"lightskyblue" => 0x87CEFA,
"lightslategray" => 0x778899,
"lightslategrey" => 0x778899,
"lightsteelblue" => 0xB0C4DE,
"lightyellow" => 0xFFFFE0,
"lime" => 0x00FF00,
"limegreen" => 0x32CD32,
"linen" => 0xFAF0E6,
"magenta" => 0xFF00FF,
"maroon" => 0x800000,
"m... | Rust | 0 |
er'].username,'project': task['project'],
'method': task['method'], 'code_file': task['code_file'],'data_file':task["data_file"]} # 在这里修改返回的键名
modified_tasks.append(modified_task)
return JsonResponse(list(modified_tasks), safe=False)
'''
def run_floc(request):
#先创建一条报告记录
d... | Python | 1 |
intln!("NO SOLUTION");
assert!(opt.expected_makespan.is_none(), "Expected a valid solution");
}
println!("TOTAL RUNTIME: {:.6}", start_time.elapsed().as_secs_f64());
}
fn parse(input: &str) -> JobShop {
let mut lines = input.lines();
lines.next(); // drop header "num_jobs num_machines"
let ... | Rust | 0 |
main_input = Input(shape = (None, None, None, num_channels))
input = GaussianDropout(0.5)(main_input)
x = Conv3D(32, (3, 3, 3), dilation_rate=(1, 1, 1), padding='valid', kernel_initializer=kernel_initializer, bias_initializer = bias_initializer)(input)
# keras.layers.Co... | Python | 1 |
essionOrdered:
clauses.append(not_(column.like(processLike(value))))
if metaData != MetaDataMapped:
for criteria, crtClass in baseDataQueryType.query.criterias.items():
column = baseDataProperties.get(criteria.lower())
if colum... | Python | 1 |
= read_and_clear("Choose a nickname", stdout)?;
let nickname = if let Some(n) = nickname {
n
} else {
continue;
};
let user = User {
nickname: nickname.clone(),
color: read_color(stdout, stderr)?,
};
connection.write(&Lo... | Rust | 0 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""This script creates the example directory and its contents.
"""
#end_pymotw_header
import os
def mkfile(filename, body=None):
with open(filename, 'w') as f:
f.write(body or filename)
return
def m... | Python | 1 |
, Deserialize)]
pub struct DestinyMilestoneActivityVariant {
#[serde(rename = "activityHash")]
pub activity_hash: u32,
#[serde(rename = "completionStatus")]
pub completion_status: DestinyMilestoneActivityCompletionStatus,
#[serde(rename = "activityModeHash")]
pub activity_mode_hash: Option<u32>,... | Rust | 0 |
ATTACK_PROMPT_V2 = """
Your goal is to guess the words in a masked text. Given
(1) NL text: a natural-language text explaining instruction to extract information from
a database
(2) DB Schema: the database’s schema expressed in YAML
guess the original each masked symbol exists in the text.
Masked symbols are wrapped... | Python | 1 |
on="store_true",
default=False,
help="是否从出版社网站收集摘要,设置此选项表示不收集摘要",
)
parser.add_argument(
"--from-pkl",
"-f",
type=str,
default=None,
help="从pickle加载dblp元数据,并收集摘要",
)
parser.add_argument(
"--dblp-interval",
"-d",
type=float,
... | Python | 1 |
able(v),
ReflectValueRef::I64(v) => w.print_printable(v),
ReflectValueRef::F32(v) => w.print_printable(v),
ReflectValueRef::F64(v) => w.print_printable(v),
ReflectValueRef::Bool(v) => w.print_printable(v),
ReflectValueRef::String(v) => w.print_printable::<str>... | Rust | 0 |
from operator import add, mul, sub
square = lambda x: x * x
identity = lambda x: x
triple = lambda x: 3 * x
increment = lambda x: x + 1
HW_SOURCE_FILE=__file__
def product(n, term):
"""Return the product of the first n terms in a sequence.
n -- a positive integer
term -- a function that takes one ar... | Python | 1 |
TrieIterator::new(self)
}
}
pub struct TrieIterator<'a> {
trie: &'a Trie,
iter: IndexIter32<'a>,
}
impl<'a> TrieIterator<'a> {
fn new(trie: &'a Trie) -> TrieIterator<'a> {
TrieIterator {
trie: trie,
iter: trie.child_set.iter_ones(),
}
}
}
impl<'a>... | Rust | 0 |
"_table_data_sec")
mine_item.add_value("book_name", "book_name_data22")
item = mine_item.load_item()
assert all(
[
ItemAdapter.is_item(item),
dict(item)
== {
"_update_rule": {"title": "title_data"},
"_table": "table",
... | Python | 1 |
evice, dtype=dtype)
for step in sdxl.steps:
x = sdxl(
x,
step=step,
clip_text_embedding=clip_text_embedding,
pooled_text_embedding=pooled_text_embedding,
time_ids=time_ids,
)
latent = x
pixel... | Python | 1 |
assert_eq!(c.get_or_set_with(0, || async { _get(3).await }).await, &0);
assert_eq!(c.get_or_set_with(1, || async { _get(3).await }).await, &1);
assert_eq!(c.get_or_set_with(2, || async { _get(3).await }).await, &2);
assert_eq!(c.get_or_set_with(3, || async { _get(1).await }).await, &3);
... | Rust | 0 |
"""
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db... | Python | 1 |
"""
# Definition for a QuadTree node.
class Node:
def __init__(self, val, isLeaf, topLeft, topRight, bottomLeft, bottomRight):
self.val = val
self.isLeaf = isLeaf
self.topLeft = topLeft
self.topRight = topRight
self.bottomLeft = bottomLeft
self.bottomRight = bottomRig... | Python | 1 |
)]
fn from(variant: RECEIVE7_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `RECEIVE7` writer - Write '1' to disable interrupt for event RECEIVE\\[7\\]"]
pub struct RECEIVE7_W<'a> {
w: &'a mut W,
}
impl<'a> RECEIVE7_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
... | Rust | 0 |
"""EJERCICIO:
Explora el concepto de "decorador" y muestra cómo crearlo
con un ejemplo genérico"""
from datetime import datetime
def do_not_disturb(func):
def wrapper_do_not_disturb(*args):
if 19 <= datetime.now().hour < 24:
print(f'- The action "{func}" cannot be completed at this time -')
... | Python | 1 |
lt()
}]),
},
DescribeTestItem {
input:Ok(r#"Change 9239 by cool-guy@cool-guy2-w_cool-company on 1997/06/18 04:29:10
some-project: support for batching of p4describe operations
- update p4 api to return array of describe objects instead of pointer to single object'
- update mockapi to conform to new api
- a... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.