

lowerCAmelCase__       = [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
lowerCAmelCase__       = [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
lowerCAmelCase__       = {
    0: "Sunday",
    1: "Monday",
    2: "Tuesday",
    3: "Wednesday",
    4: "Thursday",
    5: "Friday",
    6: "Saturday",
}
def      _lowerCAmelCase(	__A   ,       __A   ,       __A			):
  assert len(str(__A			)			) > 2, "year should be in YYYY format"
  assert 1 <= month <= 12, "month should be between 1 to 12"
  assert 1 <= day <= 31, "day should be between 1 to 31"

  # Doomsday algorithm:
  UpperCAmelCase					      =  year // 100
  UpperCAmelCase					      =  (5 * (century % 4) + 2) % 7
  UpperCAmelCase					      =  year % 100
  UpperCAmelCase					      =  centurian % 12
  UpperCAmelCase					      =  (
      (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
  ) % 7
  UpperCAmelCase					      =  (
      DOOMSDAY_NOT_LEAP[month - 1]
      if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
      else DOOMSDAY_LEAP[month - 1]
  )
  UpperCAmelCase					      =  (dooms_day + day - day_anchor) % 7
  return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
      import doctest

      doctest.testmod()






import copy
import os

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






class 						__magic_name__    :


 def __init__(						self		: Optional[int]    )    ->      Optional[Any]:
   UpperCAmelCase					      =  ""
   UpperCAmelCase					      =  ""
   UpperCAmelCase					      =  []
   UpperCAmelCase					      =  0
   UpperCAmelCase					      =  2_5_6
   UpperCAmelCase					      =  0
   UpperCAmelCase					      =  0
   UpperCAmelCase					      =  0
   UpperCAmelCase					      =  0


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


 def _UpperCamelCase	(						self		: str    )    ->      int:
   plt.hist(self.img.ravel()			,						2_5_6			,						[0, 2_5_6]    )


 def _UpperCamelCase	(						self		: Dict    )    ->      Optional[Any]:
   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__       = os.path.join(os.path.basename(__file__), "image_data/input.jpg")
      lowerCAmelCase__       = ConstantStretch()
      stretcher.stretch(file_path)
      stretcher.plot_histogram()
      stretcher.show_image()



