code: def testSparse(self, apply_filter):
      def _map_fn(i):
          return (
              sparse_tensor.SparseTensorValue(
                  indices=np.array([[0, 0]]),
                  values=(i * np.array([1])),
                  dense_shape=np.array([1, 1]),
              ),
              i,
          )
  
      def _filter_fn(_, i):
          return math_ops.equal(i % 2, 0)
  
      dataset = dataset_ops.Dataset.range(10).map(_map_fn)
      dataset = apply_filter(dataset, _filter_fn)
      dataset = dataset.map(lambda x, i: x)
      self.assertDatasetProduces(
          dataset, expected_output=[_map_fn(i * 2)[0] for i in range(5)]
      )
  
imports: from absl.testing import parameterized
  import numpy
  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 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.platform import test
label_desc: Use image node_id 5 for calling the FilterTest obj's underlying member method code with example usage: obj.testSparse(apply_filter) and returns: sparse_tensor,  i, math_ops