
"""simple docstring"""



import json
import os
import unittest

from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin

class  lowerCAmelCase__							(		A_					,      unittest.TestCase      ):
     __a         =   CTRLTokenizer
     __a         =   False
     __a         =   False







     def 	lowercase      (				self     :     str     ):
       super().setUp()

       # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
       _snake_case   	=			['''adapt''', '''re@@''', '''a@@''', '''apt''', '''c@@''', '''t''', '''<unk>''']
       _snake_case   	=			dict(zip(_lowercase       , range(len(_lowercase     )     )     )     )
       _snake_case   	=			['''#version: 0.2''', '''a p''', '''ap t</w>''', '''r e''', '''a d''', '''ad apt</w>''', '''''']
       _snake_case   	=			{'''unk_token''': '''<unk>'''}

       _snake_case   	=			os.path.join(self.tmpdirname       , VOCAB_FILES_NAMES['''vocab_file''']     )
       _snake_case   	=			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(_lowercase     ) + '''\n'''     )
       with open(self.merges_file       , '''w'''       , encoding='''utf-8'''     ) as fp:
         fp.write('''\n'''.join(_lowercase     )     )







     def 	lowercase      (				self     :     Dict       , **_lowerCamelCase     :     int     ):
       kwargs.update(self.special_tokens_map     )
       return CTRLTokenizer.from_pretrained(self.tmpdirname       , **_lowercase     )







     def 	lowercase      (				self     :     Dict       , _lowerCamelCase     :     int     ):
       _snake_case   	=			'''adapt react readapt apt'''
       _snake_case   	=			'''adapt react readapt apt'''
       return input_text, output_text







     def 	lowercase      (				self     :     Any     ):
       _snake_case   	=			CTRLTokenizer(self.vocab_file       , self.merges_file       , **self.special_tokens_map     )
       _snake_case   	=			'''adapt react readapt apt'''
       _snake_case   	=			'''adapt re@@ a@@ c@@ t re@@ adapt apt'''.split()
       _snake_case   	=			tokenizer.tokenize(_lowercase     )
       self.assertListEqual(_lowercase       , _lowercase     )

       _snake_case   	=			tokens + [tokenizer.unk_token]

       _snake_case   	=			[0, 1, 2, 4, 5, 1, 0, 3, 6]
       self.assertListEqual(tokenizer.convert_tokens_to_ids(_lowercase     )       , _lowercase     )






def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			)->						int:



    """simple docstring"""






    if exponent == 1:
        return base
    if exponent % 2 == 0:
        UpperCamelCase_			  =						_modexpt(SCREAMING_SNAKE_CASE_			,						exponent // 2			,						SCREAMING_SNAKE_CASE_			) % modulo_value
        return (x * x) % modulo_value
    else:
        return (base * _modexpt(SCREAMING_SNAKE_CASE_			,						exponent - 1			,						SCREAMING_SNAKE_CASE_			)) % modulo_value




def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_ = 1_7_7_7			,						SCREAMING_SNAKE_CASE_ = 1_8_5_5			,						SCREAMING_SNAKE_CASE_ = 8			)->						int:



    """simple docstring"""






    UpperCamelCase_			  =						base
    for _ in range(1			,						SCREAMING_SNAKE_CASE_			):
        UpperCamelCase_			  =						_modexpt(SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			,						1_0**digits			)

    return result


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