checker.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ThreatPrep 作者: ThreatResponse 项目源码 文件源码
def get_category_stats(self):
        """Get a count of CheckState results for each category of checks.
        Ignore collection counts to avoid duplications"""
        flat_results = self.get_flattened_results()
        categories = list(set([x.category for x in flat_results]))
        metrics = {}
        for category in categories:
            metrics[category] = collections.Counter([
                x.status for x in filter(
                    lambda y: len(y.subchecks) == 0 and y.category==category,
                    flat_results
                )
            ])
        return metrics
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号