



"""simple docstring"""







from collections.abc import Callable

import numpy as np

def     UpperCamelCase_   (   lowerCAmelCase__				:    Callable   ,       lowerCAmelCase__				:    float   ,       lowerCAmelCase__				:    float   ,       lowerCAmelCase__				:    float   ,       lowerCAmelCase__				:    float						):

  """simple docstring"""




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

  for k in range(__lowerCAmelCase						):
    lowerCAmelCase_       :    Dict								=			y[k] + step_size * ode_func(__lowerCAmelCase   ,       y[k]						)
    lowerCAmelCase_       :    Dict								=			y[k] + (
        (step_size / 2) * (ode_func(__lowerCAmelCase   ,       y[k]						) + ode_func(x + step_size   ,       __lowerCAmelCase						))
    )
    x += step_size

  return y


if __name__ == "__main__":
     import doctest

     doctest.testmod()










"""simple docstring"""







from collections.abc import Iterable
from typing import Generic, TypeVar

lowercase__		:    Any				   =     TypeVar("""_T""")







class 				UpperCamelCase__       (     Generic[_T]  ):




      """simple docstring"""




      def __init__(				self    :				Any   ,      SCREAMING_SNAKE_CASE_    :				Iterable[_T] | None = None	):
        lowerCAmelCase_       :    list[_T]								=			list(iterable or []	)
        lowerCAmelCase_       :    list[_T]								=			[]



      def __len__(				self    :				List[str]	):
        return len(self._stacka	) + len(self._stacka	)



      def __repr__(				self    :				int	):
        return F"Queue({tuple(self._stacka[::-1] + self._stacka	)})"



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Tuple   ,      SCREAMING_SNAKE_CASE_    :				_T	):
        self._stacka.append(SCREAMING_SNAKE_CASE_	)





      def 					SCREAMING_SNAKE_CASE__			(				self    :				str	):
        lowerCAmelCase_       :    List[str]								=			self._stacka.pop
        lowerCAmelCase_       :    int								=			self._stacka.append

        if not self._stacka:
          while self._stacka:
            stacka_append(stacka_pop()	)

        if not self._stacka:
          raise IndexError('Queue is empty'	)
        return self._stacka.pop()


if __name__ == "__main__":
     from doctest import testmod

     testmod()





