


from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
    from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline









"""simple docstring"""


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 							lowercase__			(   __SCREAMING_SNAKE_CASE	):

			"""simple docstring"""







			def __init__(      self						,   _A						,   _A = None						,   _A = None						,   _A = True						,   _A = None						,   _A = False						,   _A = None						,   _A = True						,   _A = "arrow"						,   **_A						,   ):






									'''simple docstring'''







									super().__init__(
									    split=_A						,   features=_A						,   cache_dir=_A						,   keep_in_memory=_A						,   streaming=_A						,   **_A						,   )
									UpperCamelCase				:		Optional[Any]				   =			load_from_cache_file
									UpperCamelCase				:		List[str]				   =			file_format
									UpperCamelCase				:		Optional[Any]				   =			Spark(
									    df=_A						,   features=_A						,   cache_dir=_A						,   working_dir=_A						,   **_A						,   )







			def   _a      (      self    ):






									'''simple docstring'''







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



