"""simple docstring"""



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

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


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

__magic_name__     					=       {
    '''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'''
        ),
    },
}

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

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

class SCREAMING_SNAKE_CASE  (     snake_case__						):







 """simple docstring"""


 a_							:						int	      =VOCAB_FILES_NAMES
 a_							:						List[Any]	      =PRETRAINED_VOCAB_FILES_MAP
 a_							:						Optional[int]	      =PRETRAINED_INIT_CONFIGURATION
 a_							:						List[str]	      =PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 a_							:						Tuple	      =LxmertTokenizer


 def __init__( self		:   Any       , _snake_case		:   List[Any]=None       , _snake_case		:   Optional[int]=None       , _snake_case		:   Any=True       , _snake_case		:   Any="[UNK]"       , _snake_case		:   List[str]="[SEP]"       , _snake_case		:   Union[str, Any]="[PAD]"       , _snake_case		:   Union[str, Any]="[CLS]"       , _snake_case		:   Union[str, Any]="[MASK]"       , _snake_case		:   List[Any]=True       , _snake_case		:   List[str]=None       , **_snake_case		:   Any       , )					->      Union[str, Any]:




    '''simple docstring'''






    super().__init__(
        _UpperCAmelCase       , tokenizer_file=_UpperCAmelCase       , do_lower_case=_UpperCAmelCase       , unk_token=_UpperCAmelCase       , sep_token=_UpperCAmelCase       , pad_token=_UpperCAmelCase       , cls_token=_UpperCAmelCase       , mask_token=_UpperCAmelCase       , tokenize_chinese_chars=_UpperCAmelCase       , strip_accents=_UpperCAmelCase       , **_UpperCAmelCase       , )

    a__  					=		json.loads(self.backend_tokenizer.normalizer.__getstate__()					)
    if (
        normalizer_state.get('lowercase'       , _UpperCAmelCase					) != do_lower_case
        or normalizer_state.get('strip_accents'       , _UpperCAmelCase					) != strip_accents
        or normalizer_state.get('handle_chinese_chars'       , _UpperCAmelCase					) != tokenize_chinese_chars
    ):
       a__  					=		getattr(_UpperCAmelCase       , normalizer_state.pop('type'					)					)
       a__  					=		do_lower_case
       a__  					=		strip_accents
       a__  					=		tokenize_chinese_chars
       a__  					=		normalizer_class(**_UpperCAmelCase					)

    a__  					=		do_lower_case


 def 							_lowerCAmelCase					( self		:   int       , _snake_case		:   Tuple       , _snake_case		:   List[Any]=None					)					->      int:




    '''simple docstring'''






    a__  					=		[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		:   Union[str, Any]       , _snake_case		:   Optional[Any]       , _snake_case		:   Optional[int] = None					)					->      List[int]:




    '''simple docstring'''






    a__  					=		[self.sep_token_id]
    a__  					=		[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		:   Optional[Any]       , _snake_case		:   Optional[Any]       , _snake_case		:   str = None					)					->      Tuple[str]:




    '''simple docstring'''






    a__  					=		self._tokenizer.model.save(_UpperCAmelCase       , name=_UpperCAmelCase					)
    return tuple(_UpperCAmelCase					)







'''simple docstring'''

from timeit import timeit






def 				a  (     UpperCamelCase_    :    int			)       ->	int:
		if number < 0:
				raise ValueError('the value of input must not be negative'			)
		snake_case__	     =0
		while number:
				number &= number - 1
				result += 1
		return result






def 				a  (     UpperCamelCase_    :    int			)       ->	int:
		if number < 0:
				raise ValueError('the value of input must not be negative'			)
		snake_case__	     =0
		while number:
				if number % 2 == 1:
						result += 1
				number >>= 1
		return result






def 				a  (     )       ->	None:

		def do_benchmark(UpperCamelCase_    :    int			) -> None:
				snake_case__	     ='import __main__ as z'
				print(f"""Benchmark when {number = }:"""			)
				print(f"""{get_set_bits_count_using_modulo_operator(UpperCamelCase_			) = }"""			)
				snake_case__	     =timeit('z.get_set_bits_count_using_modulo_operator(25)'      ,					setup=UpperCamelCase_			)
				print(f"""timeit() runs in {timing} seconds"""			)
				print(f"""{get_set_bits_count_using_brian_kernighans_algorithm(UpperCamelCase_			) = }"""			)
				snake_case__	     =timeit(
				    'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'      ,					setup=UpperCamelCase_      ,					)
				print(f"""timeit() runs in {timing} seconds"""			)

		for number in (25, 37, 58, 0):
				do_benchmark(UpperCamelCase_			)
				print()


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			benchmark()




