code: def test_is_raises_errors_and_warnings():
      """Test that expected warnings and errors are raised."""
      with pytest.warns(
          UserWarning,
          match="Metric `InceptionScore` will save all extracted features in buffer."
          " For large datasets this may lead to large memory footprint.",
      ):
          InceptionScore()
  
      if _TORCH_FIDELITY_AVAILABLE:
          with pytest.raises(
              ValueError,
              match="Integer input to argument `feature` must be one of .*",
          ):
              _ = InceptionScore(feature=2)
      else:
          with pytest.raises(
              ModuleNotFoundError,
              match="InceptionScore metric requires that `Torch-fidelity` is installed."
              " Either install as `pip install torchmetrics[image-quality]` or `pip install torch-fidelity`.",
          ):
              InceptionScore()
  
      with pytest.raises(
          TypeError, match="Got unknown input to argument `feature`"
      ):
          InceptionScore(feature=[1, 2])
  
file_path: torchmetrics/tests/unittests/image/test_inception.py
imports: import pickle
  from contextlib import nullcontext
  import pytest
  import torch
  from torch.nn import Module
  from torch.utils.data import Dataset
  from torchmetrics.image.inception import InceptionScore
  from torchmetrics.utilities.imports import _TORCH_FIDELITY_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: test_is_raises_errors_and_warnings() without return types