





"""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_mobilebert import MobileBertTokenizer


lowerCamelCase__						= logging.get_logger(__name__)

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

lowerCamelCase__						= {
    "vocab_file": {"mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/vocab.txt"},
    "tokenizer_file": {
        "mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/tokenizer.json"
    },
}

lowerCamelCase__						= {"mobilebert-uncased": 512}


lowerCamelCase__						= {}



class   __SCREAMING_SNAKE_CASE     (    _UpperCamelCase ):







  '''simple docstring'''


  SCREAMING_SNAKE_CASE__				:List[str]						  =       VOCAB_FILES_NAMES
  SCREAMING_SNAKE_CASE__				:Optional[Any]						  =       PRETRAINED_VOCAB_FILES_MAP
  SCREAMING_SNAKE_CASE__				:Union[str, Any]						  =       PRETRAINED_INIT_CONFIGURATION
  SCREAMING_SNAKE_CASE__				:Union[str, Any]						  =       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  SCREAMING_SNAKE_CASE__				:Dict						  =       MobileBertTokenizer

  def __init__(		self :							str       , __a :							List[Any]=None       , __a :							str=None       , __a :							Any=True       , __a :							List[str]="[UNK]"       , __a :							Union[str, Any]="[SEP]"       , __a :							Optional[Any]="[PAD]"       , __a :							Tuple="[CLS]"       , __a :							Tuple="[MASK]"       , __a :							Optional[Any]=True       , __a :							Optional[Any]=None       , **__a :							Union[str, Any]       , )		->					List[Any]:
        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   :						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
        ):
              _UpperCamelCase   :						int    =							getattr(__a       , normalizer_state.pop("type"						)						)
              _UpperCamelCase   :						Tuple    =							do_lower_case
              _UpperCamelCase   :						Any    =							strip_accents
              _UpperCamelCase   :						int    =							tokenize_chinese_chars
              _UpperCamelCase   :						Optional[int]    =							normalizer_class(**__a						)

        _UpperCamelCase   :						Optional[Any]    =							do_lower_case

  def  __SCREAMING_SNAKE_CASE					(		self :							Tuple       , __a :							int       , __a :							List[str]=None						)		->					Optional[int]:
        _UpperCamelCase   :						Tuple    =							[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  __SCREAMING_SNAKE_CASE					(		self :							Tuple       , __a :							List[int]       , __a :							Optional[List[int]] = None						)		->					List[int]:
        _UpperCamelCase   :						Dict    =							[self.sep_token_id]
        _UpperCamelCase   :						Union[str, 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  __SCREAMING_SNAKE_CASE					(		self :							Dict       , __a :							str       , __a :							Optional[str] = None						)		->					Tuple[str]:
        _UpperCamelCase   :						Tuple    =							self._tokenizer.model.save(__a       , name=__a						)
        return tuple(__a						)







"""simple docstring"""


import re




def        lowercase__     (       lowercase_      )       ->		bool:




      """simple docstring"""

      _UpperCamelCase   :						List[Any]    =							re.compile(
          r"^(?:0|94|\+94|0{2}94)" r"7(0|1|2|4|5|6|7|8)" r"(-| |)" r"\d{7}$"      )

      return bool(re.search(lowercase_		,lowercase_      )      )


if __name__ == "__main__":
  lowerCamelCase__						= "0094702343221"

  print(is_sri_lankan_phone_number(phone))
