docstr: Test that we can pass custom reserved tokens to SubwordTextEncoder.
docstr_tok: ["Test","that","we","can","pass","custom","reserved","tokens","to","SubwordTextEncoder","."]
code: def test_custom_reserved_tokens(self):
      """Test that we can pass custom reserved tokens to SubwordTextEncoder."""
      corpus = "The quick brown fox jumps over the lazy dog"
      token_counts = collections.Counter(corpus.split(" "))
  
      start_symbol = "<S>"
      end_symbol = "<E>"
      reserved_tokens = text_encoder.RESERVED_TOKENS + [
          start_symbol,
          end_symbol,
      ]
      encoder = text_encoder.SubwordTextEncoder.build_to_target_size(
          10, token_counts, 2, 10, reserved_tokens=reserved_tokens
      )
  
      # Make sure that reserved tokens appear in the right places.
      self.assertEqual(encoder.decode([2]), start_symbol)
      self.assertEqual(encoder.decode([3]), end_symbol)
  
      # Make sure that we haven't messed up the ability to reconstruct.
      reconstructed_corpus = encoder.decode(encoder.encode(corpus))
      self.assertEqual(corpus, reconstructed_corpus)
  
imports: import collections
  import io
  import os
  import random
  import shutil
  import string
  import mock
  from six.moves import range
  import tensorflow.compat.v1
  from trax.data import text_encoder
label_desc: Use image node_id 6 for calling the SubwordTextEncoderTest obj's underlying member method code with example usage: obj.test_custom_reserved_tokens() without return types