






"""simple docstring"""





from PIL import Image



def   a    (     __UpperCAmelCase      :    Tuple      ,   __UpperCAmelCase      :    Any  )    ->							Image:

						def brightness(__UpperCAmelCase      :    Optional[Any]  ) -> float:
												return 1_2_8 + level + (c - 1_2_8)

						if not -2_55.0 <= level <= 2_55.0:
												raise ValueError("""level must be between -255.0 (black) and 255.0 (white)"""  )
						return img.point(__snake_case  )


if __name__ == "__main__":
							# Load image
							with Image.open('image_data/lena.jpg') as img:
														# Change brightness to 100
														__lowerCamelCase							=  change_brightness(img, 1_00)
														brigt_img.save('image_data/lena_brightness.png', format='png')








"""simple docstring"""






def      _lowercase							(    __snake_case      )		->  float:
			return 10 - x * x


def      _lowercase							(    __snake_case   ,__snake_case      )		->  float:
			# Bolzano theory in order to find if there is a root between a and b
			if equation(__snake_case      ) * equation(__snake_case      ) >= 0:
						raise ValueError("Wrong space!"      )

			__lowerCAmelCase :    List[Any]				=			a
			while (b - a) >= 0.01:
						# Find middle point
						__lowerCAmelCase :    str				=			(a + b) / 2
						# Check if middle point is root
						if equation(__snake_case      ) == 0.0:
									break
						# Decide the side to repeat the steps
						if equation(__snake_case      ) * equation(__snake_case      ) < 0:
									__lowerCAmelCase :    List[Any]				=			c
						else:
									__lowerCAmelCase :    List[str]				=			c
			return c


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	print(bisection(-2, 5))
	print(bisection(0, 6))