text string | label_name string | labels int64 |
|---|---|---|
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "ArvAuto")]
pub enum Auto {
#[doc(alias = "ARV_AUTO_OFF")]
Off,
#[doc(alias = "ARV_AUTO_ONCE")]
Once,
#[doc(alias = "ARV_AUTO_CONTINUOUS")]
Continuous,
#[doc(hidden)]
__Unknown(i32),
}
impl Auto {
#[doc(al... | Rust | 0 |
}
}
use crate::common::{
vfs::VfsError,
wad::WadError,
};
use failure::{Backtrace, Context, Fail};
use std::{
convert::From,
fmt::{self, Display},
};
#[derive(Debug)]
pub struct RenderError {
inner: Context<RenderErrorKind>,
}
impl RenderError {
pub fn kind(&self) -> RenderErrorKind {
... | Rust | 0 |
for specific volume (Roquet et al., 2014).
///
/// # Arguments
///
/// * `sa`: Absolute Salinity \[g kg-1\]
/// * `ct`: Conservative Temperature (ITS-90) \[deg C\]
/// * `p`: sea pressure \[dbar\] (i.e. absolute pressure - 10.1325 dbar)
///
/// # Returns
///
/// * `specvol`: specific volume \[m3 kg-1\]
///
/// Note th... | Rust | 0 |
String,
pub bucket: String,
pub region: String,
pub cache_path: PathBuf,
}
impl Options {
pub fn auth_enabled(&self) -> bool {
self.auth.is_some()
}
}
#![no_std]
extern crate contract_ffi;
use contract_ffi::contract_api::{account, runtime, Error};
use contract_ffi::unwrap_or_revert::UnwrapOrRevert;
use contr... | Rust | 0 |
f"The system must specifically address {t['challenge']} using {t['ai_technique']}.",
"The response must include a clear description of the system architecture, including data processing, AI model, and user interface components.",
"The implementation of the specified AI technique mus... | Python | 1 |
let nested_environment =
fs.create_salted_nested_environment(ENV_NAME).expect("should create environment");
fasync::Task::spawn(fs.collect()).detach();
// Connect to the Privacy interface and request watching.
let privacy_proxy = nested_environment
.connect_to_p... | Rust | 0 |
tinue
quality = Quality.guess(video_url)
download_item = create_stream_item(
site=SITE_NAME,
url=video_url,
title=video_title,
code=video_code,
quality=quality,
actors... | Python | 1 |
get_db()
# step 0. return all host-groups if user have all host-group access privilege
if (user_privilege & (TP_PRIVILEGE_ASSET_CREATE | TP_PRIVILEGE_ASSET_DELETE | TP_PRIVILEGE_ASSET_GROUP)) != 0:
s = SQL(get_db())
s.select_from('group', ['id', 'name'], alt_name='g')
s.where('g.type={... | Python | 1 |
7 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,... | Rust | 0 |
"""
φ-Harmonic Anchor: Elegant peak scaffold from pure φ-geometry (no dynamics)
Defines candidate φ-native anchors ℓ₀ from closed-form angular choices and
simple φ-powers, then generates the peak series ℓ_n = ⌊ℓ₀ φⁿ⌋.
This is theory-only and falsifiable. We do not tune; we expose a few natural
closed forms and let co... | Python | 1 |
skip_white_space();
if self.next_if_match(']') {
return Ok(Value::ARRAY(Vec::new()));
}
let mut array = Vec::new();
while let Ok(value) = self.parse_value() {
array.push(value);
if self.next_if_match(']') {
break;
} else ... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
import os
code = ELF('./babyheap1804')
context.arch = code.arch
context.log_level = 'debug'
gadget = lambda x: next(code.search(asm(x, os='linux', arch=code.arch)))
def add(size):
r.sendlineafter('Command: ', '1')
r.sendlineafter(': ', str(size))
... | Python | 1 |
two bytes are status
status_reg_checksum = raw_status[2:3] # Third byte is crc8 checksum
if self._crc8(status_reg) != status_reg_checksum:
raise OSError("Invalid CRC checksum for SHT3x status register.")
return status_reg
@property
def temperature(self):
"""
... | Python | 1 |
8)
}
fn send(&mut self, word: u8) -> nb::Result<(), Self::Error> {
if self.spi.stat.read().txrdy().bit_is_clear() {
return Err(nb::Error::WouldBlock);
}
self.spi
.txdat
.write(|w| unsafe { w.data().bits(word as u16) });
Ok(())
}
}
impl<... | Rust | 0 |
b, t, c = x.size()
x = x.view(b, t, c//self.chanel_num, self.chanel_num)
xup = x[:, :, smpl_up, :].view(b, t, -1)
xdown = x[:, :, smpl_down, :].view(b, t, -1)
# xup[:] = 0
self.vqvae_up.eval()
x_out_up, loss_up, metrics_up = self.vqvae_up(xup)
x_out_... | Python | 1 |
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from api import run_analysis, run_extended_analysis
from models import RunRequest, StockBasicInfo, DailyMarketData, WeeklyMarketData, MonthlyMarketData, get_session
from sqlmodel import or_
import time
im... | Python | 1 |
"""
Aprimore o desafio anterior, mostrando no final:
a: a soma de todos os valores pares digitados
b: a soma dos valores da terceira coluna
c: o maior valor da segunda linha
"""
"""
Aprimore o desafio anterior, mostrando no final:
a: a soma de todos os valores pares digitados
b: a soma dos valores da terceira coluna... | Python | 1 |
RATIO: GaugeVec = GaugeVec::new(
opts!(
"sentinel_process_cpu_ratio",
"current process cpu utilization ratio"
),
&["host", "process", "cpu", "process_cpu_ratio"]
)
.unwrap();
static ref PROCESS_MEMORY_SIZE: GaugeVec = GaugeVec::new(
opts!(
... | Rust | 0 |
r, idx4 + atom_counter))
break
break
atom_counter += m.GetNumAtoms()
return torsionList
def A_transpose_matrix(alpha):
return np.array([[np.cos(alpha), np.sin(alpha)], [-np.sin(alpha), np.cos(alpha)]], dtype=np.double)
def S_vec(alpha):
return np.array([[... | Python | 1 |
import numpy as np
def GetAreas3DTria(index, x, y, z, *args):
"""GETAREAS3DTRIA - compute areas of triangles with 3D coordinates
Compute areas of triangles with 3D coordinates.
Usage:
areas = GetAreas3DTria(index, x, y, z)
Examples:
areas = GetAreas3DTria(md.mesh.elements, md.mesh.x... | Python | 1 |
b fn src2dot<'a, P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
rustc_span::create_session_if_not_set_then(rustc_span::edition::LATEST_STABLE_EDITION, |_sg| {
items2chars(
WalkDir::new(path)
.into_iter()
.filter_map(|entry: Result<walkdir::DirEntry, _>| entry.o... | Rust | 0 |
json_data = {"WARNING": "DON'T DELETE THIS FILE! PATH OF FUNCTION SPP-IN-SOUNDUX", "SoundPad_Path": "user_dont_have_soundpad"}
with open('cfg.json', 'w') as json_file:
json.dump(json_data, json_file)
except Exception as e:
if str(e) == "0":
messagebo... | Python | 1 |
, Vec<u8>)>;
pub struct SigVerifyStage {
thread_hdls: Vec<JoinHandle<()>>,
}
impl SigVerifyStage {
#[allow(clippy::new_ret_no_self)]
pub fn new(
packet_receiver: Receiver<Packets>,
sigverify_disabled: bool,
verified_sender: Sender<VerifiedPackets>,
) -> Self {
sigverify... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################
# Copyright (C) 2014 by codeskyblue
#=============================================
'''
Some snippets of opencv2
## Resize image
ref: <http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html#void resize(Inpu... | Python | 1 |
import pygame
from sys import exit
pygame.init()
screen = pygame.display.set_mode((750,500))
pygame.display.set_caption("RIZZLER - THE GAME")
clock = pygame.time.Clock()
class Player(pygame.sprite.GroupSingle):
def __init__(self, y, maxvel, velocity):
pygame.sprite.Sprite.__init__(self)
self.y = ... | Python | 1 |
global_db[inst_id] = inst
update_db_index(inst)
return inst
def encode_inst(val):
"""
encode OWL instance name to remove any non-OWL characters (punctuation)
return val : string value of instance label
"""
puncts = '!"#$%&\'()*+,./:;<=>?@[\\]^_`{|}~ '
val = unicodedata.normalize('... | Python | 1 |
_half_extents), center + ws_half_extents)
}
/// The smallest bounding sphere containing this AABB.
#[inline]
pub fn bounding_sphere(&self) -> BoundingSphere<N> {
let center = self.center();
let rad = na::distance(self.mins(), self.maxs());
BoundingSphere::new(center, rad)
}... | Rust | 0 |
from_peer_id = from_info['peer_id']
to_peer_id = to_info['peer_id']
# Move shard from source to target peer
r = requests.post(
f"{from_peer_uri}/collections/{COLLECTION_NAME}/cluster", json={
"move_shard": {
"shard_id": 0,
"fro... | Python | 1 |
from statistics import mode
from prompt_engine.code_engine import CodeEngine, PythonCodeEngineConfig
from prompt_engine.model_config import ModelConfig
from prompt_engine.interaction import Interaction
import openai
# This is an example to showcase the capabilities of the prompt-engine and how it can be easily integra... | Python | 1 |
######################################################################
# BioSimSpace: Making biomolecular simulation a breeze!
#
# Copyright: 2017-2025
#
# Authors: Lester Hedges <lester.hedges@gmail.com>
#
# BioSimSpace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | Python | 1 |
her with the time of the
/// last status change determines the position of the node in a
/// bucket.
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub enum NodeStatus {
/// The node is considered connected.
Connected,
/// The node is considered disconnected.
Disconnected,
}
/// A `PendingNode` is a `Nod... | Rust | 0 |
handle = open('mbox.txt') # we open the file
#for lines in handle: # for every line in the file
# lines = lines.rstrip() # remove any white spaces
# if not lines.startswith('From '): continue # if the line does not start with 'From' than just skip it
# day = lines.split() # if does start with 'From ' than spl... | Python | 1 |
from setuptools import setup, find_packages
setup(
name="blockchain-pro",
version="1.0.0",
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=[
'cryptography>=41.0.3',
'python-dotenv>=1.0.0',
'fastapi>=0.95.0',
'uvicorn>=0.21.1',
'... | Python | 1 |
t("Width",200)
# get the selected object(s)
selection = FreeCADGui.Selection.getSelectionEx()
conds = []
ports = []
# if selection is not empty
for selobj in selection:
# screen the VHConductors and VHPorts
objType = Draft.getType(selobj.Object)
... | Python | 1 |
if updated_competicao:
return updated_competicao
raise HTTPException(status_code=404, detail="Competição não localizada.")
# -------------- Competição Evento --------------
@app.post("/competicao-evento/", response_model=CompeticaoEvento)
def create_competicao_evento_endpoint(competicao: CompeticaoEven... | Python | 1 |
new_hist_file.rename(hist_file)
class HistoryClear(HistoryTrim):
description = clear_hist_help
keep = Int(0, help="Number of recent lines to keep in the database.")
force = Bool(False, help="Don't prompt user for confirmation").tag(config=True)
flags = Dict( # type: ignore
dict(
... | Python | 1 |
;v="24"', 'sec-ch-ua-mobile': '?1', 'sec-ch-ua-platform': '"Android"',}) as resp:
text = await resp.text()
url = re.search(r"(https://.*?playlist.m3u8.*?)\"", text).group(1)
if "acecwply" in url:
cmd = f'yt-dlp -o "{name}.%(ext)s" -f "bestvide... | Python | 1 |
pe of the Python binary
if options.config == "64bit" and '32' in platform.machine():
print "Cannot download a 64bit binary on 32bit architecture"
exit()
if os.path.exists(os.path.join(options.output, "info.json")):
os.remove(os.path.join(options.output, "info.json"))
if options.url... | Python | 1 |
rget: "evm",
"ChargeStorageFailed {:?} [source: {:?}, target: {:?}, storage: {:?}]",
e,
origin,
target,
storage
);
Error::<T>::ChargeStorageFailed
})?;
}
}
if !config.estimate {
Pallet::<T>::unreserve_storage(&origin, storage_limit, used_storage, refunded_storage).m... | Rust | 0 |
re
def Baker2022AccuracyDeltaFrankenstein():
return _Baker2022AccuracyDelta(identifier_suffix='frankenstein', dataset='normal', image_types=["w", "f"])
def Baker2022AccuracyDeltaFragmented():
return _Baker2022AccuracyDelta(identifier_suffix='fragmented', dataset='normal', image_types=["w", "o"])
def Baker... | Python | 1 |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import json
from openvino import PartialShape, Model, Type # pylint: disable=no-name-in-module,import-error
from openvino.utils.types import get_dtype # pylint: disable=no-name-in-module,import-error
def json_model_analysis_dump(framewor... | Python | 1 |
))
}
}
<filename>src/lib.rs
//! # Angles Done With Integers
//!
//! ```
//! use integer_angles::Angle;
//!
//! assert_eq!(Angle::pi_2().cos::<f64>(), 0.0f64);
//! ```
//!
//! Here we go, down the rabbit hole of floating-point instability and all sorts of crazy problems
//! that come with representing angles within ... | Rust | 0 |
from typing import List
from pydantic import BaseModel
class CreateNNRequest(BaseModel):
name: str
description: str
neurons_per_layer: List[int]
activations: List[str] | Python | 1 |
import requests
def generate_github_report(username: str):
base_url = "https://api.github.com"
user_url = f"{base_url}/users/{username}"
user_data = requests.get(user_url).json()
if "status" in user_data and user_data["status"] == "404":
print(f"Usuario {username} no encontrado.")
r... | Python | 1 |
soa: soa.clone(),
negative_ttl: *negative_ttl,
response_code: *response_code,
trusted: *trusted,
},
// foreign
Io(io) => ResolveErrorKind::from(std::io::Error::from(io.kind())),
Proto(proto) => ResolveErrorKind::f... | Rust | 0 |
ASI_ERROR_BUFFER_TOO_SMALL: ASI_ERROR_CODE = 13;
pub const ASI_ERROR_CODE_ASI_ERROR_VIDEO_MODE_ACTIVE: ASI_ERROR_CODE = 14;
pub const ASI_ERROR_CODE_ASI_ERROR_EXPOSURE_IN_PROGRESS: ASI_ERROR_CODE = 15;
pub const ASI_ERROR_CODE_ASI_ERROR_GENERAL_ERROR: ASI_ERROR_CODE = 16;
pub const ASI_ERROR_CODE_ASI_ERROR_INVALID_MODE... | Rust | 0 |
&mut uv[1],
&mut temp,
);
uv[0] = temp;
addc(0, uv[0], v, &mut carry, &mut v);
addc(carry, uv[1], u, &mut carry, &mut u);
t = t.wrapping_add(carry as u64);
}
c[i as usize] = v;
v = u;
u = t;
t =... | Rust | 0 |
# Copyright 2014-2020 Akretion - Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
payment_mode_id = fields.Many2one(
comodel_name="account.payment.mode",
compute="_comp... | Python | 1 |
age_paths[i]
image = self.preprocess_image(self.paths["data"].joinpath(relative_file_path))
sketch= self.preprocess_image(self.paths["sketch"].joinpath(relative_file_path))
segmentation =self.preprocess_image(self.paths["segmentation"].joinpath(relative_file_path))
gray_segmentation =sel... | Python | 1 |
let mut set2 = std::collections::HashSet::new();
if !index
.into_iter()
.all(|(x, y)| set1.insert(*x) && set2.insert(*y))
{
panic!("Indices cannot be repeated");
}
}
G::batch_add_in_place(self, other, index);
}
... | Rust | 0 |
umber_field
sage: UCF = UniversalCyclotomicField()
sage: G = GL(3, UCF)
sage: e3 = UCF.gen(3); e5 = UCF.gen(5)
sage: m = matrix(UCF, 3,3, [[e3, 1, 0], [0, e5, 7],[4, 3, 2]])
sage: S = G.subgroup([m]); S
Subgroup with 1 generators (
[E(... | Python | 1 |
rows() {
self.right.current = None;
} else {
self.right.current = Some((new_right_cursor, right));
}
batch
},
)))
}
}
/// Concat multiple batches into single one using cursor as offset for concatenation star... | Rust | 0 |
z = BIG::frombytes(&r);
let mut x = BIG::frombytes(&x);
let h = BIG::frombytes(&h);
let mut W = ECP::frombytes(&wcid);
if W.is_infinity() {
return INVALID_POINT;
}
W = pair256::g1mul(&mut W, &mut x);
let mut r = BIG::new_ints(&rom::CURVE_ORDER);
z.add(&h); //new
z.rmod(&... | Rust | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# 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 ... | Python | 1 |
from django import forms
class ArticuloForm(forms.Form):
texto = forms.CharField(
label="Pon tu artículo aquí.",
widget=forms.Textarea(attrs={'rows': 10, 'cols': 80}),
help_text="Pega aquí el artículo que quieres resumir."
)
| Python | 1 |
from app import app
from services import syslog_collector, snmp_collector, netflow_collector
from services import sflow_collector, windows_events_collector, otel_collector
from services import data_processor, alert_manager
import logging
import threading
# Configure logging
logging.basicConfig(level=logging.INFO,
... | Python | 1 |
(BinOp::Eq, Some(true), _) => Some(Rvalue::Use(b.clone())),
// Transform "Ne(false, b)" ==> "b"
(BinOp::Ne, Some(false), _) => Some(Rvalue::Use(b.clone())),
// Transform "Eq(false, b)" ==> "Not(b)"
(BinOp::Eq, Some(false),... | Rust | 0 |
);
let mut encd_msg = orig.encode();
let val_decoded: Message = CnsSend::decode(&mut encd_msg);
assert_eq!(format!("{:?}", orig), format!("{:?}", val_decoded))
}
#[test]
fn network_test() {
use std::net::UdpSocket;
let localhost = "127.0.0.1:27015";
let sock = UdpSocket::bind(localhost).expec... | Rust | 0 |
IMAGE_UNITS: types::GLenum = 0x8F38;
#[allow(dead_code, non_upper_case_globals)] pub const MAX_INTEGER_SAMPLES: types::GLenum = 0x9110;
#[allow(dead_code, non_upper_case_globals)] pub const MAX_LABEL_LENGTH: types::GLenum = 0x82E8;
#[allow(dead_code, non_upper_case_globals)] pub const MAX_LAYERS: types::GLenum = 0x8281... | Rust | 0 |
::Ulong(0x14);
pub const DESC_DISPOSITION: Value = Value::Ulong(0x15);
pub const DESC_SOURCE: Value = Value::Ulong(0x28);
pub const DESC_TARGET: Value = Value::Ulong(0x29);
pub const DESC_MESSAGE_HEADER: Value = Value::Ulong(0x70);
pub const DESC_MESSAGE_DELIVERY_ANNOTATIONS: Value = Value::Ulong(0x71);
pub const DESC... | Rust | 0 |
/// # Panics
///
/// This function itself doesn't panic but it might panic if you run futures that
/// expect the tokio runtime. Use the tokio-rt feature and an `AsyncComponent` for this instead.
pub fn spawn_future<F: futures_core::future::Future<Output = ()> + Send + 'static>(f: F) {
gtk::glib::MainContext::ref_t... | Rust | 0 |
{}\" y1=\"{}\" x2=\"{}\" y2=\"{}\" class=\"arc{}\" />",
// x_coord(from as usize),
// y_coord(from as usize),
// x_coord(node_order.node(label.0) as usize),
// y_coord(node_order.node(label.0) as usize),
// if best == label.0 { " shortest" } else { "" }
//... | Rust | 0 |
_id, PauseKeeper { ..*pause_keeper })
});
}
}
#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<T::BlockNumber> for Pallet<T> {}
// Admin functions
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Pause specific operation (deposit, redeem, borrow, repay) wit... | Rust | 0 |
ms::IntoConnectParams
{
let conn = postgres::Connection::connect(params, postgres::TlsMode::None)?;
create_tables(&conn)?;
Ok(Database { conn })
}
pub fn add_channel(&self, channel: &PublicChannel) -> postgres::Result<()> {
const QUERY_INSERT_CHANNEL: &str = r#"
INS... | Rust | 0 |
"Incoming Broadcast Packets" => {
status.incoming_broadcast_packets = SoftEtherReader::decode_packets(val)?
}
"Incoming Broadcast Total Size" => {
status.incoming_broadcast_bytes = SoftEtherReader::decode_bytes(val)?
}
... | Rust | 0 |
import unittest
from .git import Git
from .shell import FakeCommand, RunResult, Shell, SpyShell
class SpyTests(unittest.TestCase):
def test_get_repo_from_remote_git(self):
shell: Shell = SpyShell(
[
FakeCommand(
"git remote get-url origin",
... | Python | 1 |
llateralCurrencyId: CurrencyId = DEFAULT_COLLATERAL_CURRENCY;
pub const GetNativeCurrencyId: CurrencyId = DEFAULT_NATIVE_CURRENCY;
pub const GetWrappedCurrencyId: CurrencyId = DEFAULT_WRAPPED_CURRENCY;
pub const MaxLocks: u32 = 50;
}
parameter_type_with_key! {
pub ExistentialDeposits: |_currency_id: Cu... | Rust | 0 |
r#"SELECT "id" FROM "glyph" WHERE NOT ("aspect" < 8 OR "aspect" IS NOT NULL)"#
);
}
#[test]
fn select_46() {
let statement = Query::select()
.column(Glyph::Id)
.from(Glyph::Table)
.cond_where(
Cond::all()
.not()
.add_option(Some(Expr::... | Rust | 0 |
values for `SectionHeader*::sh_type`.
/// ARM unwind section.
pub const SHT_ARM_EXIDX: u32 = SHT_LOPROC + 1;
/// Preemption details.
pub const SHT_ARM_PREEMPTMAP: u32 = SHT_LOPROC + 2;
/// ARM attributes section.
pub const SHT_ARM_ATTRIBUTES: u32 = SHT_LOPROC + 3;
// AArch64 values for `Rel*::r_type`.
/// No relocat... | Rust | 0 |
# This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.fftpack` namespace for importing the functions
# included below.
import warnings
from . import _realtransforms
__all__ = [ # noqa: F822
'dct', 'idct', 'dst', 'idst', 'dctn', 'idctn', 'dstn', 'idstn'
]
def __dir__():
... | Python | 1 |
# coding: utf-8
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | Python | 1 |
imes:
applyFunc[lead]( prep[lead], harvestValues[lead][t], lead )
if key:
setKeyframe( controls[lead], shape=False )
for ctrl, times in spaceOnlyTimes.items():
if t in times:
ctrl.space.set( spaceOnlyTargetValues[c... | Python | 1 |
bin("kvs")
.unwrap()
.args(&["set", "extra", "extra", "field"])
.assert()
.failure();
}
#[test]
fn cli_invalid_rm() {
Command::cargo_bin("kvs")
.unwrap()
.args(&["rm"])
.assert()
.failure();
Command::cargo_bin("kvs")
.unwrap()
.ar... | Rust | 0 |
8Char {..});
}
#[test]
fn control_char_in_string_3() {
let input = "{\"key\": \"val\u{0014}ue\"}";
let err: ParseDiag = parse_node_err!(input);
assert_err!(err, JsonParseErrorDetail::InvalidControlUTF8Char {..});
}
#[test]
fn control_char_in_string_with_unexpected_end_of_input() {
let input = "{\"key... | Rust | 0 |
subpath = [0.0; EDGE_COST_DIMENSION];
for i in 0..EDGE_COST_DIMENSION {
costs_subpath[i] =
costs_until_edge[m as usize][i] - costs_until_edge[start as usize][i];
}
//DEBUG
let subpath = path.get_subpath(self.grap... | Rust | 0 |
#
# DAPLink Interface Firmware
# Copyright (c) 2016-2017, ARM Limited, All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
# 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... | Python | 1 |
}
/// OPAINTOEN
pub mod OPAINTOEN {
/// Offset (8 bits)
pub const offset: u32 = 8;
/// Mask (1 bit: 1 << 8)
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Rea... | Rust | 0 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host):
dirs = [
"/etc/g... | Python | 1 |
olon (pcode) :
if cStack : fatal(": inside Control stack: %s" % cStack)
label = getWord()
cStack.append(("COLON",label)) # flag for following ";"
def cSemi (pcode) :
if not cStack : fatal("No : for ; to match")
code,label = cStack.pop()
if code != "COLON" : fatal(": not balanced with ;")
r... | Python | 1 |
self.start_flag,
"The AssembledApplication has already been started"
);
// Send start message to manager component
match &self.source_manager {
Some(source_manager) => {
source_manager.actor_ref().tell(SourceEvent::Start);
}
None =... | Rust | 0 |
policy, value, memory = self.forward(observation_t, memory)
# RealNVP requires sampling with 'no_grad'.
action, log_prob = self.pi_distribution.sample(policy, deterministic)
result = {
# 'policy': policy, 'value': value,
'action': action, 'log_... | Python | 1 |
)
}
}
pub mod should_shift_to_parent_phase;
pub mod phase_data;
pub mod phase_data_item;
pub mod calc_next_phase;
pub mod history_options;<reponame>jessebraham/esp32s2
#[doc = "Register `DOUT_MODE` reader"]
pub struct R(crate::R<DOUT_MODE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<DOUT_MODE_S... | Rust | 0 |
ndom_uuid()',
'title varchar(50)',
'url varchar(200)',
'job_role varchar(200)',
'job_level varchar(50)',
'pre_requirements_education text',
'pre_requirements_experience text',
'hard_skills text',
'soft_skills text',
'responsibilities text',
... | Python | 1 |
100
if let Some(new_n) = (b + 1).checked_pow(e) {
self.heap.push(Power(new_n, b + 1, e));
}
}
Some((n, b, e))
}
}
fn compute_a(n: usize) -> (u64, u64, u32) {
Powers::new()
.skip_while(|&(n, _b, _e)| n < 10)
.filter(|&(n, b, _e)| n.into_di... | Rust | 0 |
import os
import unittest
import json
from typing import Dict
import jc.parsers.proc_mtrr
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
f_in: Dict = {}
f_json: Dict = {}
@classmethod
def setUpClass(cls):
fixtures = {
'proc_mtrr': (
... | Python | 1 |
/// fn from(other: u64) -> Self {
/// Foo(other)
/// }
/// }
///
/// let foos: HashSet<Foo> = hash_set_from![1, 2, Foo(3), ..(4..=6), 7];
/// assert_eq!(foos, hash_set![Foo(1), Foo(2), Foo(3), Foo(4), Foo(5), Foo(6), Foo(7)]);
///```
pub use velcro_macros::hash_set_from;
/// An initializer for `LinkedL... | Rust | 0 |
,
cfg: &mut cfg::Cfg<'pool, C>,
) -> Bind<'pool, System, <Func as FnBind<Binder>>::Output>
where
C: ~const raw_cfg::CfgBase<System = System>,
System: raw::KernelBase + cfg::KernelStatic,
Func: ~const FnBind<Binder>,
{
let hunk = BindHunk::define().zeroed().finish(cfg)... | Rust | 0 |
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""A module containing run_workflow method definition."""
import pandas as pd
from graphrag.config.models.graph_rag_config import GraphRagConfig
from graphrag.data_model.schemas import DOCUMENTS_FINAL_COLUMNS
from graphrag.index.typing.cont... | Python | 1 |
import torch
from torch.autograd import Variable
class ShakeDrop(torch.autograd.Function):
'''
never modify p_drop!!! Keep 0.5!!! because we always use "preprocesser" mode
if modified, when gate = 1, the return value is not equal to the expectation of input.
you can modify alpha range, and keep the me... | Python | 1 |
from typing import Final
from enum import Enum
class KW(Enum):
"""Keywords"""
PRINT = 'ijustwannatelluhowimfeeling'
IF = 'andifuaskmehowimfeeling'
LET = 'give'
ASSIGN = 'up'
IMPORT1 = 'weknowthe'
IMPORT2 = "andwe'regonnaplayit"
DEF = 'gonna'
CALL = 'gotta'
RETURN1 = 'whenigive... | Python | 1 |
_seals.get(seal_definition) {
set.remove(a);
set.insert(Assignment::Revealed {
seal_definition: seal::Revealed::TxOutpoint(reveal.clone()),
assigned_state: assigned_sta... | Rust | 0 |
def count_characters(string):
lowercase_count = 0
uppercase_count = 0
digit_count = 0
special_count = 0
for char in string:
if char.islower():
lowercase_count += 1
elif char.isupper():
uppercase_count += 1
elif char.isdigit():
digit_co... | Python | 1 |
oject: str
install_tag: T.Optional[str] = None
def __post_init__(self) -> None:
if self.name != os.path.basename(self.name):
raise InvalidArguments(f'Link name is "{self.name}", but link names cannot contain path separators. '
'The dir part should be in in... | Python | 1 |
pub lpGuid: *mut ::windows_sys::core::GUID,
pub dwWidth: u32,
pub dwHeight: u32,
pub ddPixelFormat: DDPIXELFORMAT,
pub dwScratchMemAlloc: u32,
pub ddRVal: ::windows_sys::core::HRESULT,
}
impl ::core::marker::Copy for DD_GETINTERNALMOCOMPDATA {}
impl ::core::clone::Clone for DD_GETINTERNALMOCOMPDATA ... | Rust | 0 |
# -*- coding: utf-8 -*-
import sys
import numpy as np
from os.path import dirname as opd
from os.path import abspath as opa
TEST_PATH = opa(opd(opd(__file__)))
PRJ_PATH = opd(TEST_PATH)
sys.path.insert(0, PRJ_PATH)
from pyslide import contour
def test_contour_patch_splitting_no_overlap():
wsi_h, wsi_w = 5000, 5... | Python | 1 |
iphdata_alignment(dma2::DataSize::BYTE);
dma_tx.memory_increment(true);
dma_tx.direction(dma2::Direction::MEMORY_TO_PERIPH);
dma_tx.reg.s2cr.modify(|_, w| w.tcie().set_bit());
dma_rx.disable();
dma_tx.disable();
}
pub fn spi_setup(p: &stm32f411::Peripherals) {
p.RCC.ahb1enr.modify(|_, w| w.gp... | Rust | 0 |
"桂子:ケイコ",
"章夫:アキオ",
"泰貴:タイキ",
"冨士子:フジコ",
"香菜:カナ",
"桃奈 :モナ",
"敏子:トシコ",
"邦男:クニオ",
"瑞晃:ミズキ",
"杏奈:アンナ",
"茂子:シゲコ",
"香苗:カナエ",
"正道:マサミチ",
"百花:モモカ",
];
const LAST_NAME: &'static [&'static str] = &[
"室井:ムロ... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
if available
"""
self.__verify_logged_in()
return self._user_id
@property
def is_api_key(self) -> bool:
"""
Returns whether the API call was done with API key or not, if available
"""
self.__verify_logged_in()
return self._is_api_key
@propert... | Python | 1 |
r = if zeros == 0 {
0
} else {
d <<= zeros;
let n2 = n.hi >> (128 - zeros);
n.hi = n.hi << zeros | n.lo >> (128 - zeros);
n.lo <<= zeros;
n2
};
let (nhl, nhh) = u128_lo_hi(n.hi);
let qhh = div_half_u128(&mut r, d, nhh);
let qhl = div_half_u128(&mut r,... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.