本文整理汇总了Python中multiprocessing.Manager.count方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.count方法的具体用法?Python Manager.count怎么用?Python Manager.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.Manager
的用法示例。
在下文中一共展示了Manager.count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Pool
# 需要导入模块: from multiprocessing import Manager [as 别名]
# 或者: from multiprocessing.Manager import count [as 别名]
mixed.append(0)
else:
score_false.append(similiarity_index)
if similiarity_index > threshold_2:
pure.append(0)
else:
mixed.append(1)
p = Pool(processors)
p.map(score_word_similiarity, range(number_seg))
score_true.sort()
score_false.sort()
print score_true
print score_false
print "Accuracy Initial",float(sum(org_seg)-org_seg[-1])/sum(org_seg),sum(org_seg)
print "Accuracy Final",pure.count(1),float(pure.count(1))/len(pure),len(pure)
print "Step 3 done"
'''######'''
'''Step 3'''
'''######'''
'''################## STEP ** #################'''
'''Plotting Graph for finding optimum threshold'''
##################################################
def plot_word_graph():
global score_true,score_false
accuracies = []
n_pure = []
data_size = []
开发者ID:kautsiitd,项目名称:Unsupervised-Decomposition-of-a-Multi-Author-Document,代码行数:33,代码来源:words_method.py
示例2: super
# 需要导入模块: from multiprocessing import Manager [as 别名]
# 或者: from multiprocessing.Manager import count [as 别名]
self.alive.clear()
super(MD5Cracker, self).join(timeout)
# Graceful clean up
def cleanup():
for worker in workers:
worker.join()
atexit.register(cleanup)
# init vars
workers = []
work_queue = Manager().Queue()
global_namespace = Manager().Namespace()
global_namespace.finished = False
global_namespace.count = 0
# Set up Processes
number_of_processes = 16
for i in range(number_of_processes):
worker = MD5Cracker(work_queue, global_namespace)
worker.start()
workers.append(worker)
print "Target Hash: {}".format(hash)
maxChars = 13
while_count = 1
for baseWidth in range(1, maxChars + 1):
while global_namespace.finished is False: