code: def simplify_dfa(self, dfa: List["DFAState"]) -> None:
      # This is not theoretically optimal, but works well enough.
      # Algorithm: repeatedly look for two states that have the same
      # set of arcs (same labels pointing to the same nodes) and
      # unify them, until things stop changing.
  
      # dfa is a list of DFAState instances
      changes = True
      while changes:
          changes = False
          for i, state_i in enumerate(dfa):
              for j in range(i + 1, len(dfa)):
                  state_j = dfa[j]
                  if state_i == state_j:
                      # print "  unify", i, j
                      del dfa[j]
                      for state in dfa:
                          state.unifystate(state_j, state_i)
                      changes = True
                      break
  
imports: import os
  from typing import IO, Any, Dict, Iterator, List, NoReturn, Optional, Sequence, Tuple, Union
  from blib2to3.pgen2 import grammar, token, tokenize
  from blib2to3.pgen2.tokenize import GoodTokenInfo
  import pkgutil
  import io
label_desc: Use image node_id 11 for calling the ParserGenerator obj's underlying member method code with example usage: obj.simplify_dfa(dfa) without return types