class_docstr: Data iterator that switches and iterates through multiple datasets.
  
  This is a wrapper of TF reinitializble :tf_main:`iterator <data/Iterator>`.
  
  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.
  
  Example:
  
      .. code-block:: python
  
          train_data = MonoTextData(hparams_train)
          test_data = MonoTextData(hparams_test)
          iterator = DataIterator({'train': train_data, 'test': test_data})
          batch = iterator.get_next()
  
          sess = tf.Session()
  
          for _ in range(200): # Run 200 epochs of train/test
              # Starts iterating through training data from the beginning
              iterator.switch_to_dataset(sess, 'train')
              while True:
                  try:
                      train_batch_ = sess.run(batch)
                  except tf.errors.OutOfRangeError:
                      print("End of training epoch.")
              # Starts iterating through test data from the beginning
              iterator.switch_to_dataset(sess, 'test')
              while True:
                  try:
                      test_batch_ = sess.run(batch)
                  except tf.errors.OutOfRangeError:
                      print("End of test epoch.")
class_docstr_tok: ["Data","iterator","that","switches","and","iterates","through","multiple","datasets",".","This","is","a","wrapper","of","TF","reinitializble",":","tf_main",":","`","iterator","<","data\/Iterator",">","`",".","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",".","Example",":","..","code-block",":",":","python","train_data","=","MonoTextData","(","hparams_train",")","test_data","=","MonoTextData","(","hparams_test",")","iterator","=","DataIterator","(","{","'train","'",":","train_data",",","'test","'",":","test_data","}",")","batch","=","iterator.get_next","(",")","sess","=","tf.Session","(",")","for","_","in","range","(","200",")",":","#","Run","200","epochs","of","train\/test","#","Starts","iterating","through","training","data","from","the","beginning","iterator.switch_to_dataset","(","sess",",","'train","'",")","while","True",":","try",":","train_batch_","=","sess.run","(","batch",")","except","tf.errors.OutOfRangeError",":","print","(","``","End","of","training","epoch",".","''",")","#","Starts","iterating","through","test","data","from","the","beginning","iterator.switch_to_dataset","(","sess",",","'test","'",")","while","True",":","try",":","test_batch_","=","sess.run","(","batch",")","except","tf.errors.OutOfRangeError",":","print","(","``","End","of","test","epoch",".","''",")"]
docstr: Returns the next element of the activated dataset.
          
docstr_tok: ["Returns","the","next","element","of","the","activated","dataset","."]
code: def get_next(self):
      """Returns the next element of the activated dataset."""
      return self._iterator.get_next()
  
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 3 for calling the DataIterator obj's underlying member method code with example usage: obj.get_next() and returns: self