

from __future__ import annotations
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int )				-> tuple[float, float]:





    '''simple docstring'''






    assert (
        c % greatest_common_divisor(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ ) == 0
    )  # greatest_common_divisor(a,b) function implemented below
    ((A__) ,		(A__) ,		(A__))        =  extended_gcd(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )  # extended_gcd(a,b) function implemented below
    A__        =  c / d
    return (r * x, r * y)
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int = 2 )				-> None:





    '''simple docstring'''






    ((A__) ,		(A__))        =  diophantine(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )  # Initial value
    A__        =  greatest_common_divisor(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )
    A__        =  a // d
    A__        =  b // d

    for i in range(SCREAMING_SNAKE_CASE__ ):
        A__        =  xa + i * q
        A__        =  ya - i * p
        print(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int )				-> int:





    '''simple docstring'''






    if a < b:
        A__ ,		A__        =  b, a

    while a % b != 0:
        A__ ,		A__        =  b, a % b

    return b
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int       ,     SCREAMING_SNAKE_CASE__     :      int )				-> tuple[int, int, int]:





    '''simple docstring'''






    assert a >= 0 and b >= 0

    if b == 0:
        A__ ,		A__ ,		A__        =  a, 1, 0
    else:
        ((A__) ,		(A__) ,		(A__))        =  extended_gcd(SCREAMING_SNAKE_CASE__       ,     a % b )
        A__        =  q
        A__        =  p - q * (a // b)

    assert a % d == 0 and b % d == 0
    assert d == a * x + b * y

    return (d, x, y)


if __name__ == "__main__":
     from doctest import testmod

     testmod(name="diophantine", verbose=True)
     testmod(name="diophantine_all_soln", verbose=True)
     testmod(name="extended_gcd", verbose=True)
     testmod(name="greatest_common_divisor", verbose=True)




import math
import os

import cva
import numpy as np

lowercase_									=    255.0
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      float       ,     SCREAMING_SNAKE_CASE__     :      float )				-> float:





    '''simple docstring'''






    A__        =  np.mean((original - contrast) ** 2 )
    if mse == 0:
        return 100

    return 20 * math.logaa(PIXEL_MAX / math.sqrt(SCREAMING_SNAKE_CASE__ ) )
def 		_snake_case(       )				-> None:





    '''simple docstring'''






    A__        =  os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE__ ) )
    # Loading images (original image and compressed image)
    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/original_image.png' ) )
    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/compressed_image.png' )       ,     1 )

    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/PSNR-example-base.png' ) )
    A__        =  cva.imread(
        os.path.join(SCREAMING_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(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )} dB' )

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


if __name__ == "__main__":
     main()

