text string | label_name string | labels int64 |
|---|---|---|
]
pub mod owa_tx_chsta0;
#[doc = "OWA_TX_CHSTA1 register accessor: an alias for `Reg<OWA_TX_CHSTA1_SPEC>`"]
pub type OWA_TX_CHSTA1 = crate::Reg<owa_tx_chsta1::OWA_TX_CHSTA1_SPEC>;
#[doc = "OWA TX Channel Status Register1"]
pub mod owa_tx_chsta1;
#[doc = "OWA_RXCHSTA0 register accessor: an alias for `Reg<OWA_RXCHSTA0_SP... | Rust | 0 |
at1, Mat2>(
lhs: &Mat1,
rhs: &Mat2,
workspace: &mut [N],
) -> CsMatI<N, I>
where
N: Num + Copy,
I: SpIndex,
Mat1: SpMatView<N, I>,
Mat2: SpMatView<N, I>,
{
csr_mul_csr_impl(lhs.view(), rhs.view(), workspace)
}
/// Perform a matrix multiplication for matrices sharing the same storage ord... | Rust | 0 |
# Taair
# Licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
# See LICENSE file for details.
"""
Various dictonaries containing mapping for showing the correct icons/symbols in discord.
The values of the mappings are bot specifc emoji strings, which have to be modified for each bot... | Python | 1 |
.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod cast_fn;
mod coalesce_fn;
mod datetime;
mod format_fn;
mod numeric;
mod nvl_fn;
mod string;
pub use sel... | Rust | 0 |
static,
Iter: Iterator<Item = &'e Elem> + Clone,
{
fn describe<'d>(&self, doc: &'d BoxAllocator) -> DocBuilder<'d> {
doc.text("ALL").append(doc.space().append(self.0.describe(doc)).nest(2)).group()
}
fn falsify_all<'d>(&self, iter: &Iter, doc: &'d BoxAllocator) -> Option<DocBuilder<'d>> {
... | Rust | 0 |
ter::K7,
};
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static OP_MOD_RM_RM_MEM_ONLY_FALSE: OpModRM_rm_mem_only = OpModRM_rm_mem_only {
must_use_sib: false,
};
#[cfg(not(feature = "no_vex"))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static OP_MOD_RM_RM_MEM_ONLY_TRUE: OpModRM_rm_mem_only = OpModRM_rm_mem... | Rust | 0 |
Box<Node>, Box<Node>),
UnOp(UnOp, Box<Node>),
Index {
base: Box<Node>,
index: Vec<Node>,
},
Splat(Box<Node>),
AssignOp(BinOp, Box<Node>, Box<Node>),
MulAssign(Vec<Node>, Vec<Node>), // mlhs, mrhs
CompStmt(Vec<Node>),
If {
cond: Box<Node>,
then_: Box<Node>... | Rust | 0 |
ddevs, std_threshold=0.1, num_bins=8192, num_iters=1024):
super().__init__()
self.std_threshold = std_threshold
self.num_bins = num_bins
self.num_iters = num_iters
self.register_buffer('stddevs', torch.FloatTensor(stddevs))
self.register_buffer('approx_flag', self.stddevs... | Python | 1 |
e")
)
rich_text.append(
{
"type": "text",
"text": {"content": time},
"annotations": {
... | Python | 1 |
date, location)
TABLE_DATA.append(tuples)
if count > 0:
table_instance = SingleTable(TABLE_DATA, title)
print(table_instance.table)
# Instagram search
title = " Instagram "
instatls = instagramSearchTool()
instatls.searchInsta(nom)
ac... | Python | 1 |
description: info.description,
scale_factor: info.scale_factor,
modes,
is_obsolete: info.obsolete,
});
}
output_info
}
use std::time::Duration;
use std::thread::sleep;
use std::time::Instant;
pub struct FPSRegulator {
cap: u32,
wait_time: Duration,... | Rust | 0 |
ol = init_matrix_from_static_sae_array(&SAE_DIAG_BAR_VERT_THIN);
let mut evt = generate_test_event();
assert_eq!(false, arcstar_is_event_corner(&sae_pol, &mut evt));
let sae_pol = init_matrix_from_static_sae_array(&SAE_DIAG_BAR_NE_THIN);
let mut evt = generate_test_event();
asse... | Rust | 0 |
drews and Bernstein (2014)
"""
a = uc[0] ** 2
b = uc[1] ** 2
c = uc[2] ** 2
d = 2 * uc[1] * uc[2] * math.cos(math.radians(uc[3]))
e = 2 * uc[0] * uc[2] * math.cos(math.radians(uc[4]))
f = 2 * uc[0] * uc[1] * math.cos(math.radians(uc[5]))
return [a, b, c, d, e, f]
class S... | Python | 1 |
redictions(
tokens,
vocab_id_list,
vocab_id_to_token_dict,
masked_lm_prob,
cls_id,
sep_id,
mask_id,
max_predictions_per_seq,
np_rng,
)
# Padding.
tokens_np, tokentypes_np, labels_np, padding_mask_np, loss_mask_np = pad_and_convert_to_n... | Python | 1 |
ce
}
}
pub struct Engine {
pub units: Units,
pub nlu: NluModels,
}
#[derive(Debug, Clone, Copy, PartialEq, Deserialize)]
pub enum Units {
Metric,
Imperial,
}
impl ToString for Units {
fn to_string(&self) -> String {
let val = match &self {
Units::Metric => "metric",
... | Rust | 0 |
"""
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""
def pair_xor_Sum(arr, n):
"""
:param arr: list of integers
:param n: integer
:return: sum of xor of all pairs of numbers in the given list
"""
return sum(x ^... | Python | 1 |
Shader(DrawObjectIndex<CopyShader>),
UseCopyShader(DrawObjectIndex<CopyShader>),
UsePointShader(DrawObjectIndex<PointShader>),
UseBrush(DrawObjectIndex<BrushTexture>),
UseInterpolator(DrawObjectIndex<LuaScript>),
Point(PointEntry),
AddLayer(Option<DrawObjectIndex<CopyShader>>, Option<DrawObjectI... | Rust | 0 |
remented on rising edges on the CAP input selected by bits 3:2."]
COUNTER_MODE_RISING,
#[doc = "Counter Mode falling edge. TC is incremented on falling edges on the CAP input selected by bits 3:2."]
COUNTER_MODE_FALLING,
#[doc = "Counter Mode edges. TC is incremented on both edges on the CAP input selec... | Rust | 0 |
from __future__ import annotations
import functools
from typing import Any
import yaml
Loader = getattr(yaml, 'CSafeLoader', yaml.SafeLoader)
yaml_compose = functools.partial(yaml.compose, Loader=Loader)
yaml_load = functools.partial(yaml.load, Loader=Loader)
Dumper = getattr(yaml, 'CSafeDumper', yaml.SafeDumper)
... | Python | 1 |
from src.apps.rest.utils.schemas import Schema
from src.contexts.core.domain.entities.pizza import PizzaPrimitives
class CreatePizzaResponse(Schema):
pizza: PizzaPrimitives
| Python | 1 |
t_ps_fontname(&mut sfont).unwrap_or_else(|| name.to_owned());
let shortname = validate_name(shortname);
if opt.embed != 0 && opt.style != 0 {
warn!("Embedding disabled due to style option for {}.", name);
opt.embed = 0;
}
let mut fontname = shortname
+ match opt.style {
... | Rust | 0 |
///内盘
Ask = 2,
///中性盘
Neutral = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TickerType {
///未知
Unknown = 0,
///自动对盘
Automatch = 1,
///开市前成交盘
Late = 2,
///非自动对盘
NoneAutomatch = 3,
///同一证券商自动对盘
... | Rust | 0 |
= dict_to_set(want)
have_dict = dict_to_set(have)
diff = want_dict - have_dict
if diff:
port_priotity = dict(diff).get("port_priority")
max_bundle = dict(diff).get("max_bundle")
fast_switchover = dict(diff).get("fast_switchover")
if port_priotity:... | Python | 1 |
import os
import sys
from PySide6.QtGui import QIcon, QFontDatabase
from pathlib import Path
def get_app_icon():
"""Gets the application icon QIcon object, preferring .icns on macOS."""
try:
# Correctly determine base_dir for MetriCalc
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(... | Python | 1 |
/! # Application
//!
//! An application needs to run on all types of esoteric host platforms. To hide trivial
//! platform-specific details, we offers a convenient trait `Application` facade which
//! defined methods, that will be called in a pre-determined order every frame.
//!
//! The most intuitive and simple setup... | Rust | 0 |
()
timestamp = str(self.milliseconds())
headers = {
'X-Nova-Access-Key': self.apiKey,
'X-Nova-Timestamp': timestamp,
}
queryString = None
if method == 'POST':
body = self.json(query)
queryString =... | Python | 1 |
from typing import List
def solve(grid: List[List[int]]) -> List[List[int]]:
h, w = len(grid), len(grid[0])
zeros = [(r, c) for r in range(h) for c in range(w) if grid[r][c] == 0]
diag1 = [r - c for r, c in zeros]
diag2 = [r + c for r, c in zeros]
if max(diag1) - min(diag1) <= max(diag2) - min(diag2... | Python | 1 |
x00\x00',
181:b'\xa0\xa0\xa0\xc0\x80\x00',
182:b'`\xa0```\x00',
183:b'\x00\xe0\xe0\xe0\x00\x00',
184:b'\x00\x00@ \xc0\x00',
185:b'@@@\x00\x00\x00',
186:b'@\xa0@\x00\xe0\x00',
187:b'@ @\x00\x00\x00',
188:b'\x80\x80\x00` \x00',
189:b'\x80\x80\x00\xc0`\x00',
190:b'\xc0\xc0\x00` \x00',
191:b'@\x00@\x8... | Python | 1 |
t = _snd_pcm;
#[doc = " Kernel level PCM"]
pub const SND_PCM_TYPE_HW: _snd_pcm_type = 0;
#[doc = " Hooked PCM"]
pub const SND_PCM_TYPE_HOOKS: _snd_pcm_type = 1;
#[doc = " One or more linked PCM with exclusive access to selected"]
#[doc = "channels"]
pub const SND_PCM_TYPE_MULTI: _snd_pcm_type = 2;
#[doc = " File writin... | Rust | 0 |
4, byteorder='big') + chain + public_key)
return b58encode_check(raw)
def parse_derivation_path(str_derivation_path):
""" Parses a derivation path such as "m/44'/60/0'/0" and returns
list of integers for each element in path. """
path = []
if str_derivation_path[0:2] != 'm/':
ra... | Python | 1 |
mut gpioc.crl);
let ch11 = gpioc.pc0.into_analog(&mut gpioc.crl);
let tmr = Timer::tim4(device.TIM4, &clocks, &mut rcc.apb1).start_count_down(200.khz());
let scl = gpiob.pb6.into_open_drain_output(&mut gpiob.crl);
let sda = gpiob.pb7.into_open_drain_output(&mut gpiob.crl);
let i... | Rust | 0 |
rch.no_grad():
inputs = reference_tokenizer(
full_sequence, truncation=True, max_length=args.max_length, return_tensors="pt"
)
for curr_ke in inputs:
inputs[curr_ke] = inputs[curr_ke].to(device)
labels = inputs["inpu... | Python | 1 |
ord), vec![0x22]].concat(),
20 => [Vec::from(base_word), vec![0x2e]].concat(),
21 => [Vec::from(base_word), vec![0x22, 0x3e]].concat(),
22 => [Vec::from(base_word), vec![0x0a]].concat(),
23 => Vec::from(&base_word[..max(3, base_word.len()) - 3]),
24 => [Vec::from(base_word), vec![0x5d]].concat(),
25 =... | Rust | 0 |
: String },
/// Invalid transaction file
#[fail(display = "Invalid transaction file: {}.", path)]
InvalidTransactionFile { path: String },
/// Transaction is not ready for validation
#[fail(display = "Transaction is not ready for validation: {:?}.", tx)]
TransactionIsNotReadyForValidation { tx... | Rust | 0 |
000, &addr, &input, &mut temp[..]) {
Ok(_) => {
logger::debug("Call succeed");
},
Err(_) => {
logger::debug("Call failed");
}
}
let mut hasher = SipHasher::new_with_keys(0, 0);
hasher.write(&temp[..]);
let hash = (hasher.finish() & 0x00000000ffffffff) as u32;
logger::debug("Hashing succed");
let m... | Rust | 0 |
cds,
genomic,
primary_only,
)?
} else {
map_and_count_pseudo(
bam_file,
&out_dir,
&cell_barcodes,
®ion,
cds,
genomic,
primary_only,
)?
};
info!(
"Initializ... | Rust | 0 |
Reference { id: id, gen: gen }
}
}
#[derive(Clone, PartialEq, Debug)]
pub enum PdfNumber {
Integer(i64),
Real(f64),
}
#[derive(Clone, PartialEq, Debug)]
pub enum PdfObject {
Null,
Keyword(PdfKeyword),
Boolean(bool),
Number(PdfNumber),
String(PdfString),
Name(PdfName),
Symbo... | Rust | 0 |
IG[l]
etb.append((l, n, emin[l], beta))
return etb
def autoaux(mol):
'''
Create an auxiliary basis set for the given orbital basis set using
the Auto-Aux algorithm.
See also: G. L. Stoychev, A. A. Auer, and F. Neese
Automatic Generation of Auxiliary Basis Sets
J. Chem. Theo... | Python | 1 |
d the price of the asset
ax3 = plt.subplot(413, sharex=ax1)
perf.loc[:, ['algorithm_period_return', 'price_change']].plot(ax=ax3)
ax3.legend_.remove()
ax3.set_ylabel('Percent Change')
start, end = ax3.get_ylim()
ax3.yaxis.set_ticks(np.arange(start, end, (end - start) / 5))
# Fourth chart: P... | Python | 1 |
1);
if let Some(index) = self.last_index() {
self.latest_parse_time_spans[index] = TimeSpan::Started(
Instant::now()
);
}
}
}
pub fn end_parse_duration_saturating(&mut self) {
if let Some(index) = self.last_index() {
... | Rust | 0 |
nerates a black transition object based on the provided speed attribute.
fn generate_blank_transition(speed: usize) -> Vec<(Option<usize>, Option<usize>, usize)> {
let mut transition = Vec::new();
for _ in 0..2u32.pow(speed as u32) {
transition.push((None, None, 0));
}
transition
}
/// Genera... | Rust | 0 |
n!PC0={at2}\n!PC1={at2}\n".encode("ascii")
@staticmethod
def speaker_frequency(frequency: Union[int, float]) -> bytes:
"""
:param frequency:
:returns: Command to set the speaker times based on frequency.
"""
active_time = _active_time_for_frequency(frequency)
ret... | Python | 1 |
ple_rate)
if bank_file:
if not MIDIPlay.set_bank_file(bank_file):
exit(1)
print("Using bank file: %s" % bank_file)
else:
if not MIDIPlay.set_bank_no(bank_no):
exit(1)
print("Using embedded bank: %d" % bank_no)
MIDIPlay.set_loop_enabled(enable_loop)
... | Python | 1 |
pdf_reader = PyPDF2.PdfReader(io.BytesIO(file.read()))
text = ""
for page in pdf_reader.pages:
page_text = page.extract_text() or ""
text += page_text + "\n"
else:
... | Python | 1 |
=> {
dest.push_byte(0);
cm.encode_to(dest);
}
NodeMetadata::CommunityNode(cm) => {
dest.push_byte(1);
cm.encode_to(dest);
}
}
}
}
impl Decode for NodeMetadata {
fn decode<I: Input>(input: &mut I) -> Res... | Rust | 0 |
Y$.
//!
//! To the resulting value of $A$, we can add $B$ which can be computed by any party owning $Y$ since both $c$ and $\delta_i$
//! can be computed locally by and party owning $Y$.
//!
//! Therefore, we don't need to derive the private key in any point to sign a message for a derived key which is why this library... | Rust | 0 |
is_scalar0 {
// a is a scalar
let x0_elem = x0[ndarray::IxDyn(&[])];
x1.map(move |&a| x0_elem / a)
} else if is_scalar1 {
// b is a scalar
let x1_elem = x1[ndarray::IxDyn(&[])];
let rhs = T::one() / x1_elem;
x0.mapv(|x0_elem| x... | Rust | 0 |
import inet.scave.plot
from matplotlib.lines import Line2D
alternate_handles = [Line2D([0], [0], color='black', lw=1, linestyle=':', label='Line'),
Line2D([0], [0], color='black', lw=1, linestyle='--', label='Line'),
Line2D([0], [0], color='black', lw=1, linestyle='-', label='... | Python | 1 |
from easydict import EasyDict as edict
__C = edict()
dataset_cfg = __C
# Breaking Bad geometry assembly dataset
__C.BREAKING_BAD = edict()
__C.BREAKING_BAD.DATA_DIR = "../Breaking-Bad-Dataset.github.io/data/"
__C.BREAKING_BAD.DATA_FN = ( # this would vary due to different subset, use everyday as default
"every... | Python | 1 |
import argparse
import requests
from colorama import init, Fore
from bs4 import BeautifulSoup
init(autoreset=True)
def search_khoj(query):
url = f"https://khoj.doubtly.in/api/?q={query}"
response = requests.get(url)
if response.status_code == 200:
return response.json()
else:
return No... | Python | 1 |
w_connection: &RawConnection) -> Error {
let error_message = raw_connection.last_error_message();
let error_information = Box::new(error_message);
let error_kind = match raw_connection.last_error_code() {
ffi::SQLITE_CONSTRAINT_UNIQUE | ffi::SQLITE_CONSTRAINT_PRIMARYKEY =>
DatabaseErrorK... | Rust | 0 |
hread.
// A single background thread is spawned for accepting new connections.
//
// To try this out, do
// ```
// cargo run --example mesh-echo-peer \
// {number of connections to make} \
// {bind} \
// {list of endpoints to connect to}
// ```
fn main() {
let mut args = env::args().skip(1);
let connectio... | Rust | 0 |
"debug": False,
}
test_cfg = {
"nms": {"type": "nms", "iou_threshold": 0.5},
"score_thr": 0.05,
"mask_thr_binary": 0.5,
"max_per_img": 100,
"min_bbox_size": 0,
"nms_pre": 300,
}
backbone = CSPNeXt(model_name=... | Python | 1 |
nMemory(_) => ExternalMemoryType::HostMappedForeignMemory,
}
}
/// Get the [PlatformMemoryType][PlatformMemoryType] from this enum.
pub fn platform_memory_type(&self) -> PlatformMemoryType {
match self {
#[cfg(unix)]
Self::OpaqueFd(_) => PlatformMemoryType::Fd,
... | Rust | 0 |
2.after(seg_ack)) {
*snd_wnd = seg_wnd;
*snd_wl1 = seg_seq;
*snd_wl2 = seg_ack;
}
// If the incoming segment acks the sequence number that we used
// for RTT estimate, feed the sample to the estimator.
if let Some((seq_max, ... | Rust | 0 |
o.code_snippet_requests:
logger.info(
"[%s / %s] Requesting additional information",
state.context.task_id,
state.context.internal_patch_id,
)
code_snippet_requests = state.execution_info.code_snippet_requests
state.executio... | Python | 1 |
import re
def detectar_sql_injection(entrada_usuario):
padrao_malicioso = re.compile(
r"'.*\s+(OR|or)\s+['\"]\d+['\"]\s*=\s*['\"]\d+['\"](\s*--|\s*#|;)?",
re.IGNORECASE
)
if padrao_malicioso.search(entrada_usuario):
return True
return False
entrada_legitima = "admin"
entr... | Python | 1 |
self,
db_batch: &mut SchemaBatch,
min_readable_version: u64,
target_version: u64,
) -> anyhow::Result<()> {
self.event_store
.prune_events(min_readable_version, target_version, db_batch)?;
Ok(())
}
}
impl EventStorePruner {
pub(in crate::pruner) fn new(ev... | Rust | 0 |
MemoryInfo {
pub fn new(allocator_type: OrtAllocatorType, memory_type: OrtMemType) -> Result<Self> {
debug!("Creating new memory info.");
let mut memory_info_ptr: *mut OrtMemoryInfo = std::ptr::null_mut();
let status = call_ort!(
CreateCpuMemoryInfo,
allocator_type,
... | Rust | 0 |
ntexts.functions.borrow(),
&mut yaxpeax_core::arch::x86_64::analyses::data_flow::NoDisambiguation::default(),
)
.ssa_cytron();
Evaluator::new(&data.to_vec(), &cfg, &dfg).full_function_iterate();
(cfg, dfg)
}
#[test]
fn test_arithmetic() {
let instructions = &[
0xb8, 0x04, 0x00... | Rust | 0 |
import cv2
import numpy as np
def laplacian_pyramid(img, levels):
gpyr = gaussian_pyramid(img, levels)
lpyr = [gpyr[levels-1]]
for l in range(levels-1, 0, -1):
G1 = expand(gpyr[l])
G2 = gpyr[l-1]
rdiff, cdiff = G2.shape[0] - G1.shape[0], G2.shape[1] - G1.shape[1]
# if expan... | Python | 1 |
e { x, y, sx, sy, angle } => {
format!("<g transform=\"translate({} {}) rotate({}) scale({} {})\"><rect {} x=\"-0.5\" y=\"-0.5\" width=\"1\" height=\"1\" /></g>",
x, y, angle, sx, sy, attrs)
}
}
}
pub fn scaled(&self, scale: f32) -> Shape {
ma... | Rust | 0 |
from django.contrib import admin
from .models import JobTitle, Department, Gender, Employee
@admin.register(JobTitle)
class JobTitleAdmin(admin.ModelAdmin):
list_display = ['name', 'slug']
prepopulated_fields = {'slug': ('name',)}
@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):
list_d... | Python | 1 |
# Add the root path of the dmrgpy library
import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src')
import numpy as np
from dmrgpy import spinchain
def get_dc(bc="open",n=3,ii=0):
spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain
sc = spinchain.Spin_Chain(spins) # create the spin ch... | Python | 1 |
ing for invalid keys list."""
patches = """
@pytest.fixture(scope="session")
def configuration_extra_env_var_keys():
return {"key":"value"}
"""
pytester.makeconftest(
CONFTEST_TEMPLATE.format(fixture_name=FIXTURE_UNDER_TEST, patches=patches)
)
# create a tem... | Python | 1 |
import os
import json
from assembly import assemblyai_transcribe
from src.gemini import summarize_speaker_text_gemini
from src.youtube import download_youtube_mp3
if __name__ == "__main__":
print("Starting the process...")
video_id = "ATeL5I8puL4"
print(f"Downloading YouTube video with ID: {video_id}")
... | Python | 1 |
import time
import asyncio
from pydantic import BaseModel
class Point3D(BaseModel):
x: float
y: float
z: float
def d(a: Point3D, b: Point3D) -> float:
return ((a.x - b.x) ** 2 + (a.y - b.y) ** 2 + (a.z - b.z) ** 2) ** 0.5
class MockCNCAsync:
def __init__(self):
self._position: Point3D ... | Python | 1 |
let before = matches.opt_present("b");
let regex = matches.opt_present("r");
let separator = match matches.opt_str("s") {
Some(m) => {
if m.len() == 0 {
crash!(1, "separator cannot be empty")
} else {
m
... | Rust | 0 |
新的
# model_save_path = sorted(model_files, key=os.path.getmtime)[-1]
# print(f" 找到备选模型: {model_save_path}")
# # 检查是否有可用的模型文件
# if model_save_path is None or not os.path.exists(model_save_path):
# ... | Python | 1 |
wb")
ret = sdlimage.IMG_SaveJPG_RW(sf, rw, 0, 90)
sdl2.SDL_RWclose(rw)
assert sdl2.SDL_GetError() == b""
assert ret == 0
assert os.path.exists(outpath)
# Try reopening the RW as a JPG
sf2 = sdlimage.IMG_Load(outpath.encode("utf-8"))
_verify_img_load(sf2)
surface.SDL_FreeSurface(sf)
... | Python | 1 |
import os
from copy import deepcopy
import pytest
from fibsem import utils
from fibsem.milling import get_protocol_from_stages
from autolamella import config as cfg
from autolamella.structures import (
AutoLamellaMethod,
AutoLamellaProtocol,
AutoLamellaStage,
LamellaState,
create_new_experiment,
... | Python | 1 |
.30694 64 1.31297 65 1.31905 \
66 1.32516 67 1.33129 68 1.33748 69 1.34371 70 1.34997 71 1.35627 \
72 1.36261 73 1.36900 74 1.37541 75 1.38187 76 1.38835 77 1.39489 \
78 1.40146 79 1.40806 80 1.41471 81 1.42138 82 1.42810 83 1.43486 \
84 1.44165 85 1.44848 86 1.45535 87 1.46225 88 1.46919 89 1.47616 \
90... | Rust | 0 |
#!/usr/bin/env python
import os
import pytest
import boutiques as bosh
from boutiques import __file__ as bfile
from boutiques.localExec import ExecutorError
from boutiques.tests.BaseTest import BaseTest
class TestExec(BaseTest):
@pytest.fixture(autouse=True)
def set_test_dir(self):
self.setup("exec... | Python | 1 |
�', '𐩆', '🇺',
'𞺣', '𒇾', '🝝', '𐛷', 'ㆯ', '𐧅', 'ꕃ', '⦃', '🍊', 'ጿ', '🠹',
'\u{b42}', '🤠', '𒊍', '𛅒', '𘫺', '𑋲', 'Ԝ', '𑈬', '𘠧', 'ᓽ', 'ꂵ',
'⨌', '𝀑', 'Ⴑ', 'ω', '𓃎', 'ვ', 'Ⓣ', '𚿾', 'ሪ', '𝧚', '𛉰', 'ƒ',
'𝧴', 'Ź', '🤆', '𓁒', '🪢', '㍻', 'ᒜ', '𝚔', '𜾈', '߄', '𖧅',
'\u{111bb}', 'ㇿ', 'ꯆ', 'ퟪ',... | Rust | 0 |
from wayne_utils import load_data, save_data, _PUNCATUATION_EN, _PUNCATUATION_ZH
import sys
import pandas as pd
import os
from tqdm import tqdm
_ROOT_PATH = "/home/jiangpeiwen2/jiangpeiwen2/text2table_preprocess/CPL"
# 列表出所有的文本和表格路径
first_data_path = os.path.join( _ROOT_PATH, "raw/FirstCollection")
second_data_path =... | Python | 1 |
assert_eq!(Ok("1.0".to_owned()), mock.getvar("version"));
mock.write
.return_value_for("getvar:something".as_bytes(), Ok(16));
mock.read.use_closure(Box::new(|buf| {
let reply = "FAIL";
unsafe { reply.as_ptr().copy_to_nonoverlapping(buf, reply.len()) };
... | Rust | 0 |
from modules.model.PixArtAlphaModel import PixArtAlphaModel
from modules.modelLoader.BaseModelLoader import BaseModelLoader
from modules.modelLoader.mixin.InternalModelLoaderMixin import InternalModelLoaderMixin
from modules.modelLoader.mixin.ModelSpecModelLoaderMixin import ModelSpecModelLoaderMixin
from modules.model... | Python | 1 |
yof=None):
"Return text width"
args = (text,)
if displayof:
args = ('-displayof', displayof, text)
return self._tk.getint(self._call("font", "measure", self.name, *args))
def metrics(self, *options, **kw):
"""Return font metrics.
For best performance, cr... | Python | 1 |
n(status_code=401, detail="无效的令牌")
chat = Chat()
try:
results = []
for image_base64 in image_req.images:
results.append(chat.query_ocr(image_base64, image_req.sorted))
return {"error": None, "results": results}
except HTTPException as he:
raise he
except Excep... | Python | 1 |
> for &'static TypeTable {
#[inline]
fn to_lua(self, _lua: &'lua Lua) -> Result<Value<'lua>> {
Ok(Value::LightUserData(LightUserData(
TypeTable::to_ptr(self) as *const _ as *mut _,
)))
}
}
impl<'lua> FromLua<'lua> for &'static TypeTable {
#[inline]
fn from_lua(lua_value:... | Rust | 0 |
class Solution:
def minimizeXor(self, num1: int, num2: int) -> int:
kMaxBit = 30
bits = num2.bit_count()
# can turn off all bits in num1
if num1.bit_count() == bits:
return num1
ans = 0
# turn off MSB if we have bits quota
for i in reversed(range(kMaxBit)):
if num1 >> i & 1:
... | Python | 1 |
def solve(grid):
h, w = len(grid), len(grid[0])
pts = [(i, j) for i in range(h) for j in range(w) if grid[i][j] == 8]
if not pts:
return []
ys = [i for i, _ in pts]
xs = [j for _, j in pts]
y0, y1 = min(ys), max(ys)
x0, x1 = min(xs), max(xs)
H, W = y1 - y0 + 1, x1 - x0 + 1
fr... | Python | 1 |
_eq!(3, c.cache_hits().unwrap());
assert_eq!(3, c.cache_misses().unwrap());
assert_eq!(Some(200), c.cache_remove(&2));
assert_eq!(1, c.cache_size());
// removing extra is ok
assert_eq!(None, c.cache_remove(&2));
assert_eq!(1, c.cache_size());
}
#[test]
fn... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
POC Name : TerraMaster NAS网络存储服务器无限制getshell
Author : a
mail : a@lcx.cc
"""
import urlparse
def assign(service, arg):
if service == 'terramaster':
arr = urlparse.urlparse(arg)
return True, '%s://%s/' % (arr.scheme, arr.netloc)
def a... | Python | 1 |
layout = QtWidgets.QGridLayout(header)
layout.addWidget(icon, 0, 0)
layout.addWidget(heading, 0, 1)
layout.addWidget(timestamp, 0, 2)
layout.addWidget(subheading, 1, 1, 1, -1)
layout.setColumnStretch(1, 1)
layout.setContentsMargins(5, 5, 5, 5)
body = QtWi... | Python | 1 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# GNU GPLv3, 29 June 2007
#
# Examples from Ch8 of the book "Blender Scripting with Python" by Isabel Lupiani.
# Copyright (C) 2024 Isabel Lupiani, Apress.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | Python | 1 |
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
@pytest.fixture()
def driver():
driver = webdriver.Chrome()
current_url = "https://webtucre.ru/tes... | Python | 1 |
k.size() == PK_SIZE {
let h = pk_from_trits(pk.slice())?;
Some(PublicKey {
pk,
h,
_phantom: std::marker::PhantomData,
})
} else {
None
}
}
/// Try to create `PublicKey` object from slice `pk`. Fails ... | Rust | 0 |
!("system-table-{:?}", id))
}
_ => None,
}
}
pub fn details(&self, id: GlobalId) -> Result<Option<PersistDetails>, Error> {
let persister = match self.persister.as_ref() {
Some(x) => x,
None => return Ok(None),
};
let stream_name =... | Rust | 0 |
import google.generativeai as genai
from config import Settings
settings = Settings()
class LLMService:
def __init__(self):
genai.configure(api_key=settings.GEMINI_API_KEY)
self.model = genai.GenerativeModel("gemini-2.0-flash-exp")
def generate_response(self, query: str, search_results: list... | Python | 1 |
metadata=None):
return grpc.experimental.unary_unary(request, target, '/langchain.LangChain/Chat',
langchain__pb2.ChatRequest.SerializeToString,
langchain__pb2.ChatResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compressi... | Python | 1 |
pub gun_turn_rate_limits: Clamped<f64>,
/// The range of allowed radar turn rate values.
pub radar_turn_rate_limits: Clamped<f64>,
/// Each robot's starting, and maximum, hit points.
pub max_hit_points: f64,
/// Each robot's starting, and maximum, shoot power.
pub max_shoot_power: f64,
... | Rust | 0 |
w(language: &str) -> Self {
Self {
language: language.to_string(),
loaded_snippets: DashSet::new(),
triggers: Trie::new(),
//should these go here?
//snippet_triggers: DashMap::new(),
//disabled_snippets: DashSet::new(),
}
}
... | Rust | 0 |
let mut prune_remove_time = Measure::start("prune_slots");
let removed_banks = prune_slots
.into_iter()
.filter_map(|slot| self.remove(slot))
.collect();
prune_remove_time.stop();
(
removed_banks,
prune_slots_time.as_ms(),
... | Rust | 0 |
])
if src == 'start': src += '_values'
if tgt == 'end': tgt += '_values'
lookup = dict(zip(*(element.nodes.dimension_values(d) for d in (2, lidx))))
src_vals = data['patches_1'][src]
tgt_vals = data['patches_1'][tgt]
data['patches_1'][src] = [lookup.get(v, v) for v in s... | Python | 1 |
et attestations = vec![att1, att2];
slasher_test_indiv(&attestations, &slashings, 4 * chunk_size);
}
#[test]
fn surrounded_by_single_val_single_chunk() {
let v = vec![0];
let att1 = indexed_att(&v, 0, 15, 0);
let att2 = indexed_att(&v, 1, 14, 0);
let slashings = hashset![att_slashing(&att1, &att2)]... | Rust | 0 |
, (&tx3_hash, 0)], 2);
let mut pool = ProposedPool::new(DEFAULT_MAX_ANCESTORS_SIZE);
pool.add_entry(TxEntry::new(
dummy_resolve(tx1.clone(), |_| None),
MOCK_CYCLES,
MOCK_FEE,
MOCK_SIZE,
))
.unwrap();
pool.add_entry(TxEntry::new(
dummy_resolve(tx2, |_| None),... | Rust | 0 |
[ref ref] => Self::Output::from_matrix_unchecked(self.matrix() * rhs.to_homogeneous());
);
// Similarity × Transform
md_impl_all!(
Mul, mul where N: Real;
(D, U1), (DimNameSum<D, U1>, DimNameSum<D, U1>)
for D: DimNameAdd<U1>, C: TCategoryMul<TAffine>, R: SubsetOf<MatrixN<N, DimNameSum<D, U1>> >;
self: ... | Rust | 0 |
# MIT License
# Copyright (c) 2023 OPPO
# 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, ... | Python | 1 |
Platform.IMAGE,
Platform.LAWN_MOWER,
Platform.LIGHT,
Platform.LOCK,
Platform.NUMBER,
Platform.SCENE,
Platform.SELECT,
Platform.SENSOR,
Platform.SIREN,
Platform.SWITCH,
Platform.TEXT,
Platform.UPDATE,
Platform.VACUUM,
Platform.VALVE,
Platform.WATER_HEATER,
]
REL... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.