@register.function
def dev_files_status(files, addon):
    status_count = defaultdict(int)
    choices = status_choices(addon)

    for file in files:
        status_count[file.status] += 1

    return [(count, unicode(choices[status])) for
            (status, count) in status_count.items()]
Group files by their status (and files per status).
dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/helpers.py/dev_files_status