class_docstr: Wrapper class on top of the TensorFlow native iterators :class:`tf.data.Iterator`.
docstr: Provide the next batch for training in the form of a tuple `(x, y)`. The generator should loop over the data
  indefinitely.
  
  :return: A tuple containing a batch of data `(x, y)`.
  :raises `ValueError`: If the iterator has reached the end.
code: def get_batch(self) -> tuple:
      """
      Provide the next batch for training in the form of a tuple `(x, y)`. The generator should loop over the data
      indefinitely.
  
      :return: A tuple containing a batch of data `(x, y)`.
      :raises `ValueError`: If the iterator has reached the end.
      """
      import tensorflow as tf
  
      # Get next batch
      next_batch = self.iterator.get_next()
  
      # Process to get the batch
      try:
          if self.iterator_type in ("initializable", "reinitializable"):
              return self.sess.run(next_batch)
          return self.sess.run(
              next_batch, feed_dict=self.iterator_arg[1]
          )
      except (
          tf.errors.FailedPreconditionError,
          tf.errors.OutOfRangeError,
      ):
          if self.iterator_type == "initializable":
              self.sess.run(
                  self.iterator.initializer, feed_dict=self.iterator_arg
              )
              return self.sess.run(next_batch)
  
          if self.iterator_type == "reinitializable":
              self.sess.run(self.iterator_arg)
              return self.sess.run(next_batch)
  
          self.sess.run(self.iterator_arg[0].initializer)
          return self.sess.run(
              next_batch, feed_dict=self.iterator_arg[1]
          )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import abc
  import inspect
  import logging
  from typing import Any, Dict, Generator, Iterator, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
label_desc: Use image node_id 2 for calling the TensorFlowDataGenerator obj's underlying member method code with example usage: obj.get_batch() and returns: self, self, self, self, self