code: def _call_metrics(
      metric_func,
      metric_class,
      y_true,
      y_pred,
      y_train,
      y_pred_benchmark,
  ):
      """Call function and class metrics and return results."""
      class_attrs = metric_class.get_params()
      function_metric = metric_func(
          y_true,
          y_pred,
          y_train=y_train,
          y_pred_benchmark=y_pred_benchmark,
          **class_attrs,
      )
      class_metric = metric_class(
          y_true,
          y_pred,
          y_train=y_train,
          y_pred_benchmark=y_pred_benchmark,
      )
      return function_metric, class_metric
  
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 1 for calling a global function with example usage: _call_metrics(metric_func, metric_class, y_true, y_pred, y_train, y_pred_benchmark) and returns: function_metric,  class_metric