code: def test_add_model_to_pipeline_noexo(load_pos_and_neg_data):
      """Tests _add_model_to_pipeline WITHOUT exogenous variables"""
      y = load_pos_and_neg_data
  
      exp = TSForecastingExperiment()
      FH = 12
      model = NaiveForecaster()
  
      ###########################
      # 1: Empty Pipeline ####
      ###########################
  
      exp.setup(data=y, fh=FH)
  
      # -------------------------------------------------------------------------#
      # A. Final Model
      # -------------------------------------------------------------------------#
  
      # Check that the final model has changed ----
      assert isinstance(
          exp.pipeline.steps[-1][1].steps[-1][1], DummyForecaster
      )
      pipeline = _add_model_to_pipeline(
          pipeline=exp.pipeline, model=model
      )
      assert isinstance(
          pipeline.steps[-1][1].steps[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps_[-1][1].steps_[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps[-1][1].steps_[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps_[-1][1].steps[-1][1], NaiveForecaster
      )
  
      # -------------------------------------------------------------------------#
      # B. Forecasting Pipeline
      # -------------------------------------------------------------------------#
  
      # Check that the length of the Forecasting Pipeline has not changed ----
      assert len(exp.pipeline.steps) == len(pipeline.steps)
      assert len(exp.pipeline.steps_) == len(pipeline.steps_)
  
      # Check that the steps for X in the Forecasting Pipeline have not changed ----
      for i in np.arange(len(exp.pipeline.steps_)):
          assert (
              exp.pipeline.steps[i][1].__class__
              is pipeline.steps[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[i][1].__class__
              is pipeline.steps_[i][1].__class__
          )
  
      # -------------------------------------------------------------------------#
      # C. Transformed Target Forecaster
      # -------------------------------------------------------------------------#
  
      # Check that the length of the Transformed Target Forecaster has not changed ----
      assert len(exp.pipeline.steps[-1][1].steps) == len(
          pipeline.steps[-1][1].steps
      )
      assert len(exp.pipeline.steps_[-1][1].steps_) == len(
          pipeline.steps_[-1][1].steps_
      )
      assert len(exp.pipeline.steps[-1][1].steps_) == len(
          pipeline.steps[-1][1].steps_
      )
      assert len(exp.pipeline.steps_[-1][1].steps) == len(
          pipeline.steps_[-1][1].steps
      )
  
      # Check that the steps for y in the Forecasting Pipeline have not changed ----
      # Check except last step which has been checked above (Dummy vs Naive)
      for i in np.arange(len(exp.pipeline.steps_[-1][1]) - 1):
          assert (
              exp.pipeline.steps[-1][1].steps[i][1].__class__
              is pipeline.steps[-1][1].steps[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[-1][1].steps_[i][1].__class__
              is pipeline.steps_[-1][1].steps_[i][1].__class__
          )
          assert (
              exp.pipeline.steps[-1][1].steps_[i][1].__class__
              is pipeline.steps[-1][1].steps_[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[-1][1].steps[i][1].__class__
              is pipeline.steps_[-1][1].steps[i][1].__class__
          )
  
      ###############################
      # 2: Not Empty Pipeline ####
      ###############################
  
      exp.setup(data=y, fh=FH, numeric_imputation_target="drift")
  
      # -------------------------------------------------------------------------#
      # A. Final Model
      # -------------------------------------------------------------------------#
  
      # Check that the final model has changed ----
      assert isinstance(
          exp.pipeline.steps[-1][1].steps[-1][1], DummyForecaster
      )
      pipeline = _add_model_to_pipeline(
          pipeline=exp.pipeline, model=model
      )
      assert isinstance(
          pipeline.steps[-1][1].steps[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps_[-1][1].steps_[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps[-1][1].steps_[-1][1], NaiveForecaster
      )
      assert isinstance(
          pipeline.steps_[-1][1].steps[-1][1], NaiveForecaster
      )
  
      # -------------------------------------------------------------------------#
      # B. Forecasting Pipeline
      # -------------------------------------------------------------------------#
  
      # Check that the length of the Forecasting Pipeline has not changed ----
      assert len(exp.pipeline.steps) == len(pipeline.steps)
      assert len(exp.pipeline.steps_) == len(pipeline.steps_)
  
      # Check that the steps for X in the Forecasting Pipeline have not changed ----
      for i in np.arange(len(exp.pipeline.steps_)):
          assert (
              exp.pipeline.steps[i][1].__class__
              is pipeline.steps[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[i][1].__class__
              is pipeline.steps_[i][1].__class__
          )
  
      # -------------------------------------------------------------------------#
      # C. Transformed Target Forecaster
      # -------------------------------------------------------------------------#
  
      # Check that the length of the Transformed Target Forecaster has not changed ----
      assert len(exp.pipeline.steps[-1][1].steps) == len(
          pipeline.steps[-1][1].steps
      )
      assert len(exp.pipeline.steps_[-1][1].steps_) == len(
          pipeline.steps_[-1][1].steps_
      )
      assert len(exp.pipeline.steps[-1][1].steps_) == len(
          pipeline.steps[-1][1].steps_
      )
      assert len(exp.pipeline.steps_[-1][1].steps) == len(
          pipeline.steps_[-1][1].steps
      )
  
      # Check that the steps for y in the Forecasting Pipeline have not changed ----
      # Check except last step which has been checked above (Dummy vs Naive)
      for i in np.arange(len(exp.pipeline.steps_[-1][1]) - 1):
          assert (
              exp.pipeline.steps[-1][1].steps[i][1].__class__
              is pipeline.steps[-1][1].steps[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[-1][1].steps_[i][1].__class__
              is pipeline.steps_[-1][1].steps_[i][1].__class__
          )
          assert (
              exp.pipeline.steps[-1][1].steps_[i][1].__class__
              is pipeline.steps[-1][1].steps_[i][1].__class__
          )
          assert (
              exp.pipeline.steps_[-1][1].steps[i][1].__class__
              is pipeline.steps_[-1][1].steps[i][1].__class__
          )
  
file_path: pycaret/tests/test_time_series_utils_forecasting_pipeline.py
imports: import numpy
  import pytest
  from sktime.forecasting.naive import NaiveForecaster
  from pycaret.time_series import TSForecastingExperiment
  from pycaret.utils.time_series.forecasting.models import DummyForecaster
  from pycaret.utils.time_series.forecasting.pipeline import _add_model_to_pipeline, _are_pipeline_tansformations_empty, _get_imputed_data, _transformations_present_X, _transformations_present_y
label_desc: Use image node_id 5 for calling a global function with example usage: test_add_model_to_pipeline_noexo(load_pos_and_neg_data) without return types