text string | label_name string | labels int64 |
|---|---|---|
", "").strip()
if current_heading is not None
else "(no heading)",
line=start_of_section,
content="\n".join(current_section),
),
)
return chunks
class VueChunker(BaseChunker):
"""Chunks Vue Single ... | Python | 1 |
provider: Provider<Http>,
) -> eyre::Result<Option<WalletType>> {
if self.wallet.ledger {
let derivation = HDPath::LedgerLive(self.wallet.mnemonic_index as usize);
let ledger = Ledger::new(derivation, chain_id.as_u64()).await?;
Ok(Some(WalletType::Ledger(SignerMiddleware... | Rust | 0 |
import sys
from paraview.simple import *
dataFile = None
tempDir = None
for i, arg in enumerate(sys.argv):
if arg == "-D" and i+1 < len(sys.argv):
dataFile = sys.argv[i+1] + '/Testing/Data/can.ex2'
elif arg == "-T" and i+1 < len(sys.argv):
tempDir = sys.argv[i+1]
if dataFile == None:
print... | Python | 1 |
ash, Dot, LetterSpace],
'S' => vec![Dot, Dot, Dot, LetterSpace],
'T' => vec![Dash, LetterSpace],
'U' => vec![Dot, Dot, Dash, LetterSpace],
'V' => vec![Dot, Dot, Dot, Dash, LetterSpace],
'W' => vec![Dot, Dash, Dash, LetterSpace],
'X' => vec if you can as it'll have less overhead.
///
/// # Examples
///
/// [`Py... | Rust | 0 |
with optional downsampling of the internal
dimension for queries, keys, and values.
Args:
embedding_dim (int): Dimensionality of input embeddings.
num_heads (int): Number of attention heads.
downsample_rate (int): Factor by which internal dimensions are downsampled.... | Python | 1 |
arser()
config.read(filename)
if section not in config.sections():
config.add_section(section)
config.set(section, key, str(value))
try:
with open(filename, "w") as cfgfile:
config.write(cfgfile)
except OSError as ex:
raise exceptions.QiskitUserConfigError(
... | Python | 1 |
tInitSystemSystemdRwFull(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY=y
BR2_PACKAGE_SYSTEMD_BACKLIGHT=y
BR2_PACKAGE_SYSTEMD_BINFMT=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Embedding模型配置测试脚本
本脚本用于测试不同embedding模型的配置和功能:
1. 测试模型配置验证
2. 测试API接口
3. 测试模型切换
4. 性能基准测试
"""
import os
import sys
import time
import asyncio
import aiohttp
from pathlib import Path
from typing import Dict, List, Any
# 添加项目根目录到Python路径
project_root = Path(__file__).p... | Python | 1 |
from timemachines.skatertools.ensembling.precisionweightedskater import normalize, weighted_average
import math
import numpy as np
# Not written ... jus scrap for now
def port_skater(y, s, k, a, t, e, r=0.5):
""" Special purpose skater since 'y' here takes a rather particular form,
and it is intended to ... | Python | 1 |
import numpy as np #type: ignore
import predicate as pd
import propozitii as exp
def main():
# Universuri
U1 = list(range(-10, 11))
U2 = list(range(-100, 101))
U3 = np.arange(-10.0, 10.1, 0.1)
print("a) ∀x∈U1 ∃y∈U2 : x² = y")
rezultat = exp.a(None, None, U1, U2)
if rezultat:
print(... | Python | 1 |
s.get('server')
status = res.get('status')
res_ip = ip
#if int(status) in Alive_Status:
try:
Other_Url.objects.creat... | Python | 1 |
numbers_string = input().split()
inverted_string = []
for index in numbers_string:
num = int(index)
inverted_string.append(-num)
print(inverted_string)
| Python | 1 |
class Grid:
"""Represents the simulation grid for sorting particles.
Attributes:
domain_size (float): The size of the domain (in each direction).
num_cells (int): The number of cells along each axis of the grid.
cell_size (float): The size of each cell in the grid.
grid (list of... | Python | 1 |
-> Bounds<u32> {
let x1 = self.x;
let x2 = self.x + self.w - 1;
let y1 = self.y;
let y2 = self.y + self.h - 1;
Bounds::new(x1, y1, x2, y2)
}
fn contains(&self, x: u32, y: u32) -> bool {
let Bounds(a, b) = self.bounds();
x >= a.x && x <= b.x && y >= a.y &... | Rust | 0 |
else false_series.loc[i] for i, c in condition.items()],
index=condition.index
)
@handle_sheet_function_errors
@filter_nans
@convert_args_to_series_type('bool', 'skip', ('default', True))
def OR(*argv: pd.Series) -> pd.Series:
"""
{
"function": "OR",
"description": "Returns True if... | Python | 1 |
{
segment = String::new();
} else {
segment.push(ch);
}
if i == pos {
break;
}
}
if !segment.is_empty() {
p... | Rust | 0 |
"""
Entry point for running the MCP RMM server as a standalone process.
This allows the server to be started with `python -m mcp_rmm.server` or imported as a module.
"""
from auth_mcp_server import mcp
def run():
"""Run the MCP server."""
mcp.run(transport="sse")
if __name__ == "__main__":
run() | Python | 1 |
import pytest
import aioblescan as aiobs
from aioblescan.plugins.atcmithermometer import *
@pytest.mark.parametrize(
"data, mac, temp, humidity, battery, battery_volts, counter, rssi",
[
(
b"\x04>\x1d\x02\x01\x00\x008R@8\xc1\xa4\x11\x10\x16\x1a\x18\xa4\xc18@R8\x00\xf3%U\x0b\x9f\xde\xdb",
... | Python | 1 |
from openpyxl import load_workbook
from pathlib import Path
from .models import Story
import datetime
def Data_Creation() :
# Path to the excel file
static_dir_api = Path(__file__).resolve().parent
excel_file_path = static_dir_api / 'static/Dans_Le_Temps_notebook.xlsx'
# Load the excel file
workbo... | Python | 1 |
ll()
# serializer_class = EmployeeSerializer
# class employeeDetailView(generics.RetrieveUpdateDestroyAPIView):
# queryset = Employee.objects.all()
# serializer_class=EmployeeSerializer
# lookup_field ='pk'
#viewSet
# class EmployeeViewSet(viewsets.ViewSet):
# def list(self,req):
# querys... | Python | 1 |
WARNING: This function is deprecated. Use read instead.
// extern "C" fn read_response(
// resource_handler: *mut _cef_resource_handler_t,
// data_out: *mut ::std::os::raw::c_void,
// bytes_to_read: ::std::os::raw::c_int,
// bytes_read: *mut ::std::os::raw::c_int,
// callbac... | Rust | 0 |
(mention.starts_with("<:") || mention.starts_with("<a:")) && mention.ends_with('>') {
let mut name = String::default();
let mut id = String::default();
let animated = &mention[1..3] == "a:";
let start = if animated { 3 } else { 2 };
for (i, x) in mention[start..].chars().enume... | Rust | 0 |
node in ast.walk(tree):
if isinstance(node, ast.FunctionDef) and node.name == func_name:
return True
return False
def _try_match(content, prefix, entrypoint):
# All markdown code blocks, as well as raw
code_blocks = [m[1] for m in re.findall(r"(\`{3}.*?\n+)([\s... | Python | 1 |
_files: bool,
}
/// Keeps the global configuration
#[derive(Debug)]
pub struct Configuration {
variables: ConfigurationVariables,
modified: bool,
}
impl Default for ConfigurationVariables {
fn default() -> Self {
let dirs = UserDirs::new().expect("Failed to determine default user directories");
... | Rust | 0 |
{
Key,
KeyValueSeparator,
ObjectValue,
ArrayValue,
ParseOpen,
FirstValue,
}
/// I'm not smart enough to figure out the behavior of handling escape sequences when
/// when scanning multi-bytes, so this fallback is for when I was to reset and
/// process bytewise. It is much slower, but escaped ... | Rust | 0 |
# coding = utf-8
"""Blob represents caffe::Blob"""
from __future__ import absolute_import
import ctypes
from .base import LIB
from .base import check_call, ctypes2numpy_shared
class Blob(object):
"""Blob in caffe, users shouldn't create object through this class.
Always gets a reference from Net object
""... | Python | 1 |
<Tensor>>,
) -> TractResult<TVec<Arc<Tensor>>> {
let input = args_1!(inputs);
let op = op.downcast_ref::<Delay>().ok_or("Wrong Op type")?;
let buffered = op.delay + op.overlap;
let input_pulse = input.shape()[op.axis];
let output_pulse = input_pulse + op.overlap;
let ... | Rust | 0 |
false => None,
}?;
let mut new_face = Face::debug_new(wires, polygon);
if !face.orientation() {
new_face.invert();
}
shell0.push(new_face);
}
Some(shell0)
}
/// polyline, not always connected
#[derive(Debug, Default, Clone)]
struct Polyline {
posi... | Rust | 0 |
'%Y-%m-%d %H:%M:%S', time.localtime(curr_time))
json_data = json.dumps(
{'time': formatted_time, 'user_speaking': user_speaking}
)
yield f"data:{json_data}\n\n"
time.sleep(userstate_graph_update_... | Python | 1 |
from .fullboard import FullBoard
from .composer import Composer | Python | 1 |
= "Divide-by-6"]
#[inline(always)]
pub fn divcore_5(self) -> &'a mut W {
self.variant(DIVCORE_A::DIVCORE_5)
}
#[doc = "Divide-by-7"]
#[inline(always)]
pub fn divcore_6(self) -> &'a mut W {
self.variant(DIVCORE_A::DIVCORE_6)
}
#[doc = "Divide-by-8"]
#[inline(always)]
pub fn divcore_7(self) ->... | Rust | 0 |
stake_pool_info = get_account(
&mut context.banks_client,
&stake_pool_accounts.stake_pool.pubkey(),
)
.await;
let stake_pool = try_from_slice_unchecked::<StakePool>(&stake_pool_info.data).unwrap();
assert_eq!(expected_carats, stake_pool.total_carats);
}
#[tokio::test]
async fn merge_in... | Rust | 0 |
num_stages': dq_best_config.num_stages,
}
tuning_result = {
'kernel_name' : 'bwd_kernel_dq',
'inputs' : inputs,
'tuned_kernel' : tuned_kernel,
'compiler_options' : compiler_options,
... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 8 22:38:04 2018
@author: liuchuang
检查确保它正确匹配栈顶部开始符号的类型。
如果两个符号不匹配,则字符串不匹配。
如果整个字符串都被处理完并且没有什么留在栈中,
则字符串匹配。
"""
from pythonds.basic.stack import Stack
def parChecker(symbolString):
s=Stack()
balanced = True
index = 0
while i... | Python | 1 |
root,
tezedge_count,
tezedge_mean_time,
tezedge_max_time,
tezedge_total_time,
irmin_mean_time,
irmin_max_time,
irmin_total_time,
tezedge_mem_time,
tezedge_add_time,
tezedge_add_tree_time,
tezedge_find... | Rust | 0 |
ipeline.DATASET_PRESETS[args.dataset]['total_steps'])
# Prepare the learning-rate and pre-fetch it to device to avoid delays.
lr_fn = hyper.create_learning_rate_schedule(total_steps, args.base_lr,
args.decay_type,
args.warm... | Python | 1 |
om .airavata import AiravataOperator
av = AiravataOperator(AuthContext.get_access_token())
grps = av.get_available_groups()
grp_names = [str(x.groupResourceProfileName) for x in grps]
if group is not None:
assert group in grp_names, f"Group {group} was not found. Available groups: {repr(grp_names)}"
gro... | Python | 1 |
"""
Test the "snabb loadtest transient" subcommand. Needs NIC names.
Since there are only two NIC names available in snabb-bot, and we need to
execute two programs networked to each other ("run" and "loadtest"), they
are set to on-a-stick mode, so that they use one NIC each instead of two.
"""
import unittest
from t... | Python | 1 |
)
#iswap.append(0)
#if S[0, 0] < 0.:
#S[:, 0] *= -1
#if abs(S[1, 1]) < np.abs(S[1, 0]).max():
#iswap.append(1)
#if abs(S[0, 0]) < np.abs(S[1, 0]):
#iswap.append(2)
#if iswap:
#i1, i2 = iswap
#print(f'swap; {iswap}')
#m1, m2 = mass[iswap]
#... | Python | 1 |
, slot);
Some(BothReg {
arch: dst_reg,
phys: slot,
})
} else {
None
}
},
Some,
)
}
pub fn predicted_addr(&self, tag: Tag) -> (Option<AbsPc>... | Rust | 0 |
ms to be higher, especially during the rush hours. It might reveal that
# our 95% percentile estimator underestimates the demand peaks. This could be be
# quantitatively confirmed by computing empirical coverage numbers as done in
# the :ref:`calibration of confidence intervals <calibration-section>`.
#
# Looking... | Python | 1 |
nt_rewards = rewards[:, burn_in_step:-1].unsqueeze(-1)
prev_rewards = rewards[:, burn_in_step - 1 : -2].unsqueeze(-1)
target_prev_rewards = agent_rewards
burnin_dones = dones[:, 1:burn_in_step].unsqueeze(-1)
burnin_target_dones = dones[:, 1 : burn_in_step + 1].unsqueeze(-1)
agent_dones = dones[:, bu... | Python | 1 |
ine(always)]
pub const fn ptr() -> *const p0_ns::RegisterBlock {
0x418c_0500 as *const _
}
}
impl Deref for P0_NS {
type Target = p0_ns::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*P0_NS::ptr() }
}
}
#[doc = "GPIO Port 0"]
pub mod p0_ns;
#[doc = "GPIO Port 1"]
pub st... | Rust | 0 |
brier-score result
df2_mean = pd.DataFrame(np.mean(FINAL2, axis=2), index = row_header, columns=col_header2)
df2_std = pd.DataFrame(np.std(FINAL2, axis=2), index = row_header, columns=col_header2)
df2_mean.to_csv(in_path + '/result_BRIER_FINAL_MEAN.csv')
df2_std.to_csv(in_path + '/result_BRIER_FINAL_STD.csv')
### P... | Python | 1 |
b == b' ').unwrap();
sum += unsafe { art.get_unchecked(space_pos + 1..) }
.parse::<usize>()
.unwrap();
}
}
write!(res, "({} : {})", cat, sum).unwrap();
}
for cat in list_cat {
let cat = cat.chars().next().unwrap();
... | Rust | 0 |
āng"),
('匪', "fěi,fēi,fēn"),
('匫', "hū"),
('匬', "yǔ"),
('匭', "guǐ"),
('匮', "kuì"),
('匯', "huì"),
('匰', "dān"),
('匱', "guì,kuì"),
('匲', "lián"),
('匳', "lián"),
('匴', "suǎn"),
('匵', "dú"),
('匶', "jiù"),
('匷', "jué"),
('匸', "xì"),
('匹', "pǐ"),
('区', "qū,ō... | Rust | 0 |
impl ::std::default::Default for Struct_mpv_event_end_file {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub type mpv_event_end_file = Struct_mpv_event_end_file;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_mpv_event_script_input_dispatch {
pub arg0: ::std::os::raw::c_int,
pub _t... | Rust | 0 |
make sure we look okay at default sizes when beside a textbox,
// we make sure we will have at least the same height as the default textbox.
let min_height = env.get(theme::BORDERED_WIDGET_HEIGHT);
let min_width = 100.0;
let baseline = self.label.baseline_offset();
ctx.set_basel... | Rust | 0 |
rg c
C s t }| rzt| \}} || W n$ tjyL } zd}| d tv rt| \}} | rj| d dkr|| |jtd nFt | d\}} |dur|g|dd< |