<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _is_allowed_signal(self, signal):
 """Check if a signal is valid. Raise an exception if the signal is not allowed. Parameters signal: str a signal. """


        if signal not in self._allowed_signals:
            raise Exception("Signal '{0}' is not allowed for '{1}'.".format(
                signal, type(self)))