





'''simple docstring'''




import os
import unittest

from transformers import LayoutLMTokenizer, LayoutLMTokenizerFast
from transformers.models.layoutlm.tokenization_layoutlm import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin


@require_tokenizers
class 			SCREAMING_SNAKE_CASE   (_UpperCAmelCase ,		unittest.TestCase							):
     lowerCAmelCase		      =	LayoutLMTokenizer
     lowerCAmelCase		      =	LayoutLMTokenizerFast
     lowerCAmelCase		      =	True
     lowerCAmelCase		      =	True


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          super().setUp()

          __A						:			Union[str, Any]								=	[
              '''[UNK]''',
              '''[CLS]''',
              '''[SEP]''',
              '''want''',
              '''##want''',
              '''##ed''',
              '''wa''',
              '''un''',
              '''runn''',
              '''##ing''',
              ''',''',
              '''low''',
              '''lowest''',
          ]
          __A						:			Dict								=	os.path.join(self.tmpdirname						,     VOCAB_FILES_NAMES['vocab_file'])
          with open(self.vocab_file						,     'w'						,     encoding='utf-8') as vocab_writer:
               vocab_writer.write(''.join([x + '\n' for x in vocab_tokens]))


     def 							SCREAMING_SNAKE_CASE  (						self						,     **_UpperCAmelCase):

          '''simple docstring'''






          return LayoutLMTokenizer.from_pretrained(self.tmpdirname						,     **_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self						,     _UpperCAmelCase):

          '''simple docstring'''






          __A						:			Dict								=	'''UNwant\u00E9d,running'''
          __A						:			Optional[Any]								=	'''unwanted, running'''
          return input_text, output_text


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			Dict								=	self.tokenizer_class(self.vocab_file)

          __A						:			Optional[int]								=	tokenizer.tokenize('UNwant\u00E9d,running')
          self.assertListEqual(_UpperCAmelCase						,     ['un', '##want', '##ed', ',', 'runn', '##ing'])
          self.assertListEqual(tokenizer.convert_tokens_to_ids(_UpperCAmelCase)						,     [7, 4, 5, 10, 8, 9])


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          pass








'''simple docstring'''




import math






def 	_lowerCAmelCase      (  __snake_case  :			int      )					->					int:

     if not isinstance(__snake_case			,							__snake_case      ):
          __A						:			List[Any]								=	f'Input value of [number={number}] must be an integer'
          raise TypeError(__snake_case      )

     if number < 1:
          __A						:			Union[str, Any]								=	f'Input value of [number={number}] must be > 0'
          raise ValueError(__snake_case      )
     elif number == 1:
          return 3
     elif number == 2:
          return 5
     else:
          __A						:			Optional[Any]								=	int(math.log(number // 3			,							2      )      ) + 2

          __A						:			Union[str, Any]								=	[3, 5]
          __A						:			List[Any]								=	2
          __A						:			Optional[Any]								=	3
          for block in range(1			,							__snake_case      ):
               for _ in range(__snake_case      ):
                    proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]      )
                    proth_index += 1
               increment *= 2

     return proth_list[number - 1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for number in range(11):
    lowercase__   :				str      =   0
    try:
      lowercase__   :				List[str]      =   proth(number)
    except ValueError:
      print(f"""ValueError: there is no {number}th Proth number""")
      continue

    print(f"""The {number}th Proth number: {value}""")