


'''simple docstring'''
def       _lowercase							(					UpperCamelCase__							:       int,					UpperCamelCase__							:       Optional[Any]      ):
 # "extended trapezoidal rule"
 # int(f) = dx/2 * (f1 + 2f2 + ... + fn)
 __A	:		List[str]	  =      (boundary[1] - boundary[0]) / steps
 __A	:		Optional[Any]	  =      boundary[0]
 __A	:		List[str]	  =      boundary[1]
 __A	:		str	  =      make_points(UpperCamelCase__,					UpperCamelCase__,					UpperCamelCase__      )
 __A	:		Optional[int]	  =      0.0
 y += (h / 2.0) * f(UpperCamelCase__      )
 for i in x_i:
  # print(i)
  y += h * f(UpperCamelCase__      )
 y += (h / 2.0) * f(UpperCamelCase__      )
 return y


def       _lowercase							(					UpperCamelCase__							:       Any,					UpperCamelCase__							:       List[Any],					UpperCamelCase__							:       int      ):
 __A	:		Optional[Any]	  =      a + h
 while x < (b - h):
  yield x
  __A	:		int	  =      x + h


def       _lowercase							(					UpperCamelCase__							:       Union[str, Any]      ):  # enter your function here
 __A	:		Optional[int]	  =      (x - 0) * (x - 0)
 return y


def       _lowercase							(					):
 __A	:		List[Any]	  =      0.0  # Lower bound of integration
 __A	:		List[str]	  =      1.0  # Upper bound of integration
 __A	:		Optional[Any]	  =      10.0  # define number of steps or resolution
 __A	:		int	  =      [a, b]  # define boundary of integration
 __A	:		List[str]	  =      method_a(UpperCamelCase__,					UpperCamelCase__      )
 print(f"""y = {y}"""      )


if __name__ == "__main__":
 main()










'''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()






