text string | label_name string | labels int64 |
|---|---|---|
{
unsafe {
*EXECUTOR = &exec as *const ();
}
}
pub fn create_task<E: GlobalExec>(exec: &E) {
}
}
//! # EEP: EEP Embeddable Profiler
//!
//! TODO FITZGEN: more docs here
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
// extern crate leb128;
pub mod ring_buffer... | Rust | 0 |
perf_monitor.start_timer("complex_matching")
K = build_matching_graph(odd, dist)
maxw = max((data['weight'] for _, _, data in K.edges(data=True)), default=0.0)
for _, _, data in K.edges(data=True):
data['wtrans'] = maxw - data['weight']
if start is None or start not in odd:
if start... | Python | 1 |
push_column(read_u16(&rgce[6..8]) as u32, &mut formula);
formula.push('$');
formula.push_str(&format!("{}", read_u16(&rgce[2..4]) as u32 + 1));
formula.push(':');
formula.push('$');
push_column(read_u16(&rgce[8..10]) as u32, &mut formu... | Rust | 0 |
));
}
}
}
}
all_rel_paths
})
}
fn hash_file_content(hash: &mut Digest, path: &Path, stat: &Metadata)
-> Result<(), io::Error>
{
if stat.file_type().is_file() {
let mut file = try!(File::open(&path));
try!(hash.stream(&mut file)... | Rust | 0 |
ode error: {}", source))]
BsonDecodeError {
source: bson::DecoderError,
},
#[snafu(display("mongo error: {}", source))]
MongoError {
source: mongodb::Error,
},
// insert error
InsertError,
/// update error
UpdateError,
#[snafu(display("generic error: {}", desc... | Rust | 0 |
(None),
OktaUserGroupMember.ended_at > ownership_time_limit_from_now,
)
).update(
{OktaUserGroupMember.ended_at: ownership_time_limit_from_now},
synchronize_session="fetch",
)
# Reduce all role ownerships for the giv... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 2 17:56:58 2024
@author: CNN-Visualization
"""
# load vgg modela
from keras.applications.vgg19 import VGG19
# load the model
model=VGG19()
# summarize the model
model.summary()
# show the layer numbers
# n=0
# # for layer in model.layers:
# # print(n,layer.name)
# #... | Python | 1 |
};
use crate::{memory::global::Global, private::Private};
use jl_sys::{
jl_array_typename, jl_llvmpointer_typename, jl_namedtuple_typename, jl_pointer_typename,
jl_tuple_typename, jl_type_typename, jl_typename_t, jl_typename_type, jl_vecelement_typename,
};
use std::{marker::PhantomData, ptr::NonNull};
/// Des... | Rust | 0 |
&self.activation.forward(&self.label_head.forward(&hidden))?,
train,
)?;
// From from these representations, compute the label score matrix.
let relation_score_logits = self
.bilinear_label
.forward(&label_head, &label_dependent)?
// ... | Rust | 0 |
Ok(aws_smithy_http::body::SdkBody::from(out))
}
pub fn serialize_operation_crate_operation_describe_replace_root_volume_tasks(
input: &crate::input::DescribeReplaceRootVolumeTasksInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::SerializationError> {
let mut out = String::new(... | Rust | 0 |
usize {
encoding_rs::mem::utf8_latin1_up_to(::std::slice::from_raw_parts(buffer, len))
}
/// Returns the index of first byte that starts a non-Latin1 byte
/// sequence, or the length of the string if there are none.
///
/// # Undefined behavior
///
/// UB ensues if `buffer` and `buffer_len` don't designate a vali... | Rust | 0 |
import os
import json
from datetime import datetime
# Set the path to current directory, or specify an absolute path
repo_path = '.'
def generate_file_structure(repo_path):
file_structure = {}
for root, dirs, files in os.walk(repo_path):
for file in files:
if file.endswith('.json'):
... | Python | 1 |
ude::*;
#[wasm_bindgen(module = "./array")]
extern "C" {
fn topArray() -> f64;
fn getNumber() -> i32;
fn lowerCase(str: &str) -> String;
}
#[wasm_bindgen]
pub fn sum_of_square_root() -> f64 {
let n = getNumber();
let mut sum = 0;
for _ in 0..n {
sum = sum + (topArray().sqrt() as i64);... | Rust | 0 |
T: ToOwned<Owned = U> + ?Sized,
T::Owned: BorshDeserialize,
{
fn deserialize(buf: &mut &[u8]) -> Result<Self> {
Ok(T::Owned::deserialize(buf)?.into())
}
}
#[cfg(feature = "rc")]
impl<T, U> BorshDeserialize for Arc<T>
where
U: Into<Arc<T>> + Borrow<T>,
T: ToOwned<Owned = U> + ?Sized,
T::... | Rust | 0 |
metric)
runner_state = (train_state, env_state, last_obs, rng, prev_done)
return runner_state, (metric, traj_batch.obs, traj_batch.action)
if log_timestep_returns:
runner_state, (metric, actor_obs, actor_actions) = jax.lax.scan(
_update_step, runner_state, ... | Python | 1 |
import os
import mxnet as mx
# path
source_root = os.path.abspath(os.path.join(os.getcwd(), os.path.pardir))
data_root = os.path.join(source_root, 'IWSLT')
model_root = os.path.join(source_root, 'IWSLT', 'model')
log_root = os.path.join(source_root, 'IWSLT', 'log')
if not os.path.exists(model_root):
os.makedirs(m... | Python | 1 |
signd_7() {
run_test(&Instruction { mnemonic: Mnemonic::PSIGND, operand1: Some(Direct(XMM6)), operand2: Some(Direct(XMM1)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 56, 10, 241], OperandSize::Qword)
}
#[test]
fn psignd... | Rust | 0 |
#!/usr/bin/env python
import sys
import argparse
parser = argparse.ArgumentParser(description= """
Reformat a space or tab separated file to have each column aligned by inserting the
appropriate number of spaces
E.g. from
fc.enriched.bed 314660500 mc.enriched.bed 49501300 18811600 ... | Python | 1 |
>,
{
pub fn new<G>(g: G) -> Self
where
G: GraphRef + Visitable<NodeId = N, Map = VM>,
{
DfsSpace { dfs: Dfs::empty(g) }
}
}
impl<N, VM> Default for DfsSpace<N, VM>
where
VM: VisitMap<N> + Default,
{
fn default() -> Self {
DfsSpace {
dfs: Dfs {
... | Rust | 0 |
in_id(false).unwrap(), "test-chain-id");
///
/// # }
/// ```
///
/// Which will expand to:
///
/// ```ignore
/// impl CliConfiguration for Subcommand {
/// fn base_path(&self) -> Result<Option<PathBuf>> {
/// match self {
/// Subcommand::Variant1(cmd) => cmd.base_path(),
/// Subcomma... | Rust | 0 |
:rustc-link-search=native=test");
}
"#)
.file("c/src/lib.rs", "");
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(0).with_stdout(&format!("\
{compiling} c v0.5.0 ([..]
{running} `rustc [..]`
{running} `[..]`
{running} `rustc [..]`
{compiling} b v0.5.... | Rust | 0 |
d\xaay\
A\xc5KJE\xb7\x9b\xaeQ\x15!\xd4\xba\xefl\xa5\
\xbd\x94gU\xfa\x88\xb9\x95\xfb\xb4\xe6\xcb\xa1y\xe7\xef\
\xb8\x98\x03fm\x1c/N\x9a\x17\xfe\xfe<2`\x83\
\x22\xfdjc\x15g-ib\xa9\xe7O\xf9\x93\xff\xc2\
?\x8d&\xc1NW\x80\x84<\xf3p\xae\x13@\x00\xc3\
\x0d\xe2\xeb\xbb\xf4vn\x13'\x09\xc3\xc1\x90N\xdaa\
\x7fs\x8b\xef}\xf8=\x16'... | Python | 1 |
getFps', methods=['POST'])
def getFPS():
try:
log.info("START get FPS")
req = request.json
req = req[0]
out = []
for data in req:
videoPath = data["PATH"]
fileName = data["FILE_NAME"]
fps = getFps(videoPath)
out.append({"PATH":... | Python | 1 |
batch_box_preds, local_rois).reshape([-1, code_size])
batch_box_preds = rotate_points_along_z(
batch_box_preds.unsqueeze(axis=1), roi_ry).squeeze(axis=1)
batch_box_preds[:, 0:3] += roi_xyz
batch_box_preds = batch_box_preds.reshape([batch_size, -1, code_size])
return batch_cl... | Python | 1 |
ndom.randrange(arr.shape[0] - image_size + 1)
crop_x = random.randrange(arr.shape[1] - image_size + 1)
return arr[crop_y : crop_y + image_size, crop_x : crop_x + image_size]
def random_crop_two_arr(pil_image, pil_label, image_size, min_crop_frac=0.8, max_crop_frac=1.0):
assert pil_image.shape == pil_label... | Python | 1 |
, HashMap};
use std::io::Write;
use std::path::Path;
use std::process::exit;
const EXCLUDE_DEFAULT: [&str; 9] = [
r#"^\.git/"#,
r#"(^|/)Cargo\.lock$"#,
r#"\.dat$"#,
r#"\.log$"#,
r#"\.pcap$"#,
r#"\.png$"#,
r#"\.woff$"#,
r#"\.woff2$"#,
r#"^LICENSE$"#,
];
#[derive(Default, Deserialize... | Rust | 0 |
_precision = precision_score(y_true, y_pred, average='macro', labels=labels_to_consider)
macro_recall = recall_score(y_true, y_pred, average='macro', labels=labels_to_consider)
macro_f1 = f1_score(y_true, y_pred, average='macro', labels=labels_to_consider)
micro_precision = precision_score(y_tr... | Python | 1 |
n", map_datatype);
//println!("map_pto: {:?}\n\n", map_pto);
// map_datatype 可以有多层嵌套,但我们得有个层数限制,并且防范环形引用
//println!("\nmap_datatype:");
for (_k, v) in map_datatype.iter() {
let parentname = v.borrow_mut().name.clone();
for lineinfo in v.borrow_mut().members.iter_mut() {
recu... | Rust | 0 |
class Jugador:
def __init__(self, nombre, edad, equipo):
self.__nombre = nombre
self.__edad = edad
self.__equipo = equipo
#Aquí usamos el metodo del encapsulamiento para que no varie el nombre , la edad y el equipo
# Métodos 'get' para acceder a los atributos
def get_nombr... | Python | 1 |
ures_io::SeekFrom,
) -> Poll<futures_io::Result<u64>> {
self.project().reader.poll_seek(cx, pos)
}
}
<filename>src/api/domain/show_gluerecords.rs
//! [Show domain information](https://api.gandi.net/docs/domains/#v5-domain-domains-domain) route binding
use clap::{App, ArgMatches, SubCommand};
use reqwes... | Rust | 0 |
}
}
impl ToSrc for ParseNodeKind {
fn to_src(&self) -> Src {
let ident = self.ident();
quote!(_P::#ident)
}
}
quotable_to_src!(ParseNodeKind);
impl ToSrc for ParseNodeShape<ParseNodeKind> {
fn to_src(&self) -> Src {
let variant = match self {
ParseNodeShape::Opaque... | Rust | 0 |
import os
import aiobcrypt
import base64
# Class that provides general utils.
class GeneralUtils:
def convert_object_id_to_str(self, object):
object['id'] = str(object['_id'])
del object['_id']
| Python | 1 |
let serialized = bincode::serialize(&msg).unwrap();
self.client_protocol.write(&serialized).await?;
Ok(())
}
}
<filename>src/protos/trd_modify_order.rs<gh_stars>0
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct C2s {
///交易写操作防重放攻击
#[prost(message, required, tag="1")]
pub packet_... | Rust | 0 |
fF" 2 d Z ddlZddlZddlZddlZddlmZmZ ddlm Z g dZ
ej ej d j d Zd Z G d d
e Z e Zde ed < |