code: def testFilterDataset(self, apply_filter):
      components = (
          np.arange(7, dtype=np.int64),
          np.array([[1, 2, 3]], dtype=np.int64)
          * np.arange(7, dtype=np.int64)[:, np.newaxis],
          np.array(37.0, dtype=np.float64) * np.arange(7),
      )
  
      def _map_fn(x, y, z):
          return (
              math_ops.square(x),
              math_ops.square(y),
              math_ops.square(z),
          )
  
      def do_test(count, modulus):  # pylint: disable=missing-docstring
          dataset = (
              dataset_ops.Dataset.from_tensor_slices(components)
              .map(_map_fn)
              .repeat(count)
          )
          dataset = self.enableFilterParallelization(dataset)
          dataset = dataset.apply(
              testing.assert_next(["ParallelFilter"])
          )
          # pylint: disable=g-long-lambda
          dataset = apply_filter(
              dataset,
              lambda x, _y, _z: math_ops.equal(
                  math_ops.mod(x, modulus), 0
              ),
          )
          # pylint: enable=g-long-lambda
          self.assertEqual(
              [c.shape[1:] for c in components],
              [
                  shape
                  for shape in dataset_ops.get_legacy_output_shapes(
                      dataset
                  )
              ],
          )
          get_next = self.getNext(dataset)
          for _ in range(count):
              for i in [x for x in range(7) if x ** 2 % modulus == 0]:
                  result = self.evaluate(get_next())
                  for component, result_component in zip(
                      components, result
                  ):
                      self.assertAllEqual(
                          component[i] ** 2, result_component
                      )
          with self.assertRaises(errors.OutOfRangeError):
              self.evaluate(get_next())
  
      do_test(14, 2)
      do_test(4, 18)
  
      # Test an empty dataset.
      do_test(0, 1)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.experimental.ops import testing
  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.framework import combinations
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import map_fn
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the FilterParallelizationTest obj's underlying member method code with example usage: obj.testFilterDataset(apply_filter) and returns: math_ops,  math_ops,  math_ops