






"""simple docstring"""
from PIL import Image






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):

	def brightness(snake_case__					) -> float:
		return 128 + level + (c - 128)

	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")









"""simple docstring"""
import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
_lowerCAmelCase         =							"."


if __name__ == "__main__":
							_lowerCAmelCase         =							os.path.join(REPO_PATH, "utils/documentation_tests.txt")
							_lowerCAmelCase         =							[]
							_lowerCAmelCase         =							[]
							with open(doctest_file_path) as fp:
														for line in fp:
																					_lowerCAmelCase         =							line.strip()
																					_lowerCAmelCase         =							os.path.join(REPO_PATH, line)
																					if not (os.path.isfile(path) or os.path.isdir(path)):
																												non_existent_paths.append(line)
																					all_paths.append(path)
							if len(non_existent_paths) > 0:
														_lowerCAmelCase         =							"\n".join(non_existent_paths)
														raise ValueError(F'`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}')
							if all_paths != sorted(all_paths):
														raise ValueError("Files in `utils/documentation_tests.txt` are not in alphabetical order.")

