

from cva import destroyAllWindows, imread, imshow, waitKey







def _a					(			SCREAMING_SNAKE_CASE						:     List[str]       ,   SCREAMING_SNAKE_CASE						:     int						)       ->       Any:

 """simple docstring"""






 __lowerCAmelCase      ,				__lowerCAmelCase:  Tuple        = img.shape[0], img.shape[1]

 def to_grayscale(SCREAMING_SNAKE_CASE						:     Dict       ,   SCREAMING_SNAKE_CASE						:     str       ,   SCREAMING_SNAKE_CASE						:     Any						):
  return 0.2_1_2_6 * red + 0.5_8_7 * green + 0.1_1_4 * blue

 def normalize(SCREAMING_SNAKE_CASE						:     List[Any]						):
  return min(SCREAMING_SNAKE_CASE       ,   2_55						)

 for i in range(SCREAMING_SNAKE_CASE						):
  for j in range(SCREAMING_SNAKE_CASE						):
   __lowerCAmelCase:  Optional[Any]        = int(to_grayscale(*img[i][j]						)						)
   __lowerCAmelCase:  Dict        = [
       normalize(SCREAMING_SNAKE_CASE						),
       normalize(greyscale + factor						),
       normalize(greyscale + 2 * factor						),
   ]

 return img


if __name__ == "__main__":
  # read original image
  _a									=  {
      percentage: imread('''image_data/lena.jpg''', 1) for percentage in (1_0, 2_0, 3_0, 4_0)
  }

  for percentage, img in images.items():
    make_sepia(img, percentage)

  for percentage, img in images.items():
    imshow(f"Original image with sepia (factor: {percentage})", img)

  waitKey(0)
  destroyAllWindows()













from __future__ import annotations







def   snake_case		(				UpperCAmelCase						:							int,    UpperCAmelCase						:							list[int],    UpperCAmelCase						:							list[int],    UpperCAmelCase						:							int ):

				# Base Case
				if counter == 0 or capacity == 0:
								return 0

				# If weight of the nth item is more than Knapsack of capacity,
				#   then this item cannot be included in the optimal solution,
				# else return the maximum of two cases:
				#   (1) nth item included
				#   (2) not included
				if weights[counter - 1] > capacity:
								return knapsack(UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
				else:
								A									=   capacity - weights[counter - 1]
								A									=   values[counter - 1] + knapsack(
								    UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
								A									=   knapsack(UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    counter - 1 )
								return max(UpperCAmelCase,    UpperCAmelCase )


if __name__ == "__main__":
					import doctest

					doctest.testmod()





