parameters: (self, uniq=None)
docstring: Make pattern-tree tips point to same object if they are equal.
docstring_summary: Make pattern-tree tips point to same object if they are equal.
docstring_tokens: Make pattern - tree tips point to same object if they are equal .
function: def fix_identities(self, uniq=None):
          """Make pattern-tree tips point to same object if they are equal."""
          if not hasattr(self, 'children'):
              return self
          uniq = list(set(self.flat())) if uniq is None else uniq
          for i, child in enumerate(self.children):
              if not hasattr(child, 'children'):
                  assert child in uniq
                  self.children[i] = uniq[uniq.index(child)]
              else:
                  child.fix_identities(uniq)
function_tokens: def fix_identities ( self , uniq = None ) : if not hasattr ( self , 'children' ) : return self uniq = list ( set ( self . flat ( ) ) ) if uniq is None else uniq for i , child in enumerate ( self . children ) : if not hasattr ( child , 'children' ) : assert child in uniq self . children [ i ] = uniq [ uniq . index ( child ) ] else : child . fix_identities ( uniq )