def _dfs(graph, visited, node, pre, post):
    visited[node] = 1
    if (pre): yield node
    # Explore recursively the connected component
    for each in graph[node]:
        if (each not in visited):
            for other in _dfs(graph, visited, each, pre, post):
                yield other
    if (post): yield node
Depth-first search subfunction for traversals.
dataset/ETHPy150Open nerdvegas/rez/src/rez/vendor/pygraph/algorithms/traversal.py/_dfs