

import math
from timeit import timeit





def 	snake_case_      (__A     :						int     )			->	int:
   __lowerCAmelCase  :			Union[str, Any]					    =						0
   __lowerCAmelCase  :			Optional[Any]					    =						abs(__A     )
   while True:
      __lowerCAmelCase  :			str					    =						n // 1_0
      digits += 1
      if n == 0:
         break
   return digits





def 	snake_case_      (__A     :						int     )			->	int:
   return 1 if n == 0 else math.floor(math.log(abs(__A     )					,   1_0     ) + 1     )





def 	snake_case_      (__A     :						int     )			->	int:
   return len(str(abs(__A     )     )     )





def 	snake_case_      ()			->	None:
   from collections.abc import Callable

   def benchmark_a_function(__A     :						Callable					,   __A     :						int     ) -> None:
      __lowerCAmelCase  :			Optional[int]					    =						f'''{func.__name__}({value})'''
      __lowerCAmelCase  :			Dict					    =						timeit(f'''__main__.{call}'''					,   setup="""import __main__"""     )
      print(f'''{call}: {func(__A     )} -- {timing} seconds'''     )

   for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
      for func in (num_digits, num_digits_fast, num_digits_faster):
         benchmark_a_function(__A					,   __A     )
      print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()









from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_snake_case				= {"""configuration_regnet""": ["""REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """RegNetConfig"""]}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """REGNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """RegNetForImageClassification""",
      """RegNetModel""",
      """RegNetPreTrainedModel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """TFRegNetForImageClassification""",
      """TFRegNetModel""",
      """TFRegNetPreTrainedModel""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """FlaxRegNetForImageClassification""",
      """FlaxRegNetModel""",
      """FlaxRegNetPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_regnet import (
        REGNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        RegNetForImageClassification,
        RegNetModel,
        RegNetPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_regnet import (
        TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFRegNetForImageClassification,
        TFRegNetModel,
        TFRegNetPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_regnet import (
        FlaxRegNetForImageClassification,
        FlaxRegNetModel,
        FlaxRegNetPreTrainedModel,
    )


else:
  import sys

  _snake_case				= _LazyModule(__name__, globals()["""__file__"""], _import_structure)






