class_docstr: Config class for an ensemble of forecasters.
class_docstr_tok: ["Config","class","for","an","ensemble","of","forecasters","."]
code: def target_seq_index(self, target_seq_index):
      if self.models is not None:
          # Get the target_seq_index from the models if None is given
          if target_seq_index is None:
              non_none_idxs = [
                  m.target_seq_index
                  for m in self.models
                  if m.target_seq_index is not None
              ]
              if len(non_none_idxs) > 0:
                  target_seq_index = non_none_idxs[0]
              assert all(
                  m.target_seq_index in [None, target_seq_index]
                  for m in self.models
              ), (
                  f"Attempted to infer target_seq_index from the individual models in the ensemble, but "
                  f"not all models have the same target_seq_index. Got {[m.target_seq_index for m in self.models]}"
              )
          # Only override the target_seq_index from the models if there is one
          if target_seq_index is not None:
              for model in self.models:
                  model.config.target_seq_index = target_seq_index
      # Save the ensemble-level target_seq_index as a private variable
      self._target_seq_index = target_seq_index
  
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 3 for calling the ForecasterEnsembleConfig obj's underlying member method code with example usage: obj.target_seq_index(target_seq_index) without return types