text string | label_name string | labels int64 |
|---|---|---|
v_arg_large >= n_cand_buf)] - n_cand_buf
arg_buffer = sv_arg_small[nonzero_indices(sv_arg_small < n_cand_buf)]
ind_buffer = cand_ind[arg_buffer]
buffer.n_seen_so_far += n_cur
# perform overwrite op
y_upt = cur_y[ind_cur]
x_upt = cur_x[ind_cur]
ClassBalancedRando... | Python | 1 |
, 115, 104, 112], // base cell 107 pentagon
bc7![108, 100, 95, 92, 118, 114, 109], // base cell 108
bc7![109, 108, 93, 95, 117, 118, 106], // base cell 109
bc7![110, 98, 104, 96, 119, 111, 115], // base cell 110
bc7![111, 97, 110, 98, 116, 103, 119], // base cell 111
bc7![112, 107, 102, 10... | Rust | 0 |
ackBox::new(),
}
}
}
impl Default for RwLockStorage {
fn default() -> Self {
Self::new()
}
}
type MutexBlackBox = BlackBox<
(dyn for<'a> Unit<
'a,
Borrowed = MappedMutexGuard<'a, dyn Any>,
MutBorrowed = MappedMutexGuard<'a, dyn Any>,
> + Send
+ Sync... | Rust | 0 |
f.write(b"\x7fELF\x02\x01\x01\x00\x00\x00")
path = python_reported_file("binary")
msg = (
re.escape(f"Couldn't run '{path}' as Python code: ")
+ r"(ValueError|SyntaxError): source code string cannot contain null bytes"
)
with pytest.raises(Exception, match=ms... | Python | 1 |
"""
A Franka Panda reaches for 10 randomly places targets.
This script contains examples of:
- Linear (IK) paths.
- Scene manipulation (creating an object and moving it).
"""
from os.path import dirname, join, abspath
from pyrep import PyRep
from pyrep.robots.arms.panda import Panda
from pyrep.objects.shape imp... | Python | 1 |
True
return
else:
if tunnel_chain.tunnel_urls:
tunnel_url = tunnel_chain.tunnel_urls[-1]
tun_conn.update_tunnel_address(
(tunnel_url.host, t... | Python | 1 |
am_empty)
context.view_layer.objects.active = cam_empty
cam_constraint.target = cam_empty
stepsize = 360.0 / args.views
rotation_mode = 'XYZ'
print()
model_identifier = "-".join(args.obj.split("/")[-4:-2])
folder, file = model_identifier.split("-")[0], model_identifier.split("-")[1]
fp = os.path.join(os.path.abspath(... | Python | 1 |
::Value, this: &Self) {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ButtonsType {
None,
Ok,
Close,
Cancel,
YesNo,
OkCancel,
#[doc(hidden)]
_... | Rust | 0 |
# Copyright (C) 2018 David Cattermole.
#
# This file is part of mmSolver.
#
# mmSolver is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ve... | Python | 1 |
;
}
debug!("symlinking {:?} -> {:?}", source, dest);
unix::fs::symlink(&source, &dest)?;
}
for dir in &config.directories {
let dir = dir
.strip_prefix("/")
.map(|p| Path::new("/new_root").join(p))
.map_err(|e| Error::new(ErrorKind::Other, e)... | Rust | 0 |
) => ({ /* compiler built-in */ });
($cond:expr, $($args:tt)*) => ({ /* compiler built-in */ })
}
fn main() {
assert!(true, "{} {:?}", arg1(a, b, c), arg2);
}
"#,
expect![[r##"
#[rustc_builtin_macro]
macro_rules! assert {
($cond:expr) => ({ /* compiler built-in */ });
($cond:expr, $($args:tt)*)... | Rust | 0 |
from flask import Flask, request
from telegram import Update, Bot
from telegram.ext import Updater, CommandHandler, CallbackContext, MessageHandler
import requests
import uuid
TOKEN = "7137673728:AAE85wL1RBYskkrlCZaIzhEbgKmiEBiefDI"
NOWPAYMENT_API_KEY = "D37DNS7-VH1MPNS-QGM99PV-SQZQG2A"
NOWPAYMENT_TID = "2eb7650e-03a0... | Python | 1 |
from common.utilities.util_menu_access import MenuAccess
import feffery_antd_components as fac
import feffery_utils_components as fuc
from common.utilities.util_logger import Log
from dash import html
from dash_components import Card
import dash_callback.application.message_.announcement_c # noqa: F401
from i18n impor... | Python | 1 |
Aranges,
/// The `.debug_frame` section.
DebugFrame,
/// The `.eh_frame` section.
EhFrame,
/// The `.eh_frame_hdr` section.
EhFrameHdr,
/// The `.debug_info` section.
DebugInfo,
/// The `.debug_line` section.
DebugLine,
/// The `.debug_line_str` section.
DebugLineStr,
... | Rust | 0 |
pp};
use std::str::from_utf8;
use server::{configure_app, create_database_pool};
#[actix_rt::test]
async fn unrevised_entities_query() {
let pool = create_database_pool().await.unwrap();
let app = configure_app(App::new(), pool);
let app = test::init_service(app).await;
... | Rust | 0 |
rId = String;
pub type ParameterRef = Arc<dyn PluginParameterLike>;
struct ParameterStoreInner {
parameters: HashMap<ParameterId, ParameterRef>,
parameter_ids: Vec<ParameterId>,
}
use std::ops::Mul;
/**
* @brief A RGB color
*/
#[derive(Clone, Copy)]
pub struct Color {
pub r: f32,
pub g: f32,
pub... | Rust | 0 |
}
}
/// Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters.
///
/// # Arguments
///
/// - `args` specifies the commandline arguments. The first argument is the program name.
///
/// - `envs` specifies the environment varia... | Rust | 0 |
from contextlib import contextmanager
from typing import Union, Optional, Any
import numpy as np
import torch
from pytorch_toolbelt.utils import transfer_weights
from torch import nn
from torch.types import Device
def load_from_lighting(
model: nn.Module, checkpoint_path: str, map_location: Optional[Union[int, s... | Python | 1 |
let input = mem::ManuallyDrop::new(input);
for raw in input.iter() {
let cstr = ffi::CStr::from_ptr(*raw).to_str().expect("not a valid UTF-8");
if cstr == "en-US" {
*status = LookupStatus::Unavailable as i8;
return std::ptr::null::<FakeLookup>();
}
}
Box:... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import valkey
from dynaconf import Dynaconf
# Configuration
settings = Dynaconf(settings_files=["../config/settings.yaml"])
valkey_host = settings.get("valkey.host", "127.0.0.1")
valkey_port = settings.get("valkey.port", 6379)
valkey_db = settings.get("valkey.db", 8)
c... | Python | 1 |
BO::read_i32(data))
}
}
def! {
type = u64;
read_u64;
try_read_u64;
read_u64_be;
try_read_u64_be;
read_u64_le;
try_read_u64_le;
|self| {
let data = self.try_read_slice(8)?;
Ok(BO::read_u64(data))
}
}
def! {
type = i64;
read_i64;
try_read_i64;
read_i64_be;
try_read_i64_be;
rea... | Rust | 0 |
# auto.mouse_drag(block_position[0], block_position[1], drag_time=1, dy=500)
# list_block = True
# continue
if next_gift is False:
break
loop_count -= 1
if loop_count < 20:
auto.model = "normal"
if ... | Python | 1 |
Replace,
Input::KeyRestart,
Input::KeyResume,
Input::KeySave,
Input::KeySBeg,
Input::KeySCancel,
Input::KeySCommand,
Input::KeySCopy,
Input::KeySCreate,
Input::KeySDC,
Input::KeySDL,
Input::KeySelect,
Input::KeySEnd,
Input::KeySEOL,
Input::KeySExit,
Input::Key... | Rust | 0 |
inline(always)]
pub unsafe fn replace_unchecked<T: 'a>(&mut self, handle: Handle<T>, val: T) -> T {
mem::replace(self.get_unchecked_mut(handle), val)
}
/// Replaces the object referenced by the given [`Handle`] with the given value.
///
/// # Panics
///
/// This function panics if `... | Rust | 0 |
in 0..-power {
result = self.from_cubic_meters(&result);
}
result
} else if power > 0 {
let mut result = value.clone();
for _ in 0..power {
result = self.to_cubic_meters(&result);
}
result
} else {
value.clone()
}
}
fn from_cubic_meters_with_power(&self, value: &Number, power: i32... | Rust | 0 |
coverage);
let result = if !result.is_empty() {
mocranges_to_array2(result)
} else {
// TODO: try without this condition
Array::zeros((1, 0))
};
Ok(result.into_pyarray(py).to_owned())
}
/// Contract the spatial coverage removing an internal ... | Rust | 0 |
_id(id).label().to_string();
let is_failure = if exit.success() {
exit_success = exit_success + 1;
false
} else {
exit_failure = exit_failure + 1;
true
};
done = done + 1;
graph_iter.ma... | Rust | 0 |
# Given an input file, generate a ccsds.bin file that encodes the bytestream
from ccsds.model.SpacePacket import SpacePacketProtocolEncoder, SpacePacketType, SpacePacketProtocolDecoder
from ccsds.model.TCChannelCoding import CLTUEncoder, CLTUDecoder
from ccsds.model.TCDataLinkPacket import TCDataLinkProtocolEncoder, Co... | Python | 1 |
rcp14ps_zmm_k1z_zmmm512b32 = 3057,
/// `VRCP14PD xmm1 {k1}{z}, xmm2/m128/m64bcst`
///
/// `EVEX.128.66.0F38.W1 4C /r`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vrcp14pd_xmm_k1z_xmmm128b64 = 3058,
/// `VRCP14PD ymm1 {k1}{z}, ymm2/m256/m64bcst`
///
/// `EVEX.256.66.0F38.W1 4C /r`
///
/// `AV... | Rust | 0 |
"Bit 6 - General call enable"]
#[inline(always)]
pub fn engc(&mut self) -> ENGC_W {
ENGC_W { w: self }
}
#[doc = "Bit 5 - PEC enable"]
#[inline(always)]
pub fn enpec(&mut self) -> ENPEC_W {
ENPEC_W { w: self }
}
#[doc = "Bit 4 - ARP enable"]
#[inline(always)]
pub... | Rust | 0 |
ub const NDIS_RECEIVE_FILTER_FIELD_PARAMETERS_REVISION_1: u32 = 1u32;
#[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"]
pub const NDIS_RECEIVE_FILTER_FIELD_PARAMETERS_REVISION_2: u32 = 2u32;
#[doc = "*Required features: 'Win32_NetworkManagement_Ndis'*"]
pub const NDIS_RECEIVE_FILTER_FLAGS_RESERVED: u32 = 1... | Rust | 0 |
]
)
else:
schema["partitions"] = {}
file_list.append(schema["location"] + "/*")
extra_kwargs = {}
if schema["delimiter"] != chr(1):
extra_kwargs["delimiter"] = schema["delimiter"]
if schema["fileType"] == "csv":
extra_kwargs["names"] = [
col_name
... | Python | 1 |
.build_global()
.unwrap();
let command: CommandTemplate = self.conn.query_row(
"SELECT command FROM tasks WHERE id = ?1",
params![&task_id],
|row| row.get(0),
)?;
let handle = Arc::new(Mutex::new(self));
for i in 0.. {
... | Rust | 0 |
#!/usr/bin/env python3
#Please establish an "auth.py" file in the same directory as this script with the "clientid" and "clientsec" variables defined.
#This script is intended to find users listed in Child CIDs. It was developed to help identify users that may need to be removed from the console, or don't belong, as mo... | Python | 1 |
b, 0x2f
/// ```
/// <https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#b64>
B64,
/// bcrypt encoding.
///
/// ```text
/// ./ [A-Z] [a-z] [0-9]
/// 0x2e-0x2f, 0x41-0x5a, 0x61-0x7a, 0x30-0x39
/// ```
Bcrypt,
/// `crypt(3)` encoding.
//... | Rust | 0 |
erializedUntaggedI32 {
value: *self as i32
}.into()
}
#[inline]
fn memory_required( &self ) -> usize {
(*self as i32).memory_required()
}
}
__js_serializable_boilerplate!( u16 );
impl JsSerializable for u32 {
#[inline]
fn into_js< 'a >( &'a self, _: &'a Preallocate... | Rust | 0 |
Ok(()) => (),
Err(err) => report_error!("Cannot synchronize packet decoder: {}", err),
};
println!("Start decoding packets");
loop {
let offset = match ipt_decoder.offset() {
Ok(offset) => offset,
Err(err) => report_error!("cannot tell offset: {}", err),
... | Rust | 0 |
(
abs(theta) > self.angle_threshold
or abs(p) > self.position_threshold
)
# 4. Рассчитываем "плотную" награду
if not done:
# Награда за удержание угла (cos(0)=1, cos(pi/6)=0.86)
reward_angle = np.cos(theta)
... | Python | 1 |
/// Support for using sled as a backing data storage for tables
#[cfg(all(feature = "sled-1", feature = "std"))]
#[cfg_attr(feature = "docs", doc(cfg(all(sled, std))))]
pub mod sled;
/// Contains relevant traits, structs, and more for extensions to tables
pub mod prelude;
#[doc = "Register `LSCH3_CONF0` reader"]
pub ... | Rust | 0 |
def log_tensorboard_graph(tb, model, imgsz=(640, 640)):
try:
p = next(model.parameters())
imgsz = (imgsz, imgsz) if isinstance(imgsz, int) else imgsz
im = torch.zeros((1, 3, *imgsz)).to(p.device).type_as(p)
with warnings.catch_warnings():
warnings.simplefilter('ignore')
... | Python | 1 |
percentage_complete_element.get_attribute("style")
percentage_complete_value = float(percentage_complete_text.split("width: ")[-1].replace("%;", ""))
print(f"Percentage Complete for Slot {i}: {percentage_complete_value}%")
except IndexError:
pr... | Python | 1 |
,
})
.flat_map(|x| x.nested)
.filter_map(|x| match x {
NestedMeta::Meta(m) => Some(m),
_ => None,
})
.find(|m| m.path().is_ident("default"));
defattr
.map(|meta| match meta {
Meta::NameValue(mnv) => {
if let Lit::St... | Rust | 0 |
'tcx>) -> BasicBlockRef {
debug!("get_landing_pad");
let bcx = fcx.build_new_block("cleanup_unwind");
let llpersonality = bcx.ccx.eh_personality();
bcx.set_personality_fn(llpersonality);
if base::wants_msvc_seh(fcx.ccx.sess()) {
let pad = bcx.cleanup_pad(None, &[]);
... | Rust | 0 |
days = int(input("Enter the number of days :"))
if days <= 0:
print("Charge wont applied")
elif days <= 5:
charge = days * 2
print(f"The total charge on {days} days lend is {charge}")
elif days >= 6 and days <= 10:
charge = days * 3
print(f"The total charge on {days} days lend is {charge}")
elif day... | Python | 1 |