





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_squeezebert import SqueezeBertTokenizer


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

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

lowercase				:	List[str]      						=  {
    """vocab_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt"""
        ),
        """squeezebert/squeezebert-mnli""": """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt""",
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """squeezebert/squeezebert-uncased""": (
            """https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/tokenizer.json"""
        ),
        """squeezebert/squeezebert-mnli-headless""": (
            """https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/tokenizer.json"""
        ),
    },
}

lowercase				:	Tuple      						=  {
    """squeezebert/squeezebert-uncased""": 5_1_2,
    """squeezebert/squeezebert-mnli""": 5_1_2,
    """squeezebert/squeezebert-mnli-headless""": 5_1_2,
}


lowercase				:	int      						=  {
    """squeezebert/squeezebert-uncased""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli""": {"""do_lower_case""": True},
    """squeezebert/squeezebert-mnli-headless""": {"""do_lower_case""": True},
}





class 			A__   (							__UpperCAmelCase     ):




   """simple docstring"""



   __A       :    str	  =  VOCAB_FILES_NAMES
   __A       :    Any	  =  PRETRAINED_VOCAB_FILES_MAP
   __A       :    int	  =  PRETRAINED_INIT_CONFIGURATION
   __A       :    List[str]	  =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   __A       :    str	  =  SqueezeBertTokenizer

   def __init__( self ,  lowercase=None ,  lowercase=None ,  lowercase=True ,  lowercase="[UNK]" ,  lowercase="[SEP]" ,  lowercase="[PAD]" ,  lowercase="[CLS]" ,  lowercase="[MASK]" ,  lowercase=True ,  lowercase=None ,  **lowercase ,  )      ->						int:







          '''simple docstring'''

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

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

          a__						:     Optional[Any]			=    do_lower_case

   def 							__lowercase		( self ,  lowercase ,  lowercase=None)      ->						str:







          '''simple docstring'''

          a__						:     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 							__lowercase		( self ,  lowercase ,  lowercase = None)      ->						List[int]:







          '''simple docstring'''

          a__						:     str			=    [self.sep_token_id]
          a__						:     Optional[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 							__lowercase		( self ,  lowercase ,  lowercase = None)      ->						Tuple[str]:







          '''simple docstring'''

          a__						:     Optional[int]			=    self._tokenizer.model.save(lowercase ,  name=lowercase)
          return tuple(lowercase)









def A_     (		A__		,				A__		,				A__    )  ->		float:
       if principal <= 0:
              raise Exception('Principal borrowed must be > 0'    )
       if rate_per_annum < 0:
              raise Exception('Rate of interest must be >= 0'    )
       if years_to_repay <= 0 or not isinstance(A__		,				A__    ):
              raise Exception('Years to repay must be an integer > 0'    )

       # Yearly rate is divided by 12 to get monthly rate
       a__						:     str			=    rate_per_annum / 12

       # Years to repay is multiplied by 12 to get number of payments as payment is monthly
       a__						:     List[Any]			=    years_to_repay * 12

       return (
           principal
           * rate_per_month
           * (1 + rate_per_month) ** number_of_payments
           / ((1 + rate_per_month) ** number_of_payments - 1)
       )


if __name__ == "__main__":
    import doctest

    doctest.testmod()


