






import copy
import os

import cva
import numpy as np
from matplotlib import pyplot as plt







class  _lowercase   :
      def __init__(     self   ):
       snake_case__  :    Optional[Any]							       =""""""
       snake_case__  :    List[str]							       =""""""
       snake_case__  :    Dict							       =[]
       snake_case__  :    Tuple							       =0
       snake_case__  :    Optional[int]							       =2_5_6
       snake_case__  :    str							       =0
       snake_case__  :    Any							       =0
       snake_case__  :    Tuple							       =0
       snake_case__  :    List[Any]							       =0
      def 						lowercase__					(     self				,			a   ):
       snake_case__  :    Union[str, Any]							       =cva.imread(a				,			0   )
       snake_case__  :    Optional[int]							       =copy.deepcopy(self.img   )
       snake_case__       ,   snake_case__       ,   snake_case__  :    Optional[Any]							       =plt.hist(self.img.ravel()				,			2_5_6				,			[0, 2_5_6]				,			label="""x"""   )
       snake_case__  :    Any							       =np.sum(a   )
       for i in range(len(a   )   ):
        snake_case__  :    Any							       =x[i] / self.k
        self.sk += prk
        snake_case__  :    Union[str, Any]							       =(self.L - 1) * self.sk
        if self.rem != 0:
         snake_case__  :    List[Any]							       =int(last % last   )
        snake_case__  :    str							       =int(last + 1 if self.rem >= 0.5 else last   )
        self.last_list.append(a   )
        snake_case__  :    Tuple							       =int(np.ma.count(self.img   ) / self.img[1].size   )
        snake_case__  :    List[Any]							       =self.img[1].size
       for i in range(self.number_of_cols   ):
        for j in range(self.number_of_rows   ):
         snake_case__  :    Any							       =self.img[j][i]
         if num != self.last_list[num]:
          snake_case__  :    Union[str, Any]							       =self.last_list[num]
       cva.imwrite("""output_data/output.jpg"""				,			self.img   )
      def 						lowercase__					(     self   ):
       plt.hist(self.img.ravel()				,			2_5_6				,			[0, 2_5_6]   )



      def 						lowercase__					(     self   ):
       cva.imshow("""Output-Image"""				,			self.img   )
       cva.imshow("""Input-Image"""				,			self.original_image   )
       cva.waitKey(5_0_0_0   )
       cva.destroyAllWindows()


if __name__ == "__main__":
       __lowerCamelCase	:		Optional[Any]										=   os.path.join(os.path.basename(__file__), """image_data/input.jpg""")
       __lowerCamelCase	:		Union[str, Any]										=   ConstantStretch()
       stretcher.stretch(file_path)
       stretcher.plot_histogram()
       stretcher.show_image()













def 			A__							(      _a  :					list	):





 '''simple docstring'''







 if len(_a	) <= 1:
  return [tuple(_a	)]

 snake_case__  :    Optional[int]							       =[]

 def generate(_a  :					int		,  _a  :					list	):
  if k == 1:
   res.append(tuple(arr[:]	)	)
   return

  generate(k - 1		,  _a	)

  for i in range(k - 1	):
   if k % 2 == 0:  # k is even
    snake_case__       ,   snake_case__  :    Dict							       =arr[k - 1], arr[i]
   else:  # k is odd
    snake_case__       ,   snake_case__  :    int							       =arr[k - 1], arr[0]
   generate(k - 1		,  _a	)

 generate(len(_a	)		,  _a	)
 return res


if __name__ == "__main__":
       __lowerCamelCase	:		Optional[int]										=   input("""Enter numbers separated by a comma:\n""").strip()
       __lowerCamelCase	:		Any										=   [int(item) for item in user_input.split(""",""")]
       print(heaps(arr))





