class_docstr: An abstract class representing an ensemble of multiple models.
class_docstr_tok: ["An","abstract","class","representing","an","ensemble","of","multiple","models","."]
code: def __setstate__(self, state):
      if "models" in state:
          model_states = state.pop("models")
          if self.models is None and model_states is not None:
              raise ValueError(
                  f"`{type(self).__name__}.models` is None, but received a non-None `models` state."
              )
          elif self.models is None or model_states is None:
              self.config.models = None
          else:
              for i, (model, model_state) in enumerate(
                  zip(self.models, model_states)
              ):
                  if model is None and model_state is not None:
                      raise ValueError(
                          f"One of the Ensemble models is None, but received a non-None model state."
                      )
                  elif model is None or model_state is None:
                      self.models[i] = None
                  else:
                      model.__setstate__(model_state)
      super().__setstate__(state)
  
imports: import copy
  import logging
  from typing import Any, Dict, List, Tuple, Union
  import numpy
  import pandas
  from merlion.models.base import ModelBase, Config
  from merlion.models.ensemble.combine import CombinerBase, CombinerFactory, Mean
  from merlion.models.factory import ModelFactory
  from merlion.utils import TimeSeries
  from merlion.utils.misc import AutodocABCMeta
  from merlion.utils.resample import to_offset
label_desc: Use image node_id 12 for calling the EnsembleBase obj's underlying member method code with example usage: obj.__setstate__(state) without return types