def build_path(graph, node1, node2, path=None):
 if (path is None):
  path = []
 if (node1 is node2):
  return path
 path.append(node2)
 for pred in graph.all_preds(node2):
  if (pred in path):
   continue
  build_path(graph, node1, pred, path)
 return path

def build_path ( graph , node1 , node2 , path = None ) : if ( path is None ) : path = [ ] if ( node1 is node2 ) : return path path . append ( node2 ) for pred in graph . all_preds ( node2 ) : if ( pred in path ) : continue build_path ( graph , node1 , pred , path ) return path
build the path from node1 to node2 .