text string | label_name string | labels int64 |
|---|---|---|
artup_system(setup)
.run();
}
/// Deriving reflect on a struct will implement the `Reflect` and `Struct` traits
#[derive(Reflect)]
pub struct A {
x: usize,
y: Vec<u32>,
z: HashMap<String, f32>,
}
/// Deriving reflect on a unit struct will implement `Reflect` and `Struct` traits
#[derive(Reflect)]
... | Rust | 0 |
import FWCore.ParameterSet.Config as cms
# HLT dimuon trigger
import HLTrigger.HLTfilters.hltHighLevel_cfi
hltZMMPA = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone()
hltZMMPA.HLTPaths = ["HLT_PAL3Mu15_v*"]
hltZMMPA.throw = False
hltZMMPA.andOr = True
# selection of valid vertex
primaryVertexFilterForZMMPA ... | Python | 1 |
from setuptools import setup
setup(
name="QRCode-Scanner",
version="1.0",
author="Logadheep",
author_email="logadheep3438@gmail.com",
description="QRcode Scanning app using python",
)
| Python | 1 |
for c in 0..3 {
let mut channel_array = array.slice_mut(s![0, c, .., ..]);
channel_array -= mean[c];
channel_array /= std[c];
}
Ok(f32_vec_to_bytes(array.as_slice().unwrap().to_vec()))
}
pub fn assert_contains_class(img: String, labels: Vec<String>) {
let class = std::path::Pa... | Rust | 0 |
d.self) = kernel fsbase
// - fs:64 (pthread.???) = kernel stack
// - fs:72 (pthread.???) = init user fsbase
//
#[cfg(target_os = "linux")]
global_asm!(
r#"
.macro SWITCH_TO_KERNEL_STACK
mov rsp, fs:48 # rsp = kernel fsbase
mov rsp, [rsp + 64] # rsp = kernel stack
.endm
.macr... | Rust | 0 |
s {
CarStatus::Moving => cs.get_def("moving car", Color::CYAN),
CarStatus::Parked => cs.get_def("parked car", Color::rgb(180, 233, 76)),
}
}
}
_ => self.by_metadata(&input.metadata),
}
}
pub fn z... | Rust | 0 |
e::Mutable { name, value } => {
let mut out = String::from("let ");
out.push_str(name.as_str());
out.push_str("=");
out.push_str(value);
out.push(';');
Ok(out)
}
Var... | Rust | 0 |
import string
import secrets
import logging
from typing import Optional
import rsa
from .sentry import Sentry
# A helper class to handle server validation.
#
# The printer connection to OctoEverywhere is established over a secure websocket using the latest TLS protocols and policies.
# However, since OctoEverywhere ... | Python | 1 |
Some(_) => {
let entry = read_entry(line.trim_end());
return Err(ReadEntryExtError::ExtInfNotFound(entry));
}
}
};
// Read the next non-empty, non-comment line as an entry.
let mut line_buffer = String::new();
... | Rust | 0 |
_input!(input as BindParamArgs);
let query = args.query;
let params = args.params;
let with_json = if cfg!(feature = "with-json") {
quote! { Value::Json(v) => bind_box!(v), }
} else {
quote! {}
};
let with_chrono = if cfg!(feature = "with-chrono") {
quote! {
... | Rust | 0 |
v of the maximum side length.
fov = 2 * torch.rad2deg(torch.atan(1 / torch.stack([camera.intrinsics[1, 1] * (self.args.output_res[0] / max(self.args.output_res)) for camera in cameras])))
else:
# square output resolution
fov = 2 * torch.rad2deg(torch.atan(1 / ... | Python | 1 |
ream.
#[inline]
pub fn play_audio_stream(&mut self, stream: &mut AudioStream) {
unsafe {
ffi::PlayAudioStream(stream.0);
}
}
/// Pauses audio stream.
#[inline]
pub fn pause_audio_stream(&mut self, stream: &mut AudioStream) {
unsafe {
ffi::PauseAud... | Rust | 0 |
nQueue Position: {patient.queue_position}\nDiagnostics: Normal"
response = HttpResponse(records, content_type='text/plain')
response['Content-Disposition'] = 'attachment; filename="patient_records.txt"'
return response
# .................................#
# APPOINTMENTS VIEWS #
# ............. | Python | 1 |
ics['win_rate']
profit_factor = max(0, self.env.metrics.get_performance_summary()['profit_factor'])
max_drawdown = self.env.metrics.get_max_equity_drawdown()
# Reward consistent profitable trading
# Calculate trade activity score (reward more active trading)
total_trades... | Python | 1 |
filter_or("info")).init();
let db = Arc::new(DB::new().await.expect("Failed to get DB handle"));
let store = MemoryStore::new();
let server = HttpServer::new(move || {
App::new()
.data(Arc::clone(&db) as DBState)
.wrap(
RateLimiter::new(MemoryStoreActor::fr... | Rust | 0 |
ing_key(
session_key.as_ref(),
CLIENT_SEAL_MAGIC,
)));
context.recv_sealing_key = Some(Rc4::new(&generate_signing_key(
session_key.as_ref(),
SERVER_SEAL_MAGIC,
)));
context.authenticate_message = Some(AuthenticateMessage::new(
message,
Some(mic),
... | Rust | 0 |
"""
Based on the request, we will return the list of facts about the pet.
A pet can be either a cat or a dog.
"""
from pydantic import BaseModel, Field
from ibm_watsonx_orchestrate.flow_builder.flows import (
Flow, flow, START, END, Branch
)
class Pet(BaseModel):
kind: str = Field(description="the kind of pe... | Python | 1 |
);
}
fn parametros( argumento: &str ){
match argumento {
"help" => help(),
"version" => version(),
"megasena" => megasena::megasena_fn(),
"quina" => quina::quina_fn(),
"lotofacil" => lotofacil::lotofacil_fn(),
"lotomania" => lotomania::lot... | Rust | 0 |
ss();
println!(
"hart_id: {}, device_tree_addr: {:#x}",
&hart_id, device_tree_addr
);
// memory not initialized, device tree available
device_tree::init(device_tree_addr);
mm::init();
trap::init();
//batch::init();
unsafe { asm!("ebreak");}
println!("\x1b[31m[kzios]\x... | Rust | 0 |
s")
# NFT1 CHILD GENESIS
slp_nft1_child_genesis1_tx = CTransaction()
slp_nft1_child_genesis1_tx.vin = [
CTxIn(COutPoint(int(slp_nft1_send_tx_txid, 16), 1), SCRIPTSIG_OP_TRUE)
]
slp_nft1_child_genesis1_tx.vout = [
CTxOut(
0,
... | Python | 1 |
_biquad_casd_df1_inst_q31,
numStages: u8,
pCoeffs: *const q31_t,
pState: *mut q31_t,
postShift: i8,
);
}
extern "C" {
#[doc = " @brief Processing function for the floating-point Biquad cascade filter."]
#[doc = " @param[in] S points to an instance of the floating-po... | Rust | 0 |
nored if ``method`` is not ``"qdwh"``.
Returns:
A ``(unitary, posdef)`` tuple, where ``unitary`` is the unitary factor
(:math:`m \times n`), and ``posdef`` is the positive-semidefinite factor.
``posdef`` is either :math:`n \times n` or :math:`m \times m` depending on
whether ``side`` is ``"right"`` o... | Python | 1 |
// If we just generated an anonymous block box, keep using it.
// Otherwise, create a new one
match self.children.last() {
Some(&LayoutBox { box_type: AnonymousBlock, ..}) => {}
_ => self.children.push(LayoutBox::new(AnonymousBlock))
... | Rust | 0 |
iou_track_candidates = unconfirmed_tracks + [
k for k in unmatched_tracks_a if
self.tracks[k].time_since_update == 1]
unmatched_tracks_a = [
k for k in unmatched_tracks_a if
self.tracks[k].time_since_update != 1]
matches_b, unmatched_tracks_b, unmatched_... | Python | 1 |
ch.cuda.is_available(), "CUDA not available")
def test_opt_COMPLEX_gpu(self):
args.GLOBALARGS_device="cuda:0"
args.GLOBALARGS_dtype="complex128"
main()
args.GLOBALARGS_dtype="float64"
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available")
def test_opt_SYMEIG_g... | Python | 1 |
raw as *mut _),
index,
file_id,
line_start,
column_start,
line_end,
column_end,
)
}
}
}
impl Drop for SmallVectorCounterMappingRegion<'a> {
fn drop(&mut self) {
unsafe {
llvm:... | Rust | 0 |
assert!(is_match(r"^foo?$", "fo"));
}
#[test]
fn concatenation() {
assert!(is_match(r"^a+b+$", "aaabbb"));
assert!(!is_match(r"^a+b+$", "abab"));
assert!(!is_match(r"^a+b+$", "aaaa"));
}
#[test]
fn union() {
assert!(is_match(r"^foo|bar$", "bar"));
assert!(!is_match(r"^foo|bar$", "foobar"));
}
... | Rust | 0 |
frukt = fruits[i]
if milliseconds > frukt.varighet:
canvas.delete(frukt.id)
deleteList.append(i)
for j in range(len(deleteList)-1, -1, -1):
print(f"j: {j}, {deleteList[j]}")
fruits.pop(deleteList[j])
#print(f"len(fruits): {len(fruits)}")
def kollisjon()... | Python | 1 |
discs: Option<u32>,
}
impl FileInput {
pub fn from_path(path: impl AsRef<Path>) -> Self {
let path = path.as_ref();
let tag = match Id3V2Tag::read_from_path(path) {
Ok(tag) => tag,
Err(_) => {
return Self::empty(path);
}
};
Self {
... | Rust | 0 |
)
errors_sorted, perm = torch.sort(errors, dim=0, descending=True)
perm = perm.data
gt_sorted = labels[perm]
grad = lovasz_grad(gt_sorted)
loss = torch.dot(F.relu(errors_sorted), grad)
return loss
def lovasz_grad(gt_sorted):
"""
Computes gradient of the Lovasz extension w.r.t sorted err... | Python | 1 |
import unittest
from podcast_downloader.rss import only_last_n_entities
from commons import rss_entity_generator
class TestOnlyNLastRSSEntity(unittest.TestCase):
def test_get_only_last_n_rss_entities_happy_path(self):
# Assign
entity_1, entity_2, entity_3, entity_4, entity_5 = rss_entity_generato... | Python | 1 |
# Standard library
import os
from pathlib import Path
# Third-party
import pooch
import yaml
# First-party
from neural_lam.datastore import DATASTORES, init_datastore
from neural_lam.datastore.npyfilesmeps import (
compute_standardization_stats as compute_standardization_stats_meps,
)
# Local
from .dummy_datasto... | Python | 1 |
NAME = "cpio_portable_ascii"
PATTERNS = [HexString("30 37 30 37 30 31 // 07 07 01 (newc)")]
EXTRACTOR = PortableASCIIExtractor()
DOC = HandlerDoc(
name="CPIO (portable ASCII)",
description="CPIO (Copy In, Copy Out) is an archive file format used for bundling files and directories along wi... | Python | 1 |
- start_time
remaining = max(0, total_stir_time - elapsed)
progress = (elapsed / total_stir_time) * 100 if total_stir_time > 0 else 100
# 更新状态
self.data.update({
"remaining_time": remaining,
"status": f"🌪️ 搅拌中: {stir_speed} R... | Python | 1 |
"""
Regular expression matching using Brzozowski derivatives.
"""
def match(re, s):
for c in s:
re = re(c)
return re.nullable
def mark(nullable, deriv):
deriv.nullable = nullable
return deriv
fail = mark(False, lambda c: fail)
empty = mark(True, lambda c: fail)
def lit(literal):
return m... | Python | 1 |
fingerprint
pkt[32 .. 48].store_be(0xACABu16);
render("Set an identifying fingerprint", &pkt, 32 .. 48);
// Set the flags
*pkt.get_mut(48).unwrap() = true;
*pkt.get_mut(49).unwrap() = false;
*pkt.get_mut(50).unwrap() = true;
render("Set some flags", &pkt, 48 .. 51);
// Set the fragment offset to be 758, th... | Rust | 0 |
).unwrap();
let intersection = s.intersect(&r).unwrap();
let expected_t = 3.744; //3.7434776; //3.744 per intro book.
let expected_intersection_point = Point::new(1.816, -0.368, 2.269);
let expected_normal = Vector::new(-0.395, -0.123, -0.91);
let t_intersection = s.intersecti... | Rust | 0 |
),
y,
)
}
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software ... | Rust | 0 |
, 89, 108, 159, 251, 254, 255, 191, 239, 251, 254, 255, 189,
211, 102, 139, 166, 89, 255, 128, 141, 59, 83, 9, 0
]
);
}
#[test]
fn test_fits_decompress_strange6() {
let input: [u8; 84] = [
221, 153, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 0, 255, 255, 255, ... | Rust | 0 |
tail_pos.append(tail_pos[0] + len(ent2))
if rev:
head_pos, tail_pos = tail_pos, head_pos
replaced_samples.append({
'token': tokens,
'h': {'name':ent1, 'pos': head_pos},
't': {'name':ent2, 'pos': ... | Python | 1 |
hat it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Tetcoin. If not, see <http://www.... | Rust | 0 |
duce128(MOD + 1), 1);
assert_eq!(Mersenne127::reduce128(MOD + 2), 2);
assert_eq!(Mersenne127::reduce128(MOD + 3), 3);
assert_eq!(Mersenne127::reduce128(MOD + MOD), MOD);
assert_eq!(Mersenne127::reduce128(MOD + MOD + 1), MOD + 1); // only MOD + MOD + 1 greater than MOD
}
#[test]... | Rust | 0 |
- (strideY-1), top + (strideY-1), strideY):
for jdx in range(bottom, top + (strideY-1), strideY):
countTotal += 1
cbox = pya.Box.new(idx, jdx, idx + sizeX, jdx + sizeY)
cropped = ly.clip(topcell, cbox)
cell = ly.cell(cropped)
cell.flatten(-1)
... | Python | 1 |
info!("Computing matchtigs");
let mut graph = graph.clone();
let matchtigs = MatchtigAlgorithm::compute_tigs(
&mut graph,
&MatchtigAlgorithmConfiguration {
threads: opts.threads,
k,
node_weight_array_type: opts.dijkstra_node... | Rust | 0 |
}
else { break; }
}
let x = an.last().unwrap();
let qn = prime_factor(*x);
let mut cnt = 0;
for q in qn.iter() {
for i in 0..an.len() {
if q == &an[i] { an[i] = 1; cnt += 1; break; }
}
... | Rust | 0 |
e_storage.save(torch.stack(img_global_feats, dim=0), 'global')
feature_storage.save(torch.stack(img_local_feats, dim=0), 'local')
feature_storage.update_pointer(len(img_global_feats))
img_local_feats, img_cls_global_feats, img_global_feats = [], [], []
def l... | Python | 1 |
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHA... | Rust | 0 |
)
def controller_added(self, num=0):
payload = factory.control.controller_event(ControllerEvent.Added, num)
log.debug("Sending Controller added msg: %s", payload)
self._send_control_msg(ControlPayloadType.ControllerEvent, payload)
def controller_removed(self, num=0):
payload = ... | Python | 1 |
tle": state.get("globalTitle", ""),
"globalDescription": state.get("globalDescription", ""),
"itemsCreated": state.get("itemsCreated", 0),
"lastAction": state.get("lastAction", ""),
"planSteps": state.get("planSteps", []),
"currentStepIndex... | Python | 1 |
alg.norm(gt - sample, axis=-1)
dist_individual.append(dist)
dists = np.concatenate(dist_individual, axis=0)
dists_timestep = np.stack(dist_individual, axis=0)
dists = dists[~np.isnan(dists)]
percentage_area = 0.05 * total_area
radius = np.sqrt(percentage_area / np.pi)
containment_perce... | Python | 1 |
R"), os.environ.get("HISTORY_DATA")) )
handler.save_to_s3(result_df, os.path.join( os.environ.get("PARSED_FOLDER"), os.environ.get("CLEANED_DATA") ))
else:
logger.info(f"No new data to save to S3.")
def cleaning(date_df):
date, df = date_df
logger.info(f"cleaning stage 1 : {date}... | Python | 1 |
d=taFormId).first()
addCommentTAForm(comment, taInfo, handlerId=handlerInfo.id)
if (status == 'ACCEPT'):
taInfo.stageCurrent = handlerInfo.role.nextStage
message = f"TA Form {taInfo.id} forwarded by {handlerInfo.designation}"
else:
taInfo.stageCurrent = handlerInfo.role.prevStage
... | Python | 1 |
n!(" - kernel driver? {}", has_kernel_driver);
//handle.set_active_configuration(endpoint.config)?;
//handle.claim_interface(endpoint.iface)?;
//handle.set_alternate_setting(endpoint.iface, endpoint.setting)?;
if has_kernel_driver {
handle.attach_kernel_driver(endpoint.ifac... | Rust | 0 |
ode);
match (len, &mut bytes[..]) {
(1, [b0, ..]) => {
*b0 = code as u8;
}
(2, [b0, b1, ..]) => {
*b0 = (code >> 6 & 0x1F) as u8 | TAG_TWO_B;
*b1 = (code & 0x3F) as u8 | TAG_CONT;
}
(3, [b0, b1, b2, ..]) => {
*b0 = (code >> 12 &... | Rust | 0 |
from config import COMMAND_PREFIX
commands = [
"alive - बॉट का स्टेटस चेक करें",
"menu - सभी उपलब्ध कमांड्स देखें",
"help - सभी कमांड्स की जानकारी प्राप्त करें",
"owner - बॉट के मालिक की जानकारी",
"download <url> - किसी भी इंस्टाग्राम पोस्ट/रील्स को डाउनलोड करें",
"storyseen on/off - ऑटो स्टोरी... | Python | 1 |
f32::INFINITY} |
tag!("-Infinity") => {|_| f32::NEG_INFINITY} |
tag!("NaN") => {|_| f32::NAN}
)
);
named!(pub parse_f64<f64>,
alt!(
parse_finite_float |
parse_finite_float_leading => {|x| x} |
tag!("Infinity") => {|_| f64::INFINITY} |
tag!("-Infinity") => {|_| f... | Rust | 0 |
Reader of field `EFUSE_USB_DREFH_ERR`"]
pub type EFUSE_USB_DREFH_ERR_R = crate::R<u8, u8>;
#[doc = "Reader of field `EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_ERR`"]
pub type EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_ERR_R = crate::R<bool, bool>;
#[doc = "Reader of field `EFUSE_DIS_PAD_JTAG_ERR`"]
pub type EFUSE_DIS_PAD_JTAG_ERR_R = c... | Rust | 0 |
TypeId;
#[derive(Clone, Debug)]
#[repr(C)]
pub struct CharacterData {
node: Node,
data: RefCell<String>,
}
impl CharacterData {
pub fn new_inherited(node_type_id: NodeTypeId, data: String, document: Rc<Document>) -> Self {
Self {
node: Node::new(node_type_id, Some(document)),
data: RefCell::new(data),
}
... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
从ModelScope下载Deepseek模型的辅助脚本
使用方法: python download_deepseek.py [--model_id MODEL_ID] [--save_path SAVE_PATH]
"""
import os
import sys
import argparse
def download_model(model_id, save_path=None):
"""
从ModelScope下载模型
参数:
model_id: ModelScope上的模型ID... | Python | 1 |
e as "Branch Name",
dc.txn_limit as "Txn Limit",
null as "Bene LEI Code",
null as "LEI Code Expiry Date",
'A' as "Bene Details Change",
'A' as "Product-Account No Change"
from `tabPurchase Invoice` p join `tabBank Account` ba on p.supplier = ba.party{conditions} join `tabPayment Product Limit` dc on ba.name... | Python | 1 |
impl PENDSTCLR_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PENDSTCLR_A {
match self.bits {
false => PENDSTCLR_A::VALUE_0,
true => PENDSTCLR_A::VALUE_1,
}
}
#[doc = "Checks if the value of the field is `VALUE_0`"]
... | Rust | 0 |
import sys
import pytest
sys.path.append("../")
from chatbot_api.assistant import AssistantBison
mock_context = (
f"Here is information on the user:\n"
f"- User Name: Fake User\n"
f"- User Email: fake.user@example.com\n"
f"- User Primary Programming Language (also known as favorite programming langua... | Python | 1 |
}
fn value_expression_eof(input: &[u8]) -> IResult<&[u8], Value> {
all_consuming(value_expression)(input)
}
}
// Copyright 2022 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::os::unix::... | Rust | 0 |
ea: 0x20e5, # 'ê'
0xca: 0x20c5, # 'Ê'
0xee: 0x20e9, # 'î'
0xce: 0x20c9, # 'Î'
0xf4: 0x20ef, # 'ô'
0xd4: 0x20cf, # 'Ô'
0xfb: 0x20f5, # 'û'
0xdb: 0x20d5, # 'Û'
0x5e: 0x20a0, # '^'
0x103: 0x21e1, # 'ă'
0x102: 0x21c1, # 'Ă'
0... | Python | 1 |
self.robot_name = "None"
self.rack_list = []
self.low_battery = False
self.light_off_COMPLETE = False
self.robot_tasks = {} ... | Python | 1 |
lf.pipeline_write_page(free_list_page_wrapper.borrow_page());
}
let new_free_page_pid = self.alloc_page_id()?;
let remain_size = free_list_page_wrapper.remain_size();
let front = &pages[0..remain_size as usize];
let back = &pages[remain_size as usize..];
let next_cell ... | Rust | 0 |
import logging
import uvicorn
from src.main import create_app
from src.config import settings
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger("uvicorn_main")
app = create_app()
logger.info("app created")
if __name__ == "__main__":
logger.info("server running")
uvicorn.run(
"mai... | Python | 1 |
expect("Failed to get input files")
{
kukuri.append_input(path);
// kukuri.import(path);
}
kukuri.run();
}
#![warn(missing_docs, unused_imports)]
//! _This is a part of **scicrypt**. For more information, head to the
//! [scicrypt](https://crates.io/crates/scicrypt) crate homepage._
//!
//... | Rust | 0 |
"name": "@type",
"type": "string"
},
{
"name": "data",
"type": "Data"
},
{
"name": "proof",
"type": "Proof"
},
{
"name": "telephone",
"t... | Rust | 0 |
rn await event_trigger.async_attach_trigger(
hass, event_config, action, trigger_info, platform_type="device"
)
async def async_get_triggers(
hass: HomeAssistant,
device_id: str,
) -> list[dict[str, str]]:
"""List device triggers.
Make sure device is a supported remote model.
Retrieve... | Python | 1 |
Vec3, f32)
specialize_implicit_impl!(Cuboid3, Pnt3, Vec3, f32)
specialize_implicit_impl!(Capsule3, Pnt3, Vec3, f32)
specialize_implicit_impl!(Cone3, Pnt3, Vec3, f32)
specialize_implicit_impl!(Cylinder3, Pnt3, Vec3, f32)
specialize_implicit_impl!(Segment3, Pnt3, Vec3, f32)
specialize_implicit_impl!(Triangle3, Pnt3, Vec... | Rust | 0 |
/// # Arguments
///
/// * `x` - x coordinate (from top left)
/// * `y` - y coordinate (from top left)
/// * `color` - color to set the pixel to
///
/// # Returns
///
/// A `Result`, either a `()` if everything went ok, or
/// `PixelBufferError::RequestOutOfBounds` if the req... | Rust | 0 |
"""Tests for the L0NormMetric class."""
from syrupy.session import SnapshotSession
import torch
from sparse_autoencoder.metrics.train.abstract_train_metric import TrainMetricData
from sparse_autoencoder.metrics.train.l0_norm_metric import TrainBatchLearnedActivationsL0
def test_l0_norm_metric() -> None:
"""Test ... | Python | 1 |
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.p2p import *
from test_framework.qtum import *
from test_framework.blocktools import *
import time
import io
class QtumIdenticalRefunds(Bitcoi... | Python | 1 |
: InternalKeySet,
}
#[derive(Clone, PartialEq, Debug)]
pub enum RangeKind {
/// ClosedOpen is closed on the left and open on the right: the Start
/// key is included, the End key is excluded.
ClosedOpen,
/// ClosedClosed is closed on the left and the right: both keys are included.
ClosedClosed,
... | Rust | 0 |
import typing as t
import typed_ast.ast3 as typed_ast3
STANDALONE_EXPRESSION_TYPES = (
typed_ast3.Call, typed_ast3.UnaryOp, typed_ast3.BinOp, typed_ast3.BoolOp,
typed_ast3.Compare, typed_ast3.IfExp, typed_ast3.Attribute, typed_ast3.Name,
typed_ast3.Subscript, typed_ast3.Num, typed_ast3.Str, typed_ast3.F... | Python | 1 |
)
else:
self.bias = None
@staticmethod
def from_linear(src: nn.Linear, config: FTQuantize) -> "FTQuantizeLinear":
"""
Converts a non-quantized nn.Linear to a FasterTransformer quantized FTQuantizeLinear
Parameters
----------
src : nn.Linea... | Python | 1 |
at!(
"SELECT my_map FROM test_collections_keyspace.test_map_table_{}_1;",
i
)
.as_str(),
&[&[ResultValue::Map(vec![(
ResultValue::Int(0),
ResultValue::List(vec![get_type_example_result_value(*... | Rust | 0 |
x: 'a> {
lookup_map: HashMap<RegionVid, Lookup>,
infcx: InferCtxt<'a, 'gcx, 'tcx>,
}
impl<'a, 'gcx, 'tcx> NLLVisitor<'a, 'gcx, 'tcx> {
pub fn new(infcx: InferCtxt<'a, 'gcx, 'tcx>) -> Self {
NLLVisitor {
infcx: infcx,
lookup_map: HashMap::new(),
}
}
pub fn in... | Rust | 0 |
boundPacket for ClientboundPlayerAbilitiesPacket {
fn serialize(&self) -> Vec<u8> {
let mut buf = FriendlyByteBuf::new();
buf.write_varint(ClientboundPlayerAbilitiesPacket::ID);
let mut bitfield = 0;
bitfield = if self.invulnerable { bitfield | 0b00000001 } else { bitfield };
bitfield = if self.flying { bitf... | Rust | 0 |
Ed"]
pub fn msdfgen_renderSDF1(output: *const u8, sdf: *const u8, pxRange: f64);
}
extern "C" {
#[link_name = "\u{1}_ZN7msdfgen9renderSDFERKNS_9BitmapRefIfLi1EEERKNS_14BitmapConstRefIfLi3EEEd"]
pub fn msdfgen_renderSDF2(output: *const u8, sdf: *const u8, pxRange: f64);
}
extern "C" {
#[link_name = "\u{1... | Rust | 0 |
ard.add(types.InlineKeyboardButton(responses['matches_history'][lang(cid)], callback_data=json.dumps(c_data)))
keyboard.add(types.InlineKeyboardButton(responses['share'][lang(cid)], switch_inline_query="{} {}".format(region, invocador)))
get_summoner_info(
invocador,
... | Python | 1 |
consume_pat, cmt);
}
fn borrow(&mut self,
borrow_id: ast::NodeId,
borrow_span: Span,
cmt: mc::cmt<'tcx>,
loan_region: ty::Region<'tcx>,
bk: ty::BorrowKind,
loan_cause: euv::LoanCause)
{
debug!("borrow(borro... | Rust | 0 |
let update_task = lane_task.run_update(ReceiverStream::new(msg_rx));
let addr = RoutingAddr::remote(5);
let assertion_task = async move {
assert!(msg_tx.send(Ok((addr, 13))).await.is_ok());
check_receive(&mut act_rx, 13, -4).await;
check_feedback(&mut feedback_rx, addr, -4).await;
... | Rust | 0 |
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.ops.mvn import MVN
from openvino.tools.mo.front.common.replacement import FrontReplacementPattern
from openvino.tools.mo.front.tf.graph_utils import create_op_with_const_inputs
from openvino.tools.mo.graph.graph im... | Python | 1 |
# Test to check that partial array indicator is correct under various
# conditions.
from paraview.simple import *
from paraview.vtk import *
from paraview.vtk.vtkFiltersSources import vtkSphereSource
from paraview.vtk.vtkCommonDataModel import vtkPolyData
from paraview.vtk.vtkCommonCore import vtkIntArray
from paravie... | Python | 1 |
const VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: VkFormat = 1000156031;
pub const VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: VkFormat = 1000156032;
pub const VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: VkFormat = 1000156033;
pub const VK_FORMAT_MAX_ENUM: VkFormat = 2147483647;
pub type VkFormat = ::std::os::raw::c_ui... | Rust | 0 |
ge_sort(&array[..mid]), &merge_sort(&array[mid..]))
} else {
array.to_vec()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn ms() -> Result<(), Error> {
let input_file = utility::testing::get_input_file("rosalind_ms")?;
let result = rosalind_ms(&input_file)?;
a... | Rust | 0 |
from .lingd import LiNGD
from .cyclic_var_lingam import CyclicVARLiNGAM
__all__ = [
"LiNGD",
"CyclicVARLiNGAM",
]
__version__ = "1.0.0"
| Python | 1 |
32.into()],
|b| {
b.declare_variables(1, IntType::I32.into())?;
b.body()?;
let then_block = b.create_block()?;
let else_block = b.create_block()?;
let exit_block = b.create_block()?;
let lhs = Variable::from_raw(RawIdx::from_u32(0));
... | Rust | 0 |
{
continue;
}
{
let contact_base = contact.get_base_mut();
// Skip sensors.
let sensor_a: bool = contact_base.m_fixture_a.borrow().m_is_sensor;
let sensor_b: bool = contact_base.m_fixture_b.borrow().m_is_sensor;
if sensor_a || sensor_b {
continue;
... | Rust | 0 |
# Copyright (c) 2014 Katsuya Noguchi
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis... | Python | 1 |
4;
const VK_SHADER_STAGE_MISS_BIT_KHR: VkShaderStageFlagBits = 2048;
const VK_SHADER_STAGE_INTERSECTION_BIT_KHR: VkShaderStageFlagBits = 4096;
const VK_SHADER_STAGE_CALLABLE_BIT_KHR: VkShaderStageFlagBits = 8192;
const VK_SHADER_STAGE_TASK_BIT_NV: VkShaderStageFlagBits = 64;
const VK_SHADER_STAGE_MESH_BIT_NV: VkShaderS... | Rust | 0 |
vector_search_find_neighbors_jwt_sample(
mock_sdk_init, mock_index_endpoint_init, mock_index_endpoint_find_neighbors
):
vector_search_find_neighbors_sample.vector_search_find_neighbors_jwt(
project=constants.PROJECT,
location=constants.LOCATION,
index_endpoint_name=constants.VECTOR_SEARC... | Python | 1 |
"""
String Contact Multi Node
A node that concatenates multiple strings with customizable separators.
Inspired by the multi-input design pattern from Kijai's ComfyUI-KJNodes (https://github.com/kijai/ComfyUI-KJNodes)
"""
from comfy_api.latest import io
class StringContactMulti(io.ComfyNode):
"""A node that allows... | Python | 1 |
8.com': self.SearchAns_GUI_API,
'blog.vcing.top': self.BlogVCing_API,
'greasyfork': self.GreasyFork_Group_API,
'wangketiku.com': self.WangKeTiKu_API
}
url_order = sorted(QueryAns.api_priority.items(), key=lambda x: x[1], reverse=False)
# print(url_order) [(''... | Python | 1 |
usize());
emit_fn(ms, out, &name, None, mir)?;
emit_static_decl(ms, out, &name, mir.return_ty(), false)?;
Ok(())
}
fn emit_vtable<'tcx>(
ms: &mut MirState<'_, 'tcx>,
out: &mut impl JsonOutput,
trait_ref: ty::PolyTraitRef<'tcx>,
) -> io::Result<()> {
let ti = TraitInst::from_trait_ref(ms.st... | Rust | 0 |
::emplace_scalar::<u8>(dst, self.0);
}
}
}
impl flatbuffers::EndianScalar for EventTimeSource {
#[inline]
fn to_little_endian(self) -> Self {
let b = u8::to_le(self.0);
Self(b)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(self) -> Self {
... | Rust | 0 |
"""Provides a forecast for the EV schedule.
Parameters
----------
steps : int
Number of forecast steps.
Returns
-------
predictions : list
List of predicted values.
"""
minute, hour, day, month = self.get_date()
date = ... | Python | 1 |
per spawn tick).
// They are spawned along the horizontal axis on the top of the canvas.
// ------------------------------------------------------------------------------
if *enemy_spawn_tick == 200 {
enemies.push(entites::Enemy::new_random());
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.