import os
import unittest

from transformers import LxmertTokenizer, LxmertTokenizerFast
from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin







@require_tokenizers
class __snake_case       (		lowerCamelCase_     ,	unittest.TestCase	):
   lowerCAmelCase_														=							LxmertTokenizer
   lowerCAmelCase_														=							LxmertTokenizerFast
   lowerCAmelCase_														=							True
   lowerCAmelCase_														=							True




   def 			__a		(					self    :       Tuple   ):



     """simple docstring"""






     super().setUp()

     SCREAMING_SNAKE_CASE__    							=   [
         """[UNK]""",
         """[CLS]""",
         """[SEP]""",
         """want""",
         """##want""",
         """##ed""",
         """wa""",
         """un""",
         """runn""",
         """##ing""",
         """,""",
         """low""",
         """lowest""",
     ]
     SCREAMING_SNAKE_CASE__    							=   os.path.join(self.tmpdirname ,			VOCAB_FILES_NAMES["""vocab_file"""]   )
     with open(self.vocab_file ,			"""w""" ,			encoding="""utf-8"""   ) as vocab_writer:
       vocab_writer.write("""""".join([x + """\n""" for x in vocab_tokens]   )   )




   def 			__a		(					self    :       Optional[int] ,			_lowercase    :       str   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   """UNwant\u00E9d,running"""
     SCREAMING_SNAKE_CASE__    							=   """unwanted, running"""
     return input_text, output_text




   def 			__a		(					self    :       List[str]   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   self.tokenizer_class(self.vocab_file   )

     SCREAMING_SNAKE_CASE__    							=   tokenizer.tokenize("""UNwant\u00E9d,running"""   )
     self.assertListEqual(_lowercase ,			["""un""", """##want""", """##ed""", """,""", """runn""", """##ing"""]   )
     self.assertListEqual(tokenizer.convert_tokens_to_ids(_lowercase   ) ,			[7, 4, 5, 10, 8, 9]   )




   def 			__a		(					self    :       Dict   ):



     """simple docstring"""






     if not self.test_rust_tokenizer:
       return

     SCREAMING_SNAKE_CASE__    							=   self.get_tokenizer()
     SCREAMING_SNAKE_CASE__    							=   self.get_rust_tokenizer()

     SCREAMING_SNAKE_CASE__    							=   """I was born in 92000, and this is falsé."""

     SCREAMING_SNAKE_CASE__    							=   tokenizer.tokenize(_lowercase   )
     SCREAMING_SNAKE_CASE__    							=   rust_tokenizer.tokenize(_lowercase   )
     self.assertListEqual(_lowercase ,			_lowercase   )

     SCREAMING_SNAKE_CASE__    							=   tokenizer.encode(_lowercase ,			add_special_tokens=_lowercase   )
     SCREAMING_SNAKE_CASE__    							=   rust_tokenizer.encode(_lowercase ,			add_special_tokens=_lowercase   )
     self.assertListEqual(_lowercase ,			_lowercase   )

     SCREAMING_SNAKE_CASE__    							=   self.get_rust_tokenizer()
     SCREAMING_SNAKE_CASE__    							=   tokenizer.encode(_lowercase   )
     SCREAMING_SNAKE_CASE__    							=   rust_tokenizer.encode(_lowercase   )
     self.assertListEqual(_lowercase ,			_lowercase   )

import enum
import shutil
import sys


__lowerCamelCase     ,		__lowerCamelCase    :				Optional[Any]							     =	shutil.get_terminal_size()

__lowerCamelCase    :				Any							     =	{'''UP''': '''A''', '''DOWN''': '''B''', '''RIGHT''': '''C''', '''LEFT''': '''D'''}







class __snake_case       (		enum.Enum	):
   lowerCAmelCase_														=							0
   lowerCAmelCase_														=							1





def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: Optional[int]				,  __UpperCamelCase					: List[str]=""			)							->      int:







  """simple docstring"""





  sys.stdout.write(str(__UpperCamelCase			) + end			)
  sys.stdout.flush()



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: Optional[int]				,  __UpperCamelCase					: List[str]				,  __UpperCamelCase					: Optional[Any]=""			)							->      Dict:







  """simple docstring"""





  forceWrite(f"""\u001b[{color}m{content}\u001b[0m"""				,  __UpperCamelCase			)



def 			__SCREAMING_SNAKE_CASE						(      )							->      Optional[Any]:







  """simple docstring"""





  forceWrite("""\r"""			)



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int				,  __UpperCamelCase					: str			)							->      str:







  """simple docstring"""





  forceWrite(f"""\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}"""			)



def 			__SCREAMING_SNAKE_CASE						(      )							->      Dict:







  """simple docstring"""





  forceWrite(""" """ * TERMINAL_WIDTH			)
  reset_cursor()






def 			__SCREAMING_SNAKE_CASE						(      )							->      int:







  """simple docstring"""





  reset_cursor()
  forceWrite("""-""" * TERMINAL_WIDTH			)
