text string | label_name string | labels int64 |
|---|---|---|
OFFERED_HTLC_SCRIPT_WEIGHT);
assert_eq!(node_txn[0].lock_time, 0);
assert!(node_txn[0].output[0].script_pubkey.is_v0_p2wpkh()); // direct payment
check_spends!(node_txn[1], chan_1.3.clone());
assert_eq!(node_txn[1].input[0].witness.clone().last().unwrap().len(), 71);
// We don't bother to check that B can claim th... | Rust | 0 |
xtern "unadjusted" {
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.v2i64.v2f64")]
fn vcagtq_f64_(a: float64x2_t, b: float64x2_t) -> uint64x2_t;
}
vcagtq_f64_(a, b)
}
/// Floating-point absolute compare greater than
#[inline]
#[target_feature(enable = "neon")]
#[cfg_at... | Rust | 0 |
#!/usr/bin/env python2
"""
node-deserialization exploit
reference : https://opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution/
"""
__author__ = 'kall.micke@gmail.com'
import requests
import base64
import sys
def charencode(string):
"""String.CharCode"""
encod... | Python | 1 |
# -*- coding: utf-8 -*-
{
'name': 'test-lint',
'version': '0.1',
'category': 'Hidden/Tests',
'description': """A module to test Odoo code with various linters.""",
'maintainer': 'Odoo SA',
'depends': ['base'],
'installable': True,
'auto_install': False,
'license': 'LGPL-3',
}
| Python | 1 |
# -*- coding: utf-8 -*-
# See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class WooProductAttributeEpt(models.Model):
_name = "woo.product.attribute.ept"
_description = "Product Attribute"
name = fields.Char(required=1, translate=True)
slug = fields.Char(hel... | Python | 1 |
to do so.
pub const BACKFILL_EPOCHS_PER_BATCH: u64 = 2;
/// The maximum number of batches to queue before requesting more.
const BACKFILL_BATCH_BUFFER_SIZE: u8 = 20;
/// The number of times to retry a batch before it is considered failed.
const MAX_BATCH_DOWNLOAD_ATTEMPTS: u8 = 10;
/// Invalid batches are attempted... | Rust | 0 |
// }
// Now check all viable x-velocities (i.e. 0..=x2)
// We keep a vector so that duplicate pairs can be removed (i.e when a set of speeeds
// would intersect more than once)
let mut speeds = Vec::new();
for v_x_start in 0..=x2 {
let mut v_x = v_x_start;
let mut x_pos = 0;
... | Rust | 0 |
from typing import Any, Dict, Optional
CHINESE_WORDING: Dict[str, Any] =\
{
"python_not_supported": "Python版本不支持,更新 {version} 或更高版本",
"ffmpeg_not_installed": "FFMpeg没有安装",
"creating_temp": "创建临时资源",
"extracting_frames": "提取分辨率为 {resolution} 和 {fps}/秒的帧",
"extracting_frames_succeed": "提取帧成功",
"extracting_frames_fa... | Python | 1 |
in():
"""Function that will execute the ProcessGroup"""
parser = argparse.ArgumentParser(prog="Resiliency Demo",
description="Demo restart triggered by failure of user application")
parser.add_argument('--trigger-restart', action='store_true')
parser.add_argument('-... | Python | 1 |
Result<(), PrefabError> {
system_data.0.insert(entity, self.clone())?;
Ok(())
}
}/*
* Copyright 2021 Aon Cyber Solutions
*
* 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... | Rust | 0 |
status=BigPlanStatus.NOT_STARTED,
is_key=args.is_key,
eisen=args.eisen,
difficulty=args.difficulty,
actionable_date=args.actionable_date,
due_date=args.due_date,
)
new_big_plan = await generic_creator(uow, progress_reporter, new_big_pla... | Python | 1 |
if len(chunk_text.strip()) < 30: # Skip very small chunks
continue
chunk_id = str(uuid.uuid4())
section_type = self.identify_section_type(chunk_text)
metadata = DocumentMetadata(
filen... | Python | 1 |
<(), PiccoloError> {
trace!("{} binary {}", op.line, op.lexeme);
compile_expr(emitter, lhs)?;
compile_expr(emitter, rhs)?;
match op.kind {
TokenKind::Plus => emitter.add_instruction(Opcode::Add, op.line),
TokenKind::Minus => emitter.add_instruction(Opcode::Subtract, op.line),
T... | Rust | 0 |
type IDebugOutputStream = *mut ::core::ffi::c_void;
pub type IDebugPlmClient = *mut ::core::ffi::c_void;
pub type IDebugPlmClient2 = *mut ::core::ffi::c_void;
pub type IDebugPlmClient3 = *mut ::core::ffi::c_void;
pub type IDebugProperty = *mut ::core::ffi::c_void;
pub type IDebugPropertyEnumType_All = *mut ::core::ffi... | Rust | 0 |
import numpy as np
import tensorflow as tf
x1 = tf.keras.layers.Dense(8)(np.arange(10).reshape(5, 2))
x2 = tf.keras.layers.Dense(8)(np.arange(10, 20).reshape(5, 2))
concatted = tf.keras.layers.Concatenate()([x1, x2])
print(concatted.shape) | Python | 1 |
creen layout tiler for up to 8 windows"""
return direct_tiler(static_bigscreen_8, *args, **kwargs)
def widescreen_dwindle_layout_tiler(*args, **kwargs) -> Iterator[Rect]:
"""The wide-screen dwindle layout tiler"""
return direct_tiler(widescreen_dwindle, *args, **kwargs)
def obs_dwindle_layout_tiler(*arg... | Python | 1 |
#28. Mejora el programa anterior para controlar también la introducción de símbolos. Utiliza elif.
letra=input("Introduce una letra: ")
if str.isdigit(letra):
print("Eso no es una letra, es un numero")
else:
if str.isupper (letra):
print(f"La letra {letra} es mayuscula")
elif str.islower (letra):
... | Python | 1 |
);
let sub_name = attrs.cased_name();
let variant_name = &variant.ident;
let constructor_block = match variant.fields {
Named(ref fields) => from_argmatches::gen_constructor(&fields.named, &attrs),
Unit => quote!(),
Unnamed(ref fields) if fields.unnamed.len() ... | Rust | 0 |
import numpy as np
import pandas as pd
from xgboost import XGBRegressor
lon = [49.53, 79.8483, 36.81056, 85.335]
lat = [40.22, 6.913056, -1.234167, 27.73833]
country_name = ['asbk', 'sllk', 'kny', 'nber']
kdmd_25_20 = r'H:\地面无异常值\地面无异常值\PhoraDurbarKathmandu_PM2.5_2020_YTD_mean.csv'
kdmd_25_21 = r'H:\地面无异常值\地面无异常值\Pho... | Python | 1 |
0
{
u /= if (*spe).mag != 0.0f64 {
(*spe).mag
} else {
1.0f64
};
q = q.offset(strlen(b"true\x00" as *const u8 as *const i8) as isize);
if *q == 0 {
free(qq as *mut libc::c_void);
skip_whit... | Rust | 0 |
aram, constraint))
# Add security contract
self.client.add_input_contract(PyContractFactory.create_contract(
"security",
"prompt_injection_check:enabled,pii_detection:enabled,auto_fix:sanitize"
))
#... | Python | 1 |
.push_front(((buf[5] as i32) << 8) + ((buf[4] as i32) << 0));
} else {
warn!("Packet from air sensor was incorrect length or did not start with the correct bytes: {:?}", buf);
}
// debug!("Received from ai... | Rust | 0 |
}
}
/// When we create the pipe, how big of a write buffer do we specify?
///
/// This is reserved in the nonpaged pool. The fragment size is the
/// max we can write to the pipe without fragmentation, and the
/// buffer size is what we tell the pipe it is, so we have room
/// for out of band data etc.
const MAX... | Rust | 0 |
, # ▿ WHITE DOWN-POINTING SMALL TRIANGLE
'triangleleft': '\u25c3', # ◃ WHITE LEFT-POINTING SMALL TRIANGLE
'triangleright': '\u25b9', # ▹ WHITE RIGHT-POINTING SMALL TRIANGLE
'uplus': '\u228e', # ⊎ MULTISET UNION
'vartriangle': '\u25b3', # △ WHITE UP-POINTING TRIANGLE
'vee': '\u2228', # ∨ LOGICAL OR
... | Python | 1 |
not match the delta snapshot ledger index ({} != {}): {}.",
self.full_header.sep_index(),
delta_header.ledger_index(),
self.urls.full()
);
return false;
}
}
true
}
}
async fn gather_source_info... | Rust | 0 |
0, 10);
//----------------------------------------------------------------------------------
drop(d);
if rl.is_key_pressed(crate::EXIT_KEY) {
// free mouse
rl.set_camera_mode(& camera, raylib::consts::CameraMode::CAMERA_FREE);
}
},
);
}
<repo... | Rust | 0 |
from haversine import haversine_vector, Unit
import xarray as xr
import argparse
import numpy as np
from multiprocessing import Pool
from functools import partial
from os.path import join, exists
from os import makedirs
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-c", "--coord... | Python | 1 |
<reponame>wgslsmith/wgslsmith
use std::mem;
use ast::types::DataType;
use ast::{FnDecl, FnInput, FnOutput};
use rand::Rng;
impl<'a> super::Generator<'a> {
pub fn gen_fn(&mut self, params: Vec<FnInput>, return_type: &DataType) -> FnDecl {
let saved_state = mem::take(&mut self.fn_state);
let name =... | Rust | 0 |
st.markdown(
f'<a href="{maps_url}" target="_blank"><button style="padding:6px 12px; border-radius:4px;">Open in Google Maps</button></a>',
unsafe_allow_html=True
)
with col2:
... | Python | 1 |
""" some functions required in the simulation """
import scipy.io as sio
import numpy as np
def get_codebook():
""" load the codebook file"""
mdict = sio.loadmat('codebook/codebook_dft88.mat')
code_book = mdict['ans']
return code_book
def dB2num(dB):
num = 10 ** (dB / 10)
return num
def n... | Python | 1 |
s_k_k1_xmm_xmmm32_imm8_sae
0x80,// 'v', Previous
// Cmpsd_xmm_xmmm64_imm8
0x1E,// pops_3
0xE7, 0x02,// 359 = "cmpsd"
0x06,// cmpsd
0x08,// 0x8 = ShowNoMemSize_ForceSize
// VEX_Vcmpsd_xmm_xmm_xmmm64_imm8
0x9E,// 'v', pops_3
0xE7, 0x02,// 359 = "vcmpsd"
0x07,// vcmpsd
0x08,// 0x8 = ShowNoMemSize_ForceSize
... | Rust | 0 |
not None:
self._Parameters = []
for item in params.get("Parameters"):
obj = RuleRewriteActionParams()
obj._deserialize(item)
self._Parameters.append(obj)
memeber_set = set(params.keys())
for name, value in vars(self).items():
... | Python | 1 |
port: u16,
) -> Result<(), Error> {
// 'While the stats are state, they are usually used in the broker - which is likely never restarted
let stats = SimpleStats::new(|s| println!("{}", s));
// The restarting state will spawn the same process again as child, then restarted it each time it crashes.
let (... | Rust | 0 |
from setuptools import setup, find_packages
setup(
name="lex-guard",
version="0.1.0",
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=["pyyaml","cryptography"],
entry_points={"console_scripts": ["lexguard=policy_parser.main:main"]},
python_requires=">=3.9",
)
| Python | 1 |
::Backtrace` from a `failure::Backtrace` and prints it, if one
/// exists. Prints that a backtrace was not capture if one is not found.
pub unsafe fn print_backtrace(
trace: &failure::Backtrace,
settings: &mut crate::Settings,
) -> crate::IOResult {
let internal = backdoortrace(trace);
if let Some(inte... | Rust | 0 |
in B.
Only provided if return_indices is True.
"""
# pylint: disable=line-too-long
# see
# https://stackoverflow.com/questions/8317022/ get-intersecting-rows-across-two-2d-numpy-arrays
#pylint: disable=no-else-return
A = np.ascontiguousarray(A)
B = np.ascontiguousarray(B)
if A.ndim != B.ndim:
... | Python | 1 |
app(_context: WidgetContext) -> WidgetNode {
widget! {()}
}
fn text(_context: WidgetContext) -> WidgetNode {
widget! {()}
}
println!("{:#?}", widget! {()});
println!(
"{:#?}",
widget! {
(app)
}
);
println!(
"{:#?}",
widge... | Rust | 0 |
d with when encoded/decoded
/// with bech32.
mod fvk_hrp {
pub const MAINNET: &str = "zviews";
pub const TESTNET: &str = "zviewtestsapling";
}
/// Full Viewing Keys
///
/// Allows recognizing both incoming and outgoing notes without having
/// spend authority.
///
/// For incoming viewing keys on the productio... | Rust | 0 |
());
if texture.is_none() {
warn!(
"Texture not loaded for texture id: `{}`.",
sprite_sheet.texture_id
);
return;
}
let sprite = &sprite_sheet.sprites[sprite_render.sprite_number];
// Sprite vertex shader
set_vertex_args(effect, encoder, camera, glob... | Rust | 0 |
_base_ = [
'../_base_/models/fcaf3d.py', '../_base_/default_runtime.py',
'../_base_/datasets/s3dis-3d.py'
]
model = dict(bbox_head=dict(num_classes=5))
optim_wrapper = dict(
type='OptimWrapper',
optimizer=dict(type='AdamW', lr=0.001, weight_decay=0.0001),
clip_grad=dict(max_norm=10, norm_type=2))
... | Python | 1 |
(None, None) => (HSI, cfgr::SW_A::HSI, None),
}
}
/// Freezes the clock configuration, making it effective
pub fn freeze(self, acr: &mut ACR) -> Clocks {
let (sysclk, sysclk_source, pll_config) = self.get_sysclk();
let (hpre_bits, hpre) = self
.hclk
... | Rust | 0 |
})
}
super::TraitNotObjectSafe(def_id) => Some(super::TraitNotObjectSafe(def_id)),
super::ConstEvalFailure(err) => Some(super::ConstEvalFailure(err)),
super::Overflow => Some(super::Overflow),
}
}
}
impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCau... | Rust | 0 |
(Arc::new(RecreateWithRegret::new(2, 3, random.clone())), 1),
(Arc::new(RecreateWithGaps::new(1, (problem.jobs.size() / 10).max(1), random.clone())), 1),
(Arc::new(RecreateWithSkipBest::new(1, 2, random.clone())), 1),
(Arc::new(Recreate... | Rust | 0 |
'),
(0x1D7BB, 'M', 'σ'),
(0x1D7BD, 'M', 'τ'),
(0x1D7BE, 'M', 'υ'),
(0x1D7BF, 'M', 'φ'),
(0x1D7C0, 'M', 'χ'),
(0x1D7C1, 'M', 'ψ'),
(0x1D7C2, 'M', 'ω'),
(0x1D7C3, 'M', '∂'),
(0x1D7C4, 'M', 'ε'),
(0x1D7C5, 'M', 'θ'),
(0x1D7C6, 'M', 'κ'),
(0x1D7C7, 'M', 'φ'),
(0x1D7C8, 'M... | Python | 1 |
::size_hint(&self.lhs, strategy) + Fmt::size_hint(&self.rhs, strategy)
}
}
#[cfg(feature = "fast_fmt")]
impl<T: Cat + Fmt> Fmt for CatOne<T> {
fn fmt<W: Write>(&self, writer: &mut W, strategy: &FFDisplay) -> Result<(), W::Error> {
self.inner.fmt(writer, strategy)
}
fn size_hint(&self, strategy... | Rust | 0 |
// computation
unsafe{
let mut bz_buffer: bzip2_sys::bz_stream = mem::zeroed();
bzip2_sys::BZ2_bzDecompressInit(&mut bz_buffer as *mut _, 0, 0);
let mut output: Vec<u8> = vec![0; block_size];
bz_buffer.next_in = buffer_slice.as_ptr() as *mut _;
bz_buffer.av... | Rust | 0 |
_TM_THE_TRUTH_PROPERTY_TYPE_FLOAT: tm_the_truth_property_type =
4;
pub const tm_the_truth_property_type_TM_THE_TRUTH_PROPERTY_TYPE_DOUBLE: tm_the_truth_property_type =
5;
pub const tm_the_truth_property_type_TM_THE_TRUTH_PROPERTY_TYPE_STRING: tm_the_truth_property_type =
6;
pub const tm_the_truth_prop... | Rust | 0 |
__class__.__name__,
orm_util.state_str(self.state)
)
class DeleteState(PostSortRec):
def __init__(self, uow, state, mapper):
self.state = state
self.mapper = mapper
def execute_aggregate(self, uow, recs):
cls_ = self.__class__
mapper = self.mapper
o... | Python | 1 |
0x00001100;
pub const CKM_DES_CBC_ENCRYPT_DATA : CK_MECHANISM_TYPE = 0x00001101;
pub const CKM_DES3_ECB_ENCRYPT_DATA : CK_MECHANISM_TYPE = 0x00001102;
pub const CKM_DES3_CBC_ENCRYPT_DATA : CK_MECHANISM_TYPE = 0x00001103;
pub const CKM_AES_ECB_ENCRYPT_DATA : CK_MECHANISM_TYPE = 0x00001104;
pub con... | Rust | 0 |
band = self._find_band(memory.freq)
# mode
tmp_mode = self.get_features().valid_modes.index(memory.mode)
_mem_chan.modulation = tmp_mode / 2
_mem_chan.bandwidth = tmp_mode % 2
if memory.mode == "USB":
_mem_chan.bandwidth = 1 # narrow
# frequency/offset
... | Python | 1 |
dpi::LogicalSize
};
use winitstate::WinitState;
pub fn create_window(title: &str, width: f64, height: f64) -> WinitState {
WinitState::new(title, LogicalSize { width, height }).unwrap()
}
pub fn create_default_window() -> WinitState {
WinitState::default()
}
pub fn run(winit_state: WinitStat... | Rust | 0 |
ParX {
name: x.clone(),
typ: typ.clone(),
mode: Mode::Exec,
purpose: ParPurpose::Regular,
},
)
};
let x_params = |typ: &Typ| Arc::new(vec![x_param(typ)]);
let typ_args = Arc::new(vec_map(&tparams, |t| Arc::new(Ty... | Rust | 0 |
asks.float(), dim=1)
class Pooling(nn.Module):
def __init__(self, hidden_size, pooling_mode='cls', last_layers=None):
super(Pooling, self).__init__()
assert pooling_mode in ['mean', 'max', 'cls', 'mean_sqrt']
self.hidden_size = hidden_size
self.last_layers = last_layers
sel... | Python | 1 |
ty_1__bindgen_ty_3,
pub atcahid: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4,
pub atcacustom: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1 {
pub slave_address: u8,
pub bus: u8,
pub baud: u32,
}
#[allow(deref_nul... | Rust | 0 |
import pygame
import getopt
import sys
import os
from math import pi
import main
import navmesh
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 800
def usage():
print("Usage: {} -f filename.obj".format(os.path.basename(sys.argv[0])))
try:
opts, args = getopt.getopt(sys.argv[1:], "hf:", ["help", "file="])
except getop... | Python | 1 |
v.swap(next, current);
//! perm[current] = current;
//! current = next;
//! }
//! perm[current] = current;
//! }
//! }
//! ```
//!
//! # Crate Features
//!
//! This crate is always `#![no_std]`.
//!
//! # Rust Version
//!
//! This version of the crate requires Rust 1.15 or la... | Rust | 0 |
ebookActivity, driver, connstring, database, LogData=json.dumps(result_data))
notebookutils.notebook.exit(result_data)
# METADATA ********************
# META {
# META "language": "python",
# META "language_group": "synapse_pyspark"
# META }
# MARKDOWN ********************
# ## Merge table
# CELL **********... | Python | 1 |
# import os
from collections import defaultdict
image_ids = []
image_labels = []
image_name = []
datalist = 'train.txt'
class_first_compo = defaultdict(list)
with open(datalist) as f:
str_temp = ""
for line in f:
info = line.strip().split()
name = info[0]
class_first_compo[info[1]].appen... | Python | 1 |
::INFINITY;
let mut d = f32::INFINITY;
let mut k = None;
let n = self.smp.len();
let mut i = 0;
for l0 in &self.smp {
let not_last = i < n - 1;
let l1 = if not_last { &self.smp[i + 1] } else { l0 };
let (p_, t_) = vec2_closest_on_line(pt, *l0... | Rust | 0 |
c3: glsl_type::Vec3,
U16FloatVec4: glsl_type::Vec4
) {
type Concrete = u16;
const GL_TYPE = gl::UNSIGNED_SHORT;
const NORMALIZED = gl::FALSE;
}
format (
NormalizedU16Float: glsl_type::Float,
NormalizedU16FloatVec2: glsl_type::Vec2,
NormalizedU16FloatV... | Rust | 0 |
eWatcherProxy, cmd: DriverLsusbCommand) -> Result<()> {
lsusb::lsusb(device_watcher, cmd.into()).await
}
use interface::fill::fill;
use klv::klv::*;
use klv::ul::*;
use klv::value::*;
use klv::value::element::Element;
use klv::value::value_data::*;
use klv::value::partition::PartitionStatus::*;
use std::io::prelu... | Rust | 0 |
from sympy.core.numbers import (I, pi)
from sympy.core.symbol import Symbol
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.matrices.dense import Matrix
from sympy.physics.quantum.qft import QFT, IQFT, RkGate
from sympy.physics.quantum.gate im... | Python | 1 |
from abc import ABC, abstractmethod
from models.referral import ReferralsOrm
from respositories import SQLAlchemyRepository, AbstractSQLRepository
from schemas.referral import ReferralInDB
class ReferralRepositoryBase(AbstractSQLRepository[ReferralInDB], ABC):
@abstractmethod
async def add_referral(self, re... | Python | 1 |
ength indicates absent symbol
continue
#for (int j = length_of[i]-1; j >= 0; j --)
for j in xrange(length_of[i]-1, -1, -1):
#next = 0 # shouldn't be necessary
assert not ht.t[cur].is_leaf # oops, walked onto a leaf
if codes[length_of[i]] & (1<<j):
# 1 == right
next = ht.t[cur].right
if 0... | Python | 1 |
#import the library
import pandas as pd
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
#load the data
data = pd.read_csv("applesep2023.csv")
print(data)
#feature and target
feature = data[["qty"]]
target = data["price"]
model = LinearRegression(random_state = 42)
model.fit(feature,... | Python | 1 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def h2o_group_by_types():
"""
This test checks that if the returned frame after a group_by operation returns correct type of group_by column.
"""
data = h2o.H2OFrame([["4/1/07", 1, "A", 2.2],
... | Python | 1 |
from direct.directnotify import DirectNotifyGlobal
from pirates.distributed.DistributedInteractiveAI import DistributedInteractiveAI
from pirates.piratesbase import PiratesGlobals
import random
class DistributedGameTableAI(DistributedInteractiveAI):
notify = DirectNotifyGlobal.directNotify.newCategory('Distributed... | Python | 1 |
AND_KHR: VkPerformanceCounterScopeKHR = 2;
const VK_QUERY_SCOPE_COMMAND_BUFFER_KHR: VkPerformanceCounterScopeKHR = 0;
const VK_QUERY_SCOPE_RENDER_PASS_KHR: VkPerformanceCounterScopeKHR = 1;
const VK_QUERY_SCOPE_COMMAND_KHR: VkPerformanceCounterScopeKHR = 2;
const VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR: VkPerformance... | Rust | 0 |
).await {
match command.data.name.as_str() {
"make_account" => self.make_account(ctx, command).await,
"bet" => self.bet(ctx, command).await,
"leaderboard" => self.leadeboard(ctx, command).await,
"reset" =... | Rust | 0 |
"""Poor man's exchanges for routing messages."""
import logging
import re
from collections import defaultdict
from typing import Callable
from .._topics import DEFAULT_TOPIC
from ._message import GuidanceMessage
logger = logging.getLogger(__name__)
WILDCARD_PATTERN = r".*"
class TopicExchange:
"""Queue-less t... | Python | 1 |
import ismrmrd
import xml.etree.ElementTree as ET
XML = """<?xml version="1.0"?>
<ismrmrdMeta>
<meta>
<name>pi</name>
<value>3.14159265</value>
</meta>
<meta>
<name>extra</name>
<value>Hello, World!</value>
</meta>
<meta>
<name>extra</name>
<value>654321</value>
</meta>
<meta>
... | Python | 1 |
from __future__ import annotations
from collections.abc import Sequence
import functools
import re
DECODE_DEFAULT_CHARS = ";/?:@&=+$,#"
DECODE_COMPONENT_CHARS = ""
decode_cache: dict[str, list[str]] = {}
def get_decode_cache(exclude: str) -> Sequence[str]:
if exclude in decode_cache:
return decode_cach... | Python | 1 |
# Crea un script que acepte un string de 5 caracteres y devuelva otro string con todos los caracteres
# duplicados. Si el input es ‘sbc56’, el output deberá ser ‘ssbbcc5566’
#solicitamos el texto en pantalla
texto= input(" Introduce una cadena de texto con 5 o más carecteres: ")
#Ahora vamos a verificar el contenido
... | Python | 1 |
@numba.jit(nopython=True)
def div_up(m, n):
return m // n + (m % n > 0)
| Python | 1 |
"lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "share", "examples"))
rmdir(self, os.path.join(self.package_folder, "share", "man"))
rmdir(self, os.path.join(self.package_folder, "var"))
def package_info(self):
self.cpp_info.components["mit-krb5"].set_property("pk... | Python | 1 |
: f32,
pub speed_down: f32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tm_image_handle_t {
_unused: [u8; 0],
}
pub const TM_TT_PROP__LIGHT_COMPONENT__TYPE: ::std::os::raw::c_int = 0;
pub const TM_TT_PROP__LIGHT_COMPONENT__COLOR: ::std::os::raw::c_int = 1;
pub const TM_TT_PROP__LIGHT_COMPONENT__INT... | Rust | 0 |
enised_type_check_tokenised_batch(depccg_parser, tokenised_sentence):
with pytest.raises(ValueError):
_=depccg_parser.sentences2diagrams([tokenised_sentence], tokenised=False)
def test_tokenised_type_check_untokenised_sentence_s2t(depccg_parser, sentence):
with pytest.raises(ValueError):
_=dep... | Python | 1 |
import linuxcnc
import emccanon
import interpreter
def init_stdglue(self):
pass
def io_output_M62(self,**words):
self.execute("M62 P0")
return interpreter.INTERP_OK
def io_output_M63(self,**words):
self.execute("M63 P0")
return interpreter.INTERP_OK
def io_output_M64(self,**words):
self.e... | Python | 1 |
import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('localhost', 12345))
prompt = client_socket.recv(1024).decode()
print(prompt)
password = "pass"
client_socket.send(password.encode())
response = client_socket.recv(1024).decode()
print(response)
if "Access granted... | Python | 1 |
from aiogram import types
from aiogram.dispatcher import FSMContext
from keyboards.default import main_menu
from services.affiliate import generate_affiliate_link
async def cmd_start(message: types.Message, state: FSMContext):
await state.finish()
welcome_text = """
🛍️ أهلا بك في بوت التخفيضات من علي إ... | Python | 1 |
ustInterner<'tcx>>,
) -> Arc<chalk_solve::rust_ir::OpaqueTyDatum<RustInterner<'tcx>>> {
// FIXME(chalk): actually lower opaque ty
let value = chalk_solve::rust_ir::OpaqueTyDatumBound {
bounds: chalk_ir::Binders::new(chalk_ir::VariableKinds::new(&self.interner), vec![]),
};
... | Rust | 0 |
_GATE, bufferd_port));
} else {
self.msgs.push(msg);
}
}
//if triggered send message from queue to the port on OUT_GATE
//else remember readiness in receive_ready
TRIGG_GATE => {
if !self.msgs.is_empty()... | Rust | 0 |
from typing import List, Optional
from infrastucture.repositories.brigada_repository import BrigadaRepository
from domain.entities.brigada import Brigada
class BrigadaService:
def __init__(self, brigada_repo: BrigadaRepository):
self.brigada_repo = brigada_repo
async def delete_brigada(self, brigada_... | Python | 1 |
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from isaaclab.utils import configclass
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpo... | Python | 1 |
mul64(y2, h2);
let mut z0h = bmul64(y0r, h0r);
let mut z1h = bmul64(y1r, h1r);
let mut z2h = bmul64(y2r, h2r);
z2 ^= z0 ^ z1;
z2h ^= z0h ^ z1h;
z0h = rev64(z0h) >> 1;
z1h = rev64(z1h) >> 1;
z2h = rev64(z2h) >> 1;
let v0 = z0;
let mut v1 =... | Rust | 0 |
dVd = (beta * dfgche1_dVd + fgche1 * dbeta_dVd - gche * dfgche2_dVd) / fgche2;
let dgche_dVb = (beta * dfgche1_dVb + fgche1 * dbeta_dVb - gche * dfgche2_dVb) / fgche2;
T0 = 1.0 + gche * Rds;
let Idl = gche / T0;
T1 = (1.0 - Idl * Rds) / T0;
T2 = Idl * Idl;
let dIdl_dVg =... | Rust | 0 |
#!/usr/bin/python3
"""
Script that takes in a letter and sends a POST request
with the letter as a parameter. The letter must be sent in the variable q.
If no argument is given, set q="".
If the response body is properly JSON formatted and not empty
Otherwise:
Display "Not a valid JSON" if the JSON is invalid.
Display ... | Python | 1 |
b user_id: Uuid,
}
#[derive(Queryable)]
pub struct PasswordReset {
pub token: String,
pub user_id: Uuid,
pub created_at: DateTime<Utc>,
}
impl From<PasswordReset> for domain::password_resets::PasswordResetTokenData {
fn from(reset: PasswordReset) -> Self {
Self {
user_id: reset.use... | 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 |
}
}
}
})
}
pub(crate) async fn wait_for_stop(
handles: Vec<JoinHandle<()>>,
services: Vec<ServiceAny>,
shutdown_timeout: Duration,
is_graceful_shutdown: &AtomicBool,
) {
info!("Started {}", worker_name());
let shutdown_handle = ShutdownHandle::new(shutdown_... | Rust | 0 |
actor_prime(padded_c_prime, h_idx, w_idx)
c_doubleprime_i = self.extractor_doubleprime(padded_y1_hat, h_idx, w_idx)
concatenated_c_i = np.concatenate([c_doubleprime_i, c_prime_i], axis=1)
pred_mean, pred_sigma = self.sess.run([self.pred_mean, self.pred_sigma],
... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data modules for Command Manager plugin
""" | Python | 1 |
obstacle_map_depths.append(src_data)
# Value map output is a list of (rgb, depth, tf_camera_to_episodic, min_depth,
# max_depth, fov) for each of the cameras in VALUE_MAP_CAMS
value_map_rgbd = []
value_cam_srcs: List[str] = VALUE_MAP_CAMS + ["hand_depth_estimated"]
# RGB ca... | Python | 1 |
-lang.org/std/primitive.u64.html)
///
/// # Arguments
///
/// * `a` - Any [`i64`](https://doc.rust-lang.org/std/primitive.i64.html) number
///
/// # Examples
///
/// ```
/// use rustils::parse::ulong::i64_to_u64_res;
/// use rustils::error::ParseError::InvalidNumber;
///
/// assert_eq!(i64_to_u64_res(0_i64), Ok(0_u64))... | Rust | 0 |
t)]
pub(crate) struct FixedSize2;
impl ColumnSize for FixedSize2 {
fn size(&self) -> u8 { 2 }
}
#[derive(Copy, Clone, Default)]
pub(crate) struct FixedSize4;
impl ColumnSize for FixedSize4 {
fn size(&self) -> u8 { 4 }
}
#[derive(Copy, Clone, Default)]
pub(crate) struct FixedSize8;
impl ColumnSize for FixedSiz... | Rust | 0 |
Trunc,
F64x2Nearest,
F32x4Abs,
F32x4Neg,
F32x4Sqrt,
F32x4Add,
F32x4Sub,
F32x4Mul,
F32x4Div,
F32x4Min,
F32x4Max,
F32x4PMin,
F32x4PMax,
F64x2Abs,
F64x2Neg,
F64x2Sqrt,
F64x2Add,
F64x2Sub,
F64x2Mul,
F64x2Div,
F64x2Min,
F64x2Max,
F64x2PM... | Rust | 0 |
trato', 'Carpeta física']],
on='Contrato',
how='left',
suffixes=('', '_user')
)
# 6) Rellenar y limpiar sufijo
df_carpeta['Carpeta física'] = df_carpeta['Carpeta física_user'].fillna('')
df_carpeta.drop(columns=['Carpeta física_user'], inplace=True)
... | Python | 1 |
<S: AlertPolicyService + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
let mut builder = ::grpcio::ServiceBuilder::new();
let mut instance = s.clone();
builder = builder.add_unary_handler(&METHOD_ALERT_POLICY_SERVICE_LIST_ALERT_POLICIES, move |ctx, req, resp| {
instance.list_alert_policies(ct... | Rust | 0 |
} else if let Some(explain) = ExplainStatement::parse_lookahead(tokens)? {
Ok(Statement::Explain(explain))
} else if let Some(update) = UpdateStatement::parse_lookahead(tokens)? {
Ok(Statement::Update(update))
} else {
Err(tokens.expecting("SELECT, INSERT, CRE... | Rust | 0 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service
from selenium.webdriv... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.