code: def test_compare_models_engines_local_args(load_pos_and_neg_data):
      """Tests the setting of engines for compare_models using local args.
      We test for both statistical models and regression models.
      """
  
      exp = TSForecastingExperiment()
      data = load_pos_and_neg_data
  
      exp.setup(
          data=data,
          fold=2,
          fh=12,
          fold_strategy="sliding",
          verbose=False,
      )
  
      # Default Model Engine ----
      # A. Statistical Models
      assert exp.get_engine("auto_arima") == "pmdarima"
      model = exp.compare_models(include=["auto_arima"])
      assert isinstance(model, PmdAutoARIMA)
      # Original engine should remain the same
      assert exp.get_engine("auto_arima") == "pmdarima"
  
      # B. Regression Models
      assert exp.get_engine("lr_cds_dt") == "sklearn"
      model = exp.compare_models(include=["lr_cds_dt"])
      assert isinstance(model.regressor, SklearnLinearRegression)
      # Original engine should remain the same
      assert exp.get_engine("lr_cds_dt") == "sklearn"
  
      # Override model engine locally ----
      # A. Statistical Models
      model = exp.compare_models(
          include=["auto_arima"], engine={"auto_arima": "statsforecast"}
      )
      assert isinstance(model, StatsForecastAutoARIMA)
      # Original engine should remain the same
      assert exp.get_engine("auto_arima") == "pmdarima"
      model = exp.compare_models(include=["auto_arima"])
      assert isinstance(model, PmdAutoARIMA)
  
      # B. Regression Models
      model = exp.compare_models(
          include=["lr_cds_dt"], engine={"lr_cds_dt": "sklearnex"}
      )
      parent_library = model.regressor.__module__
      assert parent_library.startswith(
          "sklearnex"
      ) or parent_library.startswith("daal4py")
      # Original engine should remain the same
      assert exp.get_engine("lr_cds_dt") == "sklearn"
      model = exp.compare_models(include=["lr_cds_dt"])
      assert isinstance(model.regressor, SklearnLinearRegression)
  
imports: from sklearn.linear_model import LinearRegression
  from sktime.forecasting.arima import AutoARIMA
  from sktime.forecasting.statsforecast import StatsForecastAutoARIMA
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 4 for calling a global function with example usage: test_compare_models_engines_local_args(load_pos_and_neg_data) without return types