




import math
from timeit import timeit


def 						lowerCamelCase__   (		_A							):







	'''simple docstring'''





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


def 						lowerCamelCase__   (		_A							):







	'''simple docstring'''





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


def 						lowerCamelCase__   (		_A							):







	'''simple docstring'''





	return len(str(abs(_A							)							)							)


def 						lowerCamelCase__   (		):







	'''simple docstring'''





	from collections.abc import Callable

	def benchmark_a_function(_A					,     _A							) -> None:
		snake_case_		   =					f"{func.__name__}({value})"
		snake_case_		   =					timeit(f"__main__.{call}"					,     setup="import __main__"							)
		print(f"{call}: {func(_A							)} -- {timing} seconds"							)

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


lowercase__    :					List[str]					=						{
    "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"],
}

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

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase__    :					List[Any]					=						[
		    "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

		lowercase__    :					Any					=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
