class_docstr: Prevent a signal to be raised during the execution of some code
class_docstr_tok: ["Prevent","a","signal","to","be","raised","during","the","execution","of","some","code"]
docstr: Raise the delayed signal if any or restore the old signal handlers
docstr_tok: ["Raise","the","delayed","signal","if","any","or","restore","the","old","signal","handlers"]
code: def stop_now(self):
      """Raise the delayed signal if any or restore the old signal handlers"""
  
      if not self.signal_received:
          self.restore_handlers()
  
      else:
          self.delayed = time.time() - self.start
  
          log.warning("Termination was delayed by %.4f s", self.delayed)
          handler = self.handlers[self.signal_received[0]]
  
          if callable(handler):
              handler(*self.signal_received)
  
imports: from __future__ import annotations
  import logging
  import os
  import shutil
  import signal
  import time
  import typing
  import warnings
  from contextlib import contextmanager
  from dataclasses import dataclass
  from typing import Callable
  import orion.core
  from orion.core.utils import backward
  from orion.core.utils.exceptions import BrokenExperiment, CompletedExperiment, InvalidResult, LazyWorkers, ReservationRaceCondition, WaitingForTrials
  from orion.core.utils.flatten import flatten, unflatten
  from orion.core.worker.consumer import ExecutionError
  from orion.core.worker.trial import AlreadyReleased
  from orion.executor.base import AsyncException, AsyncResult
  from orion.storage.base import LockAcquisitionTimeout
label_desc: Use image node_id 5 for calling the Protected obj's underlying member method code with example usage: obj.stop_now() without return types