code: def _identifySuperGraph(self):
          if self.debug:
              sys.stdout.write("Condensing Graph: ")
              start = time.clock()
          G = nx.DiGraph()
          G.add_edges_from(self.edges)
          if self.short_circuit:
              self.superNodes = G.nodes()
              self.superArcs = G.edges()
              return
          self.augmentedEdges = {}
          N = len(self.Y)
          processed = np.zeros(N)
          for node in range(N):
              if processed[node]:
                  continue
              if G.in_degree(node) == 1 and G.out_degree(node) == 1:
                  removedNodes = []
                  lower_link = list(G.in_edges(node))[0][0]
                  while (
                      G.in_degree(lower_link) == 1
                      and G.out_degree(lower_link) == 1
                  ):
                      new_lower_link = list(G.in_edges(lower_link))[0][0]
                      G.add_edge(new_lower_link, node)
                      G.remove_node(lower_link)
                      removedNodes.append(lower_link)
                      lower_link = new_lower_link
                  removedNodes.reverse()
                  removedNodes.append(node)
                  upper_link = list(G.out_edges(node))[0][1]
                  while (
                      G.in_degree(upper_link) == 1
                      and G.out_degree(upper_link) == 1
                  ):
                      new_upper_link = list(G.out_edges(upper_link))[0][1]
                      G.add_edge(node, new_upper_link)
                      G.remove_node(upper_link)
                      removedNodes.append(upper_link)
                      upper_link = new_upper_link
                  G.add_edge(lower_link, upper_link)
                  G.remove_node(node)
                  self.augmentedEdges[(lower_link, upper_link)] = removedNodes
                  processed[removedNodes] = 1
          self.superNodes = G.nodes()
          self.superArcs = G.edges()
          if self.debug:
              end = time.clock()
              sys.stdout.write("%f s\n" % (end - start))