本文整理汇总了Python中db.Db.get_signature_matches_count方法的典型用法代码示例。如果您正苦于以下问题:Python Db.get_signature_matches_count方法的具体用法?Python Db.get_signature_matches_count怎么用?Python Db.get_signature_matches_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.Db
的用法示例。
在下文中一共展示了Db.get_signature_matches_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _fetch_counts
# 需要导入模块: from db import Db [as 别名]
# 或者: from db.Db import get_signature_matches_count [as 别名]
def _fetch_counts(whorls):
db = Db()
db.connect()
# result dict. 'total' is the total number of entries, 'sig_matches' is
# the number matching signature in whorls, other keys are variables in
# signature.
counts = {}
# query an incrementally updated totals table which has an index on
# unique (variable, value)
md5_whorls = FingerprintHelper.value_or_md5(whorls)
for i in FingerprintHelper.whorl_names:
counts[i] = db.get_whorl_value_count(i, md5_whorls[i], config.epoched)
total = db.get_total_count(config.epoched)
matching = db.get_signature_matches_count(whorls["signature"], config.epoched)
return counts, total, matching