code: def build_dataset(self, num_elements, options=None):
      dataset = dataset_ops.Dataset.range(num_elements).apply(
          cardinality.assert_cardinality(num_elements)
      )
      if options:
          dataset = dataset.with_options(options)
      return dataset
  
file_path: tensorflow/tensorflow/python/data/experimental/kernel_tests/assert_cardinality_test.py
imports: from absl.testing import parameterized
  from tensorflow.python.data.experimental.ops import cardinality
  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.platform import test
label_desc: Use image node_id 1 for calling the AssertCardinalityCheckpointTest obj's underlying member method code with example usage: obj.build_dataset(num_elements, options) and returns: dataset