


def        UpperCamelCase_(				_A   :Union[str, Any]  )->		int:
			UpperCamelCase__					=       abs(SCREAMING_SNAKE_CASE_  )
			UpperCamelCase__					=       0
			while n > 0:
						res += n % 10
						n //= 10
			return res
def        UpperCamelCase_(				_A   :str  )->		int:
			UpperCamelCase__					=       abs(SCREAMING_SNAKE_CASE_  )
			return n if n < 10 else n % 10 + sum_of_digits(n // 10  )
def        UpperCamelCase_(				_A   :Tuple  )->		int:
			return sum(int(SCREAMING_SNAKE_CASE_  ) for c in str(abs(SCREAMING_SNAKE_CASE_  )  )  )
def        UpperCamelCase_(				)->		None:
			from collections.abc import Callable
			from timeit import timeit

			def benchmark_a_function(_A   :Any				,     _A   :Tuple  ) -> None:
						UpperCamelCase__					=       F'''{func.__name__}({value})'''
						UpperCamelCase__					=       timeit(F'''__main__.{call}'''				,     setup="import __main__"  )
						print(F'''{call:56} = {func(SCREAMING_SNAKE_CASE_  )} -- {timing:.4f} seconds'''  )

			for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
						for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
									benchmark_a_function(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  )
						print()


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						benchmark()






import os
import tempfile
import unittest

from transformers.models.marian.convert_marian_tatoeba_to_pytorch import DEFAULT_REPO, TatoebaConverter
from transformers.testing_utils import slow
from transformers.utils import cached_property







@unittest.skipUnless(os.path.exists(UpperCAmelCase      )					,	'Tatoeba directory does not exist.'      )
class        lowerCamelCase__	(							unittest.TestCase      ):






			"""simple docstring"""






			@cached_property
			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__					=       tempfile.mkdtemp()
						return TatoebaConverter(save_dir=snake_case     )




			@slow
			def 				snake_case__				(							self     ):

						'''simple docstring'''


						self.resolver.convert_models(["heb-eng"]     )







			@slow
			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__,      UpperCamelCase__					=       self.resolver.write_model_card("opus-mt-he-en"      ,						dry_run=snake_case     )
						assert mmeta["long_pair"] == "heb-eng"


