




'''simple docstring'''



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_bert import BertTokenizer


UpperCamelCase_       =							logging.get_logger(__name__)

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

UpperCamelCase_       =							{
    "vocab_file": {
        "bert-base-uncased": "https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt",
        "bert-large-uncased": "https://huggingface.co/bert-large-uncased/resolve/main/vocab.txt",
        "bert-base-cased": "https://huggingface.co/bert-base-cased/resolve/main/vocab.txt",
        "bert-large-cased": "https://huggingface.co/bert-large-cased/resolve/main/vocab.txt",
        "bert-base-multilingual-uncased": (
            "https://huggingface.co/bert-base-multilingual-uncased/resolve/main/vocab.txt"
        ),
        "bert-base-multilingual-cased": "https://huggingface.co/bert-base-multilingual-cased/resolve/main/vocab.txt",
        "bert-base-chinese": "https://huggingface.co/bert-base-chinese/resolve/main/vocab.txt",
        "bert-base-german-cased": "https://huggingface.co/bert-base-german-cased/resolve/main/vocab.txt",
        "bert-large-uncased-whole-word-masking": (
            "https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/vocab.txt"
        ),
        "bert-large-cased-whole-word-masking": (
            "https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/vocab.txt"
        ),
        "bert-large-uncased-whole-word-masking-finetuned-squad": (
            "https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"
        ),
        "bert-large-cased-whole-word-masking-finetuned-squad": (
            "https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"
        ),
        "bert-base-cased-finetuned-mrpc": (
            "https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/vocab.txt"
        ),
        "bert-base-german-dbmdz-cased": "https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/vocab.txt",
        "bert-base-german-dbmdz-uncased": (
            "https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/vocab.txt"
        ),
        "TurkuNLP/bert-base-finnish-cased-v1": (
            "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/vocab.txt"
        ),
        "TurkuNLP/bert-base-finnish-uncased-v1": (
            "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/vocab.txt"
        ),
        "wietsedv/bert-base-dutch-cased": (
            "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/vocab.txt"
        ),
    },
    "tokenizer_file": {
        "bert-base-uncased": "https://huggingface.co/bert-base-uncased/resolve/main/tokenizer.json",
        "bert-large-uncased": "https://huggingface.co/bert-large-uncased/resolve/main/tokenizer.json",
        "bert-base-cased": "https://huggingface.co/bert-base-cased/resolve/main/tokenizer.json",
        "bert-large-cased": "https://huggingface.co/bert-large-cased/resolve/main/tokenizer.json",
        "bert-base-multilingual-uncased": (
            "https://huggingface.co/bert-base-multilingual-uncased/resolve/main/tokenizer.json"
        ),
        "bert-base-multilingual-cased": (
            "https://huggingface.co/bert-base-multilingual-cased/resolve/main/tokenizer.json"
        ),
        "bert-base-chinese": "https://huggingface.co/bert-base-chinese/resolve/main/tokenizer.json",
        "bert-base-german-cased": "https://huggingface.co/bert-base-german-cased/resolve/main/tokenizer.json",
        "bert-large-uncased-whole-word-masking": (
            "https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/tokenizer.json"
        ),
        "bert-large-cased-whole-word-masking": (
            "https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/tokenizer.json"
        ),
        "bert-large-uncased-whole-word-masking-finetuned-squad": (
            "https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"
        ),
        "bert-large-cased-whole-word-masking-finetuned-squad": (
            "https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"
        ),
        "bert-base-cased-finetuned-mrpc": (
            "https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/tokenizer.json"
        ),
        "bert-base-german-dbmdz-cased": (
            "https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/tokenizer.json"
        ),
        "bert-base-german-dbmdz-uncased": (
            "https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/tokenizer.json"
        ),
        "TurkuNLP/bert-base-finnish-cased-v1": (
            "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/tokenizer.json"
        ),
        "TurkuNLP/bert-base-finnish-uncased-v1": (
            "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/tokenizer.json"
        ),
        "wietsedv/bert-base-dutch-cased": (
            "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/tokenizer.json"
        ),
    },
}

UpperCamelCase_       =							{
    "bert-base-uncased": 5_1_2,
    "bert-large-uncased": 5_1_2,
    "bert-base-cased": 5_1_2,
    "bert-large-cased": 5_1_2,
    "bert-base-multilingual-uncased": 5_1_2,
    "bert-base-multilingual-cased": 5_1_2,
    "bert-base-chinese": 5_1_2,
    "bert-base-german-cased": 5_1_2,
    "bert-large-uncased-whole-word-masking": 5_1_2,
    "bert-large-cased-whole-word-masking": 5_1_2,
    "bert-large-uncased-whole-word-masking-finetuned-squad": 5_1_2,
    "bert-large-cased-whole-word-masking-finetuned-squad": 5_1_2,
    "bert-base-cased-finetuned-mrpc": 5_1_2,
    "bert-base-german-dbmdz-cased": 5_1_2,
    "bert-base-german-dbmdz-uncased": 5_1_2,
    "TurkuNLP/bert-base-finnish-cased-v1": 5_1_2,
    "TurkuNLP/bert-base-finnish-uncased-v1": 5_1_2,
    "wietsedv/bert-base-dutch-cased": 5_1_2,
}

UpperCamelCase_       =							{
    "bert-base-uncased": {"do_lower_case": True},
    "bert-large-uncased": {"do_lower_case": True},
    "bert-base-cased": {"do_lower_case": False},
    "bert-large-cased": {"do_lower_case": False},
    "bert-base-multilingual-uncased": {"do_lower_case": True},
    "bert-base-multilingual-cased": {"do_lower_case": False},
    "bert-base-chinese": {"do_lower_case": False},
    "bert-base-german-cased": {"do_lower_case": False},
    "bert-large-uncased-whole-word-masking": {"do_lower_case": True},
    "bert-large-cased-whole-word-masking": {"do_lower_case": False},
    "bert-large-uncased-whole-word-masking-finetuned-squad": {"do_lower_case": True},
    "bert-large-cased-whole-word-masking-finetuned-squad": {"do_lower_case": False},
    "bert-base-cased-finetuned-mrpc": {"do_lower_case": False},
    "bert-base-german-dbmdz-cased": {"do_lower_case": False},
    "bert-base-german-dbmdz-uncased": {"do_lower_case": True},
    "TurkuNLP/bert-base-finnish-cased-v1": {"do_lower_case": False},
    "TurkuNLP/bert-base-finnish-uncased-v1": {"do_lower_case": True},
    "wietsedv/bert-base-dutch-cased": {"do_lower_case": False},
}






class 				_a							(       SCREAMING_SNAKE_CASE__      ):





       '''simple docstring'''






       A		:							Union[str, Any]								=		VOCAB_FILES_NAMES
       A		:							int								=		PRETRAINED_VOCAB_FILES_MAP
       A		:							Union[str, Any]								=		PRETRAINED_INIT_CONFIGURATION
       A		:							int								=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       A		:							List[str]								=		BertTokenizer







       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__(
                 __lowerCamelCase,				tokenizer_file=__lowerCamelCase,				do_lower_case=__lowerCamelCase,				unk_token=__lowerCamelCase,				sep_token=__lowerCamelCase,				pad_token=__lowerCamelCase,				cls_token=__lowerCamelCase,				mask_token=__lowerCamelCase,				tokenize_chinese_chars=__lowerCamelCase,				strip_accents=__lowerCamelCase,				**__lowerCamelCase,				)

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

             SCREAMING_SNAKE_CASE					:	Dict   =		do_lower_case







       def     UpperCamelCase_				(	self,				A,				A=None   ):







             '''simple docstring'''







             SCREAMING_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     UpperCamelCase_				(	self,				A,				A = None   ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE					:	int   =		[self.sep_token_id]
             SCREAMING_SNAKE_CASE					:	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'''







             SCREAMING_SNAKE_CASE					:	Dict   =		self._tokenizer.model.save(__lowerCamelCase,				name=__lowerCamelCase   )
             return tuple(__lowerCamelCase   )









"""simple docstring"""



def 		__lowercase     (   snake_case_  :  int						)   ->int:



    '''simple docstring'''







    assert (
        isinstance(snake_case_				,snake_case_						) and number_of_steps > 0
    ), F"""number_of_steps needs to be positive integer, your input {number_of_steps}"""
    if number_of_steps == 1:
        return 1
    __A ,       __A    :						List[Any]						 =     1, 1
    for _ in range(number_of_steps - 1						):
        __A ,       __A    :						List[str]						 =     current + previous, current
    return current


if __name__ == "__main__":
       import doctest

       doctest.testmod()




