text string | label_name string | labels int64 |
|---|---|---|
enerator used for interfaces.
interface<'a> {
/// The identifier for the interface.
pub(crate) ident: &'a str,
/// Sub types associated with the interface.
pub(crate) sub_types: &'a [Spanned<RpSubType>],
/// The sub type strategy associated with the interface.
pub(cra... | Rust | 0 |
{
let value =
*fields.get(index).ok_or_else(|| {
Error::from(format!("Column {} expected at {}, but have only {} fields",
col_name, index, fields.len()))
})?;
Ok(value)
}
fn parse_line<'a>(config: &GroupConfig, i_key: usize, i_value: usize, line: &'a... | Rust | 0 |
ted class (and optionally its confidence) for an image batch (NHWC:rgb). """
probs = self._model(batch_x)
if with_confidence:
return probs.numpy().argmax(axis=1), probs.numpy().max(axis=1)
else:
return probs.numpy().argmax(axis=1)
def training_step(self, ba... | Python | 1 |
== "chat":
return msg.role
return msg.type
for msg in st.session_state.langchain_messages:
streamlit_type = _get_openai_type(msg)
avatar = "🦜" if streamlit_type == "assistant" else None
with st.chat_message(streamlit_type, avatar=avatar):
st.markdown(msg.content)
run_collector = RunC... | Python | 1 |
"""
Write a function to find the volume of a sphere.
assert math.isclose(volume_sphere(10), 4188.790204786391, rel_tol=0.001)
"""
def volume_sphere(radius):
return (4/3) * math.pi * (radius ** 3)
assert math.isclose(volume_sphere(10), 4188.790204786391, rel_tol=0.001)
/python/python_fundamentals/for_loop_basic2.p... | Python | 1 |
en.is_some() {
new_list.push(token.unwrap().clone());
token = token_addr.next();
}
new_list
}
#[ink(message)]
pub fn set_new_manager(&mut self, to:AccountId) ->bool{
let caller = self.env().caller();
assert_eq!(caller == self.vault_ma... | Rust | 0 |
from django.core.cache import caches
from django_digest.utils import get_setting
from redis.exceptions import LockError
NONCE_NO_COUNT = '' # Needs to be something other than None to determine not set vs set to null
class RedisCacheNonceStorage():
_blocking_timeout = 30
def _get_cache(self):
# Dyna... | Python | 1 |
// retrieve interruptee's PS
wsr a0, EPS\level
l32i a0, sp, +XT_STK_PC // retrieve interruptee's PC
wsr a0, EPC\level
.endif
l32i a0, sp, +XT_STK_A0 // retrieve interruptee's A0
l32i sp, sp, +XT_STK_A1 // remove exception frame
rsync ... | Rust | 0 |
pattern
// * Each piece of luggage has a tracking id
// * Luggage goes through multiple states at the airport:
// * Check-in (passenger gives luggage to airport)
// * OnLoading (luggage is loaded onto correct plane)
// * Offloading (luggage is taken off plane at destination)
// * AwaitingPicku... | Rust | 0 |
pend(b_max_att_repres)
# fifth - max & mean
all_aware_repres.append(f_relevancy.max(2, keepdim=True)[0])
all_aware_repres.append(f_relevancy.mean(2, keepdim=True))
all_aware_repres.append(b_relevancy.max(2, keepdim=True)[0])
all_aware_repres.append(b_relevancy.mean(2, keepdim=Tr... | Python | 1 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
### Import the libraries and packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import seaborn as sns
# In[2]:
import warnings
warnings.filterwarnings("ignore")
# In[3]:
### displa... | Python | 1 |
{
unsafe {
let ccr = periph_freq_hz / 200000;
let trise = periph_freq_hz / 1000000 + 1;
let periph_freq_mhz = periph_freq_hz / 1000000;
self.cr2
.modify(|curr| curr | (periph_freq_mhz & I2C_CR2_FREQ_MASK));
self.ccr.write(ccr & I2C_CC... | Rust | 0 |
step < slice.len() && &slice[step] <= value {
slice = &slice[step..];
}
step = step >> 1;
}
slice = &slice[1..]; // advance one, as we always stayed <= value
}
return slice;
}use crate::algorithms::compose::matchers::SortedMatcher;
// TODO: Change this... | Rust | 0 |
import Metal
from PyObjCTools.TestSupport import TestCase, min_os_level, min_sdk_level
import objc
class TestMTLComputePipelineHelper(Metal.NSObject):
def maxTotalThreadsPerThreadgroup(self):
return 1
def threadExecutionWidth(self):
return 1
def staticThreadgroupMemoryLength(self):
... | Python | 1 |
gt_has_match = keeps.any(1)
pred_to_gt = [[] for x in range(pred_boxes.shape[0])]
for gt_ind, gt_box, keep_inds in zip(np.where(gt_has_match)[0],
gt_boxes[gt_has_match],
keeps[gt_has_match],
... | Python | 1 |
as u32;
};
if methods.sha256sum {
acc |= ALPM_PKG_VALIDATION_SHA256SUM as u32;
};
if methods.signature {
acc |= ALPM_PKG_VALIDATION_SIGNATURE as u32;
};
acc
}
}
... | Rust | 0 |
{
break;
}
_ => error!("{:?}", e),
}
}
})
.unwrap()
}
fn verifier_services(
packet_receiver: PacketReceiver,
verified_sender: Sender<VerifiedPackets>,
... | Rust | 0 |
requested.
logging.warning(
f"Database file {DEFAULT_DB_PATH} exists and overwrite is False. Assuming file is already generated."
)
return
# 1. Download dataset
dataset = download_dataset(DEFAULT_REPO_ID)
# 2. Create database schema (Tables only)
# Note: This will f... | Python | 1 |
ait?;
let guild = guild_id.0 as i64;
Ok(sqlx::query_scalar!(
"SELECT title FROM faq_titles WHERE guild=? ORDER BY title ASC",
guild
)
.fetch_all(&mut conn)
.await?)
}
pub async fn get_faq_tag(&self, guild_id: GuildId, tag: &str) -> Result<Option<... | Rust | 0 |
holds = {
MetricType.CPU_USAGE: {'warning': 70, 'critical': 90},
MetricType.MEMORY_USAGE: {'warning': 80, 'critical': 95},
MetricType.ERROR_RATE: {'warning': 0.05, 'critical': 0.15},
MetricType.SUCCESS_RATE: {'warning': 0.95, 'critical': 0.85},
MetricType.RESP... | Python | 1 |
r.state_dict()
torch.save(saved_dict, path)
# Upload model to external logging service
if self.logger_type in ["neptune", "wandb"]:
self.writer.save_model(path, self.current_learning_iteration)
def load(self, path, load_optimizer=True):
loaded_dict = torch.load(path)
... | Python | 1 |
_unwrap();
io.return_output(
engine::get_erc20_from_nep141(&io, &args.nep141)
.sdk_unwrap()
.as_slice(),
);
}
#[no_mangle]
pub extern "C" fn get_nep141_from_erc20() {
let mut io = Runtime;
let erc20_address: crate::engine::ERC20Ad... | Rust | 0 |
def box_cxcywh_to_xyxy(x):
x_c, y_c, w, h = x.unbind(-1)
b = [x_c - 0.5 * w, y_c - 0.5 * h, x_c + 0.5 * w, y_c + 0.5 * h]
return torch.stack(b, dim=-1)
| Python | 1 |
load_targets(events_dir)
refresher = threading.Thread(target=refresh_loop, args=(events_dir,), daemon=True)
refresher.start()
with ThreadPoolExecutor(max_workers=args.threads) as executor:
futures = [executor.submit(mine_worker, 500, args.dry_run) for _ in range(args.threads)]
try:
... | Python | 1 |
o
cgK1 @ s\ d Z ddlZddlZddlZejdd ZG dd dZG dd deZG d d
d
eZdS )a Provides classes to represent module version numbers (one class for
each style of version numbering). There are currently two such classes
implemented: StrictVersion and LooseVersion.
Ev... | Python | 1 |
oi.set_origin_invitation_id(oi_origin_invitation_id as u64);
invitations.push(oi);
}
response.set_invitations(invitations);
Ok(response)
}
fn row_to_account(&self, row: postgres::rows::Row) -> sessionsrv::Account {
let mut account = sessionsrv::Account::... | Rust | 0 |
# Real-valued Non-Volume Preserving layer
import torch
from torch import nn
from torch.utils.checkpoint import checkpoint
from .flow import Flow
def my_checkpoint(module, func, x):
if module.training and x.requires_grad:
return checkpoint(func, x, preserve_rng_state=False)
else:
return func(... | Python | 1 |
in range(FLAGS.num_games):
returns, history = _play_game(game, bots, argv[1:])
histories[" ".join(history)] += 1
for i, v in enumerate(returns):
overall_returns[i] += v
if v > 0:
overall_wins[i] += 1
except (KeyboardInterrupt, ... | Python | 1 |
from typing import List
class Solution:
def maximumCount(self, nums: List[int]) -> int:
n=len(nums)
count_neg = 0
count_zero = 0
for i in range(n):
if nums[i]<0:
count_neg+=1
elif nums[i]==0:
count_zero+=1
else:brea... | Python | 1 |
{
self
}
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}
fn layout(&mut self, widget: &mut Widget) {
self.label
.borrow_mut()
.state
.add_text_arg("value", &self.value.to_string());
widget.do_base_layout();
}
fn on_add(&mu... | Rust | 0 |
import subprocess
import sys
libraries = {
'cryptography': {'install': 'cryptography', 'import': 'cryptography'},
'pycryptodome': {'install': 'pycryptodome', 'import': 'Crypto'},
}
def install(libraries):
for name, lib in libraries.items():
try:
__import__(lib['import'])
pr... | Python | 1 |
PC Client
use crate::service::cache::{cache_get_nonce, cache_put_nonce};
use crate::service::error::RemoteNode::{EmptyNonce, InvalidNonce, InvalidStatusRequest, JSONRPC};
use crate::service::error::ServiceError;
use abscissa_core::tracing::info;
use jsonrpc_core::response::Output::{Failure, Success};
use jsonrpc_core:... | Rust | 0 |
d result in error"
);
}
#[test]
fn event_event_to_string() {
let event = Event::Completed;
assert_eq!(event_to_string(event), "completed");
}
}
//! A fully generated, opinionated API client library for Zoom.
//!
//! [](https://docs.r... | Rust | 0 |
self.phi = phi
"""map"""
super(ImageViewer3D_Sliced_Contour,self).__init__(ax,data, sliceDim, textStr, showColorbar)
def get_phi_slice_at_dimension(self,index):
"""
Get map (based on which we can draw contours) at a particular slice index
:param index: slice ind... | Python | 1 |
from typing import Any, Dict
import logging
from .constants import WORKSPACE_OPT_FIELDS
from .base import (
get_asana_client,
get_next_page,
remove_none_values,
AsanaToolExecutionError,
)
logger = logging.getLogger(__name__)
async def get_workspace_by_id(
workspace_id: str,
) -> Dict[str, Any]:
... | Python | 1 |
Self{
body,
path,
digest
}
}
fn body(self) -> String {
self.body
}
fn content_type(&self) -> &str {
CONTENT_TYPE_MANIFEST
}
fn digest(&self) -> &str {
self.digest.as_str()
}
}
impl Responder for WharfixManifest {
... | Rust | 0 |
let cpu = CpuFeatureLevel::default();
let w = 640;
let h = 480;
let input_plane = new_plane::<u16>(&mut ra, w, h);
let mut dst_plane = new_plane::<u16>(&mut ra, w, h);
let (row_frac, col_frac, src) = get_params(
&input_plane,
PlaneOffset { x: 0, y: 0 },
MotionVector { row: 0, col: 4 },
);
c... | Rust | 0 |
Store {
value: Arc<Mutex<Option<Vec<u8>>>>,
}
impl NodeStore for TrackingValueStore {
type Delegate = MockPlaneStore;
fn engine_info(&self) -> EngineInfo {
EngineInfo {
path: "tracking".to_string(),
kind: "tracking".to_string(),
}
}
fn lane_id_of(&self, _la... | Rust | 0 |
visiting.insert(index);
for dependency in graph.dependencies(index) {
match visit(graph, dependency, visited, visiting, ordered) {
Err(err) => return Err(err),
Ok(()) => {}
}
}
visiting.remove(&index);
visited.insert(index... | Rust | 0 |
initialize_symbol = self.find_symbol_in_methoddict("initialize",
w_class.class_shadow(self))
interp.perform(w_class, w_selector=initialize_symbol)
def find_symbol_in_methoddict(self, string, cls, fail=True):
if isinstance(cls, W_PointersObject):
cls = cls.... | Python | 1 |
import json
with open("rule_verification_results.json", "r") as f:
data = json.load(f)
# Filter and sort by average consistency score (descending)
filtered = sorted(data, key=lambda x: sum(x['consistency_scores']) / len(x['consistency_scores']), reverse=True)
top_rules = filtered[:5] # Adjust the number of top ... | Python | 1 |
else {
reads += 1
}
}
1 => {
let reads = SeqReads::get_seq_stats(&recs.trim().as_bytes());
sq_per_read.push(reads);
}
2 => {
if !&recs.starts_with('+') {
panic!(
... | Rust | 0 |
damage_player(20);
assert_eq!(dungeon.get_player_hp(), 80);
}
#[test]
fn get_num_enemies_returns_number_of_enemies() {
let mut dungeon = Dungeon::new();
assert_eq!(dungeon.get_num_enemies(), 0);
add_enemies(&mut dungeon, &vec![(1, 2), (3, 4)]);
assert_eq!(dungeon.get_num_enemies(), 2);
}
fn add_e... | Rust | 0 |
JSON20);
test_failure!(JSON21);
test_failure!(JSON22);
test_failure!(JSON23);
test_failure!(JSON26);
test_failure!(JSON28);
test_failure!(JSON29);
test_failure!(JSON30);
test_failure!(JSON31);
test_failure!(JSON32);
test_failure!(JSON33);
test_failure!(JSON34);
test_failure!(Key1);
test_failure!(Key2);
test_failure!(Ke... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: Kend
@Date: 2023/12/03
@Time: 15:19
@Description: post_process - 文件描述
@Modify:
@Contact: tankang0722@gmail.com
"""
import torch
import torchvision
"""
如果一个预测框的置信度是0.9,表示模型认为这个框内很可能包含一个对象。然后,模型预测这个对象属于 "猫" 类别的概率是0.8,属于 "狗" 类别的概率是0.2。
那么,这个预测框内对象属于 "猫" 类别的类别置信度... | Python | 1 |
import gurobipy as gp
from gurobipy import GRB
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def is_solvable(initial_state):
inversions = 0
empty_tile_row = 0 # Hàng của ô trống, đánh số từ 1
for i in range(len(initial_state)):
if initial_state... | Python | 1 |
rest distinct objects (distance, alignment)
Distinctive attributes when duplicates exist:
Ordinal position (e.g., 'third from right')
Size comparison (e.g., '20% larger than adjacent')
Unique markings (scratches/logos/wear patterns)
Structure requirements:
Single paragraph without line breaks
... | Python | 1 |
in depth bias calculations.
pub slope_factor: f32,
}
/// Specifies the culling mode.
///
/// This setting works in pair with `front_face`. The `front_face` setting tells the GPU whether
/// clockwise or counter-clockwise correspond to the front and the back of each triangle. Then
/// `cull_mode` lets you specify ... | Rust | 0 |
def train(trainloader, validloader, model, architecture, criterion,
optimizer, lr, args, tasks, device, meter):
valid_iter = iter(trainloader)
for step, (data, target) in enumerate(trainloader):
batch_size = data.size(0)
model.train()
data = data.to(device)
for task, label in... | Python | 1 |
ble=invalid-name
if isMinVersion(spark_version, 1.4):
# this doesn't work in Spark <= 1.3 - github docs don't mention the older .method() for writing avro
df = sqlContext.read.parquet(parquet_file)
df.write.format('com.databricks.spark.avro').save(avro_dir)
else:
... | Python | 1 |
esired publication name e.g. 'medium'
gist_threshold: int
only gistify code snippets with a line length greater than this
"""
new_md_str = ""
code_block_started = False
code_block = []
# We will collect all parts in this list, before saving them to the same gist:
gists = []
PLAC... | Python | 1 |
from poium import Page, CSSElement, Element
from time import sleep
class BaiduPage(Page):
search_input = CSSElement("#kw", describe="百度搜索框")
search_button = CSSElement("#su", describe="百度按钮")
icp = CSSElement("#cp", describe="备案信息")
search_key = CSSElement(".res-gap-right16", describe="")
setting_... | Python | 1 |
From) {
if start_at_beginning.is_some() {
warn!(message = "Use of deprecated option `start_at_beginning`. Please use `ignore_checkpoints` and `read_from` options instead.")
}
match start_at_beginning {
Some(true) => (
ignore_checkpoints.unwrap_or(true),
read_from.map... | Rust | 0 |
.context(list_by_elastic_pool::ExecuteRequestError)?;
match rsp.status() {
http::StatusCode::OK => {
let rsp_body = rsp.body();
let rsp_value: DatabaseListResult =
serde_json::from_slice(rsp_body).context(list_by_elastic_pool::DeserializeEr... | Rust | 0 |
import re
text = "Emails: JOE@example.com, WAYA@mail.com"
print(re.findall(r'\b[\w.-]+@[\w.-]+\.\w+\b', text))
date = "2025-09-24"
print(bool(re.match(r'^\d{4}-\d{2}-\d{2}$', date)))
s = "hello world, hello universe"
print(re.sub(r'hello', 'hi', s))
split_str = "hello@world.com#2025"
print(re.split(r'\W+', split_st... | Python | 1 |
ty())
.enumerate()
{
if index == 0 {
println!("\n## {}s", name);
println!("\n|{}|Description|\n|-----|---------|", name);
}
if !item.description.is_empty() || variant != BlockType::Resource {
println!("|`{}`|{}|", item.name, item.description.join("... | Rust | 0 |
idle) and 1 (operating at full discharge
rate)
"""
voltage = self.voltage
discharged = dt * load * self._peak_discharge_rate
new_voltage = (voltage if voltage is not None else self._max) - discharged
while new_voltage < self._min:
new_voltage += self.... | Python | 1 |
ring(),
stdout: stdout.to_str().unwrap().to_string(),
stderr: stderr.to_str().unwrap().to_string(),
..Default::default()
};
let req = with_namespace!(req, NAMESPACE);
let _resp = client.create(req).await.expect("Failed to create task");
println!("Task: {:?} created", CID);
... | Rust | 0 |
_address()?;
Ok(signers)
}
/// `calc_address` calculates the `Signers` address.
pub fn calc_address(&self) -> Result<Address> {
let mut clone = self.clone();
clone.address = Address::default();
let buf = clone.to_bytes()?;
let digest = Blake512Hasher::hash(&buf);
... | Rust | 0 |
"cie1000QosConfigInterfaceQbvGclAdminTableInfoGroup": cie1000QosConfigInterfaceQbvGclAdminTableInfoGroup,
"cie1000QosConfigInterfaceQbvParamsTableInfoGroup": cie1000QosConfigInterfaceQbvParamsTableInfoGroup,
"cie1000QosConfigQceTableInfoGroup": cie1000QosConfigQceTableInfoGroup,
"cie1000QosCon... | Python | 1 |
ror(#[from] identity_core::Error),
/// Caused by errors from the [identity_did] crate.
#[error(transparent)]
DIDError(#[from] identity_did::Error),
/// Caused by errors from the [identity_credential] crate.
#[error(transparent)]
CredentialError(#[from] identity_credential::Error),
/// Caused by errors fro... | Rust | 0 |
ED] state.
Disabled = 2,
/// This version is destroyed, and the key material is no longer stored.
/// A version may not leave this state once entered.
Destroyed = 3,
/// This version is scheduled for destruction, and will be destroyed soon.
/// Call
/// [RestoreCr... | Rust | 0 |
.await;
assert_matches!(res, AdminResponse::ActiveAppsListed(v) if v.contains(&"test-by-path".to_string()) && v.contains(&"test-by-hash".to_string())
);
handle.shutdown().await;
tokio::time::timeout(std::time::Duration::from_secs(1), shutdown)
.await
.ok();
... | Rust | 0 |
str = match self.poke_config.as_ref().map(|v| &v.poke_msg) {
Some(v) => v,
None => unreachable!("Unreachable! poke_clients invoked without poke_config!"),
};
let escaped = raw::escape_arg(msg);
let mut conn = self.conn.clone(Some(POKE_NICK))?;
thread::Builder::new... | Rust | 0 |
(pt['d']) for pt in self.odom_points])
max_pt = self.odom_points[max_idx]
marker_max = Marker()
marker_max.header.stamp = rospy.Time.now()
marker_max.header.frame_id = 'map'
marker_max.ns = 'lap_max_d'
marker_max.id = 12
marker_max.type... | Python | 1 |
"""
URL configuration for server project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... | Python | 1 |
count = random_range(5, 30);
let row_height = (app.window_rect().h() as i32 / row_count) as i32;
// seperate each line in parts
for i in (0..=row_count).rev() {
// how many fragments
let mut part_count = i + 1;
let mut parts = Vec::new();
for _ i... | Rust | 0 |
s};
use crate::deps::MutableDeps;
use crate::id::{Ballot, InstanceId, LocalInstanceId, ReplicaId, Seq};
use crate::ins::Instance;
use epkv_utils::cmp::max_assign;
use epkv_utils::iter::{copied_map_collect, map_collect};
use std::collections::{hash_map, HashMap};
use std::mem;
use fnv::FnvHashMap;
use ordered_vecmap:... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
L = 1.0 # Length of the rod (m)
N = 10 # Number of segments
dx = L / N # Spatial step (m)
dt = 0.01 # Time step (s)
time_steps = 100000 # Number of time steps
k = 200 # Thermal conductivity (W/m·K)
A = 0.01 ... | Python | 1 |
th, Game.button_height, (242, 210, 189), Game.TEXT_COLOR)
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
... | Python | 1 |
current_account_index = 0
last_error = None
max_retries = len(account_ids)
for i in range(max_retries):
try:
# 获取当前账户(粘性直到配额错误)
account_id = account_ids[current_account_index]
credentials = sel... | Python | 1 |
onally) pretrained on the LVD-142M dataset.
"""
return _make_dinov2_model(
arch_name="vit_large",
pretrained=pretrained,
weights=weights,
num_register_tokens=4,
interpolate_antialias=True,
interpolate_offset=0.0,
**kwargs,
)
def dinov2_vitg14_reg(*, ... | Python | 1 |
# -*- coding: utf-8 -*-
import pytest
import env # noqa: F401
from pybind11_tests import pickling as m
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
@pytest.mark.parametrize("cls_name", ["Pickleable", "PickleableNew"])
def test_roundtrip(cls_name):
cls = ... | Python | 1 |
x5c\x17\x07\x0d\
\xf3\x83\xcf]\xd7=\xce%a\xb4\x86\xe6\x89\x02N;\
\xa28x\xbd<X\xaf\xcf\xce}V\x8e\x80\xa2\x13\x0e\
\xd9`O.F\xe5\xacrO\x94\xeb\xa9d\x83%\x10\
\x03\xd1\xc2<\xed[\x02\xfa\x1ez\x90\x01pBle\
\xce\x81\xe2\xf0s\x1d=\xa9\xd16\xda/\x1e\xa7\xcf\x83\
\xa4\xf1:U\xf0y>\xf4\xbcq0\x10\xf0s?\xcc\
g\x024 \xd6\xcc/\x12:\xd... | Python | 1 |
import numpy as np
def average_remoteness(intervals, dtype=None):
"""
Calculates average remoteness of the intervals grouped by congeneric sequence.
$$
\\left[ g_j \\right]_{1 \\le j \\le m} =
\\left[
\\frac{1}{n_j} * \\sum_{i=1}^{n_j} \\log_2 \\Delta_{ij}
\\right]_{1 \\le j \\le m}
$... | Python | 1 |
#module load ucsc-tools and use genePredToGtf to create a gtf file. Then run the following script
#usage: python python_genepredtogtf.gtf genepredtogtf_output.gtf gtf_formatted.gtf
#following script will format the gtf file.
import sys
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
in... | Python | 1 |
import click
from constants import MODEL_NAME, PIPELINE_NAME, PIPELINE_STEP_NAME
from pipelines.inference_pipeline import inference_pipeline_retail
# from pipelines.inference_pipeline impor
from pipelines.training_pipeline import training_retail
DEPLOY = "deploy"
PREDICT = "predict"
DEPLOY_AND_PREDICT = "deploy_and... | Python | 1 |
import threading
import time
def tache_longue(nom: str) -> None:
print(f"Debut de {nom}")
time.sleep(3)
print(f"fin de {nom}")
# Création de 2 threads
thread1 = threading.Thread(target=tache_longue, args=("Tache 1", ))
thread2 = threading.Thread(target=tache_longue, args=("Tache 2", ))
# Démarre
threa... | Python | 1 |
in() >= 0.1
assert x.max() <= 42
def test_sample_powerlaw():
random_state = np.random.RandomState(seed=0)
x = sample_powerlaw(x_min=0.1, x_max=10, gamma=2, size=2, random_state=random_state)
assert_allclose(x, [0.14886601, 0.1873559])
def test_random_times():
# An example without dead time.
... | Python | 1 |
return Ok(4);
}
return Ok(4 + str_len); // 4 + str_len;
}
_ => Err(VoltError::InvalidColumnType(col_type))
}
}
fn calc_offsets(&mut self) -> Result<(), VoltError> {
let mut offsets = Vec::with_capacity((self.column_count + 1) as usize);
... | Rust | 0 |
y_markup=markup)
@bot.callback_query_handler(func=lambda call: call.data == 'svaz')
def registration_callback(call):
markup = types.InlineKeyboardMarkup()
btn5 = types.InlineKeyboardButton('Главное меню', callback_data='main_menu')
markup.row(btn5)
bot.edit_message_text(chat_id=call.message.chat.id, mes... | Python | 1 |
"ref_answer": self.ref_answer,
"correctness": correctness}
stage_d4_node_input = {'d_prompt_kv': d_prompt_kv}
return stage_d4_node_input
def get_stage_d5_node_input(self, best_answer, bad_answer):
target_1 = best_answer["stage_d1_output"]... | Python | 1 |
class Phone:
def __init__(self , brand , model_name , price):
self.brand = brand
self.model_name = model_name
self._price = price
def full_name(self):
return f"{self.brand} {self.model_name}"
def make_a_call(self,number):
return f"calling {number}......"
clas... | Python | 1 |
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | Python | 1 |
}
}
}
fn add_destination_order<S: Serializer>(&self, s: &mut S::SerializeStruct) {
if let Some(deor) = self.destination_order {
s.serialize_field(
"destination_order",
&QosData::new(ParameterId::PID_DESTINATION_ORDER, deor),
)
.unwrap();
}
}
fn add_time_bas... | Rust | 0 |
alues_ground[:, 0])
xmax = np.max(self.objective_values_ground[:, 0])
ymin = np.min(self.objective_values_ground[:, 1])
ymax = np.max(self.objective_values_ground[:, 1])
zmin = np.min(self.objective_values_ground[:, 2])
zmax = np.max(self.objective_values_ground[:, 2])
a... | Python | 1 |
deKeyType,
/// The file from which to read the node's secret key to use for libp2p networking.
///
/// The contents of the file are parsed according to the choice of `--node-key-type`
/// as follows:
///
/// `ed25519`:
/// The file must contain an unencoded 32 byte or hex encoded Ed25519 secret key.
///
/... | Rust | 0 |
Returns:
ReActAgent
"""
llm = llm or Settings.llm
if callback_manager is not None:
llm.callback_manager = callback_manager
memory = memory or memory_cls.from_defaults(
chat_history=chat_history or [], llm=llm
)
return cls(
... | Python | 1 |
# Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | Python | 1 |
cord
and "traceback" in record["result"]
):
# 找到traceback
error_info_raw["error_or_NOT"] = "error"
error_info_raw["error_msg"] = record["result"... | Python | 1 |
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
'''Base commands.
'''
import sublime_plugin
import os
from Dart.lib.pub_package import PubPackage
from Da... | Python | 1 |
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from yardimUI import NasilKullanilirYardim
import Scripts.Kamera.sabitler as sb
import sqlite3
import sys
import threading
import goruntu_isleme as gi
from anasayfaUI import Anasayfa
class ClickableLabel(QLabel):
def __init__(s... | Python | 1 |
2::new(0.0, room.depth / 2.0),
Door::East => Vec2::new(-room.width / 2.0, 0.0),
Door::West => Vec2::new(room.width / 2.0, 0.0),
};
let (width, height) = (1.0, 0.1);
let rotation = match door {
Door::North => 0.0,
Door::S... | Rust | 0 |
partner_location).norm() - radius_sum;
if abs_diff_eq!(distance, 0.0, epsilon = super::EPS) {
return;
}
}
let mut write = self.write().unwrap();
write.add_path(space, partner_id, partner_track_id);
... | Rust | 0 |
, captioned], check=True)
summary = summarize_segment(transcript_text)
dot_code = None
image_path = os.path.join(workdir, "summary_graph.png")
image_generated = False
try:
dot_match = re.search(r"```dot\s*(.*?)```", summary, re.DOTALL)
if dot_match:
... | Python | 1 |
:type ClientProtocol: str
:param _Remark: 说明信息
注意:此字段可能返回 null,表示取不到有效值。
:type Remark: str
:param _ConsumerType: 消费者类型,枚举值ACTIVELY, PASSIVELY
注意:此字段可能返回 null,表示取不到有效值。
:type ConsumerType: str
:param _BroadcastEnabled: 是否开启广播消费
:type BroadcastEnabled: bool
:param ... | Python | 1 |
RetryT>
where
MakeFutureT: FnMut() -> FutureT,
FutureT: Future<Output = Result<T, E>>,
{
/// Set the max duration to sleep between each attempt.
#[inline]
pub fn max_delay(mut self, delay: Duration) -> Self {
self.config = self.config.max_delay(delay);
self
}
/// Remove the ... | Rust | 0 |
tionChangedEvent {
/// The ID of the topology.
pub topology_id: ObjectId,
/// The topology's previous description.
pub previous_description: TopologyDescription,
/// The topology's new description.
pub new_description: TopologyDescription,
}
/// Published when a topology is initialized.
#[der... | Rust | 0 |
import torch
from torch import nn
from torch.nn import Conv2d,MaxPool2d,Flatten,Linear
import torchvision
from torch.utils.tensorboard import SummaryWriter
dataset = torchvision.datasets.CIFAR10(root = r'C:\Users\13394\Desktop\项目\PyTorch\dataset',train = False ,transform=torchvision.transforms.ToTensor())
class BS(nn.... | Python | 1 |
Throttled,
"EVENTBRIDGE_UNAVAILABLE" => ErrorCode::EventbridgeUnavailable,
"INTERNAL_ERROR" => ErrorCode::InternalError,
"RESOURCE_NOT_FOUND" => ErrorCode::ResourceNotFound,
"RESOURCE_SCAN_NOT_DISABLED" => ErrorCode::ResourceScanNotDisabled,
"SSM_THROTTLED" =>... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.