code: def __init__(
      self,
      should_signal: bool,
      failure_on_step: bool,
      failure_on_training: bool,
      on_last_batch: bool,
  ):
      super().__init__()
      self.should_signal = should_signal
      self.failure_on_step = failure_on_step
      self.failure_on_training = failure_on_training
      self.on_last_batch = on_last_batch
      self.seen_train_batches = []
  
imports: import inspect
  import pytest
  from lightning.fabric.utilities.seed import seed_everything
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.callbacks import OnExceptionCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.utilities.exceptions import SIGTERMException
  from torch.utils.data.dataloader import DataLoader
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 to create a new TestAutoRestartModelUnderSignal object from inherited base classes: BoringModel with example: obj = TestAutoRestartModelUnderSignal(should_signal, failure_on_step, failure_on_training, on_last_batch)