code: def test_evaluate_exog():
      """Test evaluate works when exogenous regressors are present."""
      y, X = load_longley()
      forecaster = UnobservedComponents(level="local linear trend")
      cv = SlidingWindowSplitter(
          fh=[1, 2, 3], window_length=4, step_length=1
      )
      results = evaluate(
          forecaster=forecaster,
          y=y,
          X=X,
          cv=cv,
          strategy="refit",
          return_data=True,
          error_score="raise",
      )
      assert results.shape == (10, 8)
  
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 8 for calling a global function with example usage: test_evaluate_exog() without return types