"""simple docstring"""






from PIL import Image


def      UpperCAmelCase__			(							lowerCAmelCase__	:Image   ,						lowerCAmelCase__	:float						)					->       Image:
      '''simple docstring'''


      def brightness(lowerCAmelCase__	:int						) -> 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(lowerCAmelCase__						)


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




"""simple docstring"""






from __future__ import annotations


def      UpperCAmelCase__			(							lowerCAmelCase__	:dict   ,						lowerCAmelCase__	:str						)					->       set[str]:
      '''simple docstring'''


      lowercase				,				lowercase								=      set(lowerCAmelCase__						), [start]

      while stack:
            lowercase								=      stack.pop()
            explored.add(lowerCAmelCase__						)
            # Differences from BFS:
            # 1) pop last element instead of first one
            # 2) add adjacent elements to stack without exploring them
            for adj in reversed(graph[v]						):
                  if adj not in explored:
                        stack.append(lowerCAmelCase__						)
      return explored


__lowerCAmelCase       :			str   	={
    """A""": ["""B""", """C""", """D"""],
    """B""": ["""A""", """D""", """E"""],
    """C""": ["""A""", """F"""],
    """D""": ["""B""", """D"""],
    """E""": ["""B""", """F"""],
    """F""": ["""C""", """E""", """G"""],
    """G""": ["""F"""],
}

if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(depth_first_search(G, """A"""))



