def dfs(graph, start):
    stack = [iter([start])]
    seen = set()
    while stack:
        node = next(stack[-1], None)
        if node is None:
            stack.pop()
        elif node not in seen:
            seen.add(node)
            stack.append(iter(graph[node]))
            yield node
dataset/ETHPy150Open bioinformed/vgraph/vgraph/graph.py/dfs/original