



from cva import destroyAllWindows, imread, imshow, waitKey

def       A_   (						__a  :					Optional[int]			,		__a  :					int		):

				"""simple docstring"""
				a__   ,      a__					   =		img.shape[0], img.shape[1]

				def to_grayscale(__a  :					Optional[Any]			,		__a  :					List[Any]			,		__a  :					Any		):
								return 0.2_1_2_6 * red + 0.5_8_7 * green + 0.1_1_4 * blue

				def normalize(__a  :					List[Any]		):
								return min(__a			,		255		)

				for i in range(__a		):
								for j in range(__a		):
												a__					   =		int(to_grayscale(*img[i][j]		)		)
												a__					   =		[
												    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()






import math
from decimal import Decimal, getcontext

def       A_   (						__a  :					int = 4_000_000		):

				"""simple docstring"""

				try:
								a__					   =		int(__a		)
				except (TypeError, ValueError):
								raise TypeError("""Parameter n must be int or castable to int."""		)
				if n <= 0:
								raise ValueError("""Parameter n must be greater than or equal to one."""		)
				a__					   =		100
				a__					   =		(Decimal(5		) ** Decimal(0.5		) + 1) / Decimal(2		)

				a__					   =		(math.floor(math.log(n * (phi + 2)			,		__a		) - 1		) // 3) * 3 + 2
				a__					   =		Decimal(round(phi ** Decimal(index + 1		)		)		) / (phi + 2)
				a__					   =		num // 2
				return int(__a		)


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

