<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trapped_signals(cls, new_signal_handler):
 """A contextmanager which temporarily overrides signal handling."""

    try:
      previous_signal_handler = cls.reset_signal_handler(new_signal_handler)
      yield
    finally:
      cls.reset_signal_handler(previous_signal_handler)