
'''simple docstring'''







import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
					import torch
class  SCREAMING_SNAKE_CASE__       (  unittest.TestCase			,					__UpperCamelCase   ):
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Optional[int]								=	load_tool("""speech-to-text"""			)
					self.tool.setup()
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     List[str]								=	self.tool(torch.ones(3000			)			)
					self.assertEqual(_A  ,    """ you"""			)

	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Tuple								=	self.tool(audio=torch.ones(3000			)			)
					self.assertEqual(_A  ,    """ you"""			)
"""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_    )





