code: def test_mifid_raises_errors_and_warnings():
      """Test that expected warnings and errors are raised."""
      if _TORCH_FIDELITY_AVAILABLE:
          with pytest.raises(
              ValueError,
              match="Integer input to argument `feature` must be one of .*",
          ):
              _ = MemorizationInformedFrechetInceptionDistance(
                  feature=2
              )
      else:
          with pytest.raises(
              ModuleNotFoundError,
              match="FID metric requires that `Torch-fidelity` is installed."
              " Either install as `pip install torchmetrics[image-quality]` or `pip install torch-fidelity`.",
          ):
              _ = MemorizationInformedFrechetInceptionDistance()
  
      with pytest.raises(
          TypeError, match="Got unknown input to argument `feature`"
      ):
          _ = MemorizationInformedFrechetInceptionDistance(
              feature=[1, 2]
          )
  
      with pytest.raises(
          ValueError,
          match="Argument `cosine_distance_eps` expected to be a float greater than 0",
      ):
          _ = MemorizationInformedFrechetInceptionDistance(
              cosine_distance_eps=-1
          )
  
      with pytest.raises(
          ValueError,
          match="Argument `cosine_distance_eps` expected to be a float greater than 0",
      ):
          _ = MemorizationInformedFrechetInceptionDistance(
              cosine_distance_eps=1.1
          )
  
file_path: torchmetrics/tests/unittests/image/test_mifid.py
imports: from contextlib import nullcontext
  from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.linalg import sqrtm
  from torchmetrics.image.mifid import MemorizationInformedFrechetInceptionDistance, NoTrainInceptionV3
  from torchmetrics.utilities.imports import _TORCH_FIDELITY_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: test_mifid_raises_errors_and_warnings() without return types