



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_lxmert import LxmertTokenizer


A__								=						{'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

A__								=						{
    '''vocab_file''': {
        '''unc-nlp/lxmert-base-uncased''': '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt''',
    },
    '''tokenizer_file''': {
        '''unc-nlp/lxmert-base-uncased''': (
            '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json'''
        ),
    },
}

A__								=						{
    '''unc-nlp/lxmert-base-uncased''': 512,
}

A__								=						{
    '''unc-nlp/lxmert-base-uncased''': {'''do_lower_case''': True},
}


class       a							(			__lowerCamelCase				):
		__lowerCAmelCase	:    List[Any]											=					VOCAB_FILES_NAMES
		__lowerCAmelCase	:    Dict											=					PRETRAINED_VOCAB_FILES_MAP
		__lowerCAmelCase	:    Union[str, Any]											=					PRETRAINED_INIT_CONFIGURATION
		__lowerCAmelCase	:    Dict											=					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		__lowerCAmelCase	:    Optional[Any]											=					LxmertTokenizer



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

						snake_case__	:      Dict     		=	do_lower_case



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






def 			_lowerCAmelCase       (					__lowerCAmelCase  ,  __lowerCAmelCase      )   ->					int:


				"""simple docstring"""

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



def 			_lowerCAmelCase       (					)   ->					None:


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

