

from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset


class 				SCREAMING_SNAKE_CASE__ (__snake_case					):





    def 				snake_case_    (				self):
         return [
             {"col_1": 3, "col_2": "a"},
             {"col_1": 2, "col_2": "b"},
             {"col_1": 1, "col_2": "c"},
             {"col_1": 0, "col_2": "d"},
         ]





    def 				snake_case_    (				self):
         lowercase__   :       Optional[int]				=	{'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
         return Dataset.from_dict(a)





    def 				snake_case_    (				self):
         lowercase__   :       Optional[int]				=	self._create_example_records()
         lowercase__   :       Union[str, Any]				=	Dataset.from_list(a)
         self.assertListEqual(dset.column_names						,       ['col_1', 'col_2'])
         for i, r in enumerate(a):
              self.assertDictEqual(a						,       example_records[i])





    def 				snake_case_    (				self):
         lowercase__   :       Optional[Any]				=	self._create_example_records()
         lowercase__   :       Optional[int]				=	Dataset.from_list(a)
         lowercase__   :       Any				=	Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]})
         self.assertEqual(dset.info						,       dset_from_dict.info)





    def 				snake_case_    (				self):  # checks what happens with missing columns
         lowercase__   :       List[str]				=	[{'col_1': 1}, {'col_2': 'x'}]
         lowercase__   :       Optional[Any]				=	Dataset.from_list(a)
         self.assertDictEqual(dset[0]						,       {'col_1': 1})
         self.assertDictEqual(dset[1]						,       {'col_1': None})  # NB: first record is used for columns





    def 				snake_case_    (				self):  # checks if the type can be inferred from the second record
         lowercase__   :       List[str]				=	[{'col_1': []}, {'col_1': [1, 2]}]
         lowercase__   :       Any				=	Dataset.from_list(a)
         self.assertEqual(dset.info.features['col_1']						,       Sequence(Value('int64')))





    def 				snake_case_    (				self):
         lowercase__   :       Optional[int]				=	Dataset.from_list([])
         self.assertEqual(len(a)						,       0)
         self.assertListEqual(dset.column_names						,       [])




import numpy as np

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   str     ,					SCREAMING_SNAKE_CASE_		:   Optional[int]     ,					SCREAMING_SNAKE_CASE_		:   Optional[int]     ,					SCREAMING_SNAKE_CASE_		:   Union[str, Any]     ,					SCREAMING_SNAKE_CASE_		:   List[Any]      ):



     '''simple docstring'''





     lowercase__   :       List[Any]				=	int(np.ceil((x_end - xa) / h      )      )
     lowercase__   :       Dict				=	np.zeros((n + 1,)      )
     lowercase__   :       Dict				=	ya
     lowercase__   :       Union[str, Any]				=	xa

     for k in range(SCREAMING_SNAKE_CASE_      ):
          lowercase__   :       Optional[int]				=	f(SCREAMING_SNAKE_CASE_     ,					y[k]      )
          lowercase__   :       Dict				=	f(x + 0.5 * h     ,					y[k] + 0.5 * h * ka      )
          lowercase__   :       Any				=	f(x + 0.5 * h     ,					y[k] + 0.5 * h * ka      )
          lowercase__   :       List[Any]				=	f(x + h     ,					y[k] + h * ka      )
          lowercase__   :       Tuple				=	y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
          x += h

     return y


if __name__ == "__main__":
       import doctest

       doctest.testmod()

