code: def testSerialization(self):
      with context.eager_mode():
          sentencepiece_model_file = (
              "tensorflow_text/python/ops/test_data/"
              "test_oss_model.model"
          )
          model = gfile.GFile(sentencepiece_model_file, "rb").read()
          sp = SentencepieceTokenizer(model)
          strings = ["hello", "world"]
          dataset = dataset_ops.Dataset.from_tensor_slices(strings)
          # Ensure we can map the tokenizer across the dataset.
          dataset = dataset.map(sp.tokenize)
          graph = dataset._as_serialized_graph()
          element_spec = dataset.element_spec
          dataset_graph_string = graph.numpy()
          expected = sp.tokenize(strings)
  
      # Reset the eager context to make sure that the serialized dataset graph
      # is self-contained.
      context._reset_context()
  
      with context.eager_mode():
          restored = dataset_ops.from_variant(
              gen_experimental_dataset_ops.dataset_from_graph(
                  dataset_graph_string
              ),
              element_spec,
          )
          for i, result in enumerate(restored):
              self.assertAllEqual(result, expected[i])
  
imports: import sys
  import tempfile
  from absl.testing import parameterized
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.module import module
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_gather_ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import save
  from tensorflow_text.python.ops.sentencepiece_tokenizer import SentencepieceTokenizer
label_desc: Use image node_id 1 for calling the DatasetSerializationTest obj's underlying member method code with example usage: obj.testSerialization() without return types