code: def test_bert_tokenizer(
      self,
      text_inputs,
      expected,
      vocab=None,
      expected_extracted=None,
      lower_case=True,
      num_oov=1,
      preserve_unused_token=False,
  ):
      text_inputs = constant_op.constant(text_inputs)
      if not vocab:
          vocab = _VOCAB
      table = _create_table(vocab, num_oov)
      self.evaluate(table.initializer)
      tokenizer = bert_tokenizer.BertTokenizer(
          table,
          token_out_type=dtypes.string,
          lower_case=lower_case,
          preserve_unused_token=preserve_unused_token,
      )
      results = tokenizer.tokenize(text_inputs)
      self.assertAllEqual(results, expected)
  
      # Verify that the int ids are the same.
      expected_rt = ragged_factory_ops.constant(expected)
      expected_int = table.lookup(expected_rt.flat_values)
      expected_int_rt = (
          ragged_tensor.RaggedTensor.from_nested_row_splits(
              expected_int, expected_rt.nested_row_splits
          )
      )
      int_tokenizer = bert_tokenizer.BertTokenizer(
          vocab_lookup_table=table,
          token_out_type=dtypes.int64,
          lower_case=lower_case,
          preserve_unused_token=preserve_unused_token,
      )
      results_int = int_tokenizer.tokenize(text_inputs)
      self.assertAllEqual(results_int, expected_int_rt)
  
      # Verify that the offsets can extract the expected tokens
      _, begin, end = tokenizer.tokenize_with_offsets(text_inputs)
  
      extracted_wordpieces = _ragged_substr(text_inputs, begin, end)
      if expected_extracted:
          self.assertAllEqual(extracted_wordpieces, expected_extracted)
      else:
          # The extracted won't have any wordpieces with '##' prefix. Strip them
          # out.
          stripped_prefix_flat = string_ops.regex_replace(
              expected_rt.flat_values, "##", ""
          )
          stripped_prefix = expected_rt.with_flat_values(
              stripped_prefix_flat
          )
          self.assertAllEqual(extracted_wordpieces, stripped_prefix)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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 import string_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_map_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
  from tensorflow_text.python.ops import bert_tokenizer
label_desc: Use image node_id 3 for calling the BertTokenizerTest obj's underlying member method code with example usage: obj.test_bert_tokenizer(text_inputs, expected, vocab, expected_extracted, lower_case, num_oov, preserve_unused_token) without return types