code: def test_empty_metric():
      """Test empty metric."""
      with pytest.raises(
          ValueError,
          match="At least one of `things` and `stuffs` must be non-empty",
      ):
          metric = ModifiedPanopticQuality(things=[], stuffs=[])
  
      metric = ModifiedPanopticQuality(things=[0], stuffs=[])
      assert torch.isnan(metric.compute())
  
file_path: torchmetrics/tests/unittests/detection/test_modified_panoptic_quality.py
imports: from typing import Any, Dict
  import numpy
  import pytest
  import torch
  from torchmetrics.detection import ModifiedPanopticQuality
  from torchmetrics.functional.detection import modified_panoptic_quality
  from unittests import _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 4 for calling a global function with example usage: test_empty_metric() without return types