text string | label_name string | labels int64 |
|---|---|---|
ns, indent=4), f'Added {serverid} to nickprotect'):
await ctx.send('Server added. Now wait for me to restart!')
@nickprotect.command()
async def remove(self, ctx, serverid=None):
'''Removes a guild from nick protect'''
with open('data/options.json') as f:
options = json.... | Python | 1 |
(), 0x2);
assert_eq!(mcu.get_register(1), 0x09);
}
#[test]
/// Tests simple add instruction which results in zero and carry flag on
fn test_add_flags() {
let mut mcu = McuFactory::create("attiny85");
mcu.set_register(1, 0x78);
mcu.set_register(2, 0x88);
// 0x78 + 0x88 = 0x100
let memory_data = ... | Rust | 0 |
print("Thank you for using Currency Converter!")
# Ask user if they want to continue
while True:
another_conversion = input("Do you want to continue? (yes/no): ").lower()
if another_conversion == 'yes' or another_conversion == 'no':
break
print("Invalid input! Please ... | Python | 1 |
import logging
import os
import sys
from typing import Any, Dict, List, Union
from unittest import TestCase, main
import pynvml
import torch
from rtp_llm.async_decoder_engine.async_model import AsyncModel
from rtp_llm.model_factory import ModelConfig, ModelFactory
from rtp_llm.pipeline.pipeline import Pipeline
from r... | Python | 1 |
ipt.serialize(&mut serialized_script)?;
Ok(serialized_script)
}
/// Compiles the module.
pub fn into_compiled_module(self, file_name: &str, code: &str) -> Result<CompiledModule> {
Ok(self.compile_mod(Symbol::from(file_name), code)?.0)
}
/// Compiles the module into a serialized for... | Rust | 0 |
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
# Theming for Qtile
from os import path
import subprocess
import json
from .path import qtile_path
def load_theme():
theme = "material-ocean" # dark-grey
config = path.join(qtile_path, "config.json")
if ... | Python | 1 |
import os
import pandas as pd
import torch.utils.data as data
from src.utils.dataset_utils import pil_loader
from .dataloader_mode import DataloaderMode
class TID2013Dataset(data.Dataset):
def __init__(self, cfg, index, transform, mode):
self.root = cfg.data.root
meta_info = pd.read_csv(cfg.dat... | Python | 1 |
ce.
Raises:
CalibrationError: If schedules were added outside of the :code:`__init__`
method. This will remain so until schedules can be serialized.
"""
if self._has_manually_added_schedule:
raise CalibrationError(
f"Config dictionaries fo... | Python | 1 |
earning_rate_step(optimizer, gamma):
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
decay = args.weight_decay
for param_group in optimizer.param_groups:
param_group['lr'] = gamma * param_group['lr'] * param_group['lr_mult']
param_group['weight_decay'] = decay * ... | Python | 1 |
_id = "ce84c2f150f72f1499d28b50c550c4c0";
let id: RndId = raw_id.parse().unwrap();
assert_eq!(id.to_string(), raw_id);
}
#[test]
fn from_string_upper() {
let raw_id = "CE84c2f150f72f1499D28b50c550c4c0";
let id: RndId = raw_id.parse().unwrap();
assert_eq!(id.to_string... | Rust | 0 |
`, `'\n'`) is detected.
///
/// The [`BufWriter`] struct wraps a writer and buffers its output.
/// But it only does this batched write when it goes out of scope, or when the
/// internal buffer is full. Sometimes, you'd prefer to write each line as it's
/// completed, rather than the entire buffer at once. Enter `Line... | Rust | 0 |
"""The number platform for rainbird."""
from __future__ import annotations
import logging
from pyrainbird.exceptions import RainbirdApiException, RainbirdDeviceBusyException
from homeassistant.components.number import NumberEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import U... | Python | 1 |
_alignment() {
use std::arch::asm;
info!("Entering stack alignment test with no args passed");
unsafe {
let _xmm: f32;
asm!("movaps {}, [esp]", lateout(xmm_reg) _xmm);
}
info!("Exiting stack alignment test");
}
#[allow(clippy::many_single_char_names)]
#[no_mangle]
pub extern "C" fn ... | Rust | 0 |
"""
Estimate time: 20min
Actual time: 30min
"""
from programming_language import ProgrammingLanguage
def main():
python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)... | Python | 1 |
erializer)?;
if ordinal == 0 {
return Err(serde::de::Error::custom("Ordinal must not be equal to 0"));
}
Ok(ordinal)
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[repr(transparent)]
pub struct Count(pub u32);
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[ser... | Rust | 0 |
assert ha_state.state == "0.4"
assert ha_state.attributes[ATTR_UNIT_OF_MEASUREMENT] == UnitOfTemperature.CELSIUS
await async_manipulate_test_data(
hass, hmip_device, "temperatureExternalDelta", -0.5
)
ha_state = hass.states.get(entity_id)
assert ha_state.state == "-0.5"
async def test_... | Python | 1 |
assert!(ArrayBuffer::is_view(&JsValue::from(x)));
}
#[test]
fn slice() {
let buf = ArrayBuffer::new(4);
let slice = buf.slice(2);
assert!(JsValue::from(slice).is_object());
}
#[test]
fn slice_with_end() {
let buf = ArrayBuffer::new(4);
let slice = buf.slice_with_end(1, 2);
assert!(JsValue:... | Rust | 0 |
from typing_extensions import override
import sys
from mbased.parser.ast import AndExpr, OrExpr, Expr, NotExpr, ParenExpr, Var, VarExpr
from mbased.parser.visitor import Visitor, RetVisitor
def run_pass(ast: Expr) -> Expr:
# Does analysis on the AST to find all symbols
v: SymbolSetBuilder = SymbolSetBuilder... | Python | 1 |
fill: true,
expand: true,
},
ProjectPoiContentsMsgRequestDisplayServerItem(ref item_info) =>
... | Rust | 0 |
<inEnumFile> is the file describing the intrinsics.")
print(" <outEnumFile> is the resulting file.")
return
if not os.path.isfile(inEnumFile):
print(inEnumFile + " is not an existing file.")
return
intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$")
intrEnd = re.compile("^ASTIntrEnd$")
intrValue = re.co... | Python | 1 |
new_test_ext().execute_with(|| {
let kitty_id = SubstrateKitties::kitties_owned(1)[0];
assert_noop!(
SubstrateKitties::transfer(Origin::signed(1), 1, kitty_id),
Error::<Test>::TransferToSelf
);
});
}
#[test]
fn transfer_non_owned_kitty_should_fail() {
new_test_ext().execute_with(|| {
let hash = Substra... | Rust | 0 |
x in pos], c, gstart, gend]
eqtl[eqtl[:,0]=="hs23", 0] = "hsX"
eqtl[eqtl[:,3]=="hs23", 3] = "hsX"
with open(filedir+"circos/eqtl_links.txt", "w") as o:
np.savetxt(o, eqtl, delimiter=" ", fmt="%s")
### write genes
if "eqtlMapSNPs" in geneshead:
genes = genes[np.where((genes[:,geneshead.index("ciMap")]=="Yes... | Python | 1 |
p = []
for n in range(4,1000):
a ='3' + '5' * n
while '25' in a or '355' in a or '555' in a:
if '25' in a:
a=a.replace('25','3',1)
if '355' in a:
a=a.replace('355','52',1)
if '555' in a:
a=a.replace('555','23',1)
summa=sum(map(int,list(a)))
if ... | Python | 1 |
self.as_raw(),
libc::SOL_SOCKET,
libc::SO_INCOMING_CPU,
cpu as c_int,
)
}
}
/// Get the value of the `SO_REUSEPORT` option on this socket.
///
/// For more information about this option, see [`set_reuse_port`].
///
/// [`se... | Rust | 0 |
if self.config.output_attentions or output_attentions:
outpos += 1
attention_probs = block_output[outpos]
all_attentions += (attention_probs,)
if output_router_tuple:
outpos += 1
router_tuple = block_output[outpos]
... | Python | 1 |
default() -> Self {
Self {
date_style: options::Style::Long,
time_style: options::Style::Long,
fractional_second_digits: 2,
day_period: None,
numbering_system: None,
calendar: None,
time_zone: None,
hour_cycle: None... | Rust | 0 |
interval: c_int = match interval.as_millis().try_into() {
Ok(v) => v,
Err(_e) => return false,
};
unsafe {
sys::LogiLedFlashSingleKey(key as _, p.0 as _, p.1 as _, p.2 as _, duration, interval)
}
}
/// Stops all current LED effects
pub fn stop_ef... | Rust | 0 |
variance caused by crystal tolerance and temperature.
//!
//! SRAM and timekeeping circuitry are powered from the back-up supply when
//! main power is lost, allowing the device to maintain accurate time and the
//! SRAM contents. The times when the device switches over to the back-up supply
//! and when primary power... | Rust | 0 |
colors.white),
('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONTSIZE', (0, 0), (-1, 0), 11),
('ALIGN', (0, 0), (-1, 0), 'CENTER'),
# Cores alternadas mais elegantes
('BACKGROUND', (0, 1), (-1, 1), colors.HexColor('#e6... | Python | 1 |
derBackend>,
_db_path: Option<PathBuf>,
_name: pos::TypeName,
) -> Option<pos::TypeName> {
todo!()
}
fn hh_rust_provider_backend_naming_funs_add(
_backend: Custom<ProviderBackend>,
_name: pos::FunName,
_pos: file_info::Pos,
) {
todo!()
}
... | Rust | 0 |
def focusSummary(self):
pass
#def updateSummary(self, widget=None):
# courseIndex = self.courseCombo.get_active()
# summary = (
# _("{courseName} Class").format(
# courseName=self.courseNames[courseIndex],
# ) +
# " (" +
# self.weekDayCombo.get_active_text() +
# ")"
# )
# self.summaryEntry.set_te... | Python | 1 |
1))
)
result = validator.validate(
{"cert_info": sample_cert}, "www.example.com", 443, *sensitive_dates
)
expected_warning_1 = (
'Certificate is due to expire on sensitive date "Day 17" (2025-11-17)'
)
expected_warning_2 = (
'Certificate is due to expire on sensiti... | Python | 1 |
!(kvm_s390_irq))
);
assert_eq!(
::std::mem::align_of::<kvm_s390_irq>(),
8usize,
concat!("Alignment of ", stringify!(kvm_s390_irq))
);
}
impl Default for kvm_s390_irq {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy,... | Rust | 0 |
>,
{
#[inline]
fn from(num: T) -> Self {
BlockNumber::Number(num.into())
}
}
impl Serialize for BlockNumber {
#[inline]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
match *self {
BlockNumber::Number(ref x) => {
let mut s = ArrayString::... | Rust | 0 |
.0)
}
}
// ==== "trait alias" for types that are HttpTryFrom and have Debug Errors ====
pub trait HttpTryInto<T> {
type Error: fmt::Debug;
fn try_into(self) -> Result<T, Self::Error>;
}
impl<T, U> HttpTryInto<T> for U
where
T: HttpTryFrom<U>,
T::Error: fmt::Debug,
{
type Error = T::Error;
... | Rust | 0 |
te,
&privTemplate,
res.unwrap_err()
);
let (pubOh, privOh) = res.unwrap();
println!("Private Key Object Handle: {}", privOh);
println!("Public Key Object Handle: {}", pubOh);
}
fn fixture_token_and_secret_keys(
) -> Result<(Ctx, CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_OBJECT_HANDLE), Error> {
let (ct... | Rust | 0 |
import logging
from ceph_deploy.util.system import disable_service, stop_service
from ceph_deploy.lib import remoto
SYSTEMD_UNITS = [
'ceph-mds.target',
'ceph-mon.target',
'ceph-osd.target',
'ceph-radosgw.target',
'ceph-fuse.target',
'ceph-mgr.target',
'ceph-rbd-mirror.target',
'ceph.... | Python | 1 |
ransaction status on the fly
fn mock_transaction_status(count: usize) -> Vec<TransactionStatus> {
let mut statuses = vec![];
// generate count + 1 status to mock the block metadata txn in mempool proxy
for _ in 0..=count {
let random_status = match rand::thread_rng().gen_range(0..1000) {
... | Rust | 0 |
er u64::MAX or total_memory(), limit to
// the latter to avoid spurious mismatches.
let target = knob.nr_bytes(is_limit).min(total_memory() as u64);
v = v.min(total_memory() as u64);
if target == v || (target > 0 && ((v as f64 - target as f64) / target as f64).abs() < 0.1) {
... | Rust | 0 |
from pandas import (
DataFrame,
Index,
date_range,
)
import pandas._testing as tm
class TestToFrame:
def test_to_frame_datetime_tz(self):
# GH#25809
idx = date_range(start="2019-01-01", end="2019-01-30", freq="D", tz="UTC")
result = idx.to_frame()
expected = DataFrame(i... | Python | 1 |
Lambda function.
/// * `[-d DEFAULT-REGION]` - The region in which the client is created.
/// If not supplied, uses the value of the **AWS_DEFAULT_REGION** environment variable.
/// If the environment variable is not set, defaults to **us-west-2**.
/// * `[-v]` - Whether to display additional information.
#[toki... | Rust | 0 |
import pandas as pd
from rdflib import Graph, Literal, Namespace, RDF, URIRef
from rdflib.namespace import XSD
import sys
# admissionDx
def main(inputpath):
g = Graph()
ex = Namespace("http://schema.org/eicu")
eicu = Namespace("http://www.eicu.org/ontologies#")
g.bind("ex", ex)
g.bind("eicu", eicu)... | Python | 1 |
import time
import random
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from functions import random_sleep
def make_donat(driver):
# -------------------------- ДОНАТ ВАЛИДАТОРУ -----------------... | Python | 1 |
let mut previous_hc_name: Option<&str> = None;
match hc.result {
HealthCheckResult::Ok(ref checks) => {
if let Some(resource) = checks.get(GLOBAL_NAME) {
let row = make_row(&hc.name, &previous_hc_name, GLOBAL_NAME, resource);
... | Rust | 0 |
)]
/// An LircMode2 Link
pub struct LircLink {
prog_fd: RawFd,
target_fd: RawFd,
}
impl LircLink {
pub(crate) fn new(prog_fd: RawFd, target_fd: RawFd) -> LircLink {
LircLink {
prog_fd,
target_fd: unsafe { dup(target_fd) },
}
}
/// Get ProgramInfo from this l... | Rust | 0 |
response
mock_response = Mock()
mock_response.status_code = 200
mock_response.json.return_value = mock_response_data
# Mock the client
mock_client = Mock()
mock_client.post.return_value = mock_response
model.client = mock_client
completion = model.chat_complete(messages)
asser... | Python | 1 |
:param _MaxCapacity: 图片库可容纳的最大图片特征条数,一张图片对应一条图片特征数据,不支持修改。
单个图片库容量最大可达亿级,达到容量限制后继续创建图片将会报错。
注意,包月计费下支持绑定的最小库容量为500万。
:type MaxCapacity: int
:param _Brief: 图库简介。
:type Brief: str
:param _MaxQps: 访问限制默认为10qps,如需扩容请联系[在线客服](https://cloud.tencent.com/online-service)申请。
:type MaxQ... | Python | 1 |
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', lambda *args: True),
('config_fc', lambda... | Python | 1 |
entType::Noteoff => { sink.send(SeqMsg::NoteOff(event.get_data().unwrap())).unwrap(); }
EventType::Controller => { sink.send(SeqMsg::Ctrl(event.get_data().unwrap())).unwrap(); }
EventType::Pitchbend => { sink.send(SeqMsg::Pitch(event.get_data().unwrap())).unwrap(); }
_ ... | Rust | 0 |
import re
import pytz
from typing import NamedTuple
from transliterate import translit
from datetime import datetime, timedelta
# creating a namedtuple class for routes
class Route(NamedTuple):
id: str
status: int
number: str
# creating a namedtuple class for buses
class Bus(NamedTuple):
number: str
... | Python | 1 |
(r#"삼일절"#)?, |_| {
helpers::month_day(3, 1)
});
b.rule_1_terminal("Children's Day", b.reg(r#"어린이날"#)?, |_| {
helpers::month_day(5, 5)
});
b.rule_1_terminal("Memorial Day", b.reg(r#"현충일"#)?, |_| {
helpers::month_day(6, 6)
});
b.rule_1_terminal("Constitution Day", b.reg(r#"... | Rust | 0 |
_graphics::fonts::Font6x8;
//! use embedded_graphics::pixelcolor::Rgb565;
//! use embedded_graphics::prelude::*;
//! use embedded_graphics::egtext;
//! # use embedded_graphics::mock_display::MockDisplay;
//! # let mut display = MockDisplay::default();
//!
//! let value = 12.34567;
//!
//! // Create a fixed buffer of le... | Rust | 0 |
from .node import app, get_nodes, sync_all
from .sync import Sync
__all__ = ["app", "get_nodes", "sync_all", "Sync"]
| Python | 1 |
ost-in-deep-space-understanding-quaternions/
:param x: quaternion x imaginary part
-> float
:param y: quaternion y imaginary part
-> float
:param z: quaternion z imaginary part
-> float
:param w: quaternion real part
-> float
... | Python | 1 |
await self.bot.update_cash(match, reduce=True)
self.bot.gain_or_lose-=match
self.turns_lost+=1
await self.bot.log(f"lost {match} in slots, net profit - {self.bot.gain_or_lose}", "#ffafaf")
await self.start_slots()
... | Python | 1 |
get()?;
self.thread_pool.spawn({
let manager = manager.clone();
let num_loaded_files = num_loaded_files.clone();
let embedding_holder = embedding_holder.clone();
move || {
let closure = || -> Result<(), EmbeddingModelManage... | Rust | 0 |
nd(messages)
st.session_state.messages.append({'role':'model',
'parts':[answer.text]})
st.write(bot_template.replace(
"{{MSG}}", answer.text), unsafe_allow_html=True)
st.write(user_t... | Python | 1 |
ments.
fn override_config(&self, config: MinerConfig) -> Result<MinerConfig, FrameworkError> {
Ok(config)
}
}
<reponame>LeoMcA/dino-park-fossil<gh_stars>0
use crate::send::sender::change_display_level;
use crate::send::sender::check_resize_store_data_uri;
use crate::send::sender::check_resize_store_inte... | Rust | 0 |
RL environment variable"));
diesel::sql_query(format!(
include_str!("raw/cast_query.sql"),
job=types::CastJob::Writer,
term=term,
)).load::<models::Director>(&conn).expect("Error executing query")
}
pub fn artists_query(term: &str) -> Vec<models::Artist> {
let conn = connect(&env::... | Rust | 0 |
.warning(
f"Shape changed after operation! Old shape: {self.shape}, new "
f"shape: {processed.shape}; Cannot cast to Signal class, "
"returing as `xr.DataArray`"
)
return processed
class VoltageSignal(Signal):
name = "Population mean membrane... | Python | 1 |
import odoo
from odoo.http import OpenERPSession
from odoo.addons.base_sparse_field.models.fields import monkey_patch
from odoo.addons.saas_base.exceptions import SuspendedDBException
@monkey_patch(OpenERPSession)
def check_security(self):
with odoo.registry(self.db).cursor() as cr:
uid = self.uid
... | Python | 1 |
_transform_block(face_shape, rotation, translation)
face_color = self.Illumination_layer(face_texture, face_norm_r, gamma)
face_lms_t = self.get_lms(face_shape_t, self.kp_inds)
lms = self.Projection_block(face_lms_t)
lms = torch.stack([lms[:, :, 0], self.img_size-lms[:, :, 1]], dim=2)
... | Python | 1 |
r) Custom mesh ID.",
)
parser.add_argument(
"-f",
"--force",
action="store_true",
help="Force polarRouteServer to create a new route even if one is already available.",
)
parser.add_argument(
"-o",
"--output",
nargs="?",
type=argparse.FileT... | Python | 1 |
ht may apply; resale is prohibited; no warranties given of any kind. All usage is subject to your acceptance of the License Agreement available at: http://openexchangerates.org/license/",
"timestamp": 1361055600,
"base": "USD",
"rates": {
"AED": 3.672869,
"AFN": 51.769999,
"ALL": 104.798751,
"AMD"... | Rust | 0 |
ssion.");
static ref RORL_TO_W_UPPER: Regex = Regex::new(r"(?:R|L)").expect("Failed to build regular expression.");
static ref RORL_TO_W_LOWER: Regex = Regex::new(r"(?:r|l)").expect("Failed to build regular expression.");
static ref LL_TO_WW: Regex = Regex::new(r"ll").expect("Failed to build regular express... | Rust | 0 |
[s]")
if 0:
x1 = np.array(ch1[plot_i], dtype=np.float)
x2 = np.array(ch2[plot_i], dtype=np.float)
x1 *= w/(fir_gain*2**(adc_bits-1))
x2 *= w/(fir_gain*2**(adc_bits-1))
fx1 = 2*np.fft.rfft(x1)/(len(x1))
fx2 = 2*np.fft.rfft(x2)/(len(x2))
#fx1 = r4_normalize(fx1, d)
fx1 = 20*np.log10(np.... | Python | 1 |
::<Vec<Vec<char>>>();
print_map(&data);
println!();
println!("{}", count_adjacent(&data, (0, 0), 'L'));
let mut m = data;
let mut i = 0;
let mut did_change = true;
while did_change {
let nm = run(&m);
i += 1;
println!("Gen {}", i);
println!();
pri... | Rust | 0 |
from_nanos(398_341_224_489), header.total_duration);
} else {
assert_eq!(HeaderSource::MpegFrameHeaders, header.source);
assert_eq!(Duration::from_nanos(398_341_209_552), header.total_duration);
}
}
"mp3-duration/ID3v1.mp3" => {
assert_... | Rust | 0 |
else:
times = 1
try:
fmt += C_TO_STRUCT[typ] * times
names += [name] * times
expected += C_SIZES[typ] * times
except KeyError:
continue
return names, fmt
# Make these be compiled on loading module
HEADER_NAMES, HEADER_FORMAT = make_f... | Python | 1 |
#!/usr/bin/env python
import sys,re
# given a java backtrace file ("hs_err_pidNNN.log") and a symbol
# file (produced by make nativelibs/libhzee.sym), print a decoded
# backtrace for EE code.
class Decoder:
"Decode native symbols in a java backtrace file"
def loadSymbols(self, symfile):
# read the .... | Python | 1 |
more than the
# min_gain_to_split constraint.
current_lower_bound, current_upper_bound = -10, np.inf
value = compute_node_value(
sum_gradients,
sum_hessians,
current_lower_bound,
current_upper_bound,
l2_regularization,
)
assert value == -10
split_info = sp... | Python | 1 |
#first we will import necessary modules and libraries
import requests
import pandas as pd
import yfinance as yf
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
# by this Function we can scrap data from yahoo finance webpage
def scrape_yahoo_finance(stock_symbol):
url = f"https://finance.yahoo.com/quo... | Python | 1 |
pickup_datetime", DataType::Utf8, true),
Field::new("tpep_dropoff_datetime", DataType::Utf8, true),
Field::new("passenger_count", DataType::Int32, true),
Field::new("trip_distance", DataType::Utf8, true),
Field::new("RatecodeID", DataType::Utf8, true),
Field::new("store_and_fwd_f... | Rust | 0 |
.len() as i32,
if align_corners { 1 } else { 0 },
scales_h.unwrap_or(std::f64::NAN),
scales_h.is_none() as i8,
scales_w.unwrap_or(std::f64::NAN),
scales_w.is_none() as i8
));
Ok(Tensor { c_tensor: c_tensors[0] })
}
pub fn f_upsample_bi... | Rust | 0 |
rld_size > 1
# logger
# init log dir
cfg.task_name = args.cfg.split('.')[-2].split('/')[-2] # task/dataset name, \eg s3dis, modelnet40_cls
cfg.cfg_basename = args.cfg.split('.')[-2].split('/')[-1] # cfg_basename, \eg pointnext-xl
tags = [
cfg.task_name, # task name (the folder of name un... | Python | 1 |
n abnormal",
0x0004: "StrPID config Warning",
0x0008: "Fail to read EEPROM",
0x0010: "DSP and COM firmware unmatch",
0x0020: "Fail to write EEPROM",
0x0040: "SPD abnormal",
0x0080: "GND and N connect abnormal",
0x0100: "PV1 or PV2 circuit short",
0x0200: "PV1 or PV2 boost driver broken",... | Python | 1 |
the mesh graph. If both
/// ``num_mesh_nodes`` and ``mesh_weights`` are set ``num_mesh_nodes`` will
/// be ignored and ``mesh_weights`` will be used.
/// :param list path_weights: A list of node weights for the path. If both
/// ``num_path_nodes`` and ``path_weights`` are set ``num_path_nodes`` will
/// ... | Rust | 0 |
{from_protobuf_error, NiaServerError, NiaServerResult};
use crate::protocol::Serializable;
use protobuf::Message;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ActionMouseAbsoluteMove {
x: i32,
y: i32,
}
impl ActionMouseAbsoluteMove {
pub fn new(x: i32, y: i32) -> ActionMouseAbsoluteMove {
Act... | Rust | 0 |
(self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
self.w
}
}
#[doc = "Field `pf8k_rmeb` reader - Set this bit to disable SRAM timing adjust"]
pub struct PF8K_RMEB_R(crate::FieldReader<bool, bool>);
impl PF8K_RMEB_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
... | Rust | 0 |
ment")[0].add_source(
"Book of the Fallen", 149
)
toys = Instrument.objects.get_or_create(name="Toys")[0]
transgression = Instrument.objects.get_or_create(name="Transgression")[0]
tricks = Instrument.objects.get_or_create(name="Tricks and illusions")[0]
trolling = Instrument.objects.get_or_create(name="Trolling and... | Python | 1 |
fn natural_join_happy_path() {
let x = MetaVar::new("x");
let y = MetaVar::new("y");
let z = MetaVar::new("z");
let s1 = Source::new("foo", 2);
let s2 = Source::new("bar", 2);
let f1 = Plan::filter(
s1,
&[Element::Reference(x.clone()), Element::Reference(y.clone())],
)
... | Rust | 0 |
import click
from typing import (
Any,
)
from staking_deposit.key_handling.key_derivation.mnemonic import (
get_mnemonic,
reconstruct_mnemonic,
)
from staking_deposit.utils.click import (
captive_prompt_callback,
choice_prompt_func,
jit_option,
)
from staking_deposit.utils.constants import (
... | Python | 1 |
import numpy as np
import scipy
import scipy.io
from scipy.signal import butter
from scipy.sparse import spdiags
def _detrend(input_signal, lambda_value):
"""Detrend PPG signal."""
signal_length = input_signal.shape[0]
# observation matrix
H = np.identity(signal_length)
ones = np.ones(signal_length... | Python | 1 |
// but in an effort to have cross-platform reproducible streams just
// default this value to 255. I'm not sure that if we "correctly" set
// this it'd do anything anyway...
header[9] = operating_system.unwrap_or(255);
return header;
}
}
#[cfg(test)]
mod tests {
use std:... | Rust | 0 |
REVERSE COMMUNICATION)
// Distributed array to be used in the basic Arnoldi iteration
// for reverse communication. The user should not use WORKD
// as temporary workspace during the iteration. Upon termination
// WORKD(1:N) contains B*RESID(1:N).
let mut workd: ... | Rust | 0 |
XOf\
\xd2\x19U\x08\xb2\x92\xf5\xae\xc4DL\xb1\xedWq\xac\
\xe6\xa2\xb9\x149ce\x1bF:6\xad\xb5\xba\xf6\xfb\
\xf79\xa5:\xb3\x9cd\xa59M\xaehIIB1\
J\xd7^\xf7\xc3\xad\xb5\xd6\xf6WKK\xfae\xcf\xfc\
({}\x1e\xf3\xc0\x12[x+H\xd2\xbc: \x9a\
}\x17]\xd1\xfe\xd3\xe1\xf9~\xd0<\xf6\x9e\xd6\x1d|\
\xf9Z\x80\xb7v\x8c\xdcj\x83\xcc\x81n\x83$s... | Python | 1 |
.problem.create_variables([upd_var])[upd_var]
uvar.field.mappings0 = multiproc.get_dict('mappings0',
soft_set=True)
per.periodic_cache = multiproc.get_dict('periodic_cache',
... | Python | 1 |
# Copyright (c) 2010-2017 Samuel Abels
#
# 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, d... | Python | 1 |
} else {
quote_spanned! {f.span() => starlark::values::Freeze::freeze(self.#i, freezer)?,}
};
syn::Result::Ok(res)
})
.collect::<Result<Vec<_>, _>>()?;
quote! {
#name (
... | Rust | 0 |
r of the changes and group them accordingly. Take dependencies between changes into account, i.e. if a set of changes depends on another but not vice versa, the dependent changes should come later.
5. **Ensure Completeness:** Every single `Change ID` present in the input `git diff` must be assigned to exactly one prop... | Python | 1 |
\xcb\x10\xff\x0e\xafv\xdb\xec!\xc4K\
\xc6Jf\xf3\xa5\xda.7\xb7\xef\x87I\x85\xb8YX\xfc\xf2\x03\xa1\x8f4\xaf`\xab\xae]n\
\xcc,g1\x12EI\xc7\xd5\xe2\xfc\x8b\x9a\xde\xd5\xf3\x8f'\xcd\x08\x0fU\xc7\xee\xa85\
[>\x87]\x07\x82\x00\x13\xce\xf7\xc3/@\xef\x08v\x8f\x85\x87dm(1\... | Rust | 0 |
();
while b % 8 != 0 {
b = gen_b.next();
}
(a, b)
}
fn main() {
println!("part1 {}", day15(&mut Gen::new(116, 16807), &mut Gen::new(299, 48271), 40_000_000, part1));
println!("part2 {}", day15(&mut Gen::new(116, 16807), &mut Gen::new(299, 48271), 5_000_000, part2));
}<filename>examples/tra... | Rust | 0 |
let trigger_event = trigger_event.into();
let trigger_event = trigger_event.to_glib_none();
unsafe {
ffi::gtk_menu_popup_at_rect(self.to_glib_none().0, rect_window.to_glib_none().0, rect.to_glib_none().0, rect_anchor.to_glib(), menu_anchor.to_glib(), trigger_event.0);
}
}... | Rust | 0 |
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import EMEvaluator, RougeEvaluator, SquadEvaluator
from opencompass.datasets.leval import LEv... | Python | 1 |
g at them.
n18brush::highlight_tokens(
hex,
ctx,
&mut hex_iter,
|_addr, _tile, _token_space, token| {
map.try_token_name(token)
.map(|name| name == self.abbrev)
.unwrap_or(false)
},
(2... | Rust | 0 |
st MARK: &'static [u8] = b"0x000x000x000x000x000x000x000x01";
mod nix {
pub use nix::sys::eventfd::*;
}
pub struct Awakener {
io: Io,
}
impl Awakener {
pub fn new() -> io::Result<Awakener> {
Ok(Awakener {
io: Io::new(try!(eventfd())),
... | Rust | 0 |
ss of a generation
///
struct FitnessHistoryEntry {
pub min: TourFitness,
pub max: TourFitness,
pub avg: f32,
}
///
/// Storing the history after several generations
///
struct FitnessHistory {
pub history: Vec<FitnessHistoryEntry>,
}
///
/// Implementation of a trait to listen to events after each st... | Rust | 0 |
from pysisyphus.helpers import geom_loader
from pysisyphus.intcoords.setup import get_dihedral_inds
from pysisyphus.intcoords.setup_fast import (
find_bonds_for_geom,
find_bonds_bends,
find_dihedrals,
get_bond_vec_getter,
)
def test_find_bonds_fast():
geom = geom_loader("lib:split.image_021.xyz")
... | Python | 1 |
import os
import socra
from socra.io.files import read_file
from socra.utils.decorators import throttle
from socra.utils.spinner import Spinner
import typing
import json
class Inputs(socra.Schema):
target: str
prompt: str = None
class Outputs(socra.Schema):
should_update: bool
reason: str
class Ac... | Python | 1 |
ch("sentry.issue_detection.detectors.experiments.mn_plus_one_db_span_detector.metrics")
def test_ignores_prisma_client_if_depth_config_is_too_small(
self, metrics_mock: MagicMock
) -> None:
settings = deepcopy(self._settings)
settings[self.detector.settings_key]["max_allowable_depth"] = ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.