






"""simple docstring"""



from __future__ import annotations

# Define the Gravitational Constant G and the function
__A		:	str      =		6.6743E-11  # unit of G : m^3 * kg^-1 * s^-2



def 						lowercase   (    __snake_case    :			float		, __snake_case    :			float		, __snake_case    :			float		, __snake_case    :			float     ):
		lowercase_			:			Dict								=       mass_a * mass_a

		if (force, mass_a, mass_a, distance).count(0     ) != 1:
				raise ValueError('''One and only one argument must be 0'''     )
		if force < 0:
				raise ValueError('''Gravitational force can not be negative'''     )
		if distance < 0:
				raise ValueError('''Distance can not be negative'''     )
		if mass_a < 0 or mass_a < 0:
				raise ValueError('''Mass can not be negative'''     )
		if force == 0:
				lowercase_			:			Optional[int]								=       GRAVITATIONAL_CONSTANT * product_of_mass / (distance**2)
				return {"force": force}
		elif mass_a == 0:
				lowercase_			:			Optional[int]								=       (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
				return {"mass_1": mass_a}
		elif mass_a == 0:
				lowercase_			:			Dict								=       (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
				return {"mass_2": mass_a}
		elif distance == 0:
				lowercase_			:			Optional[Any]								=       (GRAVITATIONAL_CONSTANT * product_of_mass / (force)) ** 0.5
				return {"distance": distance}
		raise ValueError('''One and only one argument must be 0'''     )


# Run doctest
if __name__ == "__main__":
						import doctest

						doctest.testmod()











"""simple docstring"""



import math
import os

import cva
import numpy as np

__A		:	int      =		255.0



def 						lowercase   (    __snake_case    :			float		, __snake_case    :			float     ):
		lowercase_			:			Any								=       np.mean((original - contrast) ** 2     )
		if mse == 0:
				return 1_0_0

		return 2_0 * math.logaa(PIXEL_MAX / math.sqrt(__snake_case     )     )



def 						lowercase   (    ):
		lowercase_			:			Any								=       os.path.dirname(os.path.realpath(__snake_case     )     )
		# Loading images (original image and compressed image)
		lowercase_			:			Union[str, Any]								=       cva.imread(os.path.join(__snake_case		, '''image_data/original_image.png'''     )     )
		lowercase_			:			List[Any]								=       cva.imread(os.path.join(__snake_case		, '''image_data/compressed_image.png'''     )		, 1     )

		lowercase_			:			Tuple								=       cva.imread(os.path.join(__snake_case		, '''image_data/PSNR-example-base.png'''     )     )
		lowercase_			:			List[str]								=       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()



