



import inspect
import json
import os
import tempfile
import unittest

from transformers.models.speech_to_text_a import SpeechaTextaTokenizer
from transformers.models.speech_to_text_a.tokenization_speech_to_text_a import VOCAB_FILES_NAMES

from ...test_tokenization_common import TokenizerTesterMixin


class 		lowerCamelCase__       (						lowerCamelCase__ ,    unittest.TestCase      ):
						_lowerCAmelCase	    =       SpeechaTextaTokenizer
						_lowerCAmelCase	    =       False


						def      _lowerCamelCase	(       self  :     List[str]	):
													super().setUp()

													a__:				List[Any] 							="<s> <pad> </s> <unk> here@@ a couple of@@ words for the he@@ re@@ vocab".split(" "	)
													a__:				Union[str, Any] 							=["he re</w> 123", "here a 1456"]
													a__:				List[Any] 							=dict(zip(_UpperCAmelCase					,				range(len(_UpperCAmelCase	)	)	)	)

													a__:				str 							={"pad_token": "<pad>", "unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>"}

													a__:				Any 							=tempfile.mkdtemp()
													a__:				List[Any] 							=os.path.join(self.tmpdirname					,				VOCAB_FILES_NAMES["vocab_file"]	)
													a__:				Union[str, Any] 							=os.path.join(self.tmpdirname					,				VOCAB_FILES_NAMES["merges_file"]	)

													with open(self.vocab_file					,				"w"					,				encoding="utf-8"	) as fp:
																				fp.write(json.dumps(_UpperCAmelCase	) + "\n"	)

													with open(self.merges_file					,				"w"	) as fp:
																				fp.write("\n".join(_UpperCAmelCase	)	)


						def      _lowerCamelCase	(       self  :     str	):
													a__:				List[str] 							=list(self.get_tokenizer().get_vocab().keys()	)

													self.assertEqual(vocab_keys[0]					,				"<s>"	)
													self.assertEqual(vocab_keys[1]					,				"<pad>"	)
													self.assertEqual(vocab_keys[-1]					,				"vocab"	)
													self.assertEqual(len(_UpperCAmelCase	)					,				1_4	)


						def      _lowerCamelCase	(       self  :     Any	):
													self.assertEqual(self.get_tokenizer().vocab_size					,				1_4	)


						def      _lowerCamelCase	(       self  :     int	):
													a__:				List[str] 							=SpeechaTextaTokenizer.from_pretrained(self.tmpdirname	)

													# make sure @@ is correctly concatenated
													a__:				Dict 							=[4, 6, 8, 7, 1_0]  # ["here@@", "couple", "words", "of@@", "the"]
													a__:				List[str] 							=tokenizer.decode(_UpperCAmelCase	)

													self.assertTrue(output_string == "herecouple words ofthe"	)


						def      _lowerCamelCase	(       self  :     Dict	):
													a__:				Optional[int] 							=SpeechaTextaTokenizer.from_pretrained(self.tmpdirname	)

													with tempfile.TemporaryDirectory() as tmp_dirname:
																				tokenizer.save_pretrained(_UpperCAmelCase	)
																				os.remove(os.path.join(_UpperCAmelCase					,				"merges.txt"	)	)

																				# load tokenizer without merges file should not throw an error
																				a__:				Union[str, Any] 							=SpeechaTextaTokenizer.from_pretrained(_UpperCAmelCase	)

													with tempfile.TemporaryDirectory() as tmp_dirname:
																				# save tokenizer and load again
																				tokenizer.save_pretrained(_UpperCAmelCase	)
																				a__:				Tuple 							=SpeechaTextaTokenizer.from_pretrained(_UpperCAmelCase	)

													self.assertIsNotNone(_UpperCAmelCase	)







						def      _lowerCamelCase	(       self  :     str	):
													if not self.test_slow_tokenizer:
																				return

													a__:				List[Any] 							=inspect.signature(self.tokenizer_class.__init__	)
													a__:				Dict 							=self.get_tokenizer()

													for parameter_name, parameter in signature.parameters.items():
																				if parameter.default != inspect.Parameter.empty and parameter_name != "merges_file":
																											self.assertIn(_UpperCAmelCase					,				tokenizer.init_kwargs	)









UpperCAmelCase			=    10**8






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  bool:




      """simple docstring"""

      if n % 10 == 0:
            return False
      snake_case_       =      str(SCREAMING_SNAKE_CASE					)
      return s == s[::-1]






def        __lowerCAmelCase    ()->  int:




      """simple docstring"""

      snake_case_       =      set()
      snake_case_       =      1
      snake_case_       =      5
      while sum_squares < LIMIT:
            snake_case_       =      first_square + 1
            while sum_squares < LIMIT:
                  if is_palindrome(SCREAMING_SNAKE_CASE					):
                        answer.add(SCREAMING_SNAKE_CASE					)
                  last_square += 1
                  sum_squares += last_square**2
            first_square += 1
            snake_case_       =      first_square**2 + (first_square + 1) ** 2

      return sum(SCREAMING_SNAKE_CASE					)


if __name__ == "__main__":
   print(solution())