


'''simple docstring'''
from collections.abc import Callable

import numpy as np


def       _lowercase							(					UpperCamelCase__							:       Callable,					UpperCamelCase__							:       float,					UpperCamelCase__							:       float,					UpperCamelCase__							:       float,					UpperCamelCase__							:       float      ):
 __A	:		Any	  =      int(np.ceil((x_end - xa) / step_size      )      )
 __A	:		Union[str, Any]	  =      np.zeros((n + 1,)      )
 __A	:		int	  =      ya
 __A	:		Tuple	  =      xa

 for k in range(UpperCamelCase__      ):
  __A	:		str	  =      y[k] + step_size * ode_func(UpperCamelCase__,					y[k]      )
  __A	:		Any	  =      y[k] + (
      (step_size / 2) * (ode_func(UpperCamelCase__,					y[k]      ) + ode_func(x + step_size,					UpperCamelCase__      ))
  )
  x += step_size

 return y


if __name__ == "__main__":
 import doctest

 doctest.testmod()










'''simple docstring'''
import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey

class     _lowerCamelCase       :




 '''simple docstring'''


 def __init__(   self   ,   __lowercase   ,   __lowercase   ,   __lowercase    ):

  """simple docstring"""







  if dst_width < 0 or dst_height < 0:
   raise ValueError('Destination width/height should be > 0'    )

  __A	:		Dict	  =      img
  __A	:		Dict	  =      img.shape[1]
  __A	:		Tuple	  =      img.shape[0]
  __A	:		List[str]	  =      dst_width
  __A	:		Tuple	  =      dst_height

  __A	:		Optional[Any]	  =      self.src_w / self.dst_w
  __A	:		List[str]	  =      self.src_h / self.dst_h

  __A	:		Dict	  =      (
      np.ones((self.dst_h, self.dst_w, 3)   ,   np.uinta    ) * 255
  )


 def 			snake_case__ (   self    ):

  """simple docstring"""







  for i in range(self.dst_h    ):
   for j in range(self.dst_w    ):
    __A	:		List[str]	  =      self.img[self.get_y(__lowercase    )][self.get_x(__lowercase    )]


 def 			snake_case__ (   self   ,   __lowercase    ):

  """simple docstring"""







  return int(self.ratio_x * x    )







 def 			snake_case__ (   self   ,   __lowercase    ):

  """simple docstring"""







  return int(self.ratio_y * y    )


if __name__ == "__main__":
 UpperCAmelCase_				,      UpperCAmelCase_			:  str										=   8_0_0, 6_0_0
 UpperCAmelCase_			:  str										=   imread('image_data/lena.jpg', 1)
 UpperCAmelCase_			:  List[str]										=   NearestNeighbour(im, dst_w, dst_h)
 n.process()

 imshow(
     f'''Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}''', n.output
 )
 waitKey(0)
 destroyAllWindows()






