




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 						_A					(  datasets.BuilderConfig      ):
  _UpperCamelCase   :			Optional[datasets.Features] =			None


class 						_A					(  datasets.ArrowBasedBuilder      ):
  _UpperCamelCase   :			Tuple =			PandasConfig






  def 					__a			(  self		:	Any      )		->    List[Any]:






       """simple docstring"""







       return datasets.DatasetInfo(features=self.config.features      )






  def 					__a			(  self		:	str      ,						_A		:	Dict      )		->    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}"""      )
       lowercase					:   Any								= dl_manager.download_and_extract(self.config.data_files      )
       if isinstance(snake_case__      ,						(str, list, tuple)      ):
            lowercase					:   List[Any]								= data_files
            if isinstance(snake_case__      ,						snake_case__      ):
                 lowercase					:   Dict								= [files]
            # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
            lowercase					:   List[str]								= [dl_manager.iter_files(snake_case__      ) for file in files]
            return [datasets.SplitGenerator(name=datasets.Split.TRAIN      ,						gen_kwargs={'''files''': files}      )]
       lowercase					:   Optional[Any]								= []
       for split_name, files in data_files.items():
            if isinstance(snake_case__      ,						snake_case__      ):
                 lowercase					:   Optional[int]								= [files]
            # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
            lowercase					:   List[Any]								= [dl_manager.iter_files(snake_case__      ) for file in files]
            splits.append(datasets.SplitGenerator(name=snake_case__      ,						gen_kwargs={'''files''': files}      )      )
       return splits






  def 					__a			(  self		:	Optional[int]      ,						_A		:	int      )		->    Dict:






       """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
            lowercase					:   Union[str, Any]								= table_cast(snake_case__      ,						self.config.features.arrow_schema      )
       return pa_table






  def 					__a			(  self		:	Optional[Any]      ,						_A		:	Dict      )		->    str:






       """simple docstring"""







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



"""simple docstring"""







def 					a__			(				SCREAMING_SNAKE_CASE    :    int				,      SCREAMING_SNAKE_CASE    :    int				):


  '''simple docstring'''







  while b:
    lowerCAmelCase						,  lowerCAmelCase     :     Any								=							b, a % b
  return a
def 					a__			(				SCREAMING_SNAKE_CASE    :    int				,      SCREAMING_SNAKE_CASE    :    int				):


  '''simple docstring'''







  return a if b == 0 else euclidean_gcd_recursive(SCREAMING_SNAKE_CASE				,      a % b				)
def 					a__			(				):


  '''simple docstring'''







  print(f"""euclidean_gcd(3, 5) = {euclidean_gcd(3				,      5				)}"""				)
  print(f"""euclidean_gcd(5, 3) = {euclidean_gcd(5				,      3				)}"""				)
  print(f"""euclidean_gcd(1, 3) = {euclidean_gcd(1				,      3				)}"""				)
  print(f"""euclidean_gcd(3, 6) = {euclidean_gcd(3				,      6				)}"""				)
  print(f"""euclidean_gcd(6, 3) = {euclidean_gcd(6				,      3				)}"""				)

  print(f"""euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3				,      5				)}"""				)
  print(f"""euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5				,      3				)}"""				)
  print(f"""euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1				,      3				)}"""				)
  print(f"""euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3				,      6				)}"""				)
  print(f"""euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6				,      3				)}"""				)


if __name__ == "__main__":
     main()





