
"""simple docstring"""




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

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


A__ :       int				= {'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

A__ :       str				= {
    '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'
        ),
    },
}

A__ :       List[str]				= {
    'unc-nlp/lxmert-base-uncased': 5_1_2,
}

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


class       __magic_name__							(							SCREAMING_SNAKE_CASE__			):
       UpperCamelCase_ =		VOCAB_FILES_NAMES
       UpperCamelCase_ =		PRETRAINED_VOCAB_FILES_MAP
       UpperCamelCase_ =		PRETRAINED_INIT_CONFIGURATION
       UpperCamelCase_ =		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       UpperCamelCase_ =		LxmertTokenizer
       def __init__(  self			,					A_=None			,					A_=None			,					A_=True			,					A_="[UNK]"			,					A_="[SEP]"			,					A_="[PAD]"			,					A_="[CLS]"			,					A_="[MASK]"			,					A_=True			,					A_=None			,					**A_			,					)  ->						str:





         """simple docstring"""




         super().__init__(
             A_			,					tokenizer_file=A_			,					do_lower_case=A_			,					unk_token=A_			,					sep_token=A_			,					pad_token=A_			,					cls_token=A_			,					mask_token=A_			,					tokenize_chinese_chars=A_			,					strip_accents=A_			,					**A_			,					)

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

         _lowercase:      List[str]   			=  do_lower_case
       def 				lowercase_				(  self			,					A_			,					A_=None							)  ->						int:





         """simple docstring"""




         _lowercase:      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 				lowercase_				(  self			,					A_			,					A_ = None							)  ->						List[int]:





         """simple docstring"""




         _lowercase:      List[Any]   			=  [self.sep_token_id]
         _lowercase:      Any   			=  [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 				lowercase_				(  self			,					A_			,					A_ = None							)  ->						Tuple[str]:





         """simple docstring"""




         _lowercase:      str   			=  self._tokenizer.model.save(A_			,					name=A_							)
         return tuple(A_							)


"""simple docstring"""




import warnings

from ...utils import logging
from .image_processing_segformer import SegformerImageProcessor


A__ :       List[Any]				= logging.get_logger(__name__)


class       __magic_name__							(							SCREAMING_SNAKE_CASE__			):
       def __init__(  self			,					*A_			,					**A_							)  ->						None:





         """simple docstring"""




         warnings.warn(
             '''The class SegformerFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'''
             ''' Please use SegformerImageProcessor instead.'''			,					A_			,					)
         super().__init__(*A_			,					**A_							)
