'''simple docstring'''




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					):
     lowerCamelCase    :	Optional[datasets.Features]				=None




class        a__ (  datasets.ArrowBasedBuilder					):
     lowerCamelCase    :	Dict				=PandasConfig






     def   SCREAMING_SNAKE_CASE__  (					self						:						Optional[int]       ):





         """simple docstring"""



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






     def   SCREAMING_SNAKE_CASE__  (					self						:						str    ,							a						:						str       ):





         """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(a    ,							(str, list, tuple)       ):
             __lowerCamelCase            =    data_files
             if isinstance(a    ,							a       ):
                 __lowerCamelCase            =    [files]
             # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
             __lowerCamelCase            =    [dl_manager.iter_files(a       ) 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(a    ,							a       ):
                 __lowerCamelCase            =    [files]
             # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
             __lowerCamelCase            =    [dl_manager.iter_files(a       ) for file in files]
             splits.append(datasets.SplitGenerator(name=a    ,							gen_kwargs={'''files''': files}       )       )
         return splits






     def   SCREAMING_SNAKE_CASE__  (					self						:						str    ,							a						:						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(a    ,							self.config.features.arrow_schema       )
         return pa_table






     def   SCREAMING_SNAKE_CASE__  (					self						:						Tuple    ,							a						:						Tuple       ):





         """simple docstring"""



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

'''simple docstring'''




import numpy as np






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							)      ->       str:
    __lowerCamelCase            =    int(np.ceil((x_end - xa) / h							)							)
    __lowerCamelCase            =    np.zeros((n + 1,)							)
    __lowerCamelCase            =    ya
    __lowerCamelCase            =    xa

    for k in range(UpperCamelCase__							):
        __lowerCamelCase            =    f(UpperCamelCase__							,    y[k]							)
        __lowerCamelCase            =    f(x + 0.5 * h							,    y[k] + 0.5 * h * ka							)
        __lowerCamelCase            =    f(x + 0.5 * h							,    y[k] + 0.5 * h * ka							)
        __lowerCamelCase            =    f(x + h							,    y[k] + h * ka							)
        __lowerCamelCase            =    y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
        x += h

    return y


if __name__ == "__main__":
  import doctest

  doctest.testmod()
