code: def test_raises_exception_when_not_encodable(self):
      corpus = "the quick brown fox jumps over the lazy dog"
      token_counts = collections.Counter(corpus.split(" "))
  
      # Deliberately exclude some required encoding chars from the alphabet
      # and token list, making some strings unencodable.
      encoder = text_encoder.SubwordTextEncoder.build_to_target_size(
          100, token_counts, 2, 10
      )
      original = "This has UPPER CASE letters that are out of alphabet"
  
      # Previously there was a bug which produced an infinite loop in this case.
      with self.assertRaises(ValueError):
          encoder.encode(original)
  
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 8 for calling the SubwordTextEncoderTest obj's underlying member method code with example usage: obj.test_raises_exception_when_not_encodable() without return types