


"""simple docstring"""







import math




def   UpperCAmelCase__			(lowerCAmelCase_    ,		lowerCAmelCase_  ):




					'''simple docstring'''


					return math.pow(UpperCamelCase__    ,		2  ) - a




def   UpperCAmelCase__			(lowerCAmelCase_  ):




					'''simple docstring'''


					return 2 * x




def   UpperCAmelCase__			(lowerCAmelCase_  ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		  =							2.0

					while start <= a:
										__SCREAMING_SNAKE_CASE		  =							math.pow(UpperCamelCase__    ,		2  )

					return start




def   UpperCAmelCase__			(lowerCAmelCase_    ,		lowerCAmelCase_ = 9999    ,		lowerCAmelCase_ = 0.00000000000001  ):




					'''simple docstring'''


					if a < 0:
										raise ValueError("math domain error"  )

					__SCREAMING_SNAKE_CASE		  =							get_initial_point(UpperCamelCase__  )

					for _ in range(UpperCamelCase__  ):
										__SCREAMING_SNAKE_CASE		  =							value
										__SCREAMING_SNAKE_CASE		  =							value - fx(UpperCamelCase__    ,		UpperCamelCase__  ) / fx_derivative(UpperCamelCase__  )
										if abs(prev_value - value  ) < tolerance:
															return value

					return value


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

		testmod()




"""simple docstring"""

from PIL import Image


def lowerCAmelCase_   (					UpperCamelCase__						:			Image					, UpperCamelCase__						:			int			):






 """simple docstring"""







 __lowercase						=						(259 * (level + 255)) / (255 * (259 - level))

 def contrast(UpperCamelCase__						:			int			) -> int:
  return int(128 + factor * (c - 128)			)

 return img.point(UpperCamelCase__			)


if __name__ == "__main__":
       # Load image
       with Image.open("image_data/lena.jpg") as img:
              # Change contrast to 170
              UpperCAmelCase__					=change_contrast(img, 170)
              cont_img.save("image_data/lena_high_contrast.png", format="png")
