def evaluate_result(result: dict, group_order: list) -> Tuple[dict, OrderedDict]:
"""
Evaluate and describe a complete result dictionary.
As a result, a dictionary of the groups is returned. Each group has another
dictionary specifying the amount of good, the amount of bad and the amount
of neutral results as well as the overall group rating and the ratio of
good results.
"""
if 'reachable' in result and not result['reachable']:
return UnrateableSiteEvaluation(), {}
evaluated_groups = {}
described_groups = OrderedDict()
for group in group_order:
if group not in CHECKS:
continue
evaluated_groups[group], described_groups[group] = evaluate_group(
group, result)
return SiteEvaluation(evaluated_groups, group_order), described_groups
评论列表
文章目录