





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     __magic_name__     (							datasets.BuilderConfig							):





     """simple docstring"""



     __UpperCamelCase    			=   None




class     __magic_name__     (							datasets.ArrowBasedBuilder							):





     """simple docstring"""



     __UpperCamelCase    			=   PandasConfig



     def   SCREAMING_SNAKE_CASE						(							self				:Tuple     ):





        '''simple docstring'''




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



     def   SCREAMING_SNAKE_CASE						(							self				:Tuple	,					snake_case				:Dict     ):





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



     def   SCREAMING_SNAKE_CASE						(							self				:Optional[int]	,					snake_case				: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
           A_    : int								=	table_cast(snake_case	,					self.config.features.arrow_schema     )
        return pa_table





     def   SCREAMING_SNAKE_CASE						(							self				:Union[str, Any]	,					snake_case				:List[str]     ):





        '''simple docstring'''




        for i, file in enumerate(itertools.chain.from_iterable(snake_case     )     ):
           with open(snake_case	,					"rb"     ) as f:
              A_    : Dict								=	pa.Table.from_pandas(pd.read_pickle(snake_case     )     )
              yield i, self._cast_table(snake_case     )


import numpy as np






def        a_		(       __lowercase   :	np.array ) ->  np.array:
			return 1 / (1 + np.exp(-vector ))


if __name__ == "__main__":
			import doctest

			doctest.testmod()