tools/media_engagement_preload/make_dafsa.py
def dfs(node, parent):
    """Creates reverse nodes.

    A new reverse node will be created for each old node. The new node will
    get a reversed label and the parents of the old node as children.
    """
    if not node:
      sink.append(parent)
    elif id(node) not in nodemap:
      nodemap[id(node)] = (node[0][::-1], [parent])
      for child in node[1]:
        dfs(child, nodemap[id(node)])
    else:
      nodemap[id(node)][1].append(parent)
Creates reverse nodes.

    A new reverse node will be created for each old node. The new node will
    get a reversed label and the parents of the old node as children.
    
Creates reverse nodes.
A new reverse node will be created for each old node. The new node will
get a reversed label and the parents of the old node as children.
Creates reverse nodes . A new reverse node will be created for each old node . The new node will get a reversed label and the parents of the old node as children .
def dfs(node, parent):
    if not node:
      sink.append(parent)
    elif id(node) not in nodemap:
      nodemap[id(node)] = (node[0][::-1], [parent])
      for child in node[1]:
        dfs(child, nodemap[id(node)])
    else:
      nodemap[id(node)][1].append(parent)
def dfs ( node , parent ) : if not node : sink . append ( parent ) elif id ( node ) not in nodemap : nodemap [ id ( node ) ] = ( node [ 0 ] [ : : - 1 ] , [ parent ] ) for child in node [ 1 ] : dfs ( child , nodemap [ id ( node ) ] ) else : nodemap [ id ( node ) ] [ 1 ] . append ( parent )
Creates reverse nodes.
Creates reverse nodes .
"""Creates reverse nodes.

    A new reverse node will be created for each old node. The new node will
    get a reversed label and the parents of the old node as children.
    """
node
parent