




import itertools
from dataclasses import dataclass
from typing import Optional

import pandas as pd
import pyarrow as pa

import datasets
from datasets.table import table_cast







@dataclass
class        __lowerCAmelCase					(			datasets.BuilderConfig					):

			"""simple docstring"""







			snake_case_  						=			None







class        __lowerCAmelCase					(			datasets.ArrowBasedBuilder					):

			"""simple docstring"""







			snake_case_  						=			PandasConfig


			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							return datasets.DatasetInfo(features=self.config.features				)


			def  lowercase_       ( self     ,		lowerCamelCase__				)       -> int:



							'''simple docstring'''


							if not self.config.data_files:
											raise ValueError(f"""At least one data file must be specified, but got data_files={self.config.data_files}"""				)
							__lowerCamelCase									=       dl_manager.download_and_extract(self.config.data_files				)
							if isinstance(_SCREAMING_SNAKE_CASE     ,		(str, list, tuple)				):
											__lowerCamelCase									=       data_files
											if isinstance(_SCREAMING_SNAKE_CASE     ,		_SCREAMING_SNAKE_CASE				):
															__lowerCamelCase									=       [files]
											# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
											__lowerCamelCase									=       [dl_manager.iter_files(_SCREAMING_SNAKE_CASE				) for file in files]
											return [datasets.SplitGenerator(name=datasets.Split.TRAIN     ,		gen_kwargs={'files': files}				)]
							__lowerCamelCase									=       []
							for split_name, files in data_files.items():
											if isinstance(_SCREAMING_SNAKE_CASE     ,		_SCREAMING_SNAKE_CASE				):
															__lowerCamelCase									=       [files]
											# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
											__lowerCamelCase									=       [dl_manager.iter_files(_SCREAMING_SNAKE_CASE				) for file in files]
											splits.append(datasets.SplitGenerator(name=_SCREAMING_SNAKE_CASE     ,		gen_kwargs={'files': files}				)				)
							return splits


			def  lowercase_       ( self     ,		lowerCamelCase__				)       -> pa.Table:



							'''simple docstring'''


							if self.config.features is not None:
											# more expensive cast to support nested features with keys in a different order
											# allows str <-> int/float or str to Audio for example
											__lowerCamelCase									=       table_cast(_SCREAMING_SNAKE_CASE     ,		self.config.features.arrow_schema				)
							return pa_table






			def  lowercase_       ( self     ,		lowerCamelCase__				)       -> Optional[Any]:



							'''simple docstring'''


							for i, file in enumerate(itertools.chain.from_iterable(_SCREAMING_SNAKE_CASE				)				):
											with open(_SCREAMING_SNAKE_CASE     ,		'rb'				) as f:
															__lowerCamelCase									=       pa.Table.from_pandas(pd.read_pickle(_SCREAMING_SNAKE_CASE				)				)
															yield i, self._cast_table(_SCREAMING_SNAKE_CASE				)







"""simple docstring"""

def  __snake_case							(	__A      :						int							,		__A      :						int     )     ->       float:






				'''simple docstring'''
				return base * power(__A							,		(exponent - 1)     ) if exponent else 1


if __name__ == "__main__":
							print('Raise base to the power of exponent using recursion...')
							A_						:    str				=      int(input('Enter the base: ').strip())
							A_						:    Dict				=      int(input('Enter the exponent: ').strip())
							A_						:    List[str]				=      power(base, abs(exponent))
							if exponent < 0:  # power() does not properly deal w/ negative exponents
														A_						:    Any				=      1 / result
							print(f'''{base} to the power of {exponent} is {result}''')





