"""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


_SCREAMING_SNAKE_CASE	:		Optional[Any]   =   TypeVar('''DatasetType''', Dataset, IterableDataset)



def       A__    (	lowercase_     :	DatasetType      , lowercase_     :	int      , lowercase_     :	int						)  ->							DatasetType:
   if isinstance(lowercase_      , lowercase_						):
      return _split_by_node_map_style_dataset(lowercase_      , rank=lowercase_      , world_size=lowercase_						)
   else:
      return _split_by_node_iterable_dataset(lowercase_      , rank=lowercase_      , world_size=lowercase_						)







"""simple docstring"""







from ..utils import DummyObject, requires_backends






class      _SCREAMING_SNAKE_CASE							(			metaclass=UpperCAmelCase				):



   '''simple docstring'''



   __UpperCAmelCase	:							Union[str, Any]    =    ["torch", "librosa"]







   def __init__(	self ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(self ,				['torch', 'librosa']	)







   @classmethod
   def    _A				(	cls ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(cls ,				['torch', 'librosa']	)







   @classmethod
   def    _A				(	cls ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(cls ,				['torch', 'librosa']	)






class      _SCREAMING_SNAKE_CASE							(			metaclass=UpperCAmelCase				):



   '''simple docstring'''



   __UpperCAmelCase	:							Dict    =    ["torch", "librosa"]







   def __init__(	self ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(self ,				['torch', 'librosa']	)







   @classmethod
   def    _A				(	cls ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(cls ,				['torch', 'librosa']	)







   @classmethod
   def    _A				(	cls ,				*_SCREAMING_SNAKE_CASE ,				**_SCREAMING_SNAKE_CASE	):


      '''simple docstring'''

      requires_backends(cls ,				['torch', 'librosa']	)






