




import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey



class       a_       :





	def __init__(							self      ,     SCREAMING_SNAKE_CASE      ,     SCREAMING_SNAKE_CASE      ,     SCREAMING_SNAKE_CASE      )  ->					Dict:




				"""simple docstring"""



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

				SCREAMING_SNAKE_CASE_								=						img
				SCREAMING_SNAKE_CASE_								=						img.shape[1]
				SCREAMING_SNAKE_CASE_								=						img.shape[0]
				SCREAMING_SNAKE_CASE_								=						dst_width
				SCREAMING_SNAKE_CASE_								=						dst_height

				SCREAMING_SNAKE_CASE_								=						self.src_w / self.dst_w
				SCREAMING_SNAKE_CASE_								=						self.src_h / self.dst_h

				SCREAMING_SNAKE_CASE_								=						SCREAMING_SNAKE_CASE_								=						(
				    np.ones((self.dst_h, self.dst_w, 3)      ,     np.uinta      ) * 255
				)





	def 						A_(							self      )  ->					Optional[Any]:




				"""simple docstring"""



				for i in range(self.dst_h      ):
							for j in range(self.dst_w      ):
										SCREAMING_SNAKE_CASE_								=						self.img[self.get_y(SCREAMING_SNAKE_CASE      )][self.get_x(SCREAMING_SNAKE_CASE      )]





	def 						A_(							self      ,     SCREAMING_SNAKE_CASE      )  ->					int:




				"""simple docstring"""



				return int(self.ratio_x * x      )





	def 						A_(							self      ,     SCREAMING_SNAKE_CASE      )  ->					int:




				"""simple docstring"""



				return int(self.ratio_y * y      )


if __name__ == "__main__":
				SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__     :     Optional[Any]		    =       8_00, 6_00
				SCREAMING_SNAKE_CASE__     :     str		    =       imread("image_data/lena.jpg", 1)
				SCREAMING_SNAKE_CASE__     :     int		    =       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()






from __future__ import annotations

from typing import Any

def lowercase    (  SCREAMING_SNAKE_CASE )			->							None:


			'''simple docstring'''







			create_state_space_tree(SCREAMING_SNAKE_CASE       ,    []       ,    0 )

def lowercase    (  SCREAMING_SNAKE_CASE       ,    SCREAMING_SNAKE_CASE       ,    SCREAMING_SNAKE_CASE )			->							None:


			'''simple docstring'''







			if index == len(SCREAMING_SNAKE_CASE ):
						print(SCREAMING_SNAKE_CASE )
						return

			create_state_space_tree(SCREAMING_SNAKE_CASE       ,    SCREAMING_SNAKE_CASE       ,    index + 1 )
			current_subsequence.append(sequence[index] )
			create_state_space_tree(SCREAMING_SNAKE_CASE       ,    SCREAMING_SNAKE_CASE       ,    index + 1 )
			current_subsequence.pop()


if __name__ == "__main__":
				SCREAMING_SNAKE_CASE__     :     list[Any]		    =       [3, 1, 2, 4]
				generate_all_subsequences(seq)

				seq.clear()
				seq.extend(["A", "B", "C"])
				generate_all_subsequences(seq)
