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





class     __UpperCamelCase :






     """simple docstring"""







     def __init__(				self							:							Tuple     ,						_A							:							List[str]     ,						_A							:							int     ,						_A							:							int ):







       """simple docstring"""




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

       __SCREAMING_SNAKE_CASE      :	Dict					=		img
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		img.shape[1]
       __SCREAMING_SNAKE_CASE      :	Tuple					=		img.shape[0]
       __SCREAMING_SNAKE_CASE      :	List[str]					=		dst_width
       __SCREAMING_SNAKE_CASE      :	Tuple					=		dst_height

       __SCREAMING_SNAKE_CASE      :	Tuple					=		self.src_w / self.dst_w
       __SCREAMING_SNAKE_CASE      :	Dict					=		self.src_h / self.dst_h

       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		(
           np.ones((self.dst_h, self.dst_w, 3)     ,						np.uinta ) * 255
       )



     def  UpperCAmelCase__							(				self							:							Optional[Any] ):







       """simple docstring"""




       for i in range(self.dst_h ):
         for j in range(self.dst_w ):
           __SCREAMING_SNAKE_CASE      :	str					=		self.img[self.get_y(_A )][self.get_x(_A )]



     def  UpperCAmelCase__							(				self							:							Tuple     ,						_A							:							int ):







       """simple docstring"""




       return int(self.ratio_x * x )




     def  UpperCAmelCase__							(				self							:							Any     ,						_A							:							int ):







       """simple docstring"""




       return int(self.ratio_y * y )


if __name__ == "__main__":
   lowercase_				,    lowercase_ 				=			800, 600
   lowercase_ 				=			imread("""image_data/lena.jpg""", 1)
   lowercase_ 				=			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()




import math




def  a   (lowerCAmelCase__   ):

   if 1 < number < 4:
      # 2 and 3 are primes
      return True
   elif number < 2 or number % 2 == 0 or number % 3 == 0:
      # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
      return False

   # All primes number are in format of 6k +/- 1
   for i in range(5		,				int(math.sqrt(lowerCAmelCase__   ) + 1   )		,				6   ):
      if number % i == 0 or number % (i + 2) == 0:
         return False
   return True




def  a   (lowerCAmelCase__ = 10_001   ):

   try:
      __a					=  int(lowerCAmelCase__   )
   except (TypeError, ValueError):
      raise TypeError("""Parameter nth must be int or castable to int."""   ) from None
   if nth <= 0:
      raise ValueError("""Parameter nth must be greater than or equal to one."""   )
   __a					=  []
   __a					=  2
   while len(lowerCAmelCase__   ) < nth:
      if is_prime(lowerCAmelCase__   ):
         primes.append(lowerCAmelCase__   )
         num += 1
      else:
         num += 1
   return primes[len(lowerCAmelCase__   ) - 1]


if __name__ == "__main__":
  print(f'''{solution() = }''')



