






"""simple docstring"""



import math
from timeit import timeit



def 						lowercase   (    __snake_case    :			Optional[int]     ):
		lowercase_			:			List[Any]								=       0
		lowercase_			:			int								=       abs(_A     )
		while True:
				lowercase_			:			List[str]								=       n // 1_0
				digits += 1
				if n == 0:
						break
		return digits



def 						lowercase   (    __snake_case    :			Tuple     ):
		return 1 if n == 0 else math.floor(math.log(abs(_A     )		, 1_0     ) + 1     )



def 						lowercase   (    __snake_case    :			int     ):
		return len(str(abs(_A     )     )     )



def 						lowercase   (    ):
		from collections.abc import Callable

		def benchmark_a_function(__snake_case    :			str		, __snake_case    :			str     ) -> None:
				lowercase_			:			Optional[int]								=       F'''{func.__name__}({value})'''
				lowercase_			:			Optional[int]								=       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()











"""simple docstring"""



from typing import TYPE_CHECKING

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


__A		:	Any      =		{
    '''configuration_markuplm''': ['''MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MarkupLMConfig'''],
    '''feature_extraction_markuplm''': ['''MarkupLMFeatureExtractor'''],
    '''processing_markuplm''': ['''MarkupLMProcessor'''],
    '''tokenization_markuplm''': ['''MarkupLMTokenizer'''],
}

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:	List[str]      =		['''MarkupLMTokenizerFast''']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:	Optional[int]      =		[
						    '''MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''MarkupLMForQuestionAnswering''',
						    '''MarkupLMForSequenceClassification''',
						    '''MarkupLMForTokenClassification''',
						    '''MarkupLMModel''',
						    '''MarkupLMPreTrainedModel''',
						]


if TYPE_CHECKING:
						from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
						from .feature_extraction_markuplm import MarkupLMFeatureExtractor
						from .processing_markuplm import MarkupLMProcessor
						from .tokenization_markuplm import MarkupLMTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_markuplm_fast import MarkupLMTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_markuplm import (
												    MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MarkupLMForQuestionAnswering,
												    MarkupLMForSequenceClassification,
												    MarkupLMForTokenClassification,
												    MarkupLMModel,
												    MarkupLMPreTrainedModel,
												)


else:
						import sys

						__A		:	Optional[Any]      =		_LazyModule(__name__, globals()['''__file__'''], _import_structure)



