text string | label_name string | labels int64 |
|---|---|---|
{
pub enabled: bool,
pub override_nonempty: bool,
pub regex_mappings: Vec<RegExMapping>,
}
///
/// define a crate level config structure
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct BhathoConfig {
pub db_configs: Vec<DbManagerConfig>,
pub db_name_extractor_from_key: DbNameExtractor,
... | Rust | 0 |
condRight:
secondRight = tuple(path_builder.makeIndexes(setPaths.secondRight))
else:
secondRight = None
self.segmentModelSets[setName] = SplineSegmentModelSet(setName, left, right, secondLeft, secondRight)
return
def segmentModelLeft(self, modelSetNa... | Python | 1 |
import argparse
import os
import sys
import psutil
import pygetwindow as gw
# argumentos de linha de comando
parser = argparse.ArgumentParser(description='Lista de programas em execução')
parser.add_argument('-b', '--background', action='store_true', help='Lista os programas em execução em background')
parser.add_arg... | Python | 1 |
Other,
format!("unable to save client configuration: {}", err),
)
})
}
/// Create persistent configuration.
fn to_persistent_config(&self) -> PersistentConfig {
PersistentConfig {
uuid: self.uuid,
passwd: <PASSWORD>,
version: s... | Rust | 0 |
t<(), ()> {
self.insert_by(I::namespace_id(), ident, target, visibility, priority)
}
/// Iterate bindings in a namespace.
pub fn iter<I: NamespaceLookup>(&self) -> impl Iterator<Item = (&Ident, &Binding)> {
self.iter_by(I::namespace_id())
}
}
impl fmt::Debug for Scope {
fn fmt(&self... | Rust | 0 |
PACKED_ROW_PANELS,
schema_b: blis_types::pack_t_BLIS_PACKED_COL_PANELS,
a_next: a as *mut ::std::os::raw::c_void,
b_next: b as *mut ::std::os::raw::c_void,
is_a: 1 as inc_t,
is_b: 1 as inc_t,
dt_on_output: blis_types::num_t_BLIS_DOUBLE,
};
bli_dge... | Rust | 0 |
:
fig.delaxes(axes[i])
#plt.suptitle("Distribuição dos volumes por Chuva (0 = Não, 1 = Sim)", fontsize=22)
fig.legend(handles, labels, loc='upper right', title='CHUVA')
plt.tight_layout()
plt.savefig('ad_box_subplots_volumexchuva.png', dpi=600)
plt.show()
#%%
## Detalha as features
df_final.info()
#%%
## Estatis... | Python | 1 |
50, 140]).astype(int)
simulation = SimulationNPTLangevin(bto, pressure=hydropres)
simulation.init_velocity(mode='gaussian', temp=temp_list[0])
for temperature in temp_list:
dipole_field.set_integrator('isothermal', dt=dt, temp=temperature, tau=0.1)
gstrain.set_integrator('isothermal', dt=dt, temp=temperature, ... | Python | 1 |
#[doc = "6: Trigger source is CTIMERA1 OUT. value."]
A1OUT = 6,
#[doc = "7: Trigger source is CTIMERB1 OUT. value."]
B1OUT = 7,
#[doc = "8: Trigger source is CTIMERB3 OUT2. value."]
B3OUT2 = 8,
#[doc = "9: Trigger source is CTIMERA3 OUT2. value."]
A3OUT2 = 9,
#[doc = "10: Trigger source ... | Rust | 0 |
};
for d256 in scratch.iter_mut().rev() {
carry += *d256 as u32 * 58;
*d256 = carry as u8;
carry /= 256;
}
assert_eq!(carry, 0);
}
// Copy leading zeroes directly
let mut ret: Vec<u8> = data.bytes()... | Rust | 0 |
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Just export lexers that were contained in this module.
:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# ruff: noqa: F401
from pygments.lexers.python import NumPyLexer
from pygments.lexers... | Python | 1 |
ytes().enumerate() {
if i > UFRACT64_DIGITS || !ch.is_ascii_digit() {
return Err(FromStrError);
}
digits[i] = ch - b'0';
}
Ok(UFract64::from_digits(digits))
}
}
impl<'a> Field<'a> for UFract64 {
// Just proxy all the calls to the u64 impl.
... | Rust | 0 |
hand::Hand;
use crate::cards;
#[test]
fn full_hand() {
print_hand(&hand::Hand::full_deck() )
}
pub fn score_hand(hand: &Hand) -> i32 {
let mut score = 0;
let mut aces = 0;
for card in &hand.vec {
score += score_card(&card.value);
if &card.v... | Rust | 0 |
from typing import Dict, Tuple
PALETTE: Dict[str, Tuple[int, int, int]] = {
"green": (42, 167, 33),
"orange": (253, 148, 73),
"blue": (77, 117, 253),
"red": (236, 70, 62),
"yellow": (255, 252, 35),
"turquoise": (61, 224, 228),
"black": (49, 62, ... | Python | 1 |
StencilLayout {
pub sType : StructureType,
pub pNext : *mut void,
pub stencilLayout : ImageLayout,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct AttachmentDescriptionStencilLayout {
pub sType : StructureType,
pub pNext : *mut void,
pub stencilInitialLayout : ImageLayout,
pub stencilFinalLayout : ImageLa... | Rust | 0 |
edge_base_name}"
)
delete_knowledge_base(knowledge_base_name)
elif action == 4:
interactive_cli()
# After exiting interactive CLI, ask if the user wants to return to the task list or exit
while True:
choice = (
input... | Python | 1 |
# Ultralytics YOLO 🚀, AGPL-3.0 license
from ultralytics.engine.results import Results
from ultralytics.models.yolo.detect.predict import DetectionPredictor
from ultralytics.utils import DEFAULT_CFG, LOGGER, ops
class PosePredictor(DetectionPredictor):
"""
A class extending the DetectionPredictor class for p... | Python | 1 |
64,
}
// UnsignedIntegerLiteral represent integer numbers.
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub struct UnsignedIntegerLiteral {
#[serde(skip_serializing_if = "BaseNode::is_empty")]
#[serde(default)]
pub base: BaseNode,
#[serde(serialize_with = "serialize... | Rust | 0 |
# pylint: disable=C0114
# pylint: disable=C0115
# pylint: disable=C0301
from typing import (
TypeVar,
Optional,
Type,
List,
Tuple,
)
from pydantic import BaseModel
from ragas.prompt import PydanticPrompt
from ragas.testset.transforms.extractors.llm_based import Keyphrases, TextWithExtractionLimit
... | Python | 1 |
expect("Invalid buffer size"));
let (bytes, next) = next.split_at(LAST_MILESTONE_INDEX_SIZE);
message.last_milestone_index = u32::from_be_bytes(bytes.try_into().expect("Invalid buffer size"));
let (bytes, next) = next.split_at(CONNECTED_PEERS_SIZE);
message.connected_peers = u8::from_b... | Rust | 0 |
art=320
_globals['_LISTACCOUNTSREQUEST']._serialized_end=359
_globals['_LISTACCOUNTSRESPONSE']._serialized_start=361
_globals['_LISTACCOUNTSRESPONSE']._serialized_end=401
_globals['_SENDMESSAGEREQUEST']._serialized_start=403
_globals['_SENDMESSAGEREQUEST']._serialized_end=499
_globals['_SENDMESSAGERESPONSE'... | Python | 1 |
f):
client = Client()
client.login(
username=TEST_USER_USERNAME,
password=TEST_USER_PASSWORD
)
kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}
response = client.post('/disenroll', {
'course_id': 1,
}, **kwargs)
self.assertEq... | Python | 1 |
7fo\xbbz\x8f\x00"
)
FILTERS_RAW_3 = [{"id": lzma.FILTER_IA64, "start_offset": 0x100},
{"id": lzma.FILTER_LZMA2}]
COMPRESSED_RAW_3 = (
b"\xe0\x07\x80\x03\xdf]\x00\x05\x14\x07bX\x19\xcd\xddn\x98\x15\xe4\xb4\x9d"
b"o\x1d\xc4\xe5\n\x03\xcc2h\xc7\\\x86\xff\xf8\xe2\xfc\xe7\xd9\xfe6\xb8("
b"\xa8w... | Python | 1 |
Some(Direct(ZMM5)),
operand4: None,
lock: false,
rounding_mode: None,
merge_mode: Some(MergeMode::Zero),
sae: false,
mask: Some(MaskReg::K2),
broadcast: None,
},
&[98, 242, 101, 202, 58, 237],
OperandSize::Dword... | Rust | 0 |
crop_size[0], x0:x0+self.crop_size[1]]
occlusion_map = occlusion_map[y0:y0+self.crop_size[0], x0:x0+self.crop_size[1]]
occlusion_map_2 = occlusion_map_2[y0:y0+self.crop_size[0], x0:x0+self.crop_size[1]]
return img1, img2, flow, label, occlusion_map, occlusion_map_2, valid > 0
def __call__(... | Python | 1 |
4,7.82,14,9.88,14,12c0,3.13,1.86,6.01,4.51,7.55C18.81,19.73,19,20.06,19,20.41z"/></svg>
</svg>
}
}
}
<reponame>qryxip/misra-rust
#[allow(unused_labels)]
#[deny(unreachable_code)]
fn main() {
'outer: loop {
'inner: loop {
break 'outer;
}
'unreachable: lo... | Rust | 0 |
HERE symbol = %s", (symbol,))
count = cursor.fetchone()[0]
if count > 0:
# Delete existing current data for the symbol
cursor.execute("DELETE FROM CurrentStockData WHERE symbol = %s", (symbol,))
# Insert new current data
... | Python | 1 |
import os
import errno
import datetime
import subprocess
from opendm import log
def run(cmd, env_vars={}):
"""Run a system command"""
log.MM_DEBUG('running %s' % cmd)
env = os.environ.copy()
env["PATH"] = env["PATH"] + ":" + "::/code:/code/micmac/bin:/code/micmac/binaire-aux/linux"
for k in env... | Python | 1 |
#!/home/berald01/.local/bin/python
docstr= """
Read the gff output from dexseq_count.py to produce a table of exon IDs (gene_exon) and their
coordinates.
Example of gff attribute expected:
transcripts "NR_046018_1"; exonic_part_number "001"; gene_id "chr1_DDX11L1+"
Returned gene_exon ID: chr1_DDX11L1+:001
USAGE
... | Python | 1 |
swers = zip(*abstract_mapping.items())
matches = _fuzzy_match_names(
name_series=pd.Series(to_match),
choices=choices,
task_desc="testing",
threshold=90.0,
)
assert (matches == pd.Series(correct_answers)).all()
def test_abstract_threshold_no_match() -> None:
# With a th... | Python | 1 |
: u32, level: u32, bufptr: *mut *mut u8, prefmaxlen: u32, entriesread: *mut u32, totalentries: *mut u32, resume_handle: *mut u32) -> u32;
#[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"]
pub fn NetAccessGetInfo(servername: ::windows_sys::core::PCWSTR, resource: ::windows_sys::core::PC... | Rust | 0 |
import logging
import re
import uuid
from datetime import timedelta
from functools import partial
from itertools import product
import pytest
from appdaemon.utils import parse_timedelta
from tests.conftest import AsyncTempTest
from .utils import check_interval
logger = logging.getLogger("AppDaemon._test")
INTERVA... | Python | 1 |
for anndata bounds
if not absolute:
xmin += adata_bounds[0]
xmax += adata_bounds[0]
ymin += adata_bounds[2]
ymax += adata_bounds[2]
if xmin < adata_bounds[0] or xmax >= adata_bounds[1] or ymin < adata_bounds[2] or ymax >= adata_bou... | Python | 1 |
[
pad,
paddle.zeros((6 - pad_len,), dtype="int32"),
],
axis=0,
)
else:
pad = list(pad)
pad_len = len(pad)
_check_valid_pad_len(pad_len, x_dim, is_constant_mode)
pad.extend([0] * (6 - pad_len))
ndim_to_unsque... | Python | 1 |
, {'a'})
assert_rule(graph, 'c', RenameRule, {'a'})
assert_rule(graph, 'd', ComputeRule, {'b', 'c'})
def test_graph_for_graph_3() -> None:
base_graph = graph_3()
da = make_data(('a', 'e'))
graph = base_graph.graph_for(da, {'d'})
assert_rule(graph, 'a', FetchRule, set())
assert_rule(graph,... | Python | 1 |
参考图像和参考点
#todo:人工选择一张比较合适的图像作为参考图像,默认情况下,第一张作为参考图像
ref_points=np.empty((10,1),dtype=np.int)
points=np.empty((10,1),dtype=np.int)
filename=word[0]
for i in range(10):
ref_points[i]=int(word[i+1])
#while fid.readline()==
refimage=skimage.io.imread(imageRootPath+word[0])
plt.su... | Python | 1 |
TM layer with 64 units, not returning sequences, using ReLU activation.
# Typically used to consolidate information from the sequence into a fixed-sized representation.
# Dense Layers:
# model.add(Dense(64, activation='relu')):
# Dense layer with 64 units and ReLU activation.
# model.add(Dense(32, activation='relu')):... | Python | 1 |
from Crypto.Util.number import *
from gmpy2 import isqrt
n = 227796321863645598958206122515201912318930838347042603313248480249014576743848928534964271325110363762693534818159091871690725520741962465798747847076842458942552479124510783331058978439437464457498846228262077988352171313222510549686976512179947198528516418... | Python | 1 |
Options::new();
options.exit_on_error = true;
options.print_commands = false;
let (exit, stdout, stderr) = run_script::run(
r#"
mkdir -p /tmp/__test
mount $1 /tmp/__test
echo test > /tmp/__test/test
md5sum /tmp/__test/test
umount /tmp/__test
rm -rf /t... | Rust | 0 |
ymath --examples # Show examples
Interactive mode commands:
help # Show help
functions # List defined functions
define circle_area "π * r^2" # Define new function
quit # Exit
""",
)
parser.add_argum... | Python | 1 |
if output_count != 1 {
return Err(PsbtValidationError::InvalidOutputCount(output_count).into());
}
for output in psbt.outputs.iter() {
if output.bip32_derivation.is_empty() {
return Err(PsbtValidationError::InvalidOutputField(output.clone()).into());
... | Rust | 0 |
'a str, Stage, &'a TextureBuffer),
/// 3D Texture binding
Texture3D(&'a str, Stage, &'a TextureBuffer),
/// Storage texture binding
StorageTexture(&'a str, Stage, &'a TextureBuffer),
/// Texture sampler binding
Sampler(&'a str, Stage, &'a Sampler),
/// Storage binding
Storage(&'a str, St... | Rust | 0 |
ut()
.synchronize(&mut broad_phase, xf1, self_.m_xf);
}
} else {
for f in self_.m_fixture_list.iter() {
f.borrow_mut()
.synchronize(&mut broad_phase, self_.m_xf, self_.m_xf);
}
}
}
pub fn set_enabled<D: UserDataType>(self_: BodyPtr<D>, flag: bool) {
let world;
let m_fixture_list;
let broad_phase_... | Rust | 0 |
ditionModel models.
if args.unet_checkpoint_path is not None:
# image UNet
image_unet_config = create_image_unet_diffusers_config(IMAGE_UNET_CONFIG)
checkpoint = torch.load(args.unet_checkpoint_path)
converted_image_unet_checkpoint = convert_vd_unet_checkpoint(
checkpoint... | Python | 1 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Basket',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, seriali... | Python | 1 |
"""
测试pytorch模型到onnx的算子转换
1. 测试支持Aten算子
我们已知
Aten算子的接口定义(pytorch算子)
ONNX对应算子的实现
需要完成算子从 Aten到ONNX的符号连接即可
因此,为算子添加符号函数一般要经过以下几步:
1.获取原算子的前向推理接口。
2.获取目标 ONNX 算子的定义。
3.编写符号函数并绑定。
"""
import torch
import onnxruntime
import torch
import numpy as np
class Model(torch.nn.Module):
def __init__(self):
super(... | Python | 1 |
pub fn fb_disconnect_transaction(arg1: *mut ISC_STATUS, arg2: *mut isc_tr_handle)
// -> ISC_STATUS;
// }
extern "C" {
pub fn isc_sqlcode(arg1: *const ISC_STATUS) -> ISC_LONG;
}
// extern "C" {
// pub fn isc_sqlcode_s(arg1: *const ISC_STATUS, arg2: *mut ISC_ULONG);
// }
... | Rust | 0 |
able()
except OptionalDependencyNotAvailable:
pass
else:
from .modeling_flax_roberta import (
FlaxRobertaForCausalLM,
FlaxRobertaForMaskedLM,
FlaxRobertaForMultipleChoice,
FlaxRobertaForQuestionAnswering,
FlaxRobertaForSequenceClassific... | Python | 1 |
re_df.head(15))
plt.title(f"Top 15 Words BEFORE '{target_word}'")
plt.tight_layout()
# Plot word frequencies after target
plt.subplot(2, 1, 2)
sns.barplot(x='frequency', y='word', data=freq_after_df.head(15))
... | Python | 1 |
eferential
if (coordloctransf_x**2/bufsizexquad + coordloctransf_y**2/bufsizeyquad < 1): #inside the ellipsoid
#buffer_counter=buffer_counter+1
# print('got point')
# print('i', i)
# print('j', j)
# print('single po... | Python | 1 |
We have a blizzard of structs for a variety of reasons. Unfortunately, it's rather tedious to
manage them. Please allow me to enumerate the problems and solutions.
Some of the structs are substantially similar to the underlying db row that they model. Naming them is reasonably easy. However, many structs have "dec... | Rust | 0 |
te_input();
assert_eq!(vm.last_error(), None);
assert_eq!(vm.f_stack().len(), 1);
assert!(match vm.f_stack().pop() {
t => t > 2.0794414 && t < 2.0794416,
});
}
#[test]
fn test_flnp1() {
let vm = &mut VM::new();
vm.set_source("8E flnp1");
v... | Rust | 0 |
ine_intersection_min_max_parameters(line_origin, line_direction);
assert!(
intersection_params.is_none(),
"Line above the origin, facing right, should miss"
);
}
#[test]
fn aabb_intersects_ray_inside() {
// Given one aabb around the origin
let aabb = ... | Rust | 0 |
, _) => Pin::new(s).poll_complete(cx),
Inner::None => panic!("never"),
}
}
}
impl<S, SU> AsyncBufRead for UpgradableAsyncStream<S, SU>
where
SU: Upgrader<S> + Unpin,
S: AsyncBufRead + Unpin,
SU::Output: AsyncBufRead + Unpin,
{
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Cont... | Rust | 0 |
from os import listdir
import json
import numpy as np
import h5py
from generate_summary import generate_summary
from evaluation_metrics import evaluate_summary
path = '../exp/SumMe/results/split1' # path to the json files with the computed importance scores for each epoch
results = listdir(path)
results.sort(key=lambd... | Python | 1 |
"[:32]
logging.error("%s exception: %s", ip, e)
finally:
conn.disconnect()
return ip, site, status
# ─────────── main ───────────────────────────────────────────────────────────
def main() -> None:
if not EXCEL_FILE.is_file():
raise FileNotFoundErr... | Python | 1 |
doc = "Pull Up Resistor for GPIO16.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REG_GPIO_16_PU_A {
#[doc = "0: `0`"]
DISABLED = 0,
#[doc = "1: `1`"]
ENABLED = 1,
}
impl From<REG_GPIO_16_PU_A> for bool {
#[inline(always)]
fn from(variant: REG_GPIO_16_PU_A) -> Self {
... | Rust | 0 |
(v & !((0b1111 as u32) << (pin * 4))) | ((set.af as u32) << (pin * 4))
})
}
} else {
unsafe {
(*gpio).afr[1].modify(|v| {
(v & !((0b1111 as u32) << ((pin - 8) * 4))) | ((set.af as u32) << ((pin - 8) * 4))
})
}
}
}
fn spi_in... | Rust | 0 |
ticker=ticker,
sentiment_score=sentiment_score
)
session.add(news_data)
session.commit()
logger.info(f"Successfully stored {len(articles)} news articles for {ticker}")
except Exception as e:
sess... | Python | 1 |
import re
def check_password_strength(password):
score = 0
remarks = []
if len(password) >= 8:
score += 1
remarks.append("✓ Good length")
else:
remarks.append("✗ Too short")
if re.search(r'[A-Z]', password):
score += 1
remarks.append("✓ Has uppercase letter... | Python | 1 |
import argparse
import torch
import imageio
import skimage.transform
import torchvision
import torch.optim
import RedNet_model
from utils import utils
from utils.utils import load_ckpt
parser = argparse.ArgumentParser(description='RedNet Indoor Sementic Segmentation')
parser.add_argument('-r', '--rgb', default=None, ... | Python | 1 |
for inp in tool.tool["inputs"]:
if shortname(inp["id"]) in jobobj:
inp["default"] = jobobj[shortname(inp["id"])]
return tool
def load_tool(
argsworkflow: Union[str, CWLObjectType],
loadingContext: Optional[LoadingContext] = None,
) -> Process:
loadingContext, workflowobj,... | Python | 1 |
from opencompass.multimodal.models.llava import LLaVAScienceQAPromptConstructor, LLaVABasePostProcessor
# dataloader settings
val_pipeline = [
dict(type='mmpretrain.LoadImageFromFile'),
dict(type='mmpretrain.ToPIL', to_rgb=True),
dict(type='mmpretrain.torchvision/Resize',
size=(224, 224),
... | Python | 1 |
user_param_fields = [
{
"description": "Количество параметров.",
"is_dim": False,
"name": "ym:up:params",
"title": "Параметры",
"type": "integer",
},
{
"description": "Количество уникальных посетителей.",
"is_dim": False,
"name": "ym:up:users",... | Python | 1 |
"""
AWS Secrets Manager package initialization.
""" | Python | 1 |
me()
# 统计&上报 任务状态指标
metrics.METADATA_CRON_TASK_STATUS_TOTAL.labels(
task_name="sync_bkcc_space_data_source", status=TASK_STARTED, process_target=None
).inc()
def _refine(data_id_dict, space_id, bk_data_id) -> bool:
"""移除已经存在的数据源关联"""
is_exist = False
space_data_id_list =... | Python | 1 |
import pytest
from thefuck.rules.git_pull_clone import match, get_new_command
from thefuck.types import Command
git_err = '''
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
'''
@pytest.mark.parametrize('command', [
C... | Python | 1 |
_height = 2.0 * h;
let viewport_width = aspect_ratio * viewport_height;
let w = (look_from - look_at).unit_vector();
let u = vertical_up.cross(&w).unit_vector();
let v = w.cross(&u);
let origin = look_from;
let horizontal = focus_distance * viewport_width * u;
l... | Rust | 0 |
MIN,
Self::CODA_START_MAX + 1,
);
iter.collect()
}
fn make_coda_end_weights() -> Vec<weighted::Entry<u8, Weight>> {
let iter = TentWeightFn::from_range(
Self::CODA_END_MIN,
Self::CODA_END_MAX + 1,
);
iter.collect()
}
fn random... | Rust | 0 |
import csv
def generate_binary_strings(length):
binary_strings = []
for i in range(2**length):
binary_string = bin(i)[2:].zfill(length)
binary_strings.append(binary_string)
return binary_strings
def is_palindrome(string):
return string == string[::-1]
length = 10
binary_strings = gene... | Python | 1 |
raise e
'''
print('Generating train val lists')
np.random.seed(8964)
# to avoid data snooping, we will make two cameras of the same scene to fall in the same set, train or val
subdirs = args.dump_root.dirs()
canonic_prefixes = set([subdir.basename()[:-2] for subdir in subdirs])
with ope... | Python | 1 |
mtx = np.reshape(rician_samples, img.shape)
rician_noisy_img = img + rician_noise_mtx
# Returning the image corrupted just in the foreground (ignoring the background)
return fg_mask * rician_noisy_img, fg_mask
def generate_rician_noisy_displaced_imgs(
self,
n_snapshots: int,... | Python | 1 |
::new(url);
let resp = cl
.anonymize_series(
"foo",
Some(Anonymization {
replace: Some(hashmap! {"Tag1".to_string() => "value1".to_string()}),
keep: Some(vec!["Tag2".to_string(), "Tag3".to_string()]),
keep_private_tags: Some(false),
... | Rust | 0 |
'static, 'static> {
SubCommand::with_name("getset")
.about("String.GetSet: Store item, return old value")
.arg(
Arg::with_name("key")
.help("Key of item to retrieve+store")
.required(true),
)
.arg(
... | Rust | 0 |
println!("You have to initialize GTK!");
return Err(Error{ message: "You have to initialize GTK!".to_string(), inner_error: InnerError::GtkInitError})
}
let theme = gtk_icon_theme_get_default();
DEFAULT_THEME = Some(theme);
}
let icon_name... | Rust | 0 |
i2str[code])
if code in self.code2cui:
return list(self.cui2str[self.code2cui[code]])
return None
def search_by_string_list(self, string_list):
for string in string_list:
if string in self.str2cui:
find_string = self.cui2str[self.str2cui[string]]
... | Python | 1 |
Out")
self.log_user_logout()
self.logout_button.emit()
def log_user_logout(self):
if self.current_user_id is None:
print("No current user logged in") # Debug print
return
try:
cursor = self.conn.cursor()
# Retrieve the latest LogID
... | Python | 1 |
# Vuln Hunter - Nessus Integration (Stub)
# DO NOT USE ILLEGALLY. Only scan networks you own or have permission to scan.
from typing import Dict, Any
async def run_nessus_scan(target: str, policy: str = "Basic Network Scan") -> Dict[str, Any]:
"""
Stub function for Nessus integration.
Args:
ta... | Python | 1 |
# Copyright 2016 Cloudbase Solutions Srl
#
# 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 l... | Python | 1 |
# ΔΙΑΓΡΑΦΗ παραγόμενων αρχείων για πλήρη καθαρισμό
try:
for pat in ("STEP7_FINAL_SCENARIO*.xlsx", "STEP1_6_PER_SCENARIO*.xlsx", "INPUT_STEP1*.xlsx"):
for f in ROOT.glob(pat):
try:
f.unlink()
except Exception:
pass
exce... | Python | 1 |
"/beacon/validators/pubkeys") => {
into_boxfut(helpers::implementation_pending_response(req))
}
// Methods for Validator
(&Method::GET, "/beacon/validator/duties") => {
into_boxfut(validator::get_validator_duties::<T>(req))
}
(... | Rust | 0 |
ot serialized or deserialized, but is added during preprocessing step and then used for internal calculations
#[derive(Clone, Default, Debug)]
pub struct TreeNodeTempData {
pub id: usize,
pub substitutions: BTreeMap<usize, Nuc>,
pub mutations: BTreeMap<usize, Nuc>,
pub aa_substitutions: BTreeMap<String, BTreeMa... | Rust | 0 |
Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use nom::{le_u16, le_u32, le_u64};
#[derive(Debug,PartialEq)]
pub struct Smb3TransformRecord<'a> {
pub session_id: u64,
pub enc_algo: u16,
pub enc_data: &'a[u8],
}
named!(pub parse_smb3_transform_record<Smb3TransformRecord>,
do_parse!(
tag!... | Rust | 0 |
its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use interner::StringKey;
use thiserror::Error;
#[derive(Clone, Debug, Error, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ValidationMessage {
#[error(
"I... | Rust | 0 |
('Saving gt_labels to: ' + cache_file)
with open(cache_file, 'wb') as f:
cPickle.dump(gt_labels, f)
return gt_labels
def load_pascal_annotation(self, index):
"""
Load image and bounding boxes info from XML file in the PASCAL VOC
format.
"""
imnam... | Python | 1 |
utputPin)?;
self.dcx.set_high().map_err(Error::OutputPin)?;
for val in data.iter() {
self.wrx.set_low().map_err(Error::OutputPin)?;
self.set_data_bus(*val)?;
self.wrx.set_high().map_err(Error::OutputPin)?;
}
self.csx.set_high().map_err(Error::OutputP... | Rust | 0 |
_id=state.id,
preview_id=preview.id,
provider="whisper",
text="Hello!",
metadata={},
)
stage_map = await temp_db.compute_stage_map(state.id)
assert stage_map["wiki_data"] is True
assert stage_map["character_profile"] is True
assert stage_map["voice_generation"] is Tr... | Python | 1 |
5) & 0x01) != 0)
}
#[doc = "Bit 6 - Individual Mask Bits"]
#[inline(always)]
pub fn mi6(&self) -> MI6_R {
MI6_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Individual Mask Bits"]
#[inline(always)]
pub fn mi7(&self) -> MI7_R {
MI7_R::new(((self.bits >> 7) & 0x... | Rust | 0 |
pgt_epi8(a, b);
assert_eq_m256i(r, _mm256_insert_epi8(_mm256_set1_epi8(0), !0, 0));
}
#[simd_test(enable = "avx2")]
unsafe fn test_mm256_cmpgt_epi16() {
let a = _mm256_insert_epi16(_mm256_set1_epi16(0), 5, 0);
let b = _mm256_set1_epi16(0);
let r = _mm256_cmpgt_epi16(a, b);
... | Rust | 0 |
get_icc_regs, set_icc_regs};
use redist_regs::{construct_gicr_typers, get_redist_regs, set_redist_regs};
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::convert::TryInto;
use std::sync::Arc;
const GITS_CTLR: u32 = 0x0000;
const GITS_IIDR: u32 = 0x0004;
const GITS_CBASER: u32 = 0x0080;
const GITS_CWRIT... | Rust | 0 |
ndex
print("뉴욕 온도 데이터 일부:\n", df_temp_ny.head())
print(f"뉴욕 온도 데이터 길이: {len(df_temp_ny)}")
# 1-3) 병합 - Merging energy data with temperature data
df_energy_to_merge = df_energy_daily.reset_index()
df_temp_to_merge = df_temp_ny.reset_index()
df_all = pd.merge(df_energy_to_merge, df_temp_to_merge[['date', 'AverageTemper... | Python | 1 |
ScreenshotError_VRScreenshotError_NotFound = 101,
EVRScreenshotError_VRScreenshotError_BufferTooSmall = 102,
EVRScreenshotError_VRScreenshotError_ScreenshotAlreadyInProgress = 108,
}
pub type TrackedDeviceIndex_t = u32;
pub type VRNotificationId = u32;
pub type VROverlayHandle_t = u64;
pub type glSharedTextureH... | Rust | 0 |
ivate keys).
We should probably make a version of this that doesn't require chrome.
"""
@staticmethod
def RunCRXGen(chrome_path, manifest_dir, private_key=None):
if chrome_path is None:
raise Exception('Chrome binary not specified!')
if not os.path.isfile(chrome_path):
raise Exception('Chr... | Python | 1 |
import pandas as pd
class ExporterAgent:
def run(self, sim_results):
writer = pd.ExcelWriter("outputs/strategy_results.xlsx", engine="openpyxl")
for code, strategy_results in sim_results.items():
all_strategies_df = []
for strat_key, result in strategy_results.items():
... | Python | 1 |
let out_ray = match refract(r.dir, outward_normal, ni_over_nt) {
Some(refracted) => {
if random::<f64>() < schlick(cosine, self.index) {
// Return REFLECT
Ray::new(hit.p, reflected)
} else {
// Return REFRACT
... | Rust | 0 |
.path.join(path, file_name))
return result
def device_parser(str_device):
def parser_dash(str_device):
if not len(str_device):
return []
device_id = str_device.split('-')
device_id = [i for i in range(int(device_id[0]), int(device_id[-1])+1)]
return device_id
i... | Python | 1 |
class Sql:
create_favorite_sql = """create table favorite
(
id bigint unsigned auto_increment comment '收藏ID'
primary key,
user_id bigint unsigned not null comment '用户ID',
poetry_id int not null comment '诗歌ID',
create_time datetime default CURRENT_TIMESTAMP not null comment '收藏时间'
)... | Python | 1 |
;
}
}
}
let elapsed_time = get_formatted_elapsed_time(start);
output.add_metadata_entry(format!(
"Created by whitebox_tools\' {} tool",
self.get_tool_name()
));
output.add_metadata_entry(format!("Input file: {}", input_file));
... | Rust | 0 |
_edge5c==2,img_ABC==1))
_6_side=np.where(np.bitwise_and(dilate_img_edge5c==2,img_ABC==2))
_5_contour=np.where(img_edge5c==1)
_6_contour=np.where(img_edge5c==2)
return _5_roof,_5_back,_6_roof,_6_side,_5_contour,_6_contour
label_edge5cls=sample['label_edge5cls'].cpu().numpy().copy()
... | Python | 1 |
}
/* FIXME _ProfStop(PGROUP_DWT); */
/*----------------MCT-------------------*/
/* FIXME _ProfStart(PGROUP_MCT); */
if opj_tcd_mct_decode(p_tcd, p_manager) == 0 {
return 0 as libc::c_int;
}
/* FIXME _ProfStop(PGROUP_MCT); */
/* FIXME _ProfStart(PGROUP_DC_SHIFT); */
if opj_tcd_dc_level_shift_decode(... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.