text string | label_name string | labels int64 |
|---|---|---|
== 4:
count_4 += 1
# elif i == 5:
# count_5 += 1
# elif i == 6:
# count_6 += 1
# else:
# count_7 += 1
print(count_0)
print(count_1)
print(count_2)
print(count_3)
# print(count_4)
# print(count_5)
# print(count_6)
# print(count_7)
# 将标签写入txt文件
print(len(y_km))
# t = open('H:\\... | Python | 1 |
representation of a single permit from a semaphore.
pub struct SharedPermit {
inner: Arc<Semaphore>,
}
impl Drop for SharedPermit {
fn drop(&mut self) {
self.inner.add_permits(1);
}
}
<reponame>vkochnev/ral<filename>generator/src/device.rs
use std::fmt::{Display, Formatter, Result};
use svd_parse... | Rust | 0 |
# 2022.10.14 18:07
import re
from hoshino import Service, priv
from . import db,until
sv_help = '''
[帮助绘图]查看帮助
'''.strip()
sv = Service(
name = '绘图', #功能名
use_priv = priv.NORMAL, #使用权限
manage_priv = priv.ADMIN, #管理权限
visible = True, #是否可见
enable_on_default = True, #是否默认启用
bundle = '娱乐', #属于哪... | Python | 1 |
# Notebooks-contrib test
import os
import sys
def bsql_start():
"""
set up users to use SQL in the RAPIDS AI ecosystem
> try to import BlazingContext from BlazingSQL
> offer to install BlazingSQL if module not found
BlazingSQL prereqs:
> Conda: https://docs.blazingdb.com/docs/i... | Python | 1 |
= prev_active
continue
removed_this_arm = 0
ebones = arm_obj.data.edit_bones
# Build a set of bone names to keep: any bone that is directly used
# and all of its ancestors (parents) must be preserved.
keep_names = set(used_bones)
... | Python | 1 |
/// ### Why is this bad?
/// Concise code helps focusing on behavior instead of boilerplate.
///
/// ### Example
/// ```rust
/// let foo: Option<i32> = None;
/// match foo {
/// Some(v) => v,
/// None => 1,
/// };
/// ```
///
/// Use instead:
/// ```rust
/... | Rust | 0 |
{
pub async fn expand(self, db: &Database) -> Result<ExpandedParticipation, Error> {
Ok(ExpandedParticipation {
opportunity: Opportunity::load_by_uid(db, &self.opportunity)
.await?
.exterior,
when: self.when,
})
}
}
#[derive(Debug, serde:... | Rust | 0 |
"""
Created by HenryMa on 2020/8/27
"""
__author__ = 'HenryMa'
from builtins import print, int
import cv2
import numpy as np
from matplotlib import pyplot as plt
# shape: 600 * 600
img = cv2.imread('../pic/Fig0438(a)(bld_600by600).tif', 0)
# 返回的是复数 dtype.complex128
fft = np.fft.fft2(img)
print("fft is: ", fft)
# 平... | Python | 1 |
}
}
return false;
}
}
#[cfg(test)]
mod tests {
use super::Authenticator;
#[test]
fn test(){
let auth = Authenticator::new("abc");
assert!(auth.authenticate("bac"));
assert!(!auth.authenticate("abc"));
assert!(!auth.authenticate... | Rust | 0 |
figured as an I2C Slave, and the address sent by the master is equal to the address of the slave, then this bit will be of high level."]
#[inline(always)]
pub fn slave_addressed(&self) -> SLAVE_ADDRESSED_R {
SLAVE_ADDRESSED_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - This field cha... | Rust | 0 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 18 15:41:27 2018
@author: user
"""
import string
import sys
import math
import os
count = 0
path_orig = sys.argv[1]
path_sum = sys.argv[2]
path_w = sys.argv[3]
length = float(sys.argv[4])
for f in os.listdir(path_orig):
url_orig = os.path.join(pa... | Python | 1 |
] as is now the case with all Tokio
//! types since 1.0.
//!
//! We also use [Fuse] to represent optional values, just like [Option]. But
//! [Fuse] provides implementations and functions which allow us to safely
//! perform operations over the value when it's pinned. Exactly what's needed to
//! drive a [Stream] (see ... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 01 12:20:20 2014
@author: wea
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
import math
from c2cb import c2cb
pname = "SavedData\\"
fname = "openBCI_raw_2014-05-31_20-57-51_Robot05.txt"
t_plot_sec = [0.0, 135.0]
fs_Hz... | Python | 1 |
#[allow(missing_docs)]
pub fn into_any<T>(self) -> T { match self {} }
}
fn main() -> Result<(), Error> {
log::set_logger(&LOGGER)?;
log::set_max_level(MAX_LOG_LEVEL);
info!("Starting");
let mut exec = fasync::Executor::new().context("error creating event loop")?;
let (phys, phy_events) ... | Rust | 0 |
a;
#[derive(Serialize, Deserialize, Debug)]
enum GemBSData {
Config(HashMap<Section, HashMap<String, DataValue>>),
SampleData(HashMap<String, HashMap<Metadata, DataValue>>),
Contigs(Vec<Contig>),
ContigPools(HashMap<Rc<String>, ContigPool>),
}
struct GemBSFiles {
config_dir: PathBuf,
config_file: PathBuf,
gem_... | Rust | 0 |
ype: :class:`ResourceDescriptor`
:returns: A resource descriptor.
"""
return cls(
name=info['name'],
type_=info['type'],
display_name=info.get('displayName', ''),
description=info.get('description', ''),
labels=tuple(LabelDescriptor._fr... | Python | 1 |
foo in another scope should add a definition
scope.declare(Identifier::from("foo"), type_id);
assert_eq!(scope.lookup(&Identifier::from("foo")).len(), 2);
// Declaring the same name in the same scope should overwrite the
// definition
scope.declare(Identifier::from("foo"), type... | Rust | 0 |
uture>(future: F) -> (KillHandle, Killable<F>) {
let (send, recv) = channel();
let fut = Killable {
inner: Some(future),
kill: recv,
};
(KillHandle { inner: AtomicTake::new(send) }, fut)
}
#[derive(Debug)]
pub struct KillSpawn {
recv: Receiver<()>,
}
impl KillSpawn {
pub fn new(... | Rust | 0 |
x_pool = (torch.mean(x**p, dim=-1) + 1e-12)**(1/p)
else:
x_pool = self.avgpool(x)
x_pool = x_pool.view(x_pool.size(0), x_pool.size(1))
feat = self.bottleneck(x_pool)
#Divide feature map into p parts (p=num_parts)##################
part_pool_list = []
... | Python | 1 |
R % S r SSKrSSKrSSKJrJrJrJr SSKrSSKJ r
Jr SSKJ
r
JrJr SSKJr SSKJr \\
\\4 r\R. r\R0 rS q/ q\\\/ S4 \\ 4 \S
' \R< |