


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 							lowerCamelCase       (			__SCREAMING_SNAKE_CASE				,					unittest.TestCase ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      GPTNeoXJapaneseTokenizer
							SCREAMING_SNAKE_CASE										=      False
							SCREAMING_SNAKE_CASE										=      {"""do_clean_text""": False, """add_prefix_space""": False}






							def 					lowerCAmelCase     (						self :     Optional[Any]				):
													super().setUp()

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

													UpperCAmelCase__		=    os.path.join(self.tmpdirname		, VOCAB_FILES_NAMES['''vocab_file''']				)
													UpperCAmelCase__		=    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(lowerCamelCase_				)				)






							def 					lowerCAmelCase     (						self :     int		, **lowerCamelCase_ :     List[Any]				):
													kwargs.update(self.special_tokens_map				)
													return GPTNeoXJapaneseTokenizer.from_pretrained(self.tmpdirname		, **lowerCamelCase_				)






							def 					lowerCAmelCase     (						self :     Optional[int]		, lowerCamelCase_ :     List[str]				):
													UpperCAmelCase__		=    '''こんにちは、世界。 \nこんばんは、㔺界。😀'''
													UpperCAmelCase__		=    '''こんにちは、世界。 \nこんばんは、世界。😀'''
													return input_text, output_text






							def 					lowerCAmelCase     (						self :     List[str]		, lowerCamelCase_ :     Union[str, Any]				):
													UpperCAmelCase__	,				UpperCAmelCase__		=    self.get_input_output_texts(lowerCamelCase_				)
													UpperCAmelCase__		=    tokenizer.encode(lowerCamelCase_		, add_special_tokens=lowerCamelCase_				)
													UpperCAmelCase__		=    tokenizer.decode(lowerCamelCase_		, clean_up_tokenization_spaces=lowerCamelCase_				)
													return text, ids






							def 					lowerCAmelCase     (						self :     Dict				):
													pass  # TODO add if relevant






							def 					lowerCAmelCase     (						self :     Any				):
													pass  # TODO add if relevant






							def 					lowerCAmelCase     (						self :     Union[str, Any]				):
													pass  # TODO add if relevant






							def 					lowerCAmelCase     (						self :     Optional[int]				):
													UpperCAmelCase__		=    self.get_tokenizer()

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

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

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






							@slow
							def 					lowerCAmelCase     (						self :     List[Any]				):
													UpperCAmelCase__		=    self.tokenizer_class.from_pretrained('''abeja/gpt-neox-japanese-2.7b'''				)

													UpperCAmelCase__		=    tokenizer.encode('''ありがとう。'''		, add_special_tokens=lowerCamelCase_				)
													UpperCAmelCase__		=    tokenizer.encode('''どういたしまして。'''		, add_special_tokens=lowerCamelCase_				)

													UpperCAmelCase__		=    tokenizer.build_inputs_with_special_tokens(lowerCamelCase_				)
													UpperCAmelCase__		=    tokenizer.build_inputs_with_special_tokens(lowerCamelCase_		, lowerCamelCase_				)

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






							def 					lowerCAmelCase     (						self :     List[str]				):
													# Intentionally convert some words to accommodate character fluctuations unique to Japanese
													pass






							def 					lowerCAmelCase     (						self :     Any				):
													# tokenizer has no padding token
													pass



"""simple docstring"""







from collections import defaultdict






def 					a__ (       _UpperCamelCase = 5 ):





						"""simple docstring"""

						UpperCAmelCase__		=    defaultdict(_UpperCamelCase )
						UpperCAmelCase__		=    0

						while True:
												UpperCAmelCase__		=    get_digits(_UpperCamelCase )
												freqs[digits].append(_UpperCamelCase )

												if len(freqs[digits] ) == max_base:
																		UpperCAmelCase__		=    freqs[digits][0] ** 3
																		return base

												num += 1






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						return "".join(sorted(str(num**3 ) ) )


if __name__ == "__main__":
						print(f'''{solution() = }''')