





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_distilbert import DistilBertTokenizer


__lowerCamelCase			:	Union[str, Any]					    =	logging.get_logger(__name__)

__lowerCamelCase			:	int					    =	{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__lowerCamelCase			:	Union[str, Any]					    =	{
    """vocab_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-german-cased""": """https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt""",
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/tokenizer.json""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/tokenizer.json""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-german-cased""": (
            """https://huggingface.co/distilbert-base-german-cased/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/tokenizer.json"""
        ),
    },
}

__lowerCamelCase			:	List[str]					    =	{
    """distilbert-base-uncased""": 512,
    """distilbert-base-uncased-distilled-squad""": 512,
    """distilbert-base-cased""": 512,
    """distilbert-base-cased-distilled-squad""": 512,
    """distilbert-base-german-cased""": 512,
    """distilbert-base-multilingual-cased""": 512,
}


__lowerCamelCase			:	Union[str, Any]					    =	{
    """distilbert-base-uncased""": {"""do_lower_case""": True},
    """distilbert-base-uncased-distilled-squad""": {"""do_lower_case""": True},
    """distilbert-base-cased""": {"""do_lower_case""": False},
    """distilbert-base-cased-distilled-squad""": {"""do_lower_case""": False},
    """distilbert-base-german-cased""": {"""do_lower_case""": False},
    """distilbert-base-multilingual-cased""": {"""do_lower_case""": False},
}



class    A__  (			__snake_case     ):
      _UpperCAmelCase      :int		       =  VOCAB_FILES_NAMES
      _UpperCAmelCase      :str		       =  PRETRAINED_VOCAB_FILES_MAP
      _UpperCAmelCase      :Any		       =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      _UpperCAmelCase      :int		       =  PRETRAINED_INIT_CONFIGURATION
      _UpperCAmelCase      :Any		       =  ['input_ids', 'attention_mask']
      _UpperCAmelCase      :int		       =  DistilBertTokenizer





      def __init__(					self			,				A_=None			,				A_=None			,				A_=True			,				A_="[UNK]"			,				A_="[SEP]"			,				A_="[PAD]"			,				A_="[CLS]"			,				A_="[MASK]"			,				A_=True			,				A_=None			,				**A_			,				):
       '''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_			,				)

       UpperCamelCase      :   Optional[int]			      =  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
       ):
        UpperCamelCase      :   int			      =  getattr(A_			,				normalizer_state.pop("type"  )  )
        UpperCamelCase      :   Optional[int]			      =  do_lower_case
        UpperCamelCase      :   Union[str, Any]			      =  strip_accents
        UpperCamelCase      :   str			      =  tokenize_chinese_chars
        UpperCamelCase      :   int			      =  normalizer_class(**A_  )

       UpperCamelCase      :   List[Any]			      =  do_lower_case





      def 			__UpperCamelCase(					self			,				A_			,				A_=None  ):
       '''simple docstring'''




       UpperCamelCase      :   List[str]			      =  [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 			__UpperCamelCase(					self			,				A_			,				A_ = None  ):
       '''simple docstring'''




       UpperCamelCase      :   Union[str, Any]			      =  [self.sep_token_id]
       UpperCamelCase      :   str			      =  [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 			__UpperCamelCase(					self			,				A_			,				A_ = None  ):
       '''simple docstring'''




       UpperCamelCase      :   List[Any]			      =  self._tokenizer.model.save(A_			,				name=A_  )
       return tuple(A_  )







from typing import Any



def 						A_							(	_lowerCAmelCase	)		->					list[Any]:
 if not input_list:
  return []
 UpperCamelCase      :   List[str]			      =  [input_list.count(_lowerCAmelCase	) for value in input_list]
 UpperCamelCase      :   Dict			      =  max(_lowerCAmelCase	)  # Gets the maximum count in the input list.
 # Gets values of modes
 return sorted({input_list[i] for i, value in enumerate(_lowerCAmelCase	) if value == y}	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
