text string | label_name string | labels int64 |
|---|---|---|
SystemTime,
}
impl WorkStat {
#[inline(always)]
pub fn end_of_work(&self, worker_stat: &mut WorkerLocalStat) {
if !worker_stat.is_enabled() {
return;
};
worker_stat
.work_id_name_map
.insert(self.type_id, self.type_name);
*worker_stat.work_co... | Rust | 0 |
_block = crate::Pallet::<T>::get_undeployed_land_block(0);
match issued_undeployed_land_block {
Some(a) => {
// Verify details of UndeployedLandBlock
assert_eq!(a.approved, Some(target.clone()));
}
_ => {
// Should fail test
assert_eq!(0, 1);
}
}
}
// unapprove_undeployed_land_blocks
... | Rust | 0 |
= user_parent;
let mut builder = Builder::new(FunctionEntity(self.func));
builder.set_insert_point_before_inst(user_id);
builder.insert(gep_val);
}
}
fn able_to_be_sunk(&self, inst: &Instruction) -> bool {
inst.has_one_use() || {
inst.users
... | Rust | 0 |
import torch
import torch.nn as nn
from networks.decoder_modules import VAE
class AffordanceCVAE(nn.Module):
def __init__(self, in_dim, hidden_dim, latent_dim, condition_dim, coord_dim=None,
pred_len=4, condition_traj=True, z_scale=2.0):
super().__init__()
self.latent_dim = latent... | Python | 1 |
"""
Simple utility to decrypt secrets sent to `support@2i2c.org` via `age`
"""
import pathlib
import subprocess
import sys
import tempfile
from contextlib import contextmanager
import typer
from deployer.cli_app import DEVELOPMENT, app
@contextmanager
def decrypt_age_private_key():
"""
Decrypt our age priv... | Python | 1 |
h is 005 ng.
#At that first concentration, I go through each list_of_dictionaries' index, where each index is a unique dictionary
#At that particular index, I go through the keys' value that are specified for that particular concentration, which is ['Value ' + str(k) + ' at ' + i +'ng']
#Once k ==4, which means all t... | Python | 1 |
n uploaded_files:
now_filename=secure_filename(uploaded_file.filename)
file_contents = uploaded_file.read()
if now_filename[-4:]!=".txt" and now_filename[-4:]!=".csv":
return '<script>alert("上传文件接受csv文件或schema的txt文件");location.href="/import";</script>'... | Python | 1 |
# -*- coding: utf-8 -*-
import os
from datetime import datetime
import docx
def get_root_path():
return os.path.dirname(os.path.abspath(__file__))
def get_current_date():
date=datetime(datetime.now().year,datetime.now().month,datetime.now().day,0,0,0)
return date.strftime("%Y%m%d")
def get_file_path():
... | Python | 1 |
Self::DestTypeID>(senf,"traitcast_mut");
Self::_try_traitcast_mut(senf)
.map_err(|_| e )
}
#[inline]
unsafe fn _try_traitcast_mut<'s>(senf: &'s mut dyn WidgetMut<E>) -> Result<&'s mut T,()> {
// god plz fix https://github.com/rust-lang/rust/issues/51826
let t = TypeId::of... | Rust | 0 |
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const MSIRUNMODE_COMMIT: MSIRUNMODE = 18i32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub type MSISOURCETYPE = i32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServic... | Rust | 0 |
igger source is CTIMERA5 OUT2."]
A5OUT2 = 9,
#[doc = "10: Trigger source is CTIMERA1 OUT2."]
A1OUT2 = 10,
#[doc = "11: Trigger source is CTIMERB1 OUT2."]
B1OUT2 = 11,
#[doc = "12: Trigger source is CTIMERA6 OUT2, dual edge."]
A6OUT2DUAL = 12,
#[doc = "13: Trigger source is CTIMERA7 OUT2,... | Rust | 0 |
.get_album(track.album_id).unwrap();
write!(
w,
r#"{{"queue_id":"{}","track_id":"{}","title":"#,
queued_track.queue_id,
queued_track.track_id,
)?;
serde_json::to_writer(&mut w, index.get_string(track.title))?;
write!(
w,
r#","album_id":"{}","album_artist_i... | Rust | 0 |
eg<u16, _SMDMAEN>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _SMDMAEN;
#[doc = "`read()` method returns [smdmaen::R](smdmaen::R) reader structure"]
impl crate::Readable for SMDMAEN {}
#[doc = "`write(|w| ..)` method takes [smdmaen::W](smdmaen::W) writer structure"]
impl crate::Writable for SMDMAEN {}
#[doc = "DM... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
def get_exporter(nmax, data):
from iutils.ioOBJ import export_2d as export
from time import time
from numpy import zeros
verts = zeros((nmax, 2),'double')
# edges = zeros((nmax, 2),'int')
line = zeros(nmax,'int')
t0 = time()
def f(dm, fn):
vnum = dm... | Python | 1 |
len: usize,
out: *mut *mut VipsImage,
...
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn vips_svgload(
filename: *const ::std::os::raw::c_char,
out: *mut *mut VipsImage,
...
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn vips_svgload_buffer(
bu... | Rust | 0 |
from rescuer import Rescuer
from constants import VS
class RescuerManager(Rescuer):
def __init__(self, env, config_file):
super().__init__(env, config_file)
self.rescuers = []
self.explores = []
def define_rescuers_and_explores(self, list_rescuers, list_explores):
self.rescue... | Python | 1 |
do as well.
pub fn add_scope<T, S>(mut self, scope: T) -> ReportGenerateCall<'a, C, A>
where T: Into<Option<S>>,
S: AsRef<str> {
match scope.into() {
Some(scope) => self._scopes.i... | Rust | 0 |
|
//! | (accessed via nominal-SP) |
//! | ... |
//! | stack slots |
//! | (accessed via nominal-SP) |
//! nominal SP ---------------> | (alloc'd by prologue) |
//!... | Rust | 0 |
"""Настройка конфигурации логирования для различных библиотек и модулей."""
import logging
import os
import warnings
def configure_logging(enable_configure_logging=True, global_logger=False, logging_level="WARNING"):
"""
Эта функция устанавливает уровни логирования для различных библиотек и модулей,
чтоб... | Python | 1 |
* [`spirit-daemonize`](https://crates.rs/crates/spirit-daemonize): Configuration and routines to go
into background and be a nice daemon.
* [`spirit-dipstick`](https://crates.rs/crates/spirit-dipstick): Configuration of the dipstick
metrics library.
* [`spirit-log`](https://crates.rs/crates/spirit-log): Configura... | Rust | 0 |
;
}
Some(pending_owner) => {
if deps.api.addr_canonicalize(info.sender.as_str())? != pending_owner {
return Err(ContractError::Unauthorized {});
}
config.owner = pending_owner;
config.pending_owner = None;
store_config(deps.sto... | Rust | 0 |
# sage_setup: distribution = sagemath-repl
"""
The Sage Input Hook
This lets us perform actions while IPython is sitting at the terminal input
prompt. We use it to reload attached files if they have changed.
"""
###########################################################################
# Copyright (C) 2016 Vol... | Python | 1 |
!(y0, Y0);
assert_field_offset!(x1, X1);
assert_field_offset!(y1, Y1);
assert_field_offset!(u0, U0);
assert_field_offset!(v0, V0);
assert_field_offset!(u1, U1);
assert_field_offset!(v1, V1);
}
<reponame>a-mackay/raystack<filename>src/api.rs
use crate::{Date, DateTime};
use chrono::SecondsFormat;... | Rust | 0 |
]_
page 175
Returns a `CondFunc` function, which can be used as argument in
`CondLink` elements.
The argument `rot_freq` may be time-dependent.
Args:
cont_temp: Temperature of the rolling contact
bear_type: Roller type, may be one of the following:
'angular contact ball... | Python | 1 |
from matplotlib import pyplot as plt
import pandas as pd
from pathlib import Path
p = Path('data/Records/Raw/Processed')
csv_files = list(p.glob('Gerardo*.csv'))
columns = ["CH1ENTROPY","CH2ENTROPY","CH3ENTROPY","CH4ENTROPY","CH5ENTROPY","CH6ENTROPY","CH7ENTROPY","CH8ENTROPY","CH9ENTROPY","CH10ENTROPY","CH11ENTROPY",... | Python | 1 |
import pandas as pd
import zipfile
# Specify the dataset
DATA_FILE = "../DataSet/data.zip"
# Extract the ZIP file to read the contained CSV
with zipfile.ZipFile(DATA_FILE, 'r') as z:
csv_filename = z.namelist()[0] # Get the first file name inside the ZIP
df = pd.read_csv(z.open(csv_filename))
# Display a pr... | Python | 1 |
import pandas as pd
from groq import Groq
import os
import re
from dotenv import load_dotenv
load_dotenv()
# -----------------------------
# Step 1: Load dataset locally
# -----------------------------
df = pd.read_csv("Data/test.csv")
print("Dataset loaded! Sample:")
print(df.head())
# ----------------------------... | Python | 1 |
import unittest
import numpy as np
from src.dsl import Function, Type, Variable, Expression, Program, Signature
from src.program_generator import arguments, programs, random_programs, IdGenerator, Variable, Type
class Test_program_generator(unittest.TestCase):
def test_arguments(self):
g = IdGenerator()
... | Python | 1 |
.get_flag(Flag::Zero), true);
assert_eq!(test_cpu.get_flag(Flag::HalfCarry), true);
assert_eq!(test_cpu.get_flag(Flag::AddSub), false);
// Reset HL
test_cpu.set_register(RegisterLoc::H, 0x00);
test_cpu.set_register(RegisterLoc::L, 0x00);
// ROM is read only
test... | Rust | 0 |
interface
pub fn claim(chan: Channel) -> (Tx, Rx) {
static TAKEN: AtomicBool = AtomicBool::new(false);
if TAKEN
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
{
RADIO::borrow_unchecked(|radio| {
radio.FREQUENCY.write(|w| w.FREQUENCY(chan a... | Rust | 0 |
/// The tunnel is currently opene.
Open,
/// The tunnel was opened but then was manually closed.
Closed,
/// The tunnel was opened but died unexpectedly.
///
/// This may be due to something like a connection drop or the user
/// killing the associated SSH process outside of the server... | Rust | 0 |
elf::put_varint(dst, src.len() as $uint);
dst.extend_from_slice(src);
}
}
/// Decodes the varint-length-prefixed slice from `src, and advance `src`
pub fn get_varint_prefixed_slice<'a>(src: &mut &'a [u8]) -> Option<&'a [u8]> {
Self... | Rust | 0 |
rw), Protection::READ_WRITE);
assert_eq!(Protection::from_native(rwx), Protection::READ_WRITE_EXECUTE);
}
}
use crate::{configs, helpers::err, io::SupportingFileExts, network::Graph};
use log::info;
mod random_or_all;
pub struct Writer;
impl Writer {
pub fn write(
graph: &Graph,
routing_cfg... | Rust | 0 |
1);
let b1 = s1.cmp_eq(&s1_other, inst);
assert(b1);
let b2 = s1.cmp_eq(&s2, inst);
assert(!b2);
let t1 = s1.clone(inst);
let get1 = *interner.get(&t1, inst);
assert(get1 == 1);
let t2 = s2.clone(inst);
let get2 = *interner.get(&t2, inst);
assert(get1 == 1);
}
<reponame>z... | Rust | 0 |
to report multiple errors; a corresponding runtime error is raised later"]
pub const clingo_warning_e_clingo_warning_runtime_error: clingo_warning_e = 1;
#[doc = "!< undefined atom in program"]
pub const clingo_warning_e_clingo_warning_atom_undefined: clingo_warning_e = 2;
#[doc = "!< same file included multiple times... | Rust | 0 |
float(), bs_label.float())
bs_epoch_losses.append(bs_loss.item())
bs_loss.backward()
optimizer.step()
dti_val_auc, dti_val_aupr = dti_evaluate(model, dti_val_loader, device)
bs_val_macro_auc, bs_val_macro_aupr, bs_val_micro_auc, bs_val_micro_aupr = bs_eva... | Python | 1 |
c @ s d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d
Z
d Z d Z d
Z
d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d! Z! d" Z" d# Z# d$ Z$ d% Z% d& |