def iterdeps(self, intermediate=False):
    stack = deque([(None, self)])
    while stack:
        (parent, node) = stack.popleft()
        (yield (parent, node))
        if node.ready():
            stack.extend(((node, child) for child in (node.children or [])))
        elif (not intermediate):
            raise IncompleteStream()
def iterdeps(self, intermediate=False):
    stack = deque([(None, self)])
    while stack:
        (parent, node) = stack.popleft()
        (yield (parent, node))
        if node.ready():
            stack.extend(((node, child) for child in (node.children or [])))
        elif (not intermediate):
            raise IncompleteStream()