
import math
from timeit import timeit


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  int:
    __lowercase						:     Tuple		      =    0
    __lowercase						:     int		      =    abs(__lowerCAmelCase		)
    while True:
        __lowercase						:     str		      =    n // 10
        digits += 1
        if n == 0:
            break
    return digits


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  int:
    return 1 if n == 0 else math.floor(math.log(abs(__lowerCAmelCase		)		,   10		) + 1		)


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  int:
    return len(str(abs(__lowerCAmelCase		)		)		)


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

    def benchmark_a_function(__lowerCAmelCase		,   __lowerCAmelCase		) -> None:
        __lowercase						:     List[str]		      =    F'{func.__name__}({value})'
        __lowercase						:     str		      =    timeit(F'__main__.{call}'		,   setup='''import __main__'''		)
        print(F'{call}: {func(__lowerCAmelCase		)} -- {timing} seconds'		)

    for value in (262_144, 1_125_899_906_842_624, 1_267_650_600_228_229_401_496_703_205_376):
        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()




__lowerCAmelCase   :     List[Any]      =						"\n# Transformers installation\n! pip install transformers datasets\n# To install from source instead of the last release, comment the command above and uncomment the following one.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

__lowerCAmelCase   :     Optional[Any]      =						[{"type": "code", "content": INSTALL_CONTENT}]
__lowerCAmelCase   :     List[str]      =						{
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}


