def __get_dfs_data(graph, adj=None):
ordering, parent_lookup, children_lookup = depth_first_search_with_parent_data(graph, adjacency_lists=adj)<EOL>ordering_lookup = dict(list(zip(ordering, list(range(<NUM_LIT:1>, len(ordering) + <NUM_LIT:1>)))))<EOL>node_lookup = dict(list(zip(list(range(<NUM_LIT:1>, len(ordering) + <NUM_LIT:1>)), ordering)))<EOL>edge_lookup = {}<EOL>for edge_id in graph.get_all_edge_ids():<EOL><INDENT>edge = graph.get_edge(edge_id)<EOL>node_a, node_b = edge['<STR_LIT>']<EOL>parent_a = parent_lookup[node_a]<EOL>parent_b = parent_lookup[node_b]<EOL>if parent_a == node_b or parent_b == node_a:<EOL><INDENT>edge_lookup[edge_id] = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>edge_lookup[edge_id] = '<STR_LIT>'<EOL><DEDENT><DEDENT>dfs_data = {}<EOL>dfs_data['<STR_LIT>'] = ordering<EOL>dfs_data['<STR_LIT>'] = ordering_lookup<EOL>dfs_data['<STR_LIT>'] = node_lookup<EOL>dfs_data['<STR_LIT>'] = edge_lookup<EOL>dfs_data['<STR_LIT>'] = parent_lookup<EOL>dfs_data['<STR_LIT>'] = children_lookup<EOL>return dfs_data<EOL>
Internal function that calculates the depth-first search of the graph.
    Returns a dictionary with the following data:
        * 'ordering':        A dfs-ordering list of nodes
        * 'ordering_lookup': A lookup dict mapping nodes to dfs-ordering
        * 'node_lookup':     A lookup dict mapping dfs-ordering to nodes
        * 'edge_lookup':     A lookup dict mapping edges as tree-edges or back-edges
        * 'parent_lookup':   A lookup dict mapping nodes to their parent node
        * 'children_lookup': A lookup dict mapping nodes to their children