docstr: Test that we handle reserved tokens appearing in the corpus.
docstr_tok: ["Test","that","we","handle","reserved","tokens","appearing","in","the","corpus","."]
code: def test_reserved_tokens_in_corpus(self):
      """Test that we handle reserved tokens appearing in the corpus."""
      corpus = "A B {} D E F {} G {}".format(
          text_encoder.EOS, text_encoder.EOS, text_encoder.PAD
      )
  
      encoder = text_encoder.TokenTextEncoder(
          None, vocab_list=corpus.split()
      )
  
      all_tokens = encoder._id_to_token.values()
  
      # If reserved tokens are removed correctly, then the set of tokens will
      # be unique.
      self.assertEqual(len(all_tokens), len(set(all_tokens)))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import collections
  import io
  import os
  import random
  import shutil
  import string
  import mock
  import six
  from six.moves import range
  from tensor2tensor.data_generators import text_encoder
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the TokenTextEncoderTest obj's underlying member method code with example usage: obj.test_reserved_tokens_in_corpus() without return types