text string | label_name string | labels int64 |
|---|---|---|
<p>Tips: please double click left pdf file node ,or choose local pdf file. then click extract button to do the task.</p><p>操作提示:双击左侧的pdf节点,或者从本地选择pdf文件,然后点击extract按钮</p></body></html>"))
self.btnChooseFile.setText(_translate("PdfExtractExcel", " Local File"))
self.groupBox_7.setTitle(_translate("PdfExtr... | Python | 1 |
from rest_framework.decorators import api_view
from rest_framework.response import Response
from user_app.api.serializers import RegistrationSerializer
from rest_framework.authtoken.models import Token
# from user_app import models
from rest_framework import status
from rest_framework_simplejwt.tokens import RefreshTok... | Python | 1 |
from __future__ import annotations
import pytest
from qcarchivetesting.testing_classes import QCATestingSnowflake
from qcportal import PortalRequestError
from qcportal.managers import ManagerName, ManagerStatusEnum
from qcportal.utils import now_at_utc
def test_manager_client_get(snowflake: QCATestingSnowflake):
... | Python | 1 |
import re
from statistics import geometric_mean
benchmark_text = """
k: 7168; m: 1024; n: 1536; seed: 8135
⏱ 150 ± 0.2 µs
⚡ 149 µs 🐌 168 µs
k: 1536; m: 1024; n: 3072; seed: 6251
⏱ 49.1 ± 0.12 µs
⚡ 48.0 µs 🐌 57.9 µs
k: 7168; m: 1024; n: 576; seed: 12346
⏱ 146 ± 0.2 µs
⚡ 145 µs 🐌 160 µs
k: 256; m: 1024; n: 7... | Python | 1 |
.help("Path of your Rust crate root and Cargo.toml")
.default_value("./"),
);
let app = App::new("rust-i18n")
.bin_name("cargo")
.subcommand(extract_command)
.get_matches();
let mut results = HashMap::new();
#[allow(clippy::single_match)]
match app.subc... | Rust | 0 |
put.push_str(s);
self.output.push('\n');
}
}
}
fn fmt_add() -> String {
colors::green_bold("+").to_string()
}
fn fmt_add_text(x: &str) -> String {
colors::green(x).to_string()
}
fn fmt_add_text_highlight(x: &str) -> String {
colors::black_on_green(x).to_string()
}
fn fmt_rem() -> String {
colors... | Rust | 0 |
s0, ks1, bc, &mut ib); // tab key
for i in 0..13 {
let x = ks1 + i * ks0;
let y = ks0;
let m = metric[i as usize + 14];
kf.draw_key_border(x, y, ks0, bc, &mut ib);
if m != 0.01 {
kf.draw_key_background(x, y, ks0, intensity((m + offset) ... | Rust | 0 |
A, 0xCF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00, 0x90, 0x90,
0x17, 0x00, 0x6A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92,
0x00, 0x00, 0x90, 0x90, 0x0F, 0x20, 0xE0, 0x83, 0x... | Rust | 0 |
import pandas as pd
import os
def log_summary(method_name: str, base_dir="results"):
method_dir = os.path.join(base_dir, method_name, "Training")
if not os.path.exists(method_dir):
return f"[{method_name}] → Diretório não encontrado."
all_rows = []
for filename in sorted(os.listdir(method_dir... | Python | 1 |
ap_max_pool_percent = settings.get::<usize>("zswap_max_pool_percent");
// Reboot
initial_reboot(&login)?;
// Connect to host
let mut ushell = connect_and_setup_host_only(&login)?;
// Turn on SSDSWAP.
turn_on_ssdswap(&ushell)?;
// Collect timers on VM
let mut timers = vec![];
// ... | Rust | 0 |
from uuid import uuid4
import json
from .common import InfoExtractor
from ..utils import (
int_or_none,
try_get,
url_or_none,
ExtractorError,
)
class PolsatGoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?polsat(?:box)?go\.pl/.+/(?P<id>[0-9a-fA-F]+)(?:[/#?]|$)'
_TESTS = [{
'url'... | Python | 1 |
import numpy as np
from scipy.signal import savgol_filter, medfilt
from scipy.ndimage import gaussian_filter1d
def smooth(data, window_size, method="savgol", padding_mode="same", **kwargs):
"""
Smooth the data using the specified method.
Parameters:
data: np.ndarray
The data to smooth... | Python | 1 |
// instruction less.
assert_eq!(seek_instruction(&cpu, 0xF005, -2), 0xF001);
}
#[test]
fn seek_backward_impossible_1() {
let cpu = cpu_with_code! {
nop
stx 0x2B
};
// There's no way to land on 0xF003 (the last byte of the stx
// instruction... | Rust | 0 |
_base_ = './encnet_r50-d8_769x769_40k_cityscapes.py'
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
| Python | 1 |
SchedulerServer::new(
config_backend.clone(),
namespace.clone(),
request.remote_addr().ip(),
);
let scheduler_grpc_server = SchedulerGrpcServer::new(scheduler_server.clone());
let mut tonic = TonicServer::builder()
.ad... | Rust | 0 |
from typing import List
class Solution:
def NextSmallestElement(self, nums: List[int]):
n = len(nums)
st=[]
sme_map=[]
for i in range(n):
while st and st[-1]>=nums[i]:
st.pop()
if st:
sme_map.append(st[-1])
else:
... | Python | 1 |
impl<T: Parse> Parse for Bracketed<T> {
fn parse(input: ParseStream<'_>) -> SynResult<Self> {
let content;
bracketed!(content in input);
Ok(Bracketed(content.parse_terminated(T::parse)?))
}
}
#[derive(Debug)]
pub struct Braced<T>(pub Punctuated<T, Comma>);
impl<T: Parse> Parse for B... | Rust | 0 |
test!(text_003);
test!(text_004);
test!(text_005);
test!(text_006);
test!(text_007);
test!(text_008);
test!(text_009);
test!(text_010);
test!(text_011);
test!(tree_001);
test!(tree_002);
// test!(tree_003); // unsupported
test!(tree_err_001);
<filename>src/tools/rustfmt/tests/source/issue-2761.rs
const DATA: &'static [... | Rust | 0 |
], a * b.vertices[2]])
});
impl_op_ex!(*|a: &Matrix4, b: &Triangle| -> Triangle {
Triangle::new([
a.transform_point(&b.vertices[0]),
a.transform_point(&b.vertices[1]),
a.transform_point(&b.vertices[2]),
])
});
#[allow(clippy::op_ref)]
#[cfg(test)]
mod tests {
use super::*;
use ... | Rust | 0 |
import torch
__all__ = [
'query_ball_point',
'farthest_point_sample',
'NN3'
]
def square_distance(src, dst):
"""
Input:
src: source points, [B, N, C]
dst: target points, [B, M, C]
Output:
dist: per-point square distance, [B, N, M]
"""
B, N, _ = src.shape
_, ... | Python | 1 |
from core import common_utils
from core.logger import logger
from core import image_utils
from conf import settings
import os
import time
import subprocess
import threading
from tkinter import messagebox as mBox
# 开启静默模式不弹cmd窗口
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags = subprocess.STARTF_USESHOWWINDOW... | Python | 1 |
;
}
fn robot_movement(
keyboard_input: Res<Input<KeyCode>>,
// mut query: Query<&mut Transform, With<Robot>>,
mut camera_query: Query<&mut Transform, (With<Camera>, Without<Robot>)>,
mut velocities: Query<&mut RigidBodyVelocityComponent, With<Robot>>,
) {
// if let Ok(mut transform) = query.get_sin... | Rust | 0 |
t item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").major
1
r
r lenr )rC s r. major
Version.major ' #&dll"3q"8t||A?a?r- c V [ U R 5 S: a U R S $ S$ )sThe second item of :attr:`release`... | Python | 1 |
)
energy_scores = -temperature * torch.logsumexp(logits / temperature, dim=1)
# 不确定性分解
uncertainty_analysis = self._decompose_uncertainty(model, test_data, device)
return {
'calibrated_probabilities': calibrated_probs.cpu().numpy(),
'energy_scores': ... | Python | 1 |
_subgroup_assuming_on_curve());
// let point = Affine::get_point_from_x(Fq::from(335_u64), false);
assert_eq!(g.into_projective().mul(&[42_u64]).mul(&[2_u64]), g.into_projective().mul(&[84_u64]))
}<reponame>Jzow/rustlibrary
///
/// 字符串转换
/// 将任何类型转换为一个String就像实现ToString一样,不因该这样写
/// 应该实现fmt::Display自动字符串的特性
/... | Rust | 0 |
;
generate_on_func!(on_emptied "emptied");
generate_on_func!(on_ended "ended");
generate_on_func!(on_error "error");
generate_on_func!(on_focus "focus" FocusEvent);
generate_on_func!(on_input "input" InputEvent);
generate_on_func!(on_invalid "invalid");
generate_on_func!(on_keydown "keydown"... | Rust | 0 |
import urllib.request,urllib.parse
import json,re
url = "https://fe-api.zhaopin.com/c/i/sou?"
kw_work = input("请输入您想查找的工作的关键字:")
city = input("请输入您想选择的城市:")
start_page = int(input("请输入开始爬取的页:"))
end_page = int(input("请输入结束爬取的页:"))
for page in range(start_page,end_page+1):
data = {
'start': page,
'p... | Python | 1 |
a
d4 @ s d Z ddlZddlZddlZddlmZ ddlmZ g dZG dd dZ dd
dZ
dd
Zedej
jZdd Zdd Zedkreejdkree n@ejd ZeeZee ee W d n1 s0 Y dS )8A lexical analyzer class for simple shell-like syntaxes. N)deque)... | Python | 1 |
_mono_depth = outputs['stage{}'.format(stage_idx + 1)]['mono_depth'][0]
mi = np.min(stage_mono_depth[stage_mono_depth > 0])
ma = np.max(stage_mono_depth)
depth = (stage_mono_depth - mi) / (ma - mi + 1e-8)
depth = (255 * dept... | Python | 1 |
차순 정렬
lidar_2d_positions.sort(key=lambda x: (x[0], x[1]))
april_2d_positions.sort(key=lambda x: (x[0]))
# 맨 처음 좌표와 맨 끝 좌표를 기준으로 좌표를 나눔
divide_num = 30
divide_lidar_points = divide_points(lidar_2d_positions[0], lidar_2d_positions[-1], divi... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | Python | 1 |
}
}
}
}
fn load_event(path: &str, name_or_signature: &str) -> Result<Event, Error> {
let file = File::open(path)?;
let contract = Contract::load(file)?;
let params_start = name_or_signature.find('(');
match params_start {
// It's a signature.
Some(params_start) => {
let name = &name_or_signature[..p... | Rust | 0 |
arg_iter),
Err(Error::UnacceptableRequestAtThisState)
));
}
#[test]
fn test_empty_resource() {
let session = Session::Authorized(Authorized {
username: TEST_USER.to_owned(),
user_storage: AsyncUserStorage::default(),
});
let args = [];
... | Rust | 0 |
{
if maxi <= mini {
return seats[mini] + 1;
} else {
let mid = (mini + maxi) / 2;
match seats[mid].cmp(&(mid + 48)) {
Ordering::Greater => maxi = mid - 1,
_ => mini = mid,
};
}
}
}
pub fn solve(lines: &[String... | Rust | 0 |
(PError::IfElse, Span::from(i)));
}
}
}
/// Eat error Node
fn error(i: Cursor) -> PResult<Node> {
do_parse!(i, ws >> args: args_list >> end_expr >> (Node::Error(args)))
}
/// Eat raw Node
fn raw(i: Cursor, a_lws: bool) -> PResult<Node> {
let (i, a_rws) = end_expr(i)?;
let mut at = 0;
let ... | Rust | 0 |
> &mut ::std::string::String {
if self.unlock_token.is_none() {
self.unlock_token.set_default();
}
self.unlock_token.as_mut().unwrap()
}
// Take field
pub fn take_unlock_token(&mut self) -> ::std::string::String {
self.unlock_token.take().unwrap_or_else(|| ::std:... | Rust | 0 |
'''
PRÁCTICA 0 Estructura de Datos y Algoritmos IM. Curso 24/25
- AUTOR: David Sanz Fuertes
- EJERCICIO: 2
- EXPLICACIONES:
- La función frase_vocales() solicita al usuario que escriba una frase y cuenta el número de vocales presentes en ella. Utiliza un bucle para recorrer cada carácter y verifica si es una v... | Python | 1 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from password_generator import PasswordGenerator
import names
from random import randint, randrange
# Replace with your a... | Python | 1 |
AvailableEvent>,
mut ev_creature_activity_changed: EventWriter<CreatureActivityChangedEvent>,
) {
commands.spawn().insert(Ambience { is_forest: true });
let (world_columns, world_rows) = sim_params
.hexagon_builder
.get_world_columns_rows(sim_params.world_rect.size.x, sim_params.world_rect.... | Rust | 0 |
).unwrap());
let sync = ClockSynchronizer::new(cmd, channels.clone(), mock.clone());
let results = sync.sync_clocks().await;
assert_eq!(results.len(), 1);
assert_matches!(&results[0], (_, Some(v)) => {
let triple = (1, 2, 3).into();
assert_eq!(v.len(), 1);
... | Rust | 0 |
select,
};
use tokio_util::codec::Framed;
use super::config;
/// This lets multiple users talk to the same device simultaneously, which depending on the
/// user could be problematic.
async fn forward<T>(tcp: T, device: Transport) -> Result<()>
where
T: AsyncRead + AsyncWrite + 'static,
{
// Truncate each... | Rust | 0 |
def f(a):
for x in range(1, 1000):
for y in range(1, 1000):
f = (x+y<=24) or (y <= x-2) or (y >= a)
if not f:
return 0
return 1
for a in range(1, 1000):
if f(a):
print(a)
| Python | 1 |
#!/usr/bin/env python3
"""
🚀 GHST Launcher - AI Coding Engine
===================================
Simple launcher for the GHST AI coding engine with expert AI agents
for coding, debugging, and problem solving.
Created by: The GHST Expert Collective
Version: 0.1.0-alpha - AI Coding Engine Edition
"""
import sys
impo... | Python | 1 |
length:bytes.len()];
}
}
fn set_bytes(&mut self, bytes: &[u8]) {
let len = self.len();
self.replace_range(0..len, bytes);
}
}
object_struct!(NSMutableData);
impl INSData for NSMutableData { }
impl INSMutableData for NSMutableDa... | Rust | 0 |
-
# before_tests = "clefincode_chat.install.before_tests"
# Overriding Methods
# ------------------------------
override_whitelisted_methods = {
"frappe.desk.form.load.getdoc": "clefincode_chat.desk.custom_load.getdoc",
"frappe.desk.form.load.get_docinfo": "clefincode_chat.desk.custom_load.get_docinfo... | Python | 1 |
gment_stream.interpolations, 0u8),
CurveInterpolation::CubicBezier(bezier) => {
write(&mut segment_stream.interpolations, 1u8);
write(&mut segment_stream.interpolations, bezier.c1());
write(&mut segment_stream.interpolations, bezier.c2());
}
... | Rust | 0 |
import modelx as mx
from modelx.testing.testutil import ConfigureExecutor
import pytest
def test_change_attrref():
"""
m---s---bar<-m.bar
|
+--bar[a]---x
"""
m = mx.new_model()
s = m.new_space()
@mx.defcells
def foo(x):
return bar.x
@mx.defcells
def qu... | Python | 1 |
movl $$0x48+90*4, %eax
movl $0, %gs:(%eax)" :: "r"(limit) : "eax" : "volatile")
}
#[cfg(target_arch = "x86", target_os = "linux")]
#[cfg(target_arch = "x86", target_os = "freebsd")] #[inline(always)]
unsafe fn target_record_sp_limit(limit: uint) {
asm!("movl $0, %gs:48" :: "r"(limi... | Rust | 0 |
.0 / (2.0 * PI * (1.0 - cos_thetamax));
it
}
fn pdf_wi(&self, i: &InteractionData, wi: &Vector3<f32>) -> f32 {
let pcenter = self.object_to_world.transform_point(&Point3f::new(0.0, 0.0, 0.0));
// Return uniform PDF if point is inside sphere
let porigin = offset_ray_origin(&i.p,... | Rust | 0 |
U [ ; $ )N_OPTIONAL_ONNX_DTYPE_STR)
onnx_type_strs r is_optional_onnx_dtype_strr< |