code: def test_custom_metric(greater_is_better):
      """Test custom metric constructor, integration _DynamicForecastingErrorMetric."""
      from sktime.utils.estimator_checks import check_estimator
  
      y = load_airline()
  
      def custom_mape(y_true, y_pred) -> float:
          eps = np.finfo(np.float64).eps
  
          result = np.mean(
              np.abs(y_true - y_pred) / np.maximum(np.abs(y_true), eps)
          )
  
          return float(result)
  
      fc_scorer = make_forecasting_scorer(
          func=custom_mape,
          name="custom_mape",
          greater_is_better=False,
      )
  
      assert isinstance(
          fc_scorer, _classes._DynamicForecastingErrorMetric
      )
  
      score = fc_scorer(y, y)
      assert isinstance(score, float)
  
      check_estimator(fc_scorer, raise_exceptions=True)
  
file_path: sktime/sktime/performance_metrics/tests/test_metrics_classes.py
imports: from inspect import getmembers, isclass
  import numpy
  import pandas
  import pytest
  from sktime.datasets import load_airline
  from sktime.performance_metrics.forecasting import MeanSquaredError, _classes, make_forecasting_scorer
  from sktime.utils._testing.hierarchical import _make_hierarchical
  from sktime.utils._testing.panel import _make_panel
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 3 for calling a global function with example usage: test_custom_metric(greater_is_better) and returns: float