



from collections.abc import Callable

import numpy as np
def 		UpperCamelCase     (       snake_case__	:   Callable	,					snake_case__	:   float	,					snake_case__	:   float	,					snake_case__	:   float	,					snake_case__	:   float     )     ->					np.array:
   UpperCamelCase   :  Optional[int]						     =     int(np.ceil((x_end - xa) / step_size     )     )
   UpperCamelCase   :  List[str]						     =     np.zeros((n + 1,)     )
   UpperCamelCase   :  List[Any]						     =     ya
   UpperCamelCase   :  str						     =     xa

   for k in range(snake_case__     ):
      UpperCamelCase   :  Optional[Any]						     =     y[k] + step_size * ode_func(snake_case__	,					y[k]     )
      UpperCamelCase   :  Optional[Any]						     =     y[k] + (
          (step_size / 2) * (ode_func(snake_case__	,					y[k]     ) + ode_func(x + step_size	,					snake_case__     ))
      )
      x += step_size

   return y


if __name__ == "__main__":
    import doctest

    doctest.testmod()








from graphs.minimum_spanning_tree_kruskal import kruskal
def 		UpperCamelCase     (       )     ->					Tuple:
   UpperCamelCase   :  List[str]						     =     9
   UpperCamelCase   :  Optional[Any]						     =     [
       [0, 1, 4],
       [0, 7, 8],
       [1, 2, 8],
       [7, 8, 7],
       [7, 6, 1],
       [2, 8, 2],
       [8, 6, 6],
       [2, 3, 7],
       [2, 5, 4],
       [6, 5, 2],
       [3, 5, 14],
       [3, 4, 9],
       [5, 4, 10],
       [1, 7, 11],
   ]

   UpperCamelCase   :  int						     =     kruskal(snake_case__	,					snake_case__     )

   UpperCamelCase   :  List[str]						     =     [
       [7, 6, 1],
       [2, 8, 2],
       [6, 5, 2],
       [0, 1, 4],
       [2, 5, 4],
       [2, 3, 7],
       [0, 7, 8],
       [3, 4, 9],
   ]

   assert sorted(snake_case__     ) == sorted(snake_case__     )



