
'''simple docstring'''





import json
import os
import unittest

from transformers import HerbertTokenizer, HerbertTokenizerFast
from transformers.models.herbert.tokenization_herbert import VOCAB_FILES_NAMES
from transformers.testing_utils import get_tests_dir, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin

@require_tokenizers
class     a (					__magic_name__					,unittest.TestCase     ):
				_snake_case		     =			HerbertTokenizer
				_snake_case		     =			HerbertTokenizerFast
				_snake_case		     =			True




				def 						__snake_case				(				self						:					List[Any]   ):
										super().setUp()

										# Use a simpler test file without japanese/chinese characters
										with open(F"""{get_tests_dir()}/fixtures/sample_text_no_unicode.txt""",     encoding='''utf-8'''   ) as f_data:
																snake_case							:  Optional[int]			=     f_data.read().replace('''\n\n''',     '''\n'''   ).strip()

										snake_case							:  List[str]			=     [
										    '''<s>''',
										    '''</s>''',
										    '''l''',
										    '''o''',
										    '''w''',
										    '''e''',
										    '''r''',
										    '''s''',
										    '''t''',
										    '''i''',
										    '''d''',
										    '''n''',
										    '''w</w>''',
										    '''r</w>''',
										    '''t</w>''',
										    '''lo''',
										    '''low''',
										    '''er</w>''',
										    '''low</w>''',
										    '''lowest</w>''',
										    '''newer</w>''',
										    '''wider</w>''',
										    ''',</w>''',
										    '''<unk>''',
										]
										snake_case							:  Any			=     dict(zip(SCREAMING_SNAKE_CASE_,     range(len(SCREAMING_SNAKE_CASE_   )   )   )   )
										snake_case							:  Any			=     ['''l o 123''', '''lo w 1456''', '''e r</w> 1789''', '''''']

										snake_case							:  int			=     os.path.join(self.tmpdirname,     VOCAB_FILES_NAMES['''vocab_file''']   )
										snake_case							:  Optional[Any]			=     os.path.join(self.tmpdirname,     VOCAB_FILES_NAMES['''merges_file''']   )
										with open(self.vocab_file,     '''w'''   ) as fp:
																fp.write(json.dumps(SCREAMING_SNAKE_CASE_   )   )
										with open(self.merges_file,     '''w'''   ) as fp:
																fp.write('''\n'''.join(SCREAMING_SNAKE_CASE_   )   )




				def 						__snake_case				(				self						:					str,     SCREAMING_SNAKE_CASE_						:					str   ):
										snake_case							:  List[Any]			=     '''lower newer'''
										snake_case							:  Dict			=     '''lower newer'''
										return input_text, output_text




				def 						__snake_case				(				self						:					Optional[int]   ):
										snake_case							:  str			=     self.tokenizer_class(vocab_file=self.vocab_file,     merges_file=self.merges_file   )

										snake_case							:  List[str]			=     '''lower'''
										snake_case							:  List[Any]			=     ['''low''', '''er</w>''']
										snake_case							:  Dict			=     tokenizer.tokenize(SCREAMING_SNAKE_CASE_   )
										self.assertListEqual(SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_   )

										snake_case							:  List[str]			=     tokens + ['''<unk>''']
										snake_case							:  Optional[int]			=     [16, 17, 23]
										self.assertListEqual(tokenizer.convert_tokens_to_ids(SCREAMING_SNAKE_CASE_   ),     SCREAMING_SNAKE_CASE_   )




				def 						__snake_case				(				self						:					List[str]   ):
										if not self.test_rust_tokenizer:
																return

										snake_case							:  Union[str, Any]			=     self.get_tokenizer()
										snake_case							:  int			=     self.get_rust_tokenizer()

										snake_case							:  Optional[int]			=     '''lower,newer'''

										snake_case							:  List[Any]			=     tokenizer.tokenize(SCREAMING_SNAKE_CASE_   )
										snake_case							:  List[Any]			=     rust_tokenizer.tokenize(SCREAMING_SNAKE_CASE_   )
										self.assertListEqual(SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_   )

										snake_case							:  Dict			=     tokenizer.encode(SCREAMING_SNAKE_CASE_,     add_special_tokens=SCREAMING_SNAKE_CASE_   )
										snake_case							:  List[Any]			=     rust_tokenizer.encode(SCREAMING_SNAKE_CASE_,     add_special_tokens=SCREAMING_SNAKE_CASE_   )
										self.assertListEqual(SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_   )

										snake_case							:  List[Any]			=     self.get_rust_tokenizer()
										snake_case							:  Union[str, Any]			=     tokenizer.encode(SCREAMING_SNAKE_CASE_   )
										snake_case							:  Dict			=     rust_tokenizer.encode(SCREAMING_SNAKE_CASE_   )
										self.assertListEqual(SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_   )




				@slow
				def 						__snake_case				(				self						:					List[str]   ):
										snake_case							:  Optional[Any]			=     self.tokenizer_class.from_pretrained('''allegro/herbert-base-cased'''   )

										snake_case							:  List[str]			=     tokenizer.encode('''konstruowanie sekwencji''',     add_special_tokens=SCREAMING_SNAKE_CASE_   )
										snake_case							:  List[str]			=     tokenizer.encode('''konstruowanie wielu sekwencji''',     add_special_tokens=SCREAMING_SNAKE_CASE_   )

										snake_case							:  List[str]			=     tokenizer.build_inputs_with_special_tokens(SCREAMING_SNAKE_CASE_   )
										snake_case							:  Optional[int]			=     tokenizer.build_inputs_with_special_tokens(SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_   )

										assert encoded_sentence == [0] + text + [2]
										assert encoded_pair == [0] + text + [2] + text_a + [2]



'''simple docstring'''





def   A			(							A_				:       int							):
						return n * (2 * n - 1)

def   A			(							A_				:       int							):
						snake_case							:  Optional[Any]			=     (1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0

def   A			(							A_				:       int = 144							):
						snake_case							:  Any			=     start
						snake_case							:  Any			=     hexagonal_num(A_							)
						while not is_pentagonal(A_							):
												n += 1
												snake_case							:  Optional[Any]			=     hexagonal_num(A_							)
						return num


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

