



"""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 			A__   (  lowerCamelCase_							):




	'''simple docstring'''





	def __init__(     self:		List[Any]       ,			_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:		Any       ,			)				->       Any:

				"""simple docstring"""

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







	def 							_SCREAMING_SNAKE_CASE   (     self:		int)				->       List[Any]:

				"""simple docstring"""

				if self.streaming:
							return self.builder.as_streaming_dataset(split=self.split)
				__lowerCAmelCase      :  List[str]												=       None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
				self.builder.download_and_prepare(
				    download_mode=_lowercase       ,			file_format=self._file_format       ,			)
				return self.builder.as_dataset(split=self.split)
import warnings

from ..trainer import Trainer
from ..utils import logging


__lowerCamelCase			: List[Any]							   =		logging.get_logger(__name__)







class __snake_case				(						lowerCamelCase_		):




   def __init__(    self			:				Tuple       ,	_lowercase			:				Optional[int]=None       ,	**_lowercase			:				List[Any]      ):



     """simple docstring"""






     warnings.warn(
         """`SageMakerTrainer` is deprecated and will be removed in v5 of Transformers. You can use `Trainer` """
         """instead."""       ,	_lowercase       ,	)
     super().__init__(args=_lowercase       ,	**_lowercase      )
