"""simple docstring"""


import math
import os

import cva
import numpy as np

lowerCAmelCase_:       int			     =       255.0







def        __a (		A     ,					A   ):






     '''simple docstring'''



     lowercase__								=				np.mean((original - contrast) ** 2   )
     if mse == 0:
          return 1_00

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







def        __a (		):






     '''simple docstring'''



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

     lowercase__								=				cva.imread(os.path.join(A     ,					"image_data/PSNR-example-base.png"   )   )
     lowercase__								=				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()





"""simple docstring"""


def        __a (		A     ,					A   ):






     '''simple docstring'''



     lowercase__								=				sorted(A     ,					key=lambda A   : value[2]     ,					reverse=A   )

     # Create a list of size equal to the maximum deadline
     # and initialize it with -1
     lowercase__								=				max(A     ,					key=lambda A   : value[1]   )[1]
     lowercase__								=				[-1] * max_deadline

     # Finding the maximum profit and the count of jobs
     lowercase__								=				0
     lowercase__								=				0
     for job in jobs:
          # Find a free time slot for this job
          # (Note that we start from the last possible slot)
          for i in range(job[1] - 1     ,					-1     ,					-1   ):
               if time_slots[i] == -1:
                    lowercase__								=				job[0]
                    count += 1
                    max_profit += job[2]
                    break
     return [count, max_profit]


if __name__ == "__main__":
 import doctest

 doctest.testmod()




