code: def test_error_on_wrong_nan_strategy(metric_class):
      """Test error raised on wrong nan_strategy argument."""
      with pytest.raises(
          ValueError, match="Arg `nan_strategy` should either .*"
      ):
          metric_class(nan_strategy=[])
  
imports: import numpy
  import pytest
  import torch
  from torchmetrics.aggregation import CatMetric, MaxMetric, MeanMetric, MinMetric, SumMetric
  from torchmetrics.collections import MetricCollection
  from unittests import BATCH_SIZE, NUM_BATCHES
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 7 for calling a global function with example usage: test_error_on_wrong_nan_strategy(metric_class) without return types