def traversal(graph, node, order):
visited = {}<EOL>if (order == '<STR_LIT>'):<EOL><INDENT>pre = <NUM_LIT:1><EOL>post = <NUM_LIT:0><EOL><DEDENT>elif (order == '<STR_LIT>'):<EOL><INDENT>pre = <NUM_LIT:0><EOL>post = <NUM_LIT:1><EOL><DEDENT>for each in _dfs(graph, visited, node, pre, post):<EOL><INDENT>yield each<EOL><DEDENT>
Graph traversal iterator.

@type  graph: graph, digraph
@param graph: Graph.

@type  node: node
@param node: Node.

@type  order: string
@param order: traversal ordering. Possible values are:
    2. 'pre' - Preordering (default)
    1. 'post' - Postordering

@rtype:  iterator
@return: Traversal iterator.