
import math
from timeit import timeit






def        lowerCamelCase__    (    __lowerCAmelCase  :  int    ):




			"""simple docstring"""


			lowerCAmelCase_      =     0
			lowerCAmelCase_      =     abs(__lowerCAmelCase    )
			while True:
						lowerCAmelCase_      =     n // 10
						digits += 1
						if n == 0:
									break
			return digits






def        lowerCamelCase__    (    __lowerCAmelCase  :  int    ):




			"""simple docstring"""


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






def        lowerCamelCase__    (    __lowerCAmelCase  :  int    ):




			"""simple docstring"""


			return len(str(abs(__lowerCAmelCase    )    )    )






def        lowerCamelCase__    (    ):




			"""simple docstring"""


			from collections.abc import Callable

			def benchmark_a_function(__lowerCAmelCase  :  Callable   ,							__lowerCAmelCase  :  int    ) -> None:
						lowerCAmelCase_      =     F"""{func.__name__}({value})"""
						lowerCAmelCase_      =     timeit(F"""__main__.{call}"""   ,							setup="import __main__"    )
						print(F"""{call}: {func(__lowerCAmelCase    )} -- {timing} seconds"""    )

			for value in (262144, 1125899906842624, 1267650600228229401496703205376):
						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()





from typing import TYPE_CHECKING

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


_A       =					{
    "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"],
}

try:
			if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A       =					["XLMProphetNetTokenizer"]

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A       =					[
			    "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "XLMProphetNetDecoder",
			    "XLMProphetNetEncoder",
			    "XLMProphetNetForCausalLM",
			    "XLMProphetNetForConditionalGeneration",
			    "XLMProphetNetModel",
			    "XLMProphetNetPreTrainedModel",
			]


if TYPE_CHECKING:
			from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

			try:
						if not is_sentencepiece_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_xlm_prophetnet import (
						    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
						    XLMProphetNetDecoder,
						    XLMProphetNetEncoder,
						    XLMProphetNetForCausalLM,
						    XLMProphetNetForConditionalGeneration,
						    XLMProphetNetModel,
						    XLMProphetNetPreTrainedModel,
						)

else:
			import sys

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



