






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 						lowerCAmelCase   (       __a	):

					'''simple docstring'''

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


												"""simple docstring"""

												super().__init__(
												    split=__a						,   features=__a						,   cache_dir=__a						,   keep_in_memory=__a						,   streaming=__a						,   **__a						,   )
												__lowercase					:							Optional[int]			=   load_from_cache_file
												__lowercase					:							Union[str, Any]			=   file_format
												__lowercase					:							Any			=   Spark(
												    df=__a						,   features=__a						,   cache_dir=__a						,   working_dir=__a						,   **__a						,   )



					def 					lowerCAmelCase (     self :		Union[str, Any]							)	->     List[str]:


												"""simple docstring"""

												if self.streaming:
																			return self.builder.as_streaming_dataset(split=self.split							)
												__lowercase					:							Optional[int]			=   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							)







def 					snake_case_						(   lowerCAmelCase_				:  list					):

							if len(lowerCAmelCase_					) <= 1:
														return [tuple(lowerCAmelCase_					)]

							__lowercase					:							Any			=   []

							def generate(lowerCAmelCase_				:  int				,				lowerCAmelCase_				:  list					):
														if k == 1:
																					res.append(tuple(arr[:]					)					)
																					return

														generate(k - 1				,				lowerCAmelCase_					)

														for i in range(k - 1					):
																					if k % 2 == 0:  # k is even
																												__lowercase	,	__lowercase					:							List[str]			=   arr[k - 1], arr[i]
																					else:  # k is odd
																												__lowercase	,	__lowercase					:							Any			=   arr[k - 1], arr[0]
																					generate(k - 1				,				lowerCAmelCase_					)

							generate(len(lowerCAmelCase_					)				,				lowerCAmelCase_					)
							return res


if __name__ == "__main__":
	lowerCamelCase       :       Union[str, Any]        =				input('''Enter numbers separated by a comma:\n''').strip()
	lowerCamelCase       :       Optional[Any]        =				[int(item) for item in user_input.split(''',''')]
	print(heaps(arr))