
'''simple docstring'''







def 				_snake_case (		lowercase			,    lowercase						)       ->       int:
				__a       :     Tuple								=	0
				for ele in arr:
								total_sum += product_sum(UpperCAmelCase_			,    depth + 1						) if isinstance(UpperCAmelCase_			,    UpperCAmelCase_						) else ele
				return total_sum * depth

def 				_snake_case (		lowercase						)       ->       int:
				return product_sum(UpperCAmelCase_			,    1						)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
"""simple docstring"""







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


_a	:	List[Any]=					TypeVar("DatasetType", Dataset, IterableDataset)
def     __UpperCAmelCase							(       UpperCAmelCase_       :							DatasetType     ,				UpperCAmelCase_       :							int     ,				UpperCAmelCase_       :							int    )				->     DatasetType:

	'''simple docstring'''





	if isinstance(UpperCAmelCase_     ,				UpperCAmelCase_    ):
		return _split_by_node_map_style_dataset(UpperCAmelCase_     ,				rank=UpperCAmelCase_     ,				world_size=UpperCAmelCase_    )
	else:
		return _split_by_node_iterable_dataset(UpperCAmelCase_     ,				rank=UpperCAmelCase_     ,				world_size=UpperCAmelCase_    )





