



"""simple docstring"""





import string
from math import logaa




def 	UpperCAmelCase     (		A	:						str     ,				A	:						str       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		document.translate(
		    str.maketrans(''     ,				''     ,				string.punctuation       )       ).replace('\n'     ,				''       )
		_UpperCAmelCase							 =		document_without_punctuation.split(' '       )  # word tokenization
		return len([word for word in tokenize_document if word.lower() == term.lower()]       )




def 	UpperCAmelCase     (		A	:						str     ,				A	:						str       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		corpus.lower().translate(
		    str.maketrans(''     ,				''     ,				string.punctuation       )       )  # strip all punctuation and replace it with ''
		_UpperCAmelCase							 =		corpus_without_punctuation.split('\n'       )
		_UpperCAmelCase							 =		term.lower()
		return (len([doc for doc in docs if term in doc]       ), len(A       ))




def 	UpperCAmelCase     (		A	:						int     ,				A	:						int     ,				A	:						Union[str, Any]=False       ):

		'''simple docstring'''


		if smoothing:
				if n == 0:
						raise ValueError('log10(0) is undefined.'       )
				return round(1 + logaa(n / (1 + df)       )     ,				3       )

		if df == 0:
				raise ZeroDivisionError('df must be > 0'       )
		elif n == 0:
				raise ValueError('log10(0) is undefined.'       )
		return round(logaa(n / df       )     ,				3       )






def 	UpperCAmelCase     (		A	:						int     ,				A	:						int       ):

		'''simple docstring'''


		return round(tf * idf     ,				3       )







"""simple docstring"""





def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		abs(A       )
		_UpperCAmelCase							 =		0
		while n > 0:
				res += n % 10
				n //= 10
		return res




def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		abs(A       )
		return n if n < 10 else n % 10 + sum_of_digits(n // 10       )




def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		return sum(int(A       ) for c in str(abs(A       )       )       )




def 	UpperCAmelCase     (		):

		'''simple docstring'''


		from collections.abc import Callable
		from timeit import timeit

		def benchmark_a_function(A	:						Callable     ,				A	:						int       ) -> None:
				_UpperCAmelCase							 =		f'{func.__name__}({value})'
				_UpperCAmelCase							 =		timeit(f'__main__.{call}'     ,				setup='import __main__'       )
				print(f'{call:56} = {func(A       )} -- {timing:.4f} seconds'       )

		for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
				for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
						benchmark_a_function(A     ,				A       )
				print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()


