





'''simple docstring'''







def      _lowerCAmelCase		(		lowercase			)      ->      int:
			if number != int(snake_case_			):
						raise ValueError("""factorial() only accepts integral values"""			)
			if number < 0:
						raise ValueError("""factorial() not defined for negative values"""			)
			__lowerCAmelCase      		=       1
			for i in range(1      ,			number + 1			):
						value *= i
			return value





def      _lowerCAmelCase		(		lowercase			)      ->      int:
			if not isinstance(snake_case_      ,			snake_case_			):
						raise ValueError("""factorial() only accepts integral values"""			)
			if n < 0:
						raise ValueError("""factorial() not defined for negative values"""			)
			return 1 if n == 0 or n == 1 else n * factorial(n - 1			)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_a      :				Any											=					int(input("""Enter a positive integer: """).strip() or 0)
	print(f'factorial{n} is {factorial(n)}')






'''simple docstring'''







from cva import destroyAllWindows, imread, imshow, waitKey





def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      int:
			__lowerCAmelCase		, __lowerCAmelCase      		=       img.shape[0], img.shape[1]

			def to_grayscale(lowercase      ,			lowercase      ,			lowercase			):
						return 0.21_26 * red + 0.5_87 * green + 0.1_14 * blue

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

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

			return img


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

