code: def test_performance_metrics(self, ts_short, backend):
      m = Prophet(stan_backend=backend)
      m.fit(ts_short)
      df_cv = diagnostics.cross_validation(
          m, horizon="4 days", period="10 days", initial="90 days"
      )
      # Aggregation level none
      df_none = diagnostics.performance_metrics(
          df_cv, rolling_window=-1
      )
      assert set(df_none.columns) == {
          "horizon",
          "coverage",
          "mae",
          "mape",
          "mdape",
          "mse",
          "rmse",
          "smape",
      }
      assert df_none.shape[0] == 16
      # Aggregation level 0
      df_0 = diagnostics.performance_metrics(df_cv, rolling_window=0)
      assert len(df_0) == 4
      assert len(df_0["horizon"].unique()) == 4
      # Aggregation level 0.2
      df_horizon = diagnostics.performance_metrics(
          df_cv, rolling_window=0.2
      )
      assert len(df_horizon) == 4
      assert len(df_horizon["horizon"].unique()) == 4
      # Aggregation level all
      df_all = diagnostics.performance_metrics(df_cv, rolling_window=1)
      assert df_all.shape[0] == 1
      for metric in ["mse", "mape", "mae", "coverage"]:
          assert df_all[metric].values[0] == pytest.approx(
              df_none[metric].mean()
          )
      assert df_all["mdape"].values[0] == pytest.approx(
          df_none["mdape"].median()
      )
      # Custom list of metrics
      df_horizon = diagnostics.performance_metrics(
          df_cv,
          metrics=["coverage", "mse"],
      )
      assert set(df_horizon.columns) == {"coverage", "mse", "horizon"}
      # Skip MAPE
      df_cv.loc[0, "y"] = 0.0
      df_horizon = diagnostics.performance_metrics(
          df_cv,
          metrics=["coverage", "mape"],
      )
      assert set(df_horizon.columns) == {"coverage", "horizon"}
      df_horizon = diagnostics.performance_metrics(
          df_cv,
          metrics=["mape"],
      )
      assert df_horizon is None
      # List of metrics containing non-valid metrics
      with pytest.raises(ValueError):
          diagnostics.performance_metrics(
              df_cv,
              metrics=["mse", "error_metric"],
          )
  
imports: import datetime
  import itertools
  import numpy
  import pandas
  import pytest
  from prophet import Prophet, diagnostics
label_desc: Use image node_id 1 for calling the TestPerformanceMetrics obj's underlying member method code with example usage: obj.test_performance_metrics(ts_short, backend) without return types