




import json
import os
import unittest

from transformers.models.gpt_neox_japanese.tokenization_gpt_neox_japanese import (
    VOCAB_FILES_NAMES,
    GPTNeoXJapaneseTokenizer,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin
@require_tokenizers
class      a__       (   snake_case__					,							unittest.TestCase ):
						_a				:       Dict   =       GPTNeoXJapaneseTokenizer
						_a				:       List[Any]   =       False
						_a				:       int   =       {"""do_clean_text""": False, """add_prefix_space""": False}






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											super().setUp()

											__lowerCAmelCase							  =			[
											    "こん",
											    "こんに",
											    "にちは",
											    "ばんは",
											    "世界,㔺界",
											    "、",
											    "。",
											    "<BR>",
											    "<SP>",
											    "<TAB>",
											    "<URL>",
											    "<EMAIL>",
											    "<TEL>",
											    "<DATE>",
											    "<PRICE>",
											    "<BLOCK>",
											    "<KIGOU>",
											    "<U2000U2BFF>",
											    "<|emoji1|>",
											    "<unk>",
											    "<|startoftext|>",
											    "<|endoftext|>",
											]
											__lowerCAmelCase							  =			{"emoji": {"\ud83d\ude00": "<|emoji1|>"}, "emoji_inv": {"<|emoji1|>": "\ud83d\ude00"}}  # 😀
											__lowerCAmelCase							  =			{"unk_token": "<unk>"}

											__lowerCAmelCase							  =			os.path.join(self.tmpdirname						,     VOCAB_FILES_NAMES["vocab_file"]     )
											__lowerCAmelCase							  =			os.path.join(self.tmpdirname						,     VOCAB_FILES_NAMES["emoji_file"]     )
											with open(self.vocab_file						,     "w"						,     encoding="utf-8"     ) as vocab_writer:
																vocab_writer.write("".join([x + "\n" for x in vocab_tokens]     )     )
											with open(self.emoji_file						,     "w"     ) as emoji_writer:
																emoji_writer.write(json.dumps(_A     )     )






						def 							__SCREAMING_SNAKE_CASE(  self						,     **_A     ):




											"""simple docstring"""



											kwargs.update(self.special_tokens_map     )
											return GPTNeoXJapaneseTokenizer.from_pretrained(self.tmpdirname						,     **_A     )






						def 							__SCREAMING_SNAKE_CASE(  self						,     _A     ):




											"""simple docstring"""



											__lowerCAmelCase							  =			"こんにちは、世界。 \nこんばんは、㔺界。😀"
											__lowerCAmelCase							  =			"こんにちは、世界。 \nこんばんは、世界。😀"
											return input_text, output_text






						def 							__SCREAMING_SNAKE_CASE(  self						,     _A     ):




											"""simple docstring"""



											__lowerCAmelCase  ,				__lowerCAmelCase							  =			self.get_input_output_texts(_A     )
											__lowerCAmelCase							  =			tokenizer.encode(_A						,     add_special_tokens=_A     )
											__lowerCAmelCase							  =			tokenizer.decode(_A						,     clean_up_tokenization_spaces=_A     )
											return text, ids






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											pass  # TODO add if relevant






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											pass  # TODO add if relevant






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											pass  # TODO add if relevant






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											__lowerCAmelCase							  =			self.get_tokenizer()

											# Testing tokenization
											__lowerCAmelCase							  =			"こんにちは、世界。　こんばんは、㔺界。"
											__lowerCAmelCase							  =			["こん", "にちは", "、", "世界", "。", "<SP>", "こん", "ばんは", "、", "㔺界", "。"]
											__lowerCAmelCase							  =			tokenizer.tokenize(_A     )
											self.assertListEqual(_A						,     _A     )

											# Testing conversion to ids without special tokens
											__lowerCAmelCase							  =			[0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6]
											__lowerCAmelCase							  =			tokenizer.convert_tokens_to_ids(_A     )
											self.assertListEqual(_A						,     _A     )

											# Testing conversion to ids with special tokens
											__lowerCAmelCase							  =			tokens + [tokenizer.unk_token]
											__lowerCAmelCase							  =			[0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6, 1_9]
											__lowerCAmelCase							  =			tokenizer.convert_tokens_to_ids(_A     )
											self.assertListEqual(_A						,     _A     )






						@slow
						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											__lowerCAmelCase							  =			self.tokenizer_class.from_pretrained("abeja/gpt-neox-japanese-2.7b"     )

											__lowerCAmelCase							  =			tokenizer.encode("ありがとう。"						,     add_special_tokens=_A     )
											__lowerCAmelCase							  =			tokenizer.encode("どういたしまして。"						,     add_special_tokens=_A     )

											__lowerCAmelCase							  =			tokenizer.build_inputs_with_special_tokens(_A     )
											__lowerCAmelCase							  =			tokenizer.build_inputs_with_special_tokens(_A						,     _A     )

											assert encoded_sentence == ids_a
											assert encoded_pair == ids_a + ids_a






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											pass






						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											pass










import decimal







def       _a (		):
					__lowerCAmelCase							  =			0
					__lowerCAmelCase							  =			decimal.Context(prec=1_05	)
					for i in range(2 , 1_00	):
										__lowerCAmelCase							  =			decimal.Decimal(SCREAMING_SNAKE_CASE_	)
										__lowerCAmelCase							  =			number.sqrt(SCREAMING_SNAKE_CASE_	)
										if len(str(SCREAMING_SNAKE_CASE_	)	) > 1:
															answer += int(str(SCREAMING_SNAKE_CASE_	)[0]	)
															__lowerCAmelCase							  =			str(SCREAMING_SNAKE_CASE_	)[2:1_01]
															answer += sum(int(SCREAMING_SNAKE_CASE_	) for x in sqrt_number_str	)
					return answer


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					print(f'''{solution() = }''')




