

"""simple docstring"""




def 	lowerCamelCase__	(   _a):
	SCREAMING_SNAKE_CASE				: Optional[int]			       =    1
	SCREAMING_SNAKE_CASE				: Optional[Any]			       =    0
	SCREAMING_SNAKE_CASE				: str			       =    1
	SCREAMING_SNAKE_CASE				: str			       =    1
	SCREAMING_SNAKE_CASE				: Optional[int]			       =    3
	SCREAMING_SNAKE_CASE				: Optional[Any]			       =    3
	SCREAMING_SNAKE_CASE				: Optional[int]			       =    limit
	SCREAMING_SNAKE_CASE				: List[Any]			       =    0

	SCREAMING_SNAKE_CASE				: List[str]			       =    ""
	while counter != decimal + 1:
		if 4 * q + r - t < n * t:
			result += str(_a)
			if counter == 0:
				result += "."

			if decimal == counter:
				break

			counter += 1
			SCREAMING_SNAKE_CASE				: Optional[Any]			       =    10 * (r - n * t)
			SCREAMING_SNAKE_CASE				: str			       =    ((10 * (3 * q + r)) // t) - 10 * n
			q *= 10
			SCREAMING_SNAKE_CASE				: Optional[int]			       =    nr
		else:
			SCREAMING_SNAKE_CASE				: Tuple			       =    (2 * q + r) * l
			SCREAMING_SNAKE_CASE				: Dict			       =    (q * (7 * k) + 2 + (r * l)) // (t * l)
			q *= k
			t *= l
			l += 2
			k += 1
			SCREAMING_SNAKE_CASE				: Optional[int]			       =    nn
			SCREAMING_SNAKE_CASE				: Tuple			       =    nr
	return result

def 	lowerCamelCase__	(   ):
	print(f"{calculate_pi(50) = }")
	import doctest

	doctest.testmod()


if __name__ == "__main__":
			main()


import math
import os

import cva
import numpy as np

a_         =      255.0

def 	lowerCamelCase__	(   _a							,     _a):
	SCREAMING_SNAKE_CASE				: Optional[int]			       =    np.mean((original - contrast) ** 2)
	if mse == 0:
		return 100

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

def 	lowerCamelCase__	(   ):
	SCREAMING_SNAKE_CASE				: List[Any]			       =    os.path.dirname(os.path.realpath(_a))
	# Loading images (original image and compressed image)
	SCREAMING_SNAKE_CASE				: Any			       =    cva.imread(os.path.join(_a							,     "image_data/original_image.png"))
	SCREAMING_SNAKE_CASE				: List[str]			       =    cva.imread(os.path.join(_a							,     "image_data/compressed_image.png")							,     1)

	SCREAMING_SNAKE_CASE				: List[Any]			       =    cva.imread(os.path.join(_a							,     "image_data/PSNR-example-base.png"))
	SCREAMING_SNAKE_CASE				: List[str]			       =    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()