def build_failure_map(stages, projects, z):
"""
Build a dict mapping the key "projects + stages" to the number
of failures.
:param stages: list of stages.
:param projects: list of projects.
:param z: a list of lists of failures.
:return: the failures map.
"""
failure_lookup = dict()
for stages_index, failures_list in enumerate(z):
for failures_list_index, failures in enumerate(failures_list):
project = projects[stages_index]
stage = stages[failures_list_index]
failure_lookup[str(project) + str(stage)] = failures
return failure_lookup
评论列表
文章目录