




'''simple docstring'''






import math

def       __lowerCAmelCase (   snake_case__						):

			if 1 < number < 4:
						# 2 and 3 are primes
						return True
			elif number < 2 or number % 2 == 0 or number % 3 == 0:
						# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
						return False

			# All primes number are in format of 6k +/- 1
			for i in range(5 ,				int(math.sqrt(snake_case__						) + 1						) ,				6						):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True

def       __lowerCAmelCase (   snake_case__ = 600_851_475_143						):

			try:
						__UpperCamelCase				:      int									=       int(snake_case__						)
			except (TypeError, ValueError):
						raise TypeError("Parameter n must be int or castable to int."						)
			if n <= 0:
						raise ValueError("Parameter n must be greater than or equal to one."						)
			__UpperCamelCase				:      int									=       0
			if is_prime(snake_case__						):
						return n
			while n % 2 == 0:
						n //= 2
			if is_prime(snake_case__						):
						return n
			for i in range(3 ,				int(math.sqrt(snake_case__						)						) + 1 ,				2						):
						if n % i == 0:
									if is_prime(n // i						):
												__UpperCamelCase				:      int									=       n // i
												break
									elif is_prime(snake_case__						):
												__UpperCamelCase				:      List[Any]									=       i
			return max_number


if __name__ == "__main__":
				print(f'{solution() = }')









'''simple docstring'''






import math
import os

import cva
import numpy as np

_lowerCAmelCase				     = 255.0

def       __lowerCAmelCase (   snake_case__ ,				snake_case__						):
			__UpperCamelCase				:      Dict									=       np.mean((original - contrast) ** 2						)
			if mse == 0:
						return 100

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

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

			__UpperCamelCase				:      Dict									=       cva.imread(os.path.join(snake_case__ ,				"image_data/PSNR-example-base.png"						)						)
			__UpperCamelCase				:      Optional[Any]									=       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()



