code: def _is_allowed_signal(self, signal):
          
  
          if signal not in self._allowed_signals:
              raise Exception("Signal '{0}' is not allowed for '{1}'.".format(
                  signal, type(self)))
docs: Check if a signal is valid.
  
          Raise an exception if the signal is not allowed.
  
          Parameters
          ----------
          signal: str
              a signal.