



"""simple docstring"""
import math
import os

import cva
import numpy as np

__a           =							2_55.0
def   A_    (     _lowercase,   _lowercase      ):







						'''simple docstring'''


						snake_case_					:Optional[int]		=     np.mean((original - contrast) ** 2      )
						if mse == 0:
												return 100

						return 20 * math.logaa(PIXEL_MAX / math.sqrt(_lowercase      )      )
def   A_    (     ):







						'''simple docstring'''


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

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

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


if __name__ == "__main__":
						main()





"""simple docstring"""
import doctest

import projectq
from projectq.ops import H, Measure
def   A_    (     _lowercase      ):







						'''simple docstring'''


						snake_case_					:Union[str, Any]		=     quantum_engine.allocate_qubit()
						H | qubit
						Measure | qubit
						return int(_lowercase      )


if __name__ == "__main__":
						doctest.testmod()

						# initialises a new quantum backend
						__a           =							projectq.MainEngine()

						# Generate a list of 10 random numbers
						__a           =							[get_random_number(quantum_engine) for _ in range(10)]

						# Flushes the quantum engine from memory
						quantum_engine.flush()

						print("Random numbers", random_numbers_list)
