code: def on_train_start(self, trainer, pl_module):
      if self.expected_state:
          assert self.state_dict() == self.expected_state
  
imports: import logging
  import math
  import os
  import pickle
  from typing import List, Optional
  from unittest import mock
  from unittest.mock import Mock
  import cloudpickle
  import pytest
  import torch
  from lightning.pytorch import Trainer, seed_everything
  from lightning.pytorch.callbacks import EarlyStopping, ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 2 for calling the EarlyStoppingTestRestore obj's underlying member method code with example usage: obj.on_train_start(trainer, pl_module) without return types