code: def test_optimizer_amp_scaling_support_in_step_method():
      """Test that the plugin checks if the optimizer takes over unscaling in its step, making it incompatible with
      gradient clipping (example: fused Adam)."""
  
      optimizer = Mock(_step_supports_amp_scaling=True)
      precision = MixedPrecision(
          precision="16-mixed", device="cuda:0", scaler=Mock()
      )
  
      with pytest.raises(
          RuntimeError,
          match="The current optimizer.*does not allow for gradient clipping",
      ):
          precision.clip_gradients(optimizer, clip_val=1.0)
  
imports: from unittest.mock import Mock
  import pytest
  from lightning.pytorch.plugins import MixedPrecision
  from lightning.pytorch.utilities import GradClipAlgorithmType
  from torch.optim import Optimizer
label_desc: Use image node_id 2 for calling a global function with example usage: test_optimizer_amp_scaling_support_in_step_method() without return types