


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_electra import ElectraTokenizer


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

SCREAMING_SNAKE_CASE       :      List[str]												= {
    "vocab_file": {
        "google/electra-small-generator": (
            "https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt"
        ),
        "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt",
        "google/electra-large-generator": (
            "https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt"
        ),
        "google/electra-small-discriminator": (
            "https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt"
        ),
        "google/electra-base-discriminator": (
            "https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt"
        ),
        "google/electra-large-discriminator": (
            "https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt"
        ),
    },
    "tokenizer_file": {
        "google/electra-small-generator": (
            "https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-base-generator": (
            "https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-large-generator": (
            "https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-small-discriminator": (
            "https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json"
        ),
        "google/electra-base-discriminator": (
            "https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json"
        ),
        "google/electra-large-discriminator": (
            "https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json"
        ),
    },
}

SCREAMING_SNAKE_CASE       :      List[str]												= {
    "google/electra-small-generator": 512,
    "google/electra-base-generator": 512,
    "google/electra-large-generator": 512,
    "google/electra-small-discriminator": 512,
    "google/electra-base-discriminator": 512,
    "google/electra-large-discriminator": 512,
}

SCREAMING_SNAKE_CASE       :      Tuple												= {
    "google/electra-small-generator": {"do_lower_case": True},
    "google/electra-base-generator": {"do_lower_case": True},
    "google/electra-large-generator": {"do_lower_case": True},
    "google/electra-small-discriminator": {"do_lower_case": True},
    "google/electra-base-discriminator": {"do_lower_case": True},
    "google/electra-large-discriminator": {"do_lower_case": True},
}






class _lowerCamelCase(						_a   ):
       lowercase_ :	int     =			VOCAB_FILES_NAMES
       lowercase_ :	List[Any]     =			PRETRAINED_VOCAB_FILES_MAP
       lowercase_ :	Any     =			PRETRAINED_INIT_CONFIGURATION
       lowercase_ :	Dict     =			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       lowercase_ :	str     =			ElectraTokenizer
       def __init__(					self,      lowerCamelCase=None,      lowerCamelCase=None,      lowerCamelCase=True,      lowerCamelCase="[UNK]",      lowerCamelCase="[SEP]",      lowerCamelCase="[PAD]",      lowerCamelCase="[CLS]",      lowerCamelCase="[MASK]",      lowerCamelCase=True,      lowerCamelCase=None,      **lowerCamelCase,      )       ->   Union[str, Any]:




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

           _lowercase       :							Union[str, Any]      		=		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
           ):
               _lowercase       :							Dict      		=		getattr(lowerCamelCase,      normalizer_state.pop('type'))
               _lowercase       :							Optional[int]      		=		do_lower_case
               _lowercase       :							Tuple      		=		strip_accents
               _lowercase       :							str      		=		tokenize_chinese_chars
               _lowercase       :							Optional[Any]      		=		normalizer_class(**lowerCamelCase)

           _lowercase       :							Any      		=		do_lower_case
       def 			UpperCamelCase     (					self,      lowerCamelCase,      lowerCamelCase=None)       ->   Optional[Any]:




           """simple docstring"""

           _lowercase       :							List[str]      		=		[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,      lowerCamelCase,      lowerCamelCase = None)       ->   List[int]:




           """simple docstring"""

           _lowercase       :							Dict      		=		[self.sep_token_id]
           _lowercase       :							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,      lowerCamelCase,      lowerCamelCase = None)       ->   Tuple[str]:




           """simple docstring"""

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








def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       int	,							lowercase	:       int     ):


      '''simple docstring'''



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

def 			_SCREAMING_SNAKE_CASE			(							):


      '''simple docstring'''



      assert or_gate(0	,							0     ) == 0
      assert or_gate(0	,							1     ) == 1
      assert or_gate(1	,							0     ) == 1
      assert or_gate(1	,							1     ) == 1


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



