code: def test_migrate_model_checkpoint_save_on_train_epoch_end_default_collision():
      """Test that the migration warns about collisions that would occur if the keys were modified."""
      # The two keys only differ in the `save_on_train_epoch_end` value
      state_key1 = (
          "ModelCheckpoint{'monitor': None, 'mode': 'min', 'every_n_train_steps': 0, 'every_n_epochs': 1,"
          " 'train_time_interval': None, 'save_on_train_epoch_end': True}"
      )
      state_key2 = (
          "ModelCheckpoint{'monitor': None, 'mode': 'min', 'every_n_train_steps': 0, 'every_n_epochs': 1,"
          " 'train_time_interval': None, 'save_on_train_epoch_end': False}"
      )
      old_checkpoint = {
          "callbacks": {
              state_key1: {"dummy": 0},
              state_key2: {"dummy": 0},
          },
          "global_step": 0,
          "epoch": 1,
      }
      _set_version(
          old_checkpoint, "1.8.9"
      )  # pretend a checkpoint prior to 1.9.0
      with pytest.warns(
          PossibleUserWarning,
          match="callback states in this checkpoint.* colliding with each other",
      ):
          updated_checkpoint, _ = migrate_checkpoint(
              old_checkpoint.copy(), target_version="1.9.0"
          )
      assert (
          updated_checkpoint["callbacks"] == old_checkpoint["callbacks"]
      )
  
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 6 for calling a global function with example usage: test_migrate_model_checkpoint_save_on_train_epoch_end_default_collision() without return types