





"""simple docstring"""
import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
  from .tokenization_albert import AlbertTokenizer
else:
  lowerCamelCase_       =		None

lowerCamelCase_       =		logging.get_logger(__name__)
lowerCamelCase_       =		{"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"}

lowerCamelCase_       =		{
    "vocab_file": {
        "albert-base-v1": "https://huggingface.co/albert-base-v1/resolve/main/spiece.model",
        "albert-large-v1": "https://huggingface.co/albert-large-v1/resolve/main/spiece.model",
        "albert-xlarge-v1": "https://huggingface.co/albert-xlarge-v1/resolve/main/spiece.model",
        "albert-xxlarge-v1": "https://huggingface.co/albert-xxlarge-v1/resolve/main/spiece.model",
        "albert-base-v2": "https://huggingface.co/albert-base-v2/resolve/main/spiece.model",
        "albert-large-v2": "https://huggingface.co/albert-large-v2/resolve/main/spiece.model",
        "albert-xlarge-v2": "https://huggingface.co/albert-xlarge-v2/resolve/main/spiece.model",
        "albert-xxlarge-v2": "https://huggingface.co/albert-xxlarge-v2/resolve/main/spiece.model",
    },
    "tokenizer_file": {
        "albert-base-v1": "https://huggingface.co/albert-base-v1/resolve/main/tokenizer.json",
        "albert-large-v1": "https://huggingface.co/albert-large-v1/resolve/main/tokenizer.json",
        "albert-xlarge-v1": "https://huggingface.co/albert-xlarge-v1/resolve/main/tokenizer.json",
        "albert-xxlarge-v1": "https://huggingface.co/albert-xxlarge-v1/resolve/main/tokenizer.json",
        "albert-base-v2": "https://huggingface.co/albert-base-v2/resolve/main/tokenizer.json",
        "albert-large-v2": "https://huggingface.co/albert-large-v2/resolve/main/tokenizer.json",
        "albert-xlarge-v2": "https://huggingface.co/albert-xlarge-v2/resolve/main/tokenizer.json",
        "albert-xxlarge-v2": "https://huggingface.co/albert-xxlarge-v2/resolve/main/tokenizer.json",
    },
}

lowerCamelCase_       =		{
    "albert-base-v1": 5_1_2,
    "albert-large-v1": 5_1_2,
    "albert-xlarge-v1": 5_1_2,
    "albert-xxlarge-v1": 5_1_2,
    "albert-base-v2": 5_1_2,
    "albert-large-v2": 5_1_2,
    "albert-xlarge-v2": 5_1_2,
    "albert-xxlarge-v2": 5_1_2,
}

lowerCamelCase_       =		"▁"






class  _SCREAMING_SNAKE_CASE(       A  ):
       SCREAMING_SNAKE_CASE_       :				Dict     						=  VOCAB_FILES_NAMES
       SCREAMING_SNAKE_CASE_       :				List[str]     						=  PRETRAINED_VOCAB_FILES_MAP
       SCREAMING_SNAKE_CASE_       :				List[str]     						=  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       SCREAMING_SNAKE_CASE_       :				Any     						=  AlbertTokenizer




       def __init__(						self		,SCREAMING_SNAKE_CASE__=None		,SCREAMING_SNAKE_CASE__=None		,SCREAMING_SNAKE_CASE__=True		,SCREAMING_SNAKE_CASE__=True		,SCREAMING_SNAKE_CASE__=False		,SCREAMING_SNAKE_CASE__="[CLS]"		,SCREAMING_SNAKE_CASE__="[SEP]"		,SCREAMING_SNAKE_CASE__="<unk>"		,SCREAMING_SNAKE_CASE__="[SEP]"		,SCREAMING_SNAKE_CASE__="<pad>"		,SCREAMING_SNAKE_CASE__="[CLS]"		,SCREAMING_SNAKE_CASE__="[MASK]"		,**SCREAMING_SNAKE_CASE__		,)      ->				Tuple:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :List[str]		    =  (
                 AddedToken(SCREAMING_SNAKE_CASE__		,lstrip=SCREAMING_SNAKE_CASE__		,rstrip=SCREAMING_SNAKE_CASE__		,normalized=SCREAMING_SNAKE_CASE__							)
                 if isinstance(SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__							)
                 else mask_token
             )

             super().__init__(
                 SCREAMING_SNAKE_CASE__		,tokenizer_file=SCREAMING_SNAKE_CASE__		,do_lower_case=SCREAMING_SNAKE_CASE__		,remove_space=SCREAMING_SNAKE_CASE__		,keep_accents=SCREAMING_SNAKE_CASE__		,bos_token=SCREAMING_SNAKE_CASE__		,eos_token=SCREAMING_SNAKE_CASE__		,unk_token=SCREAMING_SNAKE_CASE__		,sep_token=SCREAMING_SNAKE_CASE__		,pad_token=SCREAMING_SNAKE_CASE__		,cls_token=SCREAMING_SNAKE_CASE__		,mask_token=SCREAMING_SNAKE_CASE__		,**SCREAMING_SNAKE_CASE__		,)

             __SCREAMING_SNAKE_CASE       :str		    =  do_lower_case
             __SCREAMING_SNAKE_CASE       :int		    =  remove_space
             __SCREAMING_SNAKE_CASE       :Dict		    =  keep_accents
             __SCREAMING_SNAKE_CASE       :int		    =  vocab_file
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  False if not self.vocab_file else True




       def    _UpperCamelCase					(						self		,SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__ = None							)      ->				List[int]:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :Any		    =  [self.sep_token_id]
             __SCREAMING_SNAKE_CASE       :Optional[int]		    =  [self.cls_token_id]
             if token_ids_a is None:
                   return cls + token_ids_a + sep
             return cls + token_ids_a + sep + token_ids_a + sep




       def    _UpperCamelCase					(						self		,SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__ = None							)      ->				List[int]:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :Tuple		    =  [self.sep_token_id]
             __SCREAMING_SNAKE_CASE       :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    _UpperCamelCase					(						self		,SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__ = None							)      ->				Tuple[str]:





             """simple docstring"""






             if not self.can_save_slow_tokenizer:
                   raise ValueError(
                       '''Your fast tokenizer does not have the necessary information to save the vocabulary for a slow '''
                       '''tokenizer.'''							)

             if not os.path.isdir(SCREAMING_SNAKE_CASE__							):
                   logger.error(f'''Vocabulary path ({save_directory}) should be a directory'''							)
                   return
             __SCREAMING_SNAKE_CASE       :Any		    =  os.path.join(
                 SCREAMING_SNAKE_CASE__		,(filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']							)

             if os.path.abspath(self.vocab_file							) != os.path.abspath(SCREAMING_SNAKE_CASE__							):
                   copyfile(self.vocab_file		,SCREAMING_SNAKE_CASE__							)

             return (out_vocab_file,)






"""simple docstring"""
def 					__lowerCamelCase       (							a_					:		int			,       a_					:		int							)      ->				int:
      return int((input_a, input_a).count(0							) == 0							)



def 					__lowerCamelCase       (							)      ->				None:
      assert and_gate(0			,       0							) == 0
      assert and_gate(0			,       1							) == 0
      assert and_gate(1			,       0							) == 0
      assert and_gate(1			,       1							) == 1


if __name__ == "__main__":
  test_and_gate()
  print(and_gate(1, 0))
  print(and_gate(0, 0))
  print(and_gate(0, 1))
  print(and_gate(1, 1))