code: def test_blend_models(
      load_uni_exo_data_target, load_models_uni_mix_exo_noexo
  ):
      """test blending functionality.
      NOTE: compare models does not enforce exog here for now.
      TODO: Later when Reduced Regression Models also support exogenous variables,
      we can add a test with only models that support exogenous variables (i.e.
      with enforce_exogenous=True).
      """
      data, target = load_uni_exo_data_target
  
      fh = 12
      data_for_modeling = data.iloc[:-12]
      future_data = data.iloc[-12:]
      future_exog = future_data.drop(columns=target)
  
      #########################
      # Expected Values ####
      #########################
      expected_period_index = data_for_modeling.iloc[-fh:].index
      final_expected_period_index = future_exog.index
  
      exp = TSForecastingExperiment()
      exp.setup(
          data=data_for_modeling,
          target=target,
          fh=fh,
          enforce_exogenous=False,
          session_id=42,
      )
  
      models_to_include = load_models_uni_mix_exo_noexo
      best_models = exp.compare_models(
          include=models_to_include, n_select=3
      )
  
      blender = exp.blend_models(best_models)
      y_pred = exp.predict_model(blender)
      assert isinstance(y_pred, pd.DataFrame)
      assert np.all(y_pred.index == expected_period_index)
  
      #########################
      # Test Finalize Model ##
      #########################
  
      final_model = exp.finalize_model(blender)
      y_pred = exp.predict_model(final_model, X=future_exog)
  
      assert np.all(y_pred.index == final_expected_period_index)
  
file_path: pycaret/tests/test_time_series_exogenous.py
imports: import numpy
  import pandas
  import pytest
  from pycaret.time_series import TSForecastingExperiment
  from pycaret.utils.time_series import TSApproachTypes, TSExogenousPresent
label_desc: Use image node_id 2 for calling a global function with example usage: test_blend_models(load_uni_exo_data_target, load_models_uni_mix_exo_noexo) without return types