



'''simple docstring'''


def 				__lowerCamelCase				(   A__    )       ->	int:






   """simple docstring"""
   UpperCamelCase					=  abs(A__    )
   UpperCamelCase					=  0
   while n > 0:
      res += n % 10
      n //= 10
   return res







def 				__lowerCamelCase				(   A__    )       ->	int:






   """simple docstring"""
   UpperCamelCase					=  abs(A__    )
   return n if n < 10 else n % 10 + sum_of_digits(n // 10    )







def 				__lowerCamelCase				(   A__    )       ->	int:






   """simple docstring"""
   return sum(int(A__    ) for c in str(abs(A__    )    )    )







def 				__lowerCamelCase				(   )       ->	None:






   """simple docstring"""
   from collections.abc import Callable
   from timeit import timeit

   def benchmark_a_function(A__    ,						A__    ) -> None:
      UpperCamelCase					=  F"""{func.__name__}({value})"""
      UpperCamelCase					=  timeit(F"""__main__.{call}"""    ,						setup='import __main__'    )
      print(F"""{call:56} = {func(A__    )} -- {timing:.4f} seconds"""    )

   for value in (262_144, 1_125_899_906_842_624, 1_267_650_600_228_229_401_496_703_205_376):
      for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
         benchmark_a_function(A__    ,						A__    )
      print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()






'''simple docstring'''


from PIL import Image







def 				__lowerCamelCase				(   A__    ,						A__    )       ->	Image:






   """simple docstring"""

   def brightness(A__    ) -> 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(A__    )


if __name__ == "__main__":
   # Load image
   with Image.open("image_data/lena.jpg") as img:
      # Change brightness to 100
      _lowerCamelCase	:       List[str]      	=	change_brightness(img, 100)
      brigt_img.save("image_data/lena_brightness.png", format="png")

