text string | label_name string | labels int64 |
|---|---|---|
else:
print(f"❌ Document status check failed: {doc_status_response.status_code}")
# Step 5: Verify file exists in storage
print("\n🔄 Step 5: Verifying file exists in storage...")
verify_response = await client.get(signed_url)
if verify_response.status_co... | Python | 1 |
�', "fú"),
('𦿂', "yuán"),
('𦿃', "shǎo"),
('𦿅', "bìng"),
('𦿆', "dàng"),
('𦿇', "shì"),
('𦿊', "lú"),
('𦿋', "qiè"),
('𦿌', "luó"),
('𦿍', "pò"),
('𦿏', "méng,mèng"),
('𦿐', "jié"),
('𦿓', "jī"),
('𦿖', "lù"),
('𧀄', "chàng"),
('𧀅', "miè,mò"),
('𧀆', "m... | Rust | 0 |
("a", Integer),
("b", Integer),
("c", Integer),
("d", Integer),
("e", Integer),
("f", Integer),
];
pub const TIME_SUFFIX: &[(&str, McGroupType)] = &[("s", TimeS), ("t", TimeT), ("d", TimeD)];
pub fn uq_string(p: &mut McParser) {
p.try_token(uq_string_tk, UnquotedString);
}
pub fn uq_stri... | Rust | 0 |
"set_property BITSTREAM.CONFIG.SPI_FALL_EDGE YES [current_design]",
]
self.toolchain.additional_commands = \
["write_cfgmem -force -format bin -interface spix1 -size 4 "
"-loadbit \"up 0x0 {build_name}.bit\" -file {build_name}.bin"]
def create_programmer(self):
ret... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class ProjectTask(models.Model):
_inherit = "project.task"
def _send_sms(self):
for task in self:
if task.partner_id and task.stage_id and task.stage_id.sms_tem... | Python | 1 |
import cohere
from typing import List, Dict, Any
from app.config import settings
import logging
logger = logging.getLogger(__name__)
class Reranker:
def __init__(self):
self.co = cohere.Client(settings.COHERE_API_KEY)
def rerank(self, query: str, documents: List[Dict[str, Any]], top_k: int = 5) -> Li... | Python | 1 |
///
async fn add_to_db(
conn: &mut SqliteConnection,
zettels: Vec<ParserGatherer>,
) -> Result<(), anyhow::Error> {
conn.execute("BEGIN").await?;
for zettel in zettels {
conn.execute(
sqlx::query("INSERT OR REPLACE INTO full_text VALUES(?,?);")
... | Rust | 0 |
function.
"""
global WORKLOAD_FUNC_REGISTRY
workload = json.loads(workload_key)
if not workload[0] in WORKLOAD_FUNC_REGISTRY:
raise ValueError(
"%s is not registered. " % workload[0]
+ "Please register it with @auto_scheduler.register_workload"
)
return workl... | Python | 1 |
"""
ASGI config for lab_management project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | Python | 1 |
# ! Adding Metadata
new_room.add_metadata(room_a)
new_room.add_metadata(room_b)
new_room.refresh()
new_room.compute_orientations()
new_room.set_status(ROOM_STATUS.MERGED)
room_a.set_status(ROOM_STATUS.FOR_DELETION)
room_b.set_status(ROOM_STATUS.FOR_DELETION)
... | Python | 1 |
mat!("Failed to persist record: {}", e)))
}
async fn batch_set(&self, records: Vec<DbRecord>) -> Result<(), AkdStorageError> {
// TODO: This is really bad, we may end up with partial writes in case of failure.
for record in records {
self.set(record).await?;
}
Ok(())... | Rust | 0 |
# This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.linalg` namespace for importing the functions
# included below.
import warnings
from . import _special_matrices
__all__ = [ # noqa: F822
'tri', 'tril', 'triu', 'toeplitz', 'circulant', 'hankel',
'hadamard', 'leslie'... | Python | 1 |
ted_file_path):
decrypt_file(encrypted_file_path, key)
def is_file_encrypted(file_path):
return file_path.endswith('.dedsec')
def encrypt_file(file_path, key):
iv = os.urandom(16)
cipher = Cipher(algorithms.AES(key), modes.CFB(iv), backend=default_backend())
with open(file_path, 'rb'... | Python | 1 |
[id] {
for (t, val) in track.iter().enumerate() {
waveform[t + start] += val;
}
}
}
Some(waveform)
}
fn box_clone(&self) -> Box<dyn Sample> {
let mut tracks = Vec::new();
for track in &self.tracks {
trac... | Rust | 0 |
class LRMult(object):
def __init__(self, lr_mult=1.):
self.lr_mult = lr_mult
def __call__(self, m):
if getattr(m, 'weight', None) is not None:
m.weight.lr_mult = self.lr_mult
if getattr(m, 'bias', None) is not None:
m.bias.lr_mult = self.lr_mult
| Python | 1 |
from tests.runtime_aggtest.aggtst_base import TstView
from decimal import Decimal
class aggtst_decimal_arg_min_value(TstView):
def __init__(self):
# checked manually
self.data = [{"c1": Decimal("1111.52"), "c2": Decimal("2231.90")}]
self.sql = """CREATE MATERIALIZED VIEW decimal_arg_min AS... | Python | 1 |
Alias", alias, "doesn't exist"].join(" ")));
match existing_alias {
Ok(alias_record) => {
// Check if alias is owned by user
match slack_users.filter(slack_users_id.eq(&alias_record.slack_user_id)).first::<SlackUser>(conn) {
Ok(SlackUser { id: _, s... | Rust | 0 |
from math import factorial, comb
total_games = int(input("Въведете брой мачове: "))
p_win = float(input("Вероятност за победа (в проценти): ")) / 100
p_draw = float(input("Вероятност за равен (в проценти): ")) / 100
p_loss = float(input("Вероятност за загуба (в проценти): ")) / 100
all_probabilities = {}
for k_win i... | Python | 1 |
县"),
("330226", "浙江省宁海县"),
("330227", "浙江省鄞县"),
("330281", "浙江省余姚市"),
("330282", "浙江省慈溪市"),
("330283", "浙江省奉化市"),
("330300", "浙江省温州市"),
("330301", "浙江省温州市市辖区"),
("330302", "浙江省温州市鹿城区"),
("330303", "浙江省温州市龙湾区"),
... | Rust | 0 |
.clone().unwrap());
// assert_eq!(decoded.unwrap()[0].value, amount);
let signed = sign(sign_config, &psbt_origin.clone().unwrap().psbt);
println!("{:#?}", signed.clone().unwrap());
assert_eq!(signed.clone().unwrap().is_finalized, true);
// let broadcasted = broadcast(config, &signed.unwrap().psbt);... | Rust | 0 |
oad.put_u16_le(this.warnings as u16);
payload.put_slice(this.info.as_bytes());
payload
}
}
impl MySQLPacket for MySQLOKPacket {
fn get_sequence_id(&self) -> u32 {
self.sequence_id
}
}
/**
* ERR packet protocol for MySQL.
*
* @see <a href="https://dev.mysql.com/doc/internals/en... | Rust | 0 |
_static,
use_calib_mode=False)
elif args.run_mode == "trt_fp16":
config.enable_tensorrt_engine(
workspace_size=1 << 30,
max_batch_size=1,
min_subgraph_size=15,
precision_mode=PrecisionType.Half,
use_static=trt_use_static,
us... | Python | 1 |
'''
sample_async_00.py
asyncと協調テスト
- Pico W 本体のLEDとボタンの操作
- プログラム開始時に LEDを 3回点滅させる
- ボタンを押して点滅開始、ボタン長押しで消灯
- ボタンを 20秒以上操作しないと、LEDを消灯してプログラム終了
'''
import time
from e_module import Edas
from e_machine import Eloop, Button, Bootsel_button, LED
# Eloop.start(loop_interval=10, tracelevel=14)
Eloop.start(loop_interval... | Python | 1 |
ring());
let name: Name = vec!["x", ".", "y"].into();
assert_eq!("x.y", name.to_string());
let name: Name = vec!["x", " . ", "y"].into();
assert_eq!("x.y", name.to_string());
let name: Name = vec![".", "x", "y"].into();
assert_eq!(".x y", name.to_string());
let name: Name = vec!["x", "y... | Rust | 0 |
e various nodes of the network.
pub bit_segment_1: u8,
/// Specifies the number of time quanta in Bit Segment 2: 1TQ..8TQ
/// defines the location of the transmit point. It represents the
/// PHASE_SEG2 of the CAN standard. Its duration is programmable
/// between 1 and 8 time quanta but may also b... | Rust | 0 |
from fastapi import FastAPI, HTTPException, Request
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
from pydantic import BaseModel
from chat_bot import PaintChatbot
from core.config import settings
import logging
import traceback
import time
logging.basicConfig(level=logging.INFO... | Python | 1 |
= get_console_mode(self.stdstream_handle)?;
// To enable ANSI colors (Windows 10 only):
// https://docs.microsoft.com/en-us/windows/console/setconsolemode
if original_stdstream_mode & wincon::ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0 {
let raw = original_stdstream_mode... | Rust | 0 |
/ 8];
let iter = chunks.chunks_exact(size_of);
let start = if slice.len() > size_of {
slice.len() - size_of
} else {
0
};
let remainder = &slice[start..];
Self {
iter,
remainder,
phantom: std::marker::PhantomDa... | Rust | 0 |
def test_inference_batch_consistent(self):
self._test_inference_batch_consistent(batch_sizes=[2])
| Python | 1 |
_WAIT_SECS seconds for the zwave network
# to be ready.
for i in range(NETWORK_READY_WAIT_SECS):
_LOGGER.info(
"network state: %d %s", NETWORK.state, NETWORK.state_str)
if NETWORK.state >= NETWORK.STATE_AWAKED:
_LOGGER.info("zwave ready after %d se... | Python | 1 |
{
|it| $( -> $crate::Ae![$( $ty )|+] )? { $crate::Either::Right($crate::Either::Right($crate::Either::Right($crate::Either::Right($crate::Either::Left(it))))) }
};
($( <$( $ty:ty )|+> )? :: 4 ) => {
|it| $( -> $crate::Ae![$( $ty )|+] )? { $crate::Either::Right($crate::Either::Right($crate::Ei... | Rust | 0 |
b struct Caret {
syntax: crate::SyntaxToken,
}
impl crate::ast::AstToken for Caret {
/// Returns `true` if the given [`SyntaxKind`] is a [`CARET`]
/// [`SyntaxKind`]: crate::SyntaxKind
/// [`CARET`]: crate::SyntaxKind::CARET
#[inline]
fn can_cast_from(kind: crate::SyntaxKind) -> bool {
k... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
def plotWithLabels(data, labels, title="Best Path Found by Genetic Algorithm"):
"""
Plot the path between cities with city labels.
Parameters:
- data (numpy.ndarray): Array of city coordinates [lat, lng]
- labels (list): List of city names corresp... | Python | 1 |
"""
Celery workers monitoring
Мониторинг Celery воркеров и очередей
"""
import logging
import time
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
logger = logging.getLogger(__name__)
class CeleryMonitor:
"""
Монитор для Celery workers и задач
Отслеживает:
... | Python | 1 |
import pandas as pd
import pyodbc
import numpy
import time
from pyneoinstance import Neo4jInstance
from pyneoinstance import load_yaml_file
from bs4 import BeautifulSoup
import logging
logging.basicConfig(level=logging.INFO)
def importingNodeMicroblogPost(cnxn, graph):
"""
graph as neo4j (Target DB) connector... | Python | 1 |
writer_with_size(DEFAULT_BUFFER_LENGTH)
}
/// Create a stream writer with custom buffer size.
///
/// See [`stream_writer`].
///
/// [`stream_writer`]: #fn.stream_writer
pub fn stream_writer_with_size(&mut self, size: usize) -> Result<StreamWriter<W>> {
StreamWriter::new(ChunkOutput... | Rust | 0 |
ld_points() * 2 {
let coord: <Range<T> as AsRangedCoord>::CoordDescType = self.0.clone().into();
let normal = coord.key_points(hint.max_num_points());
return normal;
}
self.bold_key_points(&hint)
}
}
impl<T: TimeValue + Clone> DiscreteRanged for Monthly<T>
where
... | Rust | 0 |
"""
Тип данных bool в Python представляет собой логические значения и используется для хранения произвольных значений,
которые могут быть истинными (True) или ложными (False).
1) Хотя bool является отдельным типом данных, в Python он на самом деле является подтипом int.
Значение True эквивалентно 1, а значение Fal... | Python | 1 |
# config.py - Configuration settings
import os
from pathlib import Path
from dotenv import load_dotenv
# Get the directory where this config file is located
CONFIG_DIR = Path(__file__).resolve().parent
# Load environment variables from .env file in the same directory
env_path = CONFIG_DIR / '.env'
load_dotenv(dotenv_... | Python | 1 |
f}|| q||r| j| }|||f}|| qn| td| |S )Nr rY r r< |