




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ....tokenization_utils_fast import PreTrainedTokenizerFast
from ....utils import logging
from .tokenization_retribert import RetriBertTokenizer


UpperCAmelCase    =					logging.get_logger(__name__)

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

UpperCAmelCase    =					{
    """vocab_file""": {
        """yjernite/retribert-base-uncased""": (
            """https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """yjernite/retribert-base-uncased""": (
            """https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/tokenizer.json"""
        ),
    },
}

UpperCAmelCase    =					{
    """yjernite/retribert-base-uncased""": 512,
}


UpperCAmelCase    =					{
    """yjernite/retribert-base-uncased""": {"""do_lower_case""": True},
}







class lowerCAmelCase_		(				__snake_case ):

 '''simple docstring'''

 __snake_case				=						VOCAB_FILES_NAMES
 __snake_case				=						PRETRAINED_VOCAB_FILES_MAP
 __snake_case				=						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 __snake_case				=						PRETRAINED_INIT_CONFIGURATION
 __snake_case				=						RetriBertTokenizer
 __snake_case				=						["input_ids", "attention_mask"]



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

       snake_case_ =   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
       ):
             snake_case_ =   getattr(_lowercase	,   normalizer_state.pop('''type'''      )      )
             snake_case_ =   do_lower_case
             snake_case_ =   strip_accents
             snake_case_ =   tokenize_chinese_chars
             snake_case_ =   normalizer_class(**_lowercase      )

       snake_case_ =   do_lower_case



 def 		UpperCamelCase__  (			self	,   _UpperCAmelCase	,   _UpperCAmelCase=None      ):
       snake_case_ =   [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	,   _UpperCAmelCase	,   _UpperCAmelCase = None      ):
       snake_case_ =   [self.sep_token_id]
       snake_case_ =   [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	,   _UpperCAmelCase	,   _UpperCAmelCase = None      ):
       snake_case_ =   self._tokenizer.model.save(_lowercase	,   name=_lowercase      )
       return tuple(_lowercase      )



def  __lowerCAmelCase					(SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      )->						int:




      """simple docstring"""

      return int((input_a, input_a).count(0      ) == 0      )






def  __lowerCAmelCase					()->						None:




      """simple docstring"""

      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))