code: def _getNext(self, dataset):
      if context.executing_eagerly():
          iterator = iter(dataset)
          return (
              iterator._next_internal
          )  # pylint: disable=protected-access
      else:
          iterator = dataset_ops.make_one_shot_iterator(dataset)
          get_next = iterator.get_next()
          return lambda: get_next
  
imports: import os
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import readers
  from tensorflow.python.data.util import structure
  from tensorflow.python.distribute import input_ops
  from tensorflow.python.eager import context
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import python_io
  from tensorflow.python.ops import gen_dataset_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 2 for calling the AutoShardDatasetTest obj's underlying member method code with example usage: obj._getNext(dataset) and returns: iterator, function