code: def test_prediction_intervals_exog(
      alpha, coverage, level_sample_data_split
  ):
      """Test prediction intervals when exogenous regressors are present."""
      level, y_train, X_train, X_test, fh = level_sample_data_split
      fh_length = X_test.shape[0]
      model_spec = {
          "level": level,
          "freq_seasonal": [{"period": 12, "harmonics": 4}],
          "autoregressive": 1,
          "mle_regression": False,
      }
      forecaster = UnobservedComponents(**model_spec)
      forecaster.fit(y=y_train, X=X_train)
      quantiles_df = forecaster.predict_quantiles(
          fh=fh, X=X_test, alpha=alpha
      )
      intervals_df = forecaster.predict_interval(
          fh=fh, X=X_test, coverage=coverage
      )
  
      if isinstance(alpha, list):
          assert quantiles_df.shape == (fh_length, len(alpha))
      else:
          assert quantiles_df.shape == (fh_length, 1)
  
      if isinstance(coverage, list):
          assert intervals_df.shape == (fh_length, 2 * len(coverage))
      else:
          intervals_np = intervals_df.to_numpy().flatten()
          assert intervals_df.shape == (fh_length, 2)
          assert intervals_np[0] < intervals_np[1]
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_series_equal
  from sktime.datasets import load_airline, load_longley
  from sktime.forecasting.model_evaluation import evaluate
  from sktime.forecasting.structural import UnobservedComponents
  from sktime.split import SlidingWindowSplitter
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 7 for calling a global function with example usage: test_prediction_intervals_exog(alpha, coverage, level_sample_data_split) without return types