


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 ):


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




											'''simple docstring'''

											super().__init__(
											    split=SCREAMING_SNAKE_CASE  ,     features=SCREAMING_SNAKE_CASE  ,     cache_dir=SCREAMING_SNAKE_CASE  ,     keep_in_memory=SCREAMING_SNAKE_CASE  ,     streaming=SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE  ,     )
											__snake_case				=		load_from_cache_file
											__snake_case				=		file_format
											__snake_case				=		Spark(
											    df=SCREAMING_SNAKE_CASE  ,     features=SCREAMING_SNAKE_CASE  ,     cache_dir=SCREAMING_SNAKE_CASE  ,     working_dir=SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE  ,     )






					def 				SCREAMING_SNAKE_CASE_	(    self						:		str    )      ->						List[str]:




											'''simple docstring'''

											if self.streaming:
																	return self.builder.as_streaming_dataset(split=self.split    )
											__snake_case				=		None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
											self.builder.download_and_prepare(
											    download_mode=SCREAMING_SNAKE_CASE  ,     file_format=self._file_format  ,     )
											return self.builder.as_dataset(split=self.split    )









import inspect
import unittest






class      UpperCamelCase(	unittest.TestCase ):


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Dict    )      ->						List[Any]:




											'''simple docstring'''

											try:
																	import diffusers  # noqa: F401
											except ImportError:
																	assert False






					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[int]    )      ->						Any:




											'''simple docstring'''

											import diffusers
											from diffusers.dependency_versions_table import deps

											__snake_case				=		inspect.getmembers(SCREAMING_SNAKE_CASE  ,     inspect.isclass    )

											for cls_name, cls_module in all_classes:
																	if "dummy_" in cls_module.__module__:
																							for backend in cls_module._backends:
																													if backend == "k_diffusion":
																																			__snake_case				=		"k-diffusion"
																													elif backend == "invisible_watermark":
																																			__snake_case				=		"invisible-watermark"
																													assert backend in deps, f'''{backend} is not in the deps table!'''





