






'''simple docstring'''

from ..utils import DummyObject, requires_backends





class 							lowercase						(						metaclass=__lowerCamelCase ):
   lowerCamelCase_    					=['transformers', 'torch', 'note_seq']


   def __init__(   self				:	str   ,		*__lowerCAmelCase				:	List[Any]   ,		**__lowerCAmelCase				:	List[Any])      ->					Tuple:
         requires_backends(self   ,		["transformers", "torch", "note_seq"])


   @classmethod
   def __UpperCAmelCase       (   cls				:	Optional[Any]   ,		*__lowerCAmelCase				:	int   ,		**__lowerCAmelCase				:	Optional[Any])      ->					str:
         requires_backends(cls   ,		["transformers", "torch", "note_seq"])


   @classmethod
   def __UpperCAmelCase       (   cls				:	int   ,		*__lowerCAmelCase				:	List[Any]   ,		**__lowerCAmelCase				:	List[Any])      ->					Optional[int]:
         requires_backends(cls   ,		["transformers", "torch", "note_seq"])







'''simple docstring'''

from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream





class 							lowercase						(						__lowerCamelCase ):


   def __init__(   self				:	str   ,		__lowerCAmelCase				:	Callable   ,		__lowerCAmelCase				:	Optional[Features] = None   ,		__lowerCAmelCase				:	str = None   ,		__lowerCAmelCase				:	bool = False   ,		__lowerCAmelCase				:	bool = False   ,		__lowerCAmelCase				:	Optional[dict] = None   ,		__lowerCAmelCase				:	Optional[int] = None   ,		**__lowerCAmelCase				:	Union[str, Any]   ,		)      ->					List[Any]:
         super().__init__(
             features=__lowerCAmelCase   ,		cache_dir=__lowerCAmelCase   ,		keep_in_memory=__lowerCAmelCase   ,		streaming=__lowerCAmelCase   ,		num_proc=__lowerCAmelCase   ,		**__lowerCAmelCase   ,		)
         lowercase_     =      Generator(
             cache_dir=__lowerCAmelCase   ,		features=__lowerCAmelCase   ,		generator=__lowerCAmelCase   ,		gen_kwargs=__lowerCAmelCase   ,		**__lowerCAmelCase   ,		)


   def __UpperCAmelCase       (   self				:	Optional[int])      ->					List[str]:
         # Build iterable dataset
         if self.streaming:
               lowercase_     =      self.builder.as_streaming_dataset(split="train")
         # Build regular (map-style) dataset
         else:
               lowercase_     =      None
               lowercase_     =      None
               lowercase_     =      None
               lowercase_     =      None

               self.builder.download_and_prepare(
                   download_config=__lowerCAmelCase   ,		download_mode=__lowerCAmelCase   ,		verification_mode=__lowerCAmelCase   ,		base_path=__lowerCAmelCase   ,		num_proc=self.num_proc   ,		)
               lowercase_     =      self.builder.as_dataset(
                   split="train"   ,		verification_mode=__lowerCAmelCase   ,		in_memory=self.keep_in_memory)
         return dataset






