def METHOD_NAME(self, group):
    "Return the ballots for a group of elections."
    to_visit = [group]
    leaf_nodes = []
    while len(to_visit) > 0:
        e = to_visit.pop()
        children = e.get_children("public_objects").all()
        if e.identifier_type == "ballot":
            leaf_nodes.append(e)
        else:
            to_visit += children
    return leaf_nodes