
import math
from timeit import timeit




def 		A						(  SCREAMING_SNAKE_CASE							):




			"""simple docstring"""


			UpperCAmelCase__		:Optional[Any] 		=    0
			UpperCAmelCase__		:int 		=    abs(UpperCamelCase__							)
			while True:
						UpperCAmelCase__		:Any 		=    n // 10
						digits += 1
						if n == 0:
									break
			return digits




def 		A						(  SCREAMING_SNAKE_CASE							):




			"""simple docstring"""


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




def 		A						(  SCREAMING_SNAKE_CASE							):




			"""simple docstring"""


			return len(str(abs(UpperCamelCase__							)							)							)




def 		A						(  ):




			"""simple docstring"""


			from collections.abc import Callable

			def benchmark_a_function(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE							) -> None:
						UpperCAmelCase__		:Dict 		=    f"""{func.__name__}({value})"""
						UpperCAmelCase__		:List[Any] 		=    timeit(f"""__main__.{call}"""     ,						setup='import __main__'							)
						print(f"""{call}: {func(UpperCamelCase__							)} -- {timing} seconds"""							)

			for value in (262144, 1125899906842624, 1267650600228229401496703205376):
						for func in (num_digits, num_digits_fast, num_digits_faster):
									benchmark_a_function(UpperCamelCase__     ,						UpperCamelCase__							)
						print()


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						benchmark()












import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
					import torch
class       UpperCamelCase_		(	unittest.TestCase				,	_lowerCamelCase       ):




					def 						lowerCAmelCase      (		self	)		->				str:
										_snake_case						=					load_tool('speech-to-text'	)
										self.tool.setup()




					def 						lowerCAmelCase      (		self	)		->				Optional[Any]:
										_snake_case						=					self.tool(torch.ones(3000	)	)
										self.assertEqual(lowerCAmelCase_					,    ' you'	)






					def 						lowerCAmelCase      (		self	)		->				Optional[int]:
										_snake_case						=					self.tool(audio=torch.ones(3000	)	)
										self.assertEqual(lowerCAmelCase_					,    ' you'	)



