code: def test_univariate_function_output_type(
      metric_func_name, random_state
  ):
      """Tests that loss function with univariate input should return scalar number."""
      metric_func = LOSS_RESULTS[metric_func_name]["func"]
      y = _make_series(n_timepoints=75, random_state=random_state)
      y_train, y_true = y.iloc[:50], y.iloc[50:]
      y_pred = y.shift(1).iloc[50:]
      y_pred_benchmark = y.rolling(2).mean().iloc[50:]
  
      function_loss = metric_func(
          y_true,
          y_pred,
          y_train=y_train,
          y_pred_benchmark=y_pred_benchmark,
      )
  
      is_num = is_numeric_dtype(function_loss)
      is_scalar = np.isscalar(function_loss)
      assert is_num and is_scalar, " ".join(
          [
              "Loss function with univariate input should return scalar number"
          ]
      )
  
file_path: sktime/sktime/performance_metrics/tests/test_performance_metrics_forecasting.py
imports: import numpy
  import pandas
  import pytest
  from pandas.api.types import is_numeric_dtype
  from sktime.performance_metrics.forecasting import GeometricMeanRelativeAbsoluteError, GeometricMeanRelativeSquaredError, MeanAbsoluteError, MeanAbsolutePercentageError, MeanAbsoluteScaledError, MeanAsymmetricError, MeanRelativeAbsoluteError, MeanSquaredError, MeanSquaredPercentageError, MeanSquaredScaledError, MedianAbsoluteError, MedianAbsolutePercentageError, MedianAbsoluteScaledError, MedianRelativeAbsoluteError, MedianSquaredError, MedianSquaredPercentageError, MedianSquaredScaledError, RelativeLoss, geometric_mean_relative_absolute_error, geometric_mean_relative_squared_error, mean_absolute_error, mean_absolute_percentage_error, mean_absolute_scaled_error, mean_asymmetric_error, mean_relative_absolute_error, mean_squared_error, mean_squared_percentage_error, mean_squared_scaled_error, median_absolute_error, median_absolute_percentage_error, median_absolute_scaled_error, median_relative_absolute_error, median_squared_error, median_squared_percentage_error, median_squared_scaled_error, relative_loss
  from sktime.performance_metrics.tests._config import RANDOM_SEED
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 5 for calling a global function with example usage: test_univariate_function_output_type(metric_func_name, random_state) without return types