code: def transition_function(self, qi, u):
          
          try:
              return self.transition[qi][u]
          except KeyError:
              if u in self.alphabet:
                  try:
                      return self.transition[qi]['*']
                  except KeyError:
                      return None
              return None
docs: :param qi: int: current state, qi ∈ Q
          :param u:str: transition character u ∈ S
          :returns Q': int :  δ(qi, u) = q