'traverse the children of block in a breadth-first order'

def get_all_children_bf(self, block):

    queue = deque([block])
    while queue:
        item = queue.popleft()
        (yield item)
        queue.extend(item.get_children())
