def _tags_statuses(checks):
    (tags, down, grace, num_down) = ({}, {}, {}, 0)
    for check in checks:
        status = check.get_status()
        if (status == 'down'):
            num_down += 1
            for tag in check.tags_list():
                down[tag] = 'down'
        elif (status == 'grace'):
            for tag in check.tags_list():
                grace[tag] = 'grace'
        else:
            for tag in check.tags_list():
                tags[tag] = 'up'
    tags.update(grace)
    tags.update(down)
    return (tags, num_down)
def _tags_statuses(checks):
    (tags, down, grace, num_down) = ({}, {}, {}, 0)
    for check in checks:
        status = check.get_status()
        if (status == 'down'):
            num_down += 1
            for tag in check.tags_list():
                down[tag] = 'down'
        elif (status == 'grace'):
            for tag in check.tags_list():
                grace[tag] = 'grace'
        else:
            for tag in check.tags_list():
                tags[tag] = 'up'
    tags.update(grace)
    tags.update(down)
    return (tags, num_down)