






from ..utils import DummyObject, requires_backends
class       _UpperCAmelCase					(       metaclass=A__	):

				"""simple docstring"""




				lowercase__											=       ["""torch""", """torchsde"""]




				def __init__(     self						:    Tuple,  *lowerCamelCase						:    str,  **lowerCamelCase						:    Dict  ):

								'''simple docstring'''
								requires_backends(self,  ['''torch''', '''torchsde''']  )




				@classmethod
				def 				lowercase__   (     cls						:    Tuple,  *lowerCamelCase						:    Union[str, Any],  **lowerCamelCase						:    Any  ):

								'''simple docstring'''
								requires_backends(cls,  ['''torch''', '''torchsde''']  )




				@classmethod
				def 				lowercase__   (     cls						:    List[Any],  *lowerCamelCase						:    Optional[int],  **lowerCamelCase						:    str  ):

								'''simple docstring'''
								requires_backends(cls,  ['''torch''', '''torchsde''']  )












from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader
class       _UpperCAmelCase					(       A__	):

				"""simple docstring"""




				def __init__(     self						:    Dict,  lowerCamelCase						:    pyspark.sql.DataFrame,  lowerCamelCase						:    Optional[NamedSplit] = None,  lowerCamelCase						:    Optional[Features] = None,  lowerCamelCase						:    bool = True,  lowerCamelCase						:    str = None,  lowerCamelCase						:    bool = False,  lowerCamelCase						:    str = None,  lowerCamelCase						:    bool = True,  lowerCamelCase						:    str = "arrow",  **lowerCamelCase						:    str,  ):

								'''simple docstring'''
								super().__init__(
								    split=lowerCamelCase,  features=lowerCamelCase,  cache_dir=lowerCamelCase,  keep_in_memory=lowerCamelCase,  streaming=lowerCamelCase,  **lowerCamelCase,  )
								lowercase__    =			load_from_cache_file
								lowercase__    =			file_format
								lowercase__    =			Spark(
								    df=lowerCamelCase,  features=lowerCamelCase,  cache_dir=lowerCamelCase,  working_dir=lowerCamelCase,  **lowerCamelCase,  )




				def 				lowercase__   (     self						:    List[Any]  ):

								'''simple docstring'''
								if self.streaming:
												return self.builder.as_streaming_dataset(split=self.split  )
								lowercase__    =			None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
								self.builder.download_and_prepare(
								    download_mode=lowerCamelCase,  file_format=self._file_format,  )
								return self.builder.as_dataset(split=self.split  )




