code: def test_create_predict_finalize_model(
      name, fh, load_pos_and_neg_data
  ):
      """test create_model, predict_model and finalize_model functionality
      Combined to save run time
      """
      exp = TSForecastingExperiment()
      data = load_pos_and_neg_data
  
      exp.setup(
          data=data,
          fold=2,
          fh=fh,
          fold_strategy="sliding",
          verbose=False,
      )
      #######################
      # Test Create Model ##
      #######################
      model = exp.create_model(name)
      assert not isinstance(model, ForecastingPipeline)
  
      #########################
      # Expected Values ####
      #########################
      # Only forcasted values
      fh_index = fh if isinstance(fh, int) else len(fh)
      # Full forecasting window
      fh_max_window = fh if isinstance(fh, int) else max(fh)
  
      expected_period_index = load_pos_and_neg_data.iloc[
          -fh_index:
      ].index
      final_expected_period_index = expected_period_index.shift(
          fh_max_window
      )
  
      ########################
      # Test Predict Model ##
      ########################
      # Default prediction
      y_pred = exp.predict_model(model)
      assert isinstance(y_pred, pd.DataFrame)
      assert np.all(y_pred.index == expected_period_index)
  
      # With Prediction Interval (default coverage = 0.9)
      y_pred = exp.predict_model(model, return_pred_int=True)
      assert isinstance(y_pred, pd.DataFrame)
      assert np.all(y_pred.columns == ["y_pred", "lower", "upper"])
      assert np.all(y_pred.index == expected_period_index)
  
      # With Prediction Interval (coverage float = 0.8)
      y_pred2 = exp.predict_model(
          model, return_pred_int=True, coverage=0.8
      )
      assert isinstance(y_pred2, pd.DataFrame)
      assert np.all(y_pred2.columns == ["y_pred", "lower", "upper"])
      assert np.all(y_pred2.index == expected_period_index)
  
      # With Prediction Interval (coverage List = [0.1, 0.9])
      y_pred3 = exp.predict_model(
          model, return_pred_int=True, coverage=[0.1, 0.9]
      )
      assert_frame_equal(y_pred2, y_pred3)  # check_exact=False
  
      # Increased forecast horizon to 2 years instead of the original 1 year
      y_pred = exp.predict_model(model, fh=np.arange(1, 25))
      assert len(y_pred) == 24
  
      #########################
      # Test Finalize Model ##
      #########################
  
      final_pipeline = exp.finalize_model(model)
      assert isinstance(final_pipeline, ForecastingPipeline)
  
      y_pred = exp.predict_model(final_pipeline)
      assert np.all(y_pred.index == final_expected_period_index)
  
file_path: pycaret/tests/test_time_series_base.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sktime.forecasting.compose import ForecastingPipeline
  from time_series_test_utils import _return_compare_model_args, _return_model_parameters
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 1 for calling a global function with example usage: test_create_predict_finalize_model(name, fh, load_pos_and_neg_data) without return types