code stringlengths 3 6.57k |
|---|
enumerate(im_fnames[1:], 1) |
cv2.imread(fname, 0) |
np.expand_dims(im_batch, axis=-1) |
load_images(_file, normalize=True) |
list(np.loadtxt(_file, dtype='str') |
DataHandler._load_data(im_fnames) |
astype(np.float32) |
load_labels(_file) |
list(np.loadtxt(_file, dtype='str') |
DataHandler._load_data(lb_fnames) |
astype(np.int32) |
np.unique(lb_batch) |
range(np.unique(lb_batch) |
np.array_equal(cur_labels, new_labels) |
zip(cur_labels, new_labels) |
os.path.join(data_dir, f) |
sorted(os.listdir(data_dir) |
np.savetxt(os.path.join(out_dir, 'train_fnames') |
np.array(train_fnames) |
np.savetxt(os.path.join(out_dir, 'test_fnames') |
np.array(test_fnames) |
os.path.join(data_dir, f) |
sorted(os.listdir(data_dir) |
np.savetxt(os.path.join(out_dir, 'train_fnames') |
np.array(train_fnames) |
np.savetxt(os.path.join(out_dir, 'valid_fnames') |
np.array(valid_fnames) |
np.savetxt(os.path.join(out_dir, 'test_fnames') |
np.array(test_fnames) |
Annotator(ABC) |
__call__(self, doc, **kwargs) |
Exception("This method must be implemented!") |
pipe(self, documents, **kwargs) |
tuples (document, context) |
or (document, context) |
self.__call__(el, **kwargs) |
start(self) |
finish(self) |
reduce(self, results) |
AnnotatorFunction(Annotator) |
__init__(self, funct) |
__call__(self, doc, **kwargs) |
self.funct(doc, **kwargs) |
queue.Queue() |
ThreadPoolExecutor(max_workers=2) |
shutdown_listener() |
repeat(None) |
shut_down_pool_queue.get() |
t_pool.shutdown() |
logger.info("shutdown") |
sys_thread_pool.submit(shutdown_listener) |
ThreadPoolExecutor(max_workers=no_task_wait_size_assessed) |
do_nothing() |
time.sleep(5) |
pre_concurrent_pool() |
time.perf_counter() |
range(no_task_wait_size_assessed) |
concurrent_pool_assessed.submit(do_nothing) |
time.sleep(5) |
logger.info("预热线程池,耗时%s", time.perf_counter() |
threads(concurrent_size=1, try_times=1, try_internal=0.05) |
decorate(func) |
functools.wraps(func) |
wrapper(*args, **kw) |
Job(concurrent_size, try_times, try_internal) |
run(func, *args, **kw) |
logger.info("threads tool return %s", re) |
Job(object) |
__init__(self, concurrent_size=1, try_times=1, try_internal=0.05) |
run(self, fn, *args, **kwargs) |
self.thread_pool.submit(self._loop, fn, *args, **kwargs) |
logger.info("同步等待结果……") |
repeat(None) |
future.done() |
future.result() |
shut_down_pool_queue.put(self.thread_pool) |
futures.remove(future) |
_loop(self, fn, *args, **kwargs) |
range(self.try_times) |
range(self.concurrent_size) |
self.futures.append(self.thread_pool.submit(fn, *args, **kwargs) |
logger.info("启动线程") |
logger.debug("获取到结果,结束") |
logger.debug("获取到结果,结束") |
time.sleep(self.try_internal) |
threads(concurrent_size=3, try_times=100, try_internal=0.1) |
test_g() |
random.choice([0.1, 0.2, 0.3, 0.4, 0.5, 1]) |
logger.info("run%s", t) |
time.sleep(t) |
format(t) |
pre_concurrent_pool() |
logger.info("拿到结果%s", test_g() |
Migration(migrations.Migration) |
models.CharField(blank=True, default=api.models.generate_mqtt_password, max_length=16, null=True) |
ScriptEngine(object) |
__init__(self) |
dict() |
list() |
debug(self) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.