



from typing import TypeVar

from .arrow_dataset import Dataset, _split_by_node_map_style_dataset
from .iterable_dataset import IterableDataset, _split_by_node_iterable_dataset


UpperCAmelCase												=   TypeVar("""DatasetType""", Dataset, IterableDataset)

def      A_ (		__a       :			str	,						__a       :			Optional[Any]	,						__a       :			Any						):

				"""simple docstring"""
				if isinstance(__a	,						__a						):
								return _split_by_node_map_style_dataset(__a	,						rank=__a	,						world_size=__a						)
				else:
								return _split_by_node_iterable_dataset(__a	,						rank=__a	,						world_size=__a						)






def      A_ (		__a       :			int						):

				"""simple docstring"""
				if number != int(__a						):
								raise ValueError("""factorial() only accepts integral values"""						)
				if number < 0:
								raise ValueError("""factorial() not defined for negative values"""						)
				a__			 =						1
				for i in range(1	,						number + 1						):
								value *= i
				return value

def      A_ (		__a       :			int						):

				"""simple docstring"""
				if not isinstance(__a	,						__a						):
								raise ValueError("""factorial() only accepts integral values"""						)
				if n < 0:
								raise ValueError("""factorial() not defined for negative values"""						)
				return 1 if n == 0 or n == 1 else n * factorial(n - 1						)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	UpperCAmelCase								=   int(input("""Enter a positive integer: """).strip() or 0)
	print(f"""factorial{n} is {factorial(n)}""")

