




from __future__ import annotations

import random

class      UpperCAmelCase						:
   __SCREAMING_SNAKE_CASE		:							int							=					6






   def __init__(	self   :       Tuple     )->			int:
     _lowercase: Optional[int]						     =    list(range(1						,					Dice.NUM_SIDES + 1     )     )






   def  _a						(	self   :       List[str]     )->			Optional[Any]:
     return random.choice(self.sides     )


def 		_lowerCamelCase				(					UpperCamelCase					,     UpperCamelCase = 2							)			->		list[float]:





  """simple docstring"""





  _lowercase: Union[str, Any]						     =    [Dice() for i in range(UpperCamelCase							)]
  _lowercase: int						     =    [0] * (len(UpperCamelCase							) * Dice.NUM_SIDES + 1)
  for _ in range(UpperCamelCase							):
    count_of_sum[sum(dice.roll() for dice in dices							)] += 1
  _lowercase: int						     =    [round((count * 100) / num_throws					,     2							) for count in count_of_sum]
  return probability[num_dice:]  # remove probability of sums that never appear


if __name__ == "__main__":
   import doctest

   doctest.testmod()






from cva import destroyAllWindows, imread, imshow, waitKey


def 		_lowerCamelCase				(					UpperCamelCase					,     UpperCamelCase							)			->		List[str]:





  """simple docstring"""





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

  def to_grayscale(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							):
    return 0.2_126 * red + 0.587 * green + 0.114 * blue

  def normalize(UpperCamelCase							):
    return min(UpperCamelCase					,     255							)

  for i in range(UpperCamelCase							):
    for j in range(UpperCamelCase							):
      _lowercase: Any						     =    int(to_grayscale(*img[i][j]							)							)
      _lowercase: str						     =    [
          normalize(UpperCamelCase							),
          normalize(greyscale + factor							),
          normalize(greyscale + 2 * factor							),
      ]

  return img


if __name__ == "__main__":
   # read original image
   UpperCAmelCase__						:       Optional[Any]							=    {
       percentage: imread('image_data/lena.jpg', 1) for percentage in (10, 20, 30, 40)
   }

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