code: def testWordPieceOpAndVerifyOffsets(
      self,
      tokens,
      expected_subwords,
      vocab,
      expected_start=None,
      expected_end=None,
      use_unknown_token=True,
      unknown_token="[UNK]",
      token_out_type=dtypes.string,
      max_bytes_per_word=100,
      split_unknown_characters=False,
  ):
      for horizon in self._FORWARD_COMPATIBILITY_HORIZONS:
          with compat.forward_compatibility_horizon(*horizon):
              tokens_t = ragged_factory_ops.constant(tokens)
              vocab_table = _CreateTable(vocab)
              self.evaluate(vocab_table.initializer)
              tokenizer = WordpieceTokenizer(
                  vocab_table,
                  unknown_token=unknown_token,
                  token_out_type=token_out_type,
                  max_bytes_per_word=max_bytes_per_word,
                  split_unknown_characters=split_unknown_characters,
              )
              (
                  subwords_t,
                  begin_t,
                  end_t,
              ) = tokenizer.tokenize_with_offsets(tokens_t)
              self.assertAllEqual(subwords_t, expected_subwords)
  
              # Verify the indices by performing the following:
              # - Extract subwords and join them together to form the original tokens.
              # - Then compare the extracted tokens and original tokens.
              begin, end = self.evaluate((begin_t, end_t))
  
              # If expected start/end offsets were provided, check them explicitly.
              # Otherwise test the offsets by extracting subwords using token offsets
              # from the original 'tokens' input.
              if expected_start is None or expected_end is None:
                  extracted_tokens = _GetTokensFromWordpieceOffsets(
                      tokens, begin, end
                  )
                  self.assertAllEqual(extracted_tokens, tokens)
              else:
                  self.assertAllEqual(begin, expected_start)
                  self.assertAllEqual(end, expected_end)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from tensorflow.python.compat import compat
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.platform import test
  from tensorflow_text.python.ops.wordpiece_tokenizer import WordpieceTokenizer
label_desc: Use image node_id 1 for calling the WordpieceOpTest obj's underlying member method code with example usage: obj.testWordPieceOpAndVerifyOffsets(tokens, expected_subwords, vocab, expected_start, expected_end, use_unknown_token, unknown_token, token_out_type, max_bytes_per_word, split_unknown_characters) without return types