text string | label_name string | labels int64 |
|---|---|---|
r, mean, variance = tf.nn.fused_batch_norm(
tensor, scale=gamma, offset=beta, mean=mean, variance=variance,
epsilon=epsilon, is_training=is_training)
else:
tensor = tf.nn.batch_normalization(
tensor, mean, variance, beta, gamma, epsilon)
if is... | Python | 1 |
e(I):
for j in range(J):
Ainit[i][j] = transfuncs[i](dj[j])*Delta
return dj, Ainit
elif (isinstance(discretizations,np.ndarray)):
J = len(discretizations)
for k in range(len(self.channels)):
transfuncs.append(self.tot_trans... | Python | 1 |
ext_context"] = matching_lines[:5] # Limit to 5 matches
# Check window titles
if screen_state.get("windows") and isinstance(screen_state["windows"], list):
matching_windows = []
for window in screen_state["windows"]:
title = windo... | Python | 1 |
wrap()
}
#[cfg(test)]
pub fn tvar_bounded_by(bound: ty::Ref<ty::Poly>) -> ty::Ref<ty::Poly> {
ty::TVar::new(crate::source::EMPTY_SPAN, "TVar".into(), bound).into()
}
#[cfg(test)]
mod test {
use super::*;
use std::collections::HashMap;
use crate::source::EMPTY_SPAN;
use crate::ty::var_usage::Vari... | Rust | 0 |
mut id: usize, val: T) {
id += self.n;
self.data[id] = val;
id >>= 1;
while id > 0 {
self.data[id] = (self.op)(self.data[(id << 1)], self.data[(id << 1) + 1]);
id >>= 1;
}
}
pub fn get(&self, i: usize) -> T {
self.data[i + self.n]
}
... | Rust | 0 |
(_: &Self) -> bool {
true
}
fn get_var(&self) -> Option<&u32> {
match *self.0 {
Type::Variable(ref var) => Some(var),
_ => None,
}
}
fn traverse<'a, F>(&'a self, f: &mut F)
where
F: Walker<'a, Self>,... | Rust | 0 |
Type};
use crate::tuple::{AsTuple, Tuple};
/// SpaceMetadata is tuple, holding space metadata in system `_space` space.
#[derive(Serialize, Debug)]
pub struct SpaceMetadata {
pub id: u32,
pub uid: u32,
pub name: String,
pub engine: SpaceEngineType,
pub field_count: u32,
pub options: Map<String,... | Rust | 0 |
) -> cublasStatus_t;
}
extern "C" {
pub fn cublasSgemmStridedBatched(
handle: cublasHandle_t,
transa: cublasOperation_t,
transb: cublasOperation_t,
m: ::std::os::raw::c_int,
n: ::std::os::raw::c_int,
k: ::std::os::raw::c_int,
alpha: *const f32,
A:... | Rust | 0 |
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.MCTunes2017.PythiaCP2Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
comEnergy = cms.double(13000.0),
crossSection = cms.untracked.double(1),
filte... | Python | 1 |
[0 as usize; 256],
),
},
}));
for i in 0..256 {
if let Some(node_ptr) = self.find_raw(i as u8) {
debug_assert!(i != d as usize, "{:?} == {:?}", ... | Rust | 0 |
Type::MYSQL_TYPE_YEAR => {
if unsigned {
Ok(Int(self.read_u16::<LE>()? as i64))
} else {
Ok(Int(self.read_i16::<LE>()? as i64))
}
}
ColumnType::MYSQL_TYPE_LONG | ColumnType::MYSQL_TYPE_INT24 => {
... | Rust | 0 |
ents['component'][component_key]['question']] = question_ui
updated_components[section_components['component'][component_key]['submission']] = gr.Button(
visible=interactive)
updated_components[section_components['component'][component_key]['answer_state']] = state_obj
updated_compon... | Python | 1 |
""
return pulumi.get(self, "project")
@_builtins.property
@pulumi.getter(name="pulumiLabels")
def pulumi_labels(self) -> pulumi.Output[Mapping[str, _builtins.str]]:
"""
The combination of labels configured directly on the resource
and default labels configured on the provide... | Python | 1 |
buf = [0u16; 40];
buf.copy_from_slice(slice);
TitleName(buf)
},
"title name (80 Bytes)",
40,
),
)
}
}
#[derive(Debug, Deserialize)]
pub struct SectionHeader {
/// See `SectionFlags`.
pub section_fla... | Rust | 0 |
code, as normal.
"""
result = errors_from_src("""
def some_function():
pass
""")
self.assertNoErrors(result)
def test_top_level_fewer_blank_lines(self):
"""
It will trigger an error when less 3 blank lines are found
before top level definitions.
"""... | Python | 1 |
import FWCore.ParameterSet.Config as cms
hltDiEG2312IsoHgcalIsoL1SeededFilter = cms.EDFilter("HLTEgammaGenericQuadraticEtaFilter",
absEtaLowEdges = cms.vdouble(0.0, 1.0, 1.479, 2.0),
candTag = cms.InputTag("hltDiEG2312IsoEcalIsoL1SeededFilter"),
doRhoCorrection = cms.bool(False),
effectiveAreas = cms.v... | Python | 1 |
ONG_OBJECT_TYPE: &str = "42809"; // wrong_object_type
pub const UNDEFINED_COLUMN: &str = "42703"; // undefined_column
pub const UNDEFINED_FUNCTION: &str = "42883"; // undefined_function
pub const UNDEFINED_TABLE: &str = "42P01"; // undefined_table
pub const UNDEFINED_PARAMETER: &str = "42P02"; // undefined_parameter
pu... | Rust | 0 |
GNPTXFSIZ, GNPTXSTS, GOTGCTL, GOTGINT, GRSTCTL, GRXFSIZ, GRXSTSP, GRXSTSR, GUSBCFG, HPTXFSIZ,
};
/// Access functions for the OTG_HS_GLOBAL peripheral instance
pub mod OTG_HS_GLOBAL {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
... | Rust | 0 |
get isolated environment launcher")?;
Ok(launcher)
}
// Asserts that we receive the expected events about a component that contains an
// out/diagnostics directory: START, STOP, OUT_DIR_READY.
#[fasync::run_singlethreaded(test)]
async fn test_with_diagnostics() -> Result<(), Error> {
let env = connect_to_prot... | Rust | 0 |
item_model::AbstractItemModel;
use qt_core::connection::Signal;
use qt_core::variant::Variant;
use qt_core::object::Object;
use qt_core::slots::{SlotBool, SlotCInt, SlotItemSelectionRefItemSelectionRef, SlotModelIndexRefModelIndexRefVectorVectorCIntRef};
use qt_core::string_list::StringList;
use qt_core::qt::{Orientati... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
# Definindo os parâmetros
omega = 1.0 # Frequência angular
# Definindo a equação diferencial do oscilador harmônico
def harmonic_oscillator(t, y):
x, v = y # y[0] é x, y[1] é v
dxdt = v
dvdt = -omega**2 * x
retu... | Python | 1 |
#[test]
fn test_bigint_to_double() {
let bi = BigInt::from(100);
assert!(bigint_to_double(&bi) == 100.0);
let bi = BigInt::from(10000000000i64);
assert!(bigint_to_double(&bi) == 10000000000.0);
let bi = BigInt::from(1000000000000000000i64);
assert!(bigint_to_d... | Rust | 0 |
ow thought process if the toggle is enabled
if show_thought_process:
with st.expander("Processing - Watch the agents in action!", expanded=True):
# Redirect stdout to our StreamToExpander
sys.stdout = StreamToExpander(st)
with st.spinner("Generating Co... | Python | 1 |
Option::is_none")]
pub width: Option<i64>,
}
/// <p>Input Location</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct InputLocation {
/// <p>key used to extract the password from EC2 Parameter store</p>
#[serde(rename = "PasswordParam")]
#[serde(skip_serializing_if = "Op... | Rust | 0 |
webpage, 'workshop videos', default=None)
if workshop_videos:
extract_urls(workshop_videos)
else:
stages_path = self._search_regex(
r'(?s)<div[^>]+id="syllabus-stages"[^>]+data-url="([^"]+)"',
webpage, 'stages path')
... | Python | 1 |
"""Tests the functionality of the mms_client.types.omi module."""
from pendulum import Date
from mms_client.types.omi import MarketQuery
from mms_client.types.omi import MarketSubmit
from tests.testutils import verify_omi_market_query
from tests.testutils import verify_omi_market_submit
def test_market_submit_defau... | Python | 1 |
tory else {}
average_payout = last_round.get('payout', 0) if last_round else 0
return {
'agent_summaries': agent_summaries,
'total_contribution': total_contribution,
'average_payout': average_payout,
'rounds': moderator.round_history
}
if __name__ == "__main__":
pri... | Python | 1 |
return Some(PublicKey { key: perm });
}
}
None
}
}
<filename>src/selector/tests/iter.rs
use super::*;
#[test]
fn iter_single() {
let selector = CibouletteSelector::new_single("hello".to_string());
let res: Vec<String> = selector.into_iter().collect();
assert_eq!(... | Rust | 0 |
rule = desc.get("rule")
save_path = ""
download_setting = ""
total_ep = desc.get("total")
current_ep = desc.get("current")
fuzzy_match = False if tmdbid else True
if note:
note_info = self.__parse_rss_desc(note)
... | Python | 1 |
import sys
sys.stdin = open("input.txt", 'r')
def check_run(card):
card_pick = [0] * 10
for c in range(len(card)):
card_pick[card[c]] = 1
for idx in range(len(card_pick) - 2):
if card_pick[idx: idx + 3] == [1, 1, 1]:
return True
return False
def triplet(card):
card_p... | Python | 1 |
eArrays(y1, y2)
if width is not None or right is not None:
x2s = fn.interweaveArrays(x2, x2)
rightEnds = fn.arrayToQPath(x2s, y1_y2, connect="pairs")
p.addPath(rightEnds)
if width is not None or left is not None:
... | Python | 1 |
model.parameters():
assert not torch.isnan(param).any(), (
f"NaN detected in parameter {param} after optimizer step"
)
# @pytest.mark.parametrize(
# "name,arch,scale,extra_arch_params",
# [
# pytest.param(
# name,
# ... | Python | 1 |
for an encoder of basic data properties.
/// Unlike `Encode` (and similar to `BasicDecode`), this trait is not object
/// safe because it's better to just provide a dynamic implementation.
pub trait BasicEncode {
/// Retrieve the encoder's endianness.
fn endianness(&self) -> Endianness;
/// Encode an unsi... | Rust | 0 |
as esperadas
4. **Visualização**: Curva do modelo "passa" pelos dados observados
### ⚠️ **Limitações do Método:**
- **Dados limitados**: Poucos pontos temporais → incerteza alta
- **Ruído nos dados**: Subnotificação, atrasos → viés nos parâmetros
- **Modelo simplificado**: SIR não captur... | Python | 1 |
import os
import subprocess
import infra.basetest
class TestSquashfs(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
"""
BR2_TARGET_ROOTFS_SQUASHFS=y
# BR2_TARGET_ROOTFS_SQUASHFS4_GZIP is not set
BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
# BR2_TARGET_ROO... | Python | 1 |
och in range(model_params["TRAIN_EPOCHS"]):
train(epoch, tokenizer, model, device, training_loader, optimizer)
path = os.path.join(output_dir, "model_files")
tokenizer.save_pretrained(path)
console.log(f"[Initiating Validation]...\n")
with torch.no_grad():
c... | Python | 1 |
normalization::UnicodeNormalization;
use md5;
use rayon::prelude::*;
use indicatif::ProgressBar;
use external_data::{UNICODE_DATA, UDHR_SAMPLES, CONFUSABLES};
use font::*;
use contour;
struct SlowerTick {
shift: usize,
last_value: AtomicUsize,
}
impl SlowerTick {
fn new(shift: usize) -> SlowerTick {
... | Rust | 0 |
#!/usr/bin/env python3
import math
import numpy as np
from cereal import messaging, car
from opendbc.car.vehicle_model import VehicleModel
from openpilot.common.realtime import DT_CTRL, Ratekeeper
from openpilot.common.params import Params
from openpilot.common.swaglog import cloudlog
LongCtrlState = car.CarControl.... | Python | 1 |
#
# Copyright (C) 2017 The Android Open Source Project
#
# 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 la... | Python | 1 |
eq!(components[0].iter().map(|elem| elem.id()).collect::<Vec<usize>>(), [1, 2, 3, 4]);
assert_eq!(components[1].iter().map(|elem| elem.id()).collect::<Vec<usize>>(), [5, 6, 7]);
assert_eq!(components[2].iter().map(|elem| elem.id()).collect::<Vec<usize>>(), [8, 9, 10, 11]);
assert_eq!(components.len(), 3);
... | Rust | 0 |
ONAR
ret = (True, 0, 'GetSonarDistance')
try:
ret = (True, HWSONAR.getDistance(), 'GetSonarDistance')
except:
ret = (False, __RPC_E03, 'GetSonarDistance')
return ret
@dispatcher.add_method
def GetBatteryVoltage():
ret = (True, 0, 'GetBatteryVoltage')
try:
ret = (Tru... | Python | 1 |
arcname)
zf.close()
if __name__ == "__main__":
provider = 'Beijing Institute of Technology'
author = r'理工大附小'
pluginname = 'Airplane Detection and Recognition in Optical Images'
root_dir = r'C:\Users\xiaoming\Desktop'
det_res = os.path.join(root_dir, 'detections') # 检测结果按照txt输出到这个文件夹
... | Python | 1 |
}
def __read_names(record, line):
"""
Ali1: 60456.blo.gz.aln Ali2: allscop//14984.blo.gz.aln
------query----- -------hit-------------
"""
if not "Ali1:" in line:
raise ValueError("Line does not contain 'Ali1:':\n%s" % line)
m = __regex["names"].search(line)
record.que... | Python | 1 |
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def __repr__(self):
return repr(self.data)
def add_left(self, node):
self.left = node
def add_right(self, node):
self.right = node
"""
2
/ \
7 9
... | Python | 1 |
, &sort_info);
let _ = term_info
.term
.move_cursor_up((term_info.height - 1) as usize);
for _ in 0..interval * 10 {
thread::sleep(Duration::from_millis(100));
if rx.try_recv().is_ok() {
break 'outer;
}
}
}
Ok... | Rust | 0 |
())
}
pub fn serialize_structure_crate_input_associate_wireless_device_with_multicast_group_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::AssociateWirelessDeviceWithMulticastGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
if let Some(v... | Rust | 0 |
# (c) @AbirHasan2005
import os
class Config(object):
API_ID = int(os.environ.get("API_ID", "0"))
API_HASH = os.environ.get("API_HASH")
BOT_TOKEN = os.environ.get("BOT_TOKEN")
BOT_USERNAME = os.environ.get("BOT_USERNAME")
DB_CHANNEL = int(os.environ.get("DB_CHANNEL", "-100"))
BOT_OWNER = int(os.environ.get("BOT... | Python | 1 |
address());
let base3: &Base3 = derived.upcast();
assert_eq!(base3 as *const _ as usize, derived.base3_address());
let base4: &Base4 = derived.upcast();
assert_eq!(base4 as *const _ as usize, derived.base4_address());
}
#[test]
fn test_virtual_upcast() {
ctor::emplac... | Rust | 0 |
ist()
non_static_indexes = []
for (index, dim) in enumerate(shape):
if dim is None:
non_static_indexes.append(index)
if not non_static_indexes:
return shape
dyn_shape = tf.shape(tensor)
for index in non_static_indexes:
shape[index] = dyn_shape[index]
return shape
def reshape_to_matrix... | Python | 1 |
'').split(",")
pp_FH = FH.replace(':', '').replace('\n', '').replace("'", '').split(",")
pp_PH = PH.replace(':', '').replace('\n', '').replace("'", '').split(",")
HH_dict = {RP2CAS[k]: v for k, v in zip(pp_fluids, pp_HH)}
FH_dict = {RP2CAS[k]: v for k, v in zip(pp_fluids, pp_FH)}
PH_dict = {RP2CAS[k]: v for k, v in zi... | Python | 1 |
pe: ignore
@dataclass
class SubscriptedDict:
dict_str: Dict[str, int] = field(default_factory=lambda: {"foo": 4})
dict_enum: Dict[Color, int] = field(default_factory=lambda: {Color.RED: 4})
dict_int: Dict[int, int] = field(default_factory=lambda: {123: 4})
dict_float: Dict[float, int] = field(default_... | Python | 1 |
lean { ref subs } => {
cmd_clean(subs)
}
Args::Combine { ref foreign_subs, ref native_subs } => {
cmd_combine(foreign_subs, native_subs)
}
Args::Export { ref format } => {
cmd_export(
format.name(),
format.video(),
... | Rust | 0 |
# An implementation of Dartmouth BASIC (1964)
#
import sys
sys.path.insert(0,"../..")
if sys.version_info[0] >= 3:
raw_input = input
import logging
logging.basicConfig(
level = logging.INFO,
filename = "parselog.txt",
filemode = "w"
)
log = logging.getLogger()
import basiclex
import basparse
import ... | Python | 1 |
);
if let Some(previous_sibling) = self[sibling].previous_sibling.take() {
self[new_sibling].previous_sibling = Some(previous_sibling);
debug_assert_eq!(self[previous_sibling].next_sibling, Some(sibling));
self[previous_sibling].next_sibling = Some(new_sibling);
} els... | Rust | 0 |
self.gridLayout_4.setRowStretch(1, 2)
self.gridLayout_4.setRowStretch(2, 1)
self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1)
self.horizontalLayout.addLayout(self.gridLayout_2)
self.horizontalLayout.setStretch(0, 1)
self.horizontalLayout.setStretch(2, 1)
self.... | Python | 1 |
occ.1 - 1 > 0 {
answer.push((
((6 + occ.0) as u32,(y + occ.1) as u32),
((6 + occ.0) as u32,(y + occ.1 - 1) as u32,false),None));
}
}
} else {
if y + occ.1 >= 1 && y + occ.1 >= 1 {
let nari = (y + occ.1 - 1) <= 2;
if nari {
answer.push((
((6 + oc... | Rust | 0 |
__version__ = "0.4.2"
def handle_resume(self) -> None:
"""Returns a shell script handling resume from hibernation.
Checks that /sys/power/resume is writable, resume= is set, and noresume is not set, if so,
checks if UUID= or PARTUUID= or LABEL= is in the resume var,
and tries to use blkid to find the ... | Python | 1 |
FAULT_SAMPLE_MASK: u32 = 4294967295u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"]
pub const D3D11_DEFAULT_SCISSOR_ENDX: u32 = 0u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"]
pub const D3D11_DEFAULT_SCISSOR_ENDY: u32 = 0u32;
#[doc = "*Required features: `\"Win32_Graphics_Direc... | Rust | 0 |
'''
Module of Android API for plyer.email.
'''
from jnius import autoclass, cast
from plyer.facades import Email
from plyer.platforms.android import activity
Intent = autoclass('android.content.Intent')
AndroidString = autoclass('java.lang.String')
class AndroidEmail(Email):
'''
Implementation of Android em... | Python | 1 |
lds_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
... | Rust | 0 |
values
const COPY_REG: RegId = 4;
const DATA_SEGMENT: &'static str = " .seg data";
const CONST_DATA_SEGMENT: &'static str = " .seg constdata";
const CODE_SEGMENT: &'static str = " .seg code";
const PROGRAM_START: &'static str =
"
; Allocate some dynamic memory for the program to use
... | Rust | 0 |
#[derive ( Copy, Clone )]
#[repr(C)]
pub struct C2RustUnnamed_4 {
pub button: wl_signal,
pub ring: wl_signal,
pub strip: wl_signal,
pub attach_tablet: wl_signal,
}
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
/*
* Copy+Paste fr... | Rust | 0 |
// }
// }
};
}
macro_rules! impl_array_deref {
($({$($generics:tt)+})? [$s:ty; $i:expr] -> $t:ty) => {
impl $(<$($generics)+>)? std::ops::Deref for $t {
type Target = [$s; $i];
fn deref(&self) -> &[$s; $i] {
use std::mem;
assert_eq!(... | Rust | 0 |
the `Toql` derive ------------v
#[derive(Debug, Serialize, Deserialize, Toql)]
#[toql(auto_key)]
pub struct Todo {
#[serde(default)] //<-- On insert `id` is undefined -> set to 0
#[toql(key)] // <-- Required and must come first
pub id: u64,
#[serde(skip_serializing_if = "Option::is_none")] //... | Rust | 0 |
lf, n: usize) -> &mut Access<T> {
&mut self.0[n]
}
}
pub fn get_static_data_comparisons(img: &Image) -> Result<ComparisonAnalyses, Error> {
let mut scores = BTreeMap::new();
let mut cstring_blocks = BTreeMap::new();
for f in img.functions.values() {
let mut fscores = BTreeMap::new();
... | Rust | 0 |
/// If you're instantiating this struct, you should make this `HashMap::empty()`.
#[serde(flatten)]
#[serde(deserialize_with = "de::extra_skip_type")]
pub _extra: HashMap<String, Value>,
}
/// Represents the key IDs used for a role and the threshold of signatures required to validate it.
/// TUF 4.3: A... | Rust | 0 |
import os
import dj_database_url
from .settings import *
# Production settings
DEBUG = False
# Security settings
SECRET_KEY = os.environ.get('SECRET_KEY', 'django-insecure-&8j!^q=tqp%g0!yvh#atdx2ed^zs%bq_g-*11(zfsbg6otzggq')
# Allowed hosts for Render
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '.onrender.com,lo... | Python | 1 |
// in case the current ARGB value's Alpha is not at it's max (255 (u8), FF00 0000 (HEX), 4.278.190.080 (u32))
// we need to adjust the values of the RGB bytes
if diff > 0 {
if red > 255 - diff {
red_adjusted = 255 - diff;
}
if green > 255 - diff {
... | Rust | 0 |
with only intersecting the single line.
if self.area_doubled() == 0 {
scanline.bresenham_intersection(&Line::new(p1, p3));
return scanline;
}
scanline.bresenham_intersection(&Line::new(p1, p2));
scanline.bresenham_intersection(&Line::new(p1, p3));
scanl... | Rust | 0 |
ures_to_compare = np.array([])
final_labels = np.zeros(len(data_features_for_clustering), dtype=int)
tasks = [(cid, data_features_for_clustering, clusters_assigned, known_normal_samples_features_to_compare, threshold_value) for cid in np.unique(clusters_assigned) if cid != -1] # Process only existing cluster I... | Python | 1 |
5363325363 * g + 0.0514459929 * b
m = 0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b
s = 0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b
l_ = l ** (1 / 3)
m_ = m ** (1 / 3)
s_ = s ** (1 / 3)
return (
np.float64(0.2104542553 * l_ + 0.7936177850 * m_ - 0.0040720468 * s_),
... | Python | 1 |
# Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | Python | 1 |
invertible());
assert!(Matrix3::from_value(6.0f64).is_diagonal());
// Matrix4
assert!(Matrix4::<f64>::identity().is_identity());
assert!(Matrix4::<f64>::identity().is_symmetric());
assert!(Matrix4::<f64>::identity().is_diagonal());
assert!(Matrix4::<f64>::identity().is_invertible());
ass... | Rust | 0 |
"""
Callable defaults
You can pass callable objects as the ``default`` parameter to a field. When
the object is created without an explicit value passed in, GingerDJ will call
the method to determine the default value.
This example uses ``datetime.datetime.now`` as the default for the ``pub_date``
field.
"""
from da... | Python | 1 |
import numpy as np
import pickle
import os
import logging
import dataclasses
import torch
from dataclasses import dataclass, field
from jsonargparse import ArgumentParser
import datetime
import torch.utils.data as tchdata
from torch.optim.lr_scheduler import CosineAnnealingWarmRestarts
import lightning as L
import ligh... | Python | 1 |
pub block_version: BlockVersion,
pub software_version: SoftwareVersion,
pub attributes: BlockHeaderAttributes,
pub extra_data_proof: Blake2b256, // hash of the Extra body data
}
impl HeaderExtraData {
pub fn new(
block_version: BlockVersion,
software_version: SoftwareVersion,
att... | Rust | 0 |
(win)
}
/// <https://invisible-island.net/ncurses/man/curs_initscr.3x.html>
pub fn isendwin() -> bool {
unsafe { bindings::isendwin() }
}
/// <https://invisible-island.net/ncurses/man/key_defined.3x.html>
pub fn key_defined(definition: &[i8]) -> i32 {
unsafe { bindings::key_defined(definition.as_ptr()) }
}
/... | Rust | 0 |
&& maybe_fun_2_retry_result.is_ok() {
return Ok((
maybe_fun_1_retry_result.unwrap(),
maybe_fun_2_retry_result.unwrap(),
))
} else {
maybe_fun_1_retry_result = contract
.query(func_1, params_1, None, Web3Options::default(), None)
.await;
maybe_fun_2_retry_result ... | Rust | 0 |
MINMATCH + 15 {
// The match length took the maximal value, indicating that there is more bytes. We
// read the extra integer.
match_length += read_integer(input, &mut input_pos)? as usize;
}
#[cfg(feature = "checked-decode")]
if output.pos() + match_length ... | Rust | 0 |
,
msg,
}
}
fn loc(&self) -> ast::Location {
ast::Location {
file: self.filename.clone(),
line: self.line,
column: self.col,
}
}
}
fn is_space(ch: u8) -> bool {
return ch == b' ' || ch == b'\t' || ch == b'\n';
}
fn is_separator(ch... | Rust | 0 |
: &'static str) -> Self {
PgVersion { major, minor, url }
}
fn port(&self) -> u16 {
BASE_POSTGRES_PORT_NO + self.major
}
fn label(&self) -> String {
format!("pg{}", self.major)
}
}
impl Display for PgVersion {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
... | Rust | 0 |
end - start # (T_i, 3)
# point_vec = points_expanded - start.unsqueeze(0) # (P_i, T_i, 3)
# edge_len_sq = torch.sum(edge_vec * edge_vec, dim=1) + 1e-8 # (T_i,)
# t = torch.sum(point_vec * edge_vec.unsqueeze(0), dim=2) / edge_len_sq # (P_i, T_i)
# t = torc... | Python | 1 |
impl From<$name> for Item {
fn from(item: $name) -> Item {
Item::$name(item)
}
}
)*
}
}
impl_into_item! {
Class;
FieldRef;
MethodRef;
InterfaceMethodRef;
String;
Integer;
Long;
Float;
Double;
Nam... | Rust | 0 |
from getrouting import TrinoQueryProperties, TrinoRequestUser
from getrouting.views import do_get_routing_group, input_pickles
import json
def test_models():
trino_query_properties_dict = {
'body': 'SELECT * from foo.bar.baz',
'queryType': 'SELECT',
'resourceGroupQueryType': 'SELECT',
... | Python | 1 |
p length bytes in size."]
#[doc = " @param length The length of @p input, in bytes."]
#[doc = " @param seed The 32-bit seed to alter the hash's output predictably."]
#[doc = ""]
#[doc = " @pre"]
#[doc = " The memory between @p input and @p input + @p length must be valid,"]
#[doc = " readabl... | Rust | 0 |
from ultralytics import YOLO
# Load a COCO-pretrained YOLOv8n model
model = YOLO("yolov8n.pt")
# Train the model on the COCO8 example dataset for 100 epochs
# results = model.train(data="C:/Users/user/Documents/python_project1/yolov8/ultralytics/ultralytics/cfg/datasets/data.yaml", epochs=10, imgsz=640)
results = mod... | Python | 1 |
--------
Usage ::
# I do not actually recommend doing this.
async for user in reaction.users():
await channel.send(f'{user} has reacted with {reaction.emoji}!')
Flattening into a list: ::
users = await reaction.users().flatten()
# use... | Python | 1 |
se std::iter::FromIterator;
let mut entries: Vec<_> = vec![&42, &16, &38];
entries.sort();
let set: HashSet<usize> = HashSet::from_iter(entries.clone().into_iter());
let guard = set.guard();
let mut collected: Vec<_> = set.iter(&guard).collect();
collected.sort();
assert_eq!(entries, ent... | Rust | 0 |
import json
import os
import pytest
from jupyterhub_traefik_proxy import traefik_utils
# Mark all tests in this file as asyncio
def test_roundtrip_routes():
pytest.mark.asyncio
routes = {
"backends": {
"backend1": {
"servers": {"server1": {"url": "http://127.0.0.1:9009", ... | Python | 1 |
mut cs: CS,
// personalization: Personalization, -> ???
bits: &[Boolean],
// params: &E::Params -> ???
) -> Result<EdwardsPoint<E>, SynthesisError>
where CS: ConstraintSystem<E>
{
let personalization = personalization.get_constant_bools();
assert_eq!(personalization.len(), 6);
let mut e... | Rust | 0 |
from enum import Enum
class LegalType(str, Enum):
NOT_SET = "Not set"
INDIVIDUAL_ENTREPRENEUR = "Individual Entrepreneur"
LIMITED_LIABILITY_COMPANY = "Limited Liability Company"
JOINT_STOCK_COMPANY = "Joint Stock Company"
GROUP_OF_COMPANIES = "Group Of Companies"
CLOSED_JOINT_STOCK_COMPANY = "... | Python | 1 |
from math import factorial
def wydrukuj_instrukcje():
print('paczek 1')
print('paczek 2')
print('paczek 3')
print('paczq9')
a = 22
b = 33
c = a + b
print(a)
print(a + b + c)
print('tu zaczyna się funkcja: \n\n')
wydrukuj_instrukcje()
def cheer(who_to_cheer):
print(f'siema {w... | Python | 1 |
if let Some((time, z, r, ref orig_acs, ref draw)) = self.unzoomed {
if cam_zoom == z && now == time && radius == r && acs == orig_acs {
g.redraw(draw);
return;
}
}
// TODO The perf is a little slow compared to when we just returned a bunc... | Rust | 0 |
oc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FFLTR1EN_A {
match self.bits {
false => FFLTR1EN_A::FFLTR1EN_0,
true => FFLTR1EN_A::FFLTR1EN_1,
}
}
#[doc = "Checks if the value of the field is `FFLTR1EN_0`"]
#[inline(always)]
... | Rust | 0 |
o
[aq @ s d Z ddlZejdkredddlZddlZddlZddlZddlZddl Z ddl
Z
dZdZej
Z
ejZe Zdded d
dZG dd
d
ZG dd dejZdS )z)Various Windows specific bits and pieces. Nwin32z
win32 only)pipePopenPIPE
PipeHandlei F)TT)duplex
ove... | Python | 1 |
mmio_devices: ArrayVec<VirtioMmioDevice, 4>,
pub pci_enabled: bool,
pub omikuji: bool,
}
static LOGGER: PrintkLogger = PrintkLogger;
pub fn init_logger() {
log::set_logger(&LOGGER).unwrap();
log::set_max_level(if cfg!(debug_assertions) {
log::LevelFilter::Trace
} else {
log::LevelF... | Rust | 0 |
config, chat_template_changed = reset_para(generate_config, input_key, value)
if chat_template_changed:
system_start_ids, user_start_ids, bot_start_ids, system_ids = init_chat_template(generate_config)
print(system_start_ids, user_start_ids, bot_start_ids, system_... | Python | 1 |
esponse = session.send(request=prepped)
response.raise_for_status()
return response
def query_create_order(query: QueryCreateOrder) -> CreatedOrder:
response = request_create_order(query=query)
endpoint_response = ResponseCreateOrder.model_validate_json(response.text)
return endpoint_response.da... | Python | 1 |
*mut lua_State, val: u64);
/// Push `i64` onto the stack
/// *[-0, +1, -]*
pub fn luaL_pushint64(l: *mut lua_State, val: i64);
/// Checks whether the argument `idx` is a `u64` or a convertable string and
/// returns this number.
/// *[-0, +0, -]*
///
/// **Return** the converted numbe... | Rust | 0 |
> 0:
# If playing (max_intervals == -1), pause (max_intervals = 0)
# If paused (max_intervals == 0), play (max_intervals = -1)
return 0 if max_intervals == -1 else -1
return max_intervals # Initial state or no clicks yet
# Callback to advance slider d... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.