code: def _construct_nx_tree(self, thisTree, thatTree=None):
          if self.debug:
              sys.stdout.write("Networkx Tree construction: ")
              start = time.clock()
          nxTree = nx.DiGraph()
          nxTree.add_edges_from(thisTree.edges)
          nodesOfThatTree = []
          if thatTree is not None:
              nodesOfThatTree = thatTree.nodes.keys()
          for (superNode, _), nodes in thisTree.augmentedEdges.items():
              superNodeEdge = list(nxTree.out_edges(superNode))
              if len(superNodeEdge) > 1:
                  warnings.warn(
                      "The supernode {} should have only a single "
                      "emanating edge. Merge tree is invalidly "
                      "structured".format(superNode)
                  )
              endNode = superNodeEdge[0][1]
              startNode = superNode
              nxTree.remove_edge(startNode, endNode)
              for node in nodes:
                  if thatTree is None or node in nodesOfThatTree:
                      nxTree.add_edge(startNode, node)
                      startNode = node
              if startNode != endNode:
                  nxTree.add_edge(startNode, endNode)
          if self.debug:
              end = time.clock()
              sys.stdout.write("%f s\n" % (end - start))
          return nxTree