


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        _a							(			UpperCamelCase__			):

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





									"""simple docstring"""







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


							def       lowerCamelCase_ (							self:	str							)			->   Optional[int]:





									"""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=UpperCamelCase_    ,						file_format=self._file_format    ,						)
									return self.builder.as_dataset(split=self.split							)






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


lowerCAmelCase__      		= {'configuration_speech_encoder_decoder': ['SpeechEncoderDecoderConfig']}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase__      		= ['SpeechEncoderDecoderModel']

try:
    if not is_flax_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase__      		= ['FlaxSpeechEncoderDecoderModel']

if TYPE_CHECKING:
    from .configuration_speech_encoder_decoder import SpeechEncoderDecoderConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_speech_encoder_decoder import SpeechEncoderDecoderModel

    try:
        if not is_flax_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_flax_speech_encoder_decoder import FlaxSpeechEncoderDecoderModel

else:
    import sys

    lowerCAmelCase__      		= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
