class_docstr: Base class for all data iterator classes to inherit. A data iterator
  is a wrapper of :tf_main:`tf.data.Iterator <data/Iterator>`, and can
  switch between and iterate through **multiple** datasets.
  
  Args:
      datasets: Datasets to iterates through. This can be:
  
          - A single instance of :tf_main:`tf.data.Dataset <data/Dataset>`             or instance of subclass of :class:`~texar.tf.data.DataBase`.
          - A `dict` that maps dataset name to             instance of :tf_main:`tf.data.Dataset <data/Dataset>` or             subclass of :class:`~texar.tf.data.DataBase`.
          - A `list` of instances of subclasses of             :class:`texar.tf.data.DataBase`. The name of instances             (:attr:`texar.tf.data.DataBase.name`) must be unique.
class_docstr_tok: ["Base","class","for","all","data","iterator","classes","to","inherit",".","A","data","iterator","is","a","wrapper","of",":","tf_main",":","`","tf.data.Iterator","<","data\/Iterator",">","`",",","and","can","switch","between","and","iterate","through","*","*","multiple","*","*","datasets",".","Args",":","datasets",":","Datasets","to","iterates","through",".","This","can","be",":","-","A","single","instance","of",":","tf_main",":","`","tf.data.Dataset","<","data\/Dataset",">","`","or","instance","of","subclass","of",":","class",":","`","~texar.tf.data.DataBase","`",".","-","A","`","dict","`","that","maps","dataset","name","to","instance","of",":","tf_main",":","`","tf.data.Dataset","<","data\/Dataset",">","`","or","subclass","of",":","class",":","`","~texar.tf.data.DataBase","`",".","-","A","`","list","`","of","instances","of","subclasses","of",":","class",":","`","texar.tf.data.DataBase","`",".","The","name","of","instances","(",":","attr",":","`","texar.tf.data.DataBase.name","`",")","must","be","unique","."]
code: def __init__(self, datasets):
      self._default_dataset_name = "data"
      if isinstance(datasets, (tf.data.Dataset, DataBase)):
          datasets = {self._default_dataset_name: datasets}
      elif isinstance(datasets, (list, tuple)):
          if any(not isinstance(d, DataBase) for d in datasets):
              raise ValueError(
                  "`datasets` must be an non-empty list of "
                  "`tx.data.DataBase` instances."
              )
          num_datasets = len(datasets)
          datasets = {d.name: d for d in datasets}
          if len(datasets) < num_datasets:
              raise ValueError("Names of datasets must be unique.")
  
      _datasets = {}
      for k, v in datasets.items():  # pylint: disable=invalid-name
          _datasets[k] = (
              v if isinstance(v, tf.data.Dataset) else v.dataset
          )
      self._datasets = _datasets
  
      if len(self._datasets) <= 0:
          raise ValueError("`datasets` must not be empty.")
  
imports: import tensorflow
  from texar.tf.data.data.data_base import DataBase
  from texar.tf.utils.variables import get_unique_named_variable_scope
label_desc: Use image node_id 1 to create a new DataIteratorBase object from inherited base classes: object with example: obj = DataIteratorBase(datasets)