original_docstring:  Merge node j into i, removing node j 
docstring: Merge node j into i, removing node j
docstring_tokens: Merge node j into i removing node j
code: def merge_nodes(self, i, j):
          """ Merge node j into i, removing node j """
          G = self.G
          if j in G[i]:
              G.remove_edge(i, j)
          if i in G[j]:
              G.remove_edge(j, i)
          G.add_edges_from(list(zip(itertools.cycle([i]), G[j], [G.weights[(j,k)] for k in G[j]])))
          G.add_edges_from(list(zip(G.pred[j], itertools.cycle([i]), [G.weights[(k,j)] for k in G.pred[j]])))
          G.get_attr(i, 'merges').append(j)
          G.remove_node(j)
code_tokens: def merge_nodes ( self , i , j ) : G = self . G if j in G [ i ] : G . remove_edge ( i , j ) if i in G [ j ] : G . remove_edge ( j , i ) G . add_edges_from ( list ( zip ( itertools . cycle ( [ i ] ) , G [ j ] , [ G . weights [ ( j , k ) ] for k in G [ j ] ] ) ) ) G . add_edges_from ( list ( zip ( G . pred [ j ] , itertools . cycle ( [ i ] ) , [ G . weights [ ( k , j ) ] for k in G . pred [ j ] ] ) ) ) G . get_attr ( i , 'merges' ) . append ( j ) G . remove_node ( j )
short_docstring: Merge node j into i, removing node j
short_docstring_tokens: Merge node j into i removing node j
comment: """ Merge node j into i, removing node j """