code: def test_migrate_dropped_apex_amp_state(monkeypatch):
      """Test that the migration warns about collisions that would occur if the keys were modified."""
      monkeypatch.setattr(
          pl, "__version__", "2.0.0"
      )  # pretend this version of Lightning is >= 2.0.0
      old_checkpoint = {"amp_scaling_state": {"scale": 1.23}}
      _set_version(
          old_checkpoint, "1.9.0"
      )  # pretend a checkpoint prior to 2.0.0
      with pytest.warns(
          UserWarning, match="checkpoint contains apex AMP data"
      ):
          updated_checkpoint, _ = migrate_checkpoint(
              old_checkpoint.copy()
          )
      assert "amp_scaling_state" not in updated_checkpoint
  
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 7 for calling a global function with example usage: test_migrate_dropped_apex_amp_state(monkeypatch) without return types