class_docstr: Class representing an ensemble of multiple forecasting models.
class_docstr_tok: ["Class","representing","an","ensemble","of","multiple","forecasting","models","."]
code: def _forecast_with_exog(
      self,
      time_stamps: List[int],
      time_series_prev: pd.DataFrame = None,
      return_prev=False,
      exog_data: pd.DataFrame = None,
      exog_data_prev: pd.DataFrame = None,
  ) -> Tuple[pd.DataFrame, Optional[pd.DataFrame]]:
      preds, errs = [], []
      time_series_prev = TimeSeries.from_pd(time_series_prev)
      if exog_data is not None:
          exog_data = (
              pd.concat((exog_data_prev, exog_data))
              if exog_data_prev is not None
              else exog_data
          )
          exog_data = TimeSeries.from_pd(exog_data)
      for model, used in zip(self.models, self.models_used):
          if used:
              pred, err = model.forecast(
                  time_stamps=time_stamps,
                  time_series_prev=time_series_prev,
                  exog_data=exog_data,
                  return_prev=return_prev,
              )
              preds.append(pred)
              errs.append(err)
  
      pred = self.combiner(preds, None).to_pd()
      err = (
          None
          if any(e is None for e in errs)
          else self.combiner(errs, None).to_pd()
      )
      return pred, err
  
imports: import logging
  import traceback
  from typing import List, Optional, Tuple, Union
  import pandas
  from merlion.evaluate.forecast import ForecastEvaluator, ForecastEvaluatorConfig
  from merlion.models.ensemble.base import EnsembleConfig, EnsembleTrainConfig, EnsembleBase
  from merlion.models.ensemble.combine import Mean
  from merlion.models.forecast.base import ForecasterBase, ForecasterExogConfig, ForecasterExogBase
  from merlion.utils.time_series import TimeSeries
label_desc: Use image node_id 8 for calling the ForecasterEnsemble obj's underlying member method code with example usage: obj._forecast_with_exog(time_stamps, time_series_prev, return_prev, exog_data, exog_data_prev) and returns: pred,  err