





'''simple docstring'''






from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class 					__snake_case  (					__SCREAMING_SNAKE_CASE							):






   '''simple docstring'''





   def __init__(							self	,		__SCREAMING_SNAKE_CASE	,		__SCREAMING_SNAKE_CASE = None	,		__SCREAMING_SNAKE_CASE = None	,		__SCREAMING_SNAKE_CASE = False	,		__SCREAMING_SNAKE_CASE = False	,		__SCREAMING_SNAKE_CASE = None	,		__SCREAMING_SNAKE_CASE = None	,		**__SCREAMING_SNAKE_CASE	,		):
    super().__init__(
        features=__SCREAMING_SNAKE_CASE	,		cache_dir=__SCREAMING_SNAKE_CASE	,		keep_in_memory=__SCREAMING_SNAKE_CASE	,		streaming=__SCREAMING_SNAKE_CASE	,		num_proc=__SCREAMING_SNAKE_CASE	,		**__SCREAMING_SNAKE_CASE	,		)
    snake_case__     :					Tuple    =  Generator(
        cache_dir=__SCREAMING_SNAKE_CASE	,		features=__SCREAMING_SNAKE_CASE	,		generator=__SCREAMING_SNAKE_CASE	,		gen_kwargs=__SCREAMING_SNAKE_CASE	,		**__SCREAMING_SNAKE_CASE	,		)


   def 		__UpperCamelCase						(							self       ):
    # Build iterable dataset
    if self.streaming:
     snake_case__     :					Dict    =  self.builder.as_streaming_dataset(split="""train"""       )
    # Build regular (map-style) dataset
    else:
     snake_case__     :					Optional[Any]    =  None
     snake_case__     :					List[Any]    =  None
     snake_case__     :					Dict    =  None
     snake_case__     :					int    =  None

     self.builder.download_and_prepare(
         download_config=__SCREAMING_SNAKE_CASE	,		download_mode=__SCREAMING_SNAKE_CASE	,		verification_mode=__SCREAMING_SNAKE_CASE	,		base_path=__SCREAMING_SNAKE_CASE	,		num_proc=self.num_proc	,		)
     snake_case__     :					Optional[int]    =  self.builder.as_dataset(
         split="""train"""	,		verification_mode=__SCREAMING_SNAKE_CASE	,		in_memory=self.keep_in_memory       )
    return dataset











from ..utils import DummyObject, requires_backends




class 			__UpperCamelCase    (							metaclass=A__    ):
     __A	:  str							  =   ["""torch""", """scipy"""]





     def __init__(     self				,							*_UpperCamelCase				,							**_UpperCamelCase					):
        requires_backends(self				,							['''torch''', '''scipy''']					)





     @classmethod
     def 		UpperCamelCase(     cls				,							*_UpperCamelCase				,							**_UpperCamelCase					):
        requires_backends(cls				,							['''torch''', '''scipy''']					)





     @classmethod
     def 		UpperCamelCase(     cls				,							*_UpperCamelCase				,							**_UpperCamelCase					):
        requires_backends(cls				,							['''torch''', '''scipy''']					)