






import math
import os

import cva
import numpy as np

UpperCAmelCase__			 =	255.0







def 						a_      (__A							,					__A			)							->	Any:



					"""simple docstring"""
					__a				:	List[Any]			=				np.mean((original - contrast) ** 2			)
					if mse == 0:
										return 100

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







def 						a_      ()							->	List[str]:



					"""simple docstring"""
					__a				:	Any			=				os.path.dirname(os.path.realpath(_A			)			)
					# Loading images (original image and compressed image)
					__a				:	str			=				cva.imread(os.path.join(_A							,					"image_data/original_image.png"			)			)
					__a				:	Optional[Any]			=				cva.imread(os.path.join(_A							,					"image_data/compressed_image.png"			)							,					1			)

					__a				:	Optional[Any]			=				cva.imread(os.path.join(_A							,					"image_data/PSNR-example-base.png"			)			)
					__a				:	int			=				cva.imread(
					    os.path.join(_A							,					"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(_A							,					_A			)} dB'			)

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


if __name__ == "__main__":
			main()










def 						a_      (__A			)							->	list:



					"""simple docstring"""
					if len(__A			) <= 1:
										return data
					else:
										return [
										    *quick_sort([e for e in data[1:] if e <= data[0]]			),
										    data[0],
										    *quick_sort([e for e in data[1:] if e > data[0]]			),
										]


if __name__ == "__main__":
			import doctest

			doctest.testmod()





