

import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_lxmert import LxmertTokenizer


__lowercase     : Dict       =						{'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

__lowercase     : Dict       =						{
    '''vocab_file''': {
        '''unc-nlp/lxmert-base-uncased''': '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt''',
    },
    '''tokenizer_file''': {
        '''unc-nlp/lxmert-base-uncased''': (
            '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json'''
        ),
    },
}

__lowercase     : List[str]       =						{
    '''unc-nlp/lxmert-base-uncased''': 512,
}

__lowercase     : List[Any]       =						{
    '''unc-nlp/lxmert-base-uncased''': {'''do_lower_case''': True},
}



class 						_A     (				snake_case				):





  '''simple docstring'''



  __lowerCamelCase			:      List[str]					=   VOCAB_FILES_NAMES
  __lowerCamelCase			:      Union[str, Any]					=   PRETRAINED_VOCAB_FILES_MAP
  __lowerCamelCase			:      List[str]					=   PRETRAINED_INIT_CONFIGURATION
  __lowerCamelCase			:      int					=   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  __lowerCamelCase			:      str					=   LxmertTokenizer





  def __init__(  self   ,SCREAMING_SNAKE_CASE_=None   ,SCREAMING_SNAKE_CASE_=None   ,SCREAMING_SNAKE_CASE_=True   ,SCREAMING_SNAKE_CASE_="[UNK]"   ,SCREAMING_SNAKE_CASE_="[SEP]"   ,SCREAMING_SNAKE_CASE_="[PAD]"   ,SCREAMING_SNAKE_CASE_="[CLS]"   ,SCREAMING_SNAKE_CASE_="[MASK]"   ,SCREAMING_SNAKE_CASE_=True   ,SCREAMING_SNAKE_CASE_=None   ,**SCREAMING_SNAKE_CASE_   ,):

      '''simple docstring'''
      super().__init__(
          SCREAMING_SNAKE_CASE_   ,tokenizer_file=SCREAMING_SNAKE_CASE_   ,do_lower_case=SCREAMING_SNAKE_CASE_   ,unk_token=SCREAMING_SNAKE_CASE_   ,sep_token=SCREAMING_SNAKE_CASE_   ,pad_token=SCREAMING_SNAKE_CASE_   ,cls_token=SCREAMING_SNAKE_CASE_   ,mask_token=SCREAMING_SNAKE_CASE_   ,tokenize_chinese_chars=SCREAMING_SNAKE_CASE_   ,strip_accents=SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   ,)

      snake_case							:		List[Any]        =		json.loads(self.backend_tokenizer.normalizer.__getstate__()    )
      if (
          normalizer_state.get("""lowercase"""   ,SCREAMING_SNAKE_CASE_    ) != do_lower_case
          or normalizer_state.get("""strip_accents"""   ,SCREAMING_SNAKE_CASE_    ) != strip_accents
          or normalizer_state.get("""handle_chinese_chars"""   ,SCREAMING_SNAKE_CASE_    ) != tokenize_chinese_chars
      ):
          snake_case							:		Union[str, Any]        =		getattr(SCREAMING_SNAKE_CASE_   ,normalizer_state.pop("""type"""    )    )
          snake_case							:		List[Any]        =		do_lower_case
          snake_case							:		List[Any]        =		strip_accents
          snake_case							:		str        =		tokenize_chinese_chars
          snake_case							:		int        =		normalizer_class(**SCREAMING_SNAKE_CASE_    )

      snake_case							:		List[Any]        =		do_lower_case





  def    snake_case_       (  self   ,SCREAMING_SNAKE_CASE_   ,SCREAMING_SNAKE_CASE_=None    ):

      '''simple docstring'''
      snake_case							:		List[Any]        =		[self.cls_token_id] + token_ids_a + [self.sep_token_id]

      if token_ids_a:
          output += token_ids_a + [self.sep_token_id]

      return output





  def    snake_case_       (  self   ,SCREAMING_SNAKE_CASE_   ,SCREAMING_SNAKE_CASE_ = None    ):

      '''simple docstring'''
      snake_case							:		Optional[Any]        =		[self.sep_token_id]
      snake_case							:		int        =		[self.cls_token_id]
      if token_ids_a is None:
          return len(cls + token_ids_a + sep    ) * [0]
      return len(cls + token_ids_a + sep    ) * [0] + len(token_ids_a + sep    ) * [1]





  def    snake_case_       (  self   ,SCREAMING_SNAKE_CASE_   ,SCREAMING_SNAKE_CASE_ = None    ):

      '''simple docstring'''
      snake_case							:		Dict        =		self._tokenizer.model.save(SCREAMING_SNAKE_CASE_   ,name=SCREAMING_SNAKE_CASE_    )
      return tuple(SCREAMING_SNAKE_CASE_    )




def 		snake_case__	(		lowercase					):
   lowerCAmelCase_:							Union[str, Any]       =	[1]

   lowerCAmelCase_  ,	lowerCAmelCase_  ,	lowerCAmelCase_:							int       =	0, 0, 0
   lowerCAmelCase_:							Union[str, Any]       =	ugly_nums[ia] * 2
   lowerCAmelCase_:							str       =	ugly_nums[ia] * 3
   lowerCAmelCase_:							Dict       =	ugly_nums[ia] * 5

   for _ in range(1							,				lowercase					):
      lowerCAmelCase_:							Any       =	min(lowercase							,				lowercase							,				lowercase					)
      ugly_nums.append(lowercase					)
      if next_num == next_a:
         ia += 1
         lowerCAmelCase_:							str       =	ugly_nums[ia] * 2
      if next_num == next_a:
         ia += 1
         lowerCAmelCase_:							Optional[int]       =	ugly_nums[ia] * 3
      if next_num == next_a:
         ia += 1
         lowerCAmelCase_:							int       =	ugly_nums[ia] * 5
   return ugly_nums[-1]


if __name__ == "__main__":
 from doctest import testmod

 testmod(verbose=True)
 print(f'''{ugly_numbers(2_0_0) = }''')