






'''simple docstring'''



import copy
import os

import cva
import numpy as np
from matplotlib import pyplot as plt
class 				__SCREAMING_SNAKE_CASE							:




      def __init__(	self   )				->Tuple:



         '''simple docstring'''
         __a					  =     ''
         __a					  =     ''
         __a					  =     []
         __a					  =     0
         __a					  =     256
         __a					  =     0
         __a					  =     0
         __a					  =     0
         __a					  =     0




      def 			__UpperCamelCase				(	self			, lowerCamelCase   )				->int:



         '''simple docstring'''
         __a					  =     cva.imread(lowerCamelCase			, 0   )
         __a					  =     copy.deepcopy(self.img   )
         __a  ,      __a  ,      __a					  =     plt.hist(self.img.ravel()			, 256			, [0, 256]			, label='x'   )
         __a					  =     np.sum(lowerCamelCase   )
         for i in range(len(lowerCamelCase   )   ):
            __a					  =     x[i] / self.k
            self.sk += prk
            __a					  =     (self.L - 1) * self.sk
            if self.rem != 0:
               __a					  =     int(last % last   )
            __a					  =     int(last + 1 if self.rem >= 0.5 else last   )
            self.last_list.append(lowerCamelCase   )
            __a					  =     int(np.ma.count(self.img   ) / self.img[1].size   )
            __a					  =     self.img[1].size
         for i in range(self.number_of_cols   ):
            for j in range(self.number_of_rows   ):
               __a					  =     self.img[j][i]
               if num != self.last_list[num]:
                  __a					  =     self.last_list[num]
         cva.imwrite('output_data/output.jpg'			, self.img   )




      def 			__UpperCamelCase				(	self   )				->int:



         '''simple docstring'''
         plt.hist(self.img.ravel()			, 256			, [0, 256]   )






      def 			__UpperCamelCase				(	self   )				->List[Any]:



         '''simple docstring'''
         cva.imshow('Output-Image'			, self.img   )
         cva.imshow('Input-Image'			, self.original_image   )
         cva.waitKey(5000   )
         cva.destroyAllWindows()


if __name__ == "__main__":
 __UpperCamelCase   :							Dict         =   os.path.join(os.path.basename(__file__), """image_data/input.jpg""")
 __UpperCamelCase   :							int         =   ConstantStretch()
 stretcher.stretch(file_path)
 stretcher.plot_histogram()
 stretcher.show_image()







'''simple docstring'''



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						str     )	->      bool:

   """simple docstring"""
   if not all(x.isalpha() for x in string     ):
      raise ValueError('String must only contain alphabetic characters.'     )

   __a					  =     sorted(string.lower()     )
   return len(SCREAMING_SNAKE_CASE__     ) == len(set(SCREAMING_SNAKE_CASE__     )     )


if __name__ == "__main__":
 __UpperCamelCase   :							int         =   input("""Enter a string """).strip()

 __UpperCamelCase   :							Tuple         =   is_isogram(input_str)
 print(f"""{input_str} is {"an" if isogram else "not an"} isogram.""")