

"""simple docstring"""
import math
from timeit import timeit







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







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







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







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







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







       return len(str(abs(lowerCamelCase   )   )   )







def       UpperCamelCase_					(     )						->     None:



       """simple docstring"""







       from collections.abc import Callable

       def benchmark_a_function(lowerCamelCase							:					Callable     , lowerCamelCase							:					int   ) -> None:
              __magic_name__			:		List[str]        =     f"""{func.__name__}({value})"""
              __magic_name__			:		int        =     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()



"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


A									=						{
    """configuration_imagegpt""": ["""IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ImageGPTConfig""", """ImageGPTOnnxConfig"""]
}

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 A									=						["""ImageGPTFeatureExtractor"""]
 A									=						["""ImageGPTImageProcessor"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 A									=						[
     """IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """ImageGPTForCausalImageModeling""",
     """ImageGPTForImageClassification""",
     """ImageGPTModel""",
     """ImageGPTPreTrainedModel""",
     """load_tf_weights_in_imagegpt""",
 ]


if TYPE_CHECKING:
 from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .feature_extraction_imagegpt import ImageGPTFeatureExtractor
  from .image_processing_imagegpt import ImageGPTImageProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_imagegpt import (
      IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST,
      ImageGPTForCausalImageModeling,
      ImageGPTForImageClassification,
      ImageGPTModel,
      ImageGPTPreTrainedModel,
      load_tf_weights_in_imagegpt,
  )

else:
 import sys

 A									=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
