code: def test_migrate_model_checkpoint_save_on_train_epoch_end_default(
      save_on_train_epoch_end,
  ):
      """Test that the 'save_on_train_epoch_end' part of the ModelCheckpoint state key gets removed."""
      legacy_state_key = (
          f"ModelCheckpoint{{'monitor': None, 'mode': 'min', 'every_n_train_steps': 0, 'every_n_epochs': 1,"
          f" 'train_time_interval': None, 'save_on_train_epoch_end': {save_on_train_epoch_end}}}"
      )
      new_state_key = (
          "ModelCheckpoint{'monitor': None, 'mode': 'min', 'every_n_train_steps': 0, 'every_n_epochs': 1,"
          " 'train_time_interval': None}"
      )
      old_checkpoint = {
          "callbacks": {legacy_state_key: {"dummy": 0}},
          "global_step": 0,
          "epoch": 1,
      }
      _set_version(
          old_checkpoint, "1.8.9"
      )  # pretend a checkpoint prior to 1.9.0
      updated_checkpoint, _ = migrate_checkpoint(
          old_checkpoint, target_version="1.9.0"
      )
      assert updated_checkpoint["callbacks"] == {
          new_state_key: {"dummy": 0}
      }
  
imports: from unittest.mock import ANY, MagicMock
  import lightning.pytorch
  import pytest
  import torch
  from lightning.fabric.utilities.warnings import PossibleUserWarning
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import EarlyStopping, ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel, ManualOptimBoringModel
  from lightning.pytorch.utilities.migration import migrate_checkpoint
  from lightning.pytorch.utilities.migration.utils import _get_version, _set_legacy_version, _set_version
label_desc: Use image node_id 5 for calling a global function with example usage: test_migrate_model_checkpoint_save_on_train_epoch_end_default(save_on_train_epoch_end) without return types