
import math
import os

import cva
import numpy as np

lowercase__							:							str													=     255.0




def 		A_	(							snake_case							:				float	, snake_case							:				float	) ->      float:



						'''simple docstring'''

						__UpperCamelCase       					=     np.mean((original - contrast) ** 2	)
						if mse == 0:
												return 100

						return 20 * math.logaa(PIXEL_MAX / math.sqrt(snake_case	)	)




def 		A_	(							) ->      None:



						'''simple docstring'''

						__UpperCamelCase       					=     os.path.dirname(os.path.realpath(snake_case	)	)
						# Loading images (original image and compressed image)
						__UpperCamelCase       					=     cva.imread(os.path.join(snake_case	, '''image_data/original_image.png'''	)	)
						__UpperCamelCase       					=     cva.imread(os.path.join(snake_case	, '''image_data/compressed_image.png'''	)	, 1	)

						__UpperCamelCase       					=     cva.imread(os.path.join(snake_case	, '''image_data/PSNR-example-base.png'''	)	)
						__UpperCamelCase       					=     cva.imread(
						    os.path.join(snake_case	, '''image_data/PSNR-example-comp-10.jpg'''	)	, 1	)

						# Value expected: 29.73dB
						print('''-- First Test --'''	)
						print(f"PSNR value is {peak_signal_to_noise_ratio(snake_case	, snake_case	)} dB"	)

						# # Value expected: 31.53dB (Wikipedia Example)
						print('''\n-- Second Test --'''	)
						print(f"PSNR value is {peak_signal_to_noise_ratio(snake_case	, snake_case	)} dB"	)


if __name__ == "__main__":
				main()






def 		A_	(							snake_case							:				Union[str, Any]	, snake_case							:				Tuple	, snake_case							:				Optional[Any]	) ->      Union[str, Any]:



						'''simple docstring'''

						assert b != 0, "This cannot accept modulo that is == 0"
						if n == 0:
												return 1

						if n % 2 == 1:
												return (bin_exp_mod(snake_case	, n - 1	, snake_case	) * a) % b

						__UpperCamelCase       					=     bin_exp_mod(snake_case	, n / 2	, snake_case	)
						return (r * r) % b


if __name__ == "__main__":
				try:
								lowercase__							:							Dict													=     int(input("Enter Base : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Power : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Modulo : ").strip())
				except ValueError:
								print("Invalid literal for integer")

				print(bin_exp_mod(BASE, POWER, MODULO))




