




'''simple docstring'''






from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase	:      List[Any]				=       logging.get_logger(__name__)

lowercase	:      Union[str, Any]				=       {
    '''bert-base-uncased''': '''https://huggingface.co/bert-base-uncased/resolve/main/config.json''',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}

class   SCREAMING_SNAKE_CASE_		(       lowerCamelCase_				):
 __snake_case	:     Dict			   =      "qdqbert"



 def __init__(  self   ,		A=30522   ,		A=768   ,		A=12   ,		A=12   ,		A=3072   ,		A="gelu"   ,		A=0.1   ,		A=0.1   ,		A=512   ,		A=2   ,		A=0.0_2   ,		A=1E-12   ,		A=True   ,		A=1   ,		A=0   ,		A=2   ,		**A   ,		):






        '''simple docstring'''




        super().__init__(pad_token_id=A   ,		bos_token_id=A   ,		eos_token_id=A   ,		**A )

        lowercase  :		List[Any]						=      vocab_size
        lowercase  :		Dict						=      max_position_embeddings
        lowercase  :		Optional[int]						=      hidden_size
        lowercase  :		List[str]						=      num_hidden_layers
        lowercase  :		Optional[Any]						=      num_attention_heads
        lowercase  :		Any						=      intermediate_size
        lowercase  :		Union[str, Any]						=      hidden_act
        lowercase  :		int						=      hidden_dropout_prob
        lowercase  :		List[Any]						=      attention_probs_dropout_prob
        lowercase  :		List[str]						=      initializer_range
        lowercase  :		Tuple						=      type_vocab_size
        lowercase  :		Dict						=      layer_norm_eps
        lowercase  :		List[str]						=      use_cache










'''simple docstring'''






import math
from timeit import timeit




def 		a_( lowerCamelCase      )				->int:






       '''simple docstring'''




       lowercase  :		Dict						=      0
       lowercase  :		Union[str, Any]						=      abs(lowerCamelCase      )
       while True:
              lowercase  :		List[Any]						=      n // 10
              digits += 1
              if n == 0:
                     break
       return digits




def 		a_( lowerCamelCase      )				->int:






       '''simple docstring'''




       return 1 if n == 0 else math.floor(math.log(abs(lowerCamelCase      )   ,				10      ) + 1      )




def 		a_( lowerCamelCase      )				->int:






       '''simple docstring'''




       return len(str(abs(lowerCamelCase      )      )      )




def 		a_( )				->None:






       '''simple docstring'''




       from collections.abc import Callable

       def benchmark_a_function(lowerCamelCase   ,				lowerCamelCase      ) -> None:
              lowercase  :		str						=      f"""{func.__name__}({value})"""
              lowercase  :		Optional[Any]						=      timeit(f"""__main__.{call}"""   ,				setup='''import __main__'''      )
              print(f"""{call}: {func(lowerCamelCase      )} -- {timing} seconds"""      )

       for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
              for func in (num_digits, num_digits_fast, num_digits_faster):
                     benchmark_a_function(lowerCamelCase   ,				lowerCamelCase      )
              print()


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()




