def METHOD_NAME(milestone):
    all_us_closed = all([user_story.is_closed for user_story in
                         milestone.user_stories.all()])
    all_tasks_closed = all([task.status is not None and task.status.is_closed for task in
                            milestone.tasks.filter(user_story__isnull=True)])
    all_issues_closed = all([issue.is_closed for issue in
                             milestone.issues.all()])
    uss_check = (milestone.user_stories.all().count() > 0
        and all_tasks_closed and all_us_closed and all_issues_closed)
    tasks_check = (milestone.tasks.filter(user_story__isnull=True).count() > 0
        and all_tasks_closed and all_issues_closed and all_us_closed)
    issues_check = (milestone.issues.all().count() > 0
        and all_issues_closed and all_tasks_closed and all_us_closed)
    return uss_check or issues_check or tasks_check