



from PIL import Image







def    _snake_case (       __snake_case					,  __snake_case    )     ->     Image:






      '''simple docstring'''







      def brightness(__snake_case    ) -> float:
            return 1_2_8 + level + (c - 1_2_8)

      if not -255.0 <= level <= 255.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, 100)
      brigt_img.save('''image_data/lena_brightness.png''', format='''png''')





def    _snake_case (       __snake_case					,  __snake_case					,  __snake_case    )     ->     list:






      '''simple docstring'''







      UpperCAmelCase_  :	Any				      =		len(__snake_case    )
      UpperCAmelCase_  :	Tuple				      =		[[0] * n for i in range(__snake_case    )]
      for i in range(__snake_case    ):
            UpperCAmelCase_  :	Optional[Any]				      =		y_points[i]

      for i in range(2					,  __snake_case    ):
            for j in range(__snake_case					,  __snake_case    ):
                  UpperCAmelCase_  :	int				      =		(
                      (xa - x_points[j - i + 1]) * q[j][i - 1]
                      - (xa - x_points[j]) * q[j - 1][i - 1]
                  ) / (x_points[j] - x_points[j - i + 1])

      return [q[n - 1][n - 1], q]


if __name__ == "__main__":
   import doctest

   doctest.testmod()
