






'''simple docstring'''







from cva import destroyAllWindows, imread, imshow, waitKey






def  lowerCAmelCase__		(					a_  :     List[str]			,						a_  :     int			)   -> Any:
       UpperCAmelCase__							,							UpperCAmelCase__	:   str												=	img.shape[0], img.shape[1]

       def to_grayscale(a_  :     List[str]			,						a_  :     Union[str, Any]			,						a_  :     Optional[int]			):
              return 0.2_126 * red + 0.587 * green + 0.114 * blue

       def normalize(a_  :     Tuple			):
              return min(a_			,						2_5_5			)

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

       return img


if __name__ == "__main__":
  # read original image
  UpperCamelCase_					=				{
      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()







'''simple docstring'''







import re






def  lowerCAmelCase__		(					a_  :     Optional[int]			)   -> Optional[Any]:
       def docstring_decorator(a_  :     Dict			):
              UpperCAmelCase__	:   Optional[int]												=	fn.__doc__
              UpperCAmelCase__	:   Dict												=	func_doc.split('''\n'''			)
              UpperCAmelCase__	:   Any												=	0
              while i < len(a_			) and re.search(r'''^\s*Examples?:\s*$'''			,						lines[i]			) is None:
                     i += 1
              if i < len(a_			):
                     UpperCAmelCase__	:   List[Any]												=	example_docstring
                     UpperCAmelCase__	:   int												=	'''\n'''.join(a_			)
              else:
                     raise ValueError(
                         f"""The function {fn} should have an empty 'Examples:' in its docstring as placeholder, """
                         f"""current docstring is:\n{func_doc}"""			)
              UpperCAmelCase__	:   Any												=	func_doc
              return fn

       return docstring_decorator