code: def test_metric_output(metric, multioutput, n_columns):
      """Test output is correct class."""
      # create numpy weights based on n_columns
      if multioutput == "numpy":
          if n_columns == 1:
              return None
          multioutput = np.random.rand(n_columns)
  
      # create test data
      y_pred = _make_series(
          n_columns=n_columns, n_timepoints=20, random_state=21
      )
      y_true = _make_series(
          n_columns=n_columns, n_timepoints=20, random_state=42
      )
  
      # coerce to DataFrame since _make_series does not return consistent output type
      y_pred = pd.DataFrame(y_pred)
      y_true = pd.DataFrame(y_true)
  
      res = metric(
          y_true=y_true,
          y_pred=y_pred,
          multioutput=multioutput,
          y_pred_benchmark=y_pred,
          y_train=y_true,
      )
  
      if (
          isinstance(multioutput, np.ndarray)
          or multioutput == "uniform_average"
      ):
          assert isinstance(res, float)
      elif multioutput == "raw_values":
          assert isinstance(res, np.ndarray)
          assert res.ndim == 1
          assert len(res) == len(y_true.columns)
  
imports: from inspect import getmembers, isfunction
  import numpy
  import pandas
  import pytest
  from sktime.performance_metrics.forecasting import _functions
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 1 for calling a global function with example usage: test_metric_output(metric, multioutput, n_columns) and returns: None