code: def add_transition(self, qi, u, qj):
          
          if u not in self.S:
              LOG.error("The specified value is invalid, f must be a member of S")
              raise InputError("The specified value is invalid, f must be a member of S")
  
          try:
              self.transition[qi][u].add(qj)
  
          except KeyError:
              try:
                  self.transition[qi][u] = {qj}
              except KeyError:
                  self.transition[qi] = dict()
                  self.transition[qi][u] = {qj}
docs: :param qi:int: current state, qi ∈ Q
          :param u:str: transition character u ∈ S
          :param qj:int: target state, qj ∈ Q, δ(qi, u) = qj
  
          If δ(qi, u) is already defined, the method replaces the
          already existent transition to qj.