code: def test_fid_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 .*",
          ):
              _ = FrechetInceptionDistance(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`.",
          ):
              _ = FrechetInceptionDistance()
  
      with pytest.raises(
          TypeError, match="Got unknown input to argument `feature`"
      ):
          _ = FrechetInceptionDistance(feature=[1, 2])
  
imports: import pickle
  from contextlib import nullcontext
  from functools import partial
  import pytest
  import torch
  from torch.nn import Module
  from torch.utils.data import Dataset
  from torchmetrics.image.fid import FrechetInceptionDistance, NoTrainInceptionV3
  from torchmetrics.utilities.imports import _TORCH_FIDELITY_AVAILABLE
label_desc: Use image node_id 4 for calling a global function with example usage: test_fid_raises_errors_and_warnings() without return types