code: def test_amp_precision_parameter_validation():
      MixedPrecision("16-mixed", "cpu")  # should not raise exception
      MixedPrecision("bf16-mixed", "cpu")
  
      with pytest.raises(
          ValueError,
          match=re.escape(
              "Passed `MixedPrecision(precision='16')`. Precision must be '16-mixed' or 'bf16-mixed'"
          ),
      ):
          MixedPrecision("16", "cpu")
  
      with pytest.raises(
          ValueError,
          match=re.escape(
              "Passed `MixedPrecision(precision=16)`. Precision must be '16-mixed' or 'bf16-mixed'"
          ),
      ):
          MixedPrecision(16, "cpu")
  
      with pytest.raises(
          ValueError,
          match=re.escape(
              "Passed `MixedPrecision(precision='bf16')`. Precision must be '16-mixed' or 'bf16-mixed'"
          ),
      ):
          MixedPrecision("bf16", "cpu")
  
file_path: pytorch-lightning/tests/tests_fabric/plugins/precision/test_amp.py
imports: import re
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric.plugins.precision.amp import MixedPrecision
label_desc: Use image node_id 7 for calling a global function with example usage: test_amp_precision_parameter_validation() without return types