code: def testMapAndBatchImplicitDispose(self):
      # Tests whether a map and batch dataset will be cleaned up correctly when
      # the pipeline does not run it until exhaustion.
      # The pipeline is TensorSliceDataset -> RepeatDataset(1000) ->
      # MapAndBatchDataset(f=square_3, batch_size=100).
      components = (
          np.arange(1000),
          np.array([[1, 2, 3]]) * np.arange(1000)[:, np.newaxis],
          np.array(37.0) * np.arange(1000),
      )
  
      def _map_fn(x, y, z):
          return (
              math_ops.square(x),
              math_ops.square(y),
              math_ops.square(z),
          )
  
      dataset = (
          dataset_ops.Dataset.from_tensor_slices(components)
          .repeat(1000)
          .apply(batching.map_and_batch(_map_fn, batch_size=100))
      )
      dataset = dataset.prefetch(5)
      get_next = self.getNext(dataset)
      for _ in range(3):
          self.evaluate(get_next())
  
imports: import math
  from absl.testing import parameterized
  import numpy
  from tensorflow.python import pywrap_sanitizers
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.data.experimental.ops import batching
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.eager import context
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the MapAndBatchTest obj's underlying member method code with example usage: obj.testMapAndBatchImplicitDispose() and returns: math_ops,  math_ops,  math_ops