






from timeit import timeit



def  a__ (__lowercase							:int   )		-> int:
				if number < 0:
								raise ValueError('''the value of input must not be negative'''   )
				_A	:				Any   =      0
				while number:
								number &= number - 1
								result += 1
				return result



def  a__ (__lowercase							:int   )		-> int:
				if number < 0:
								raise ValueError('''the value of input must not be negative'''   )
				_A	:				int   =      0
				while number:
								if number % 2 == 1:
												result += 1
								number >>= 1
				return result



def  a__ ()		-> None:

				def do_benchmark(__lowercase							:int   ) -> None:
								_A	:				Tuple   =      '''import __main__ as z'''
								print(f"""Benchmark when {number = }:"""   )
								print(f"""{get_set_bits_count_using_modulo_operator(__lowercase   ) = }"""   )
								_A	:				List[Any]   =      timeit('''z.get_set_bits_count_using_modulo_operator(25)'''					,  setup=__lowercase   )
								print(f"""timeit() runs in {timing} seconds"""   )
								print(f"""{get_set_bits_count_using_brian_kernighans_algorithm(__lowercase   ) = }"""   )
								_A	:				Optional[int]   =      timeit(
								    '''z.get_set_bits_count_using_brian_kernighans_algorithm(25)'''					,  setup=__lowercase					,  )
								print(f"""timeit() runs in {timing} seconds"""   )

				for number in (25, 37, 58, 0):
								do_benchmark(__lowercase   )
								print()


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	benchmark()











from PIL import Image



def  a__ (__lowercase							:Image					,  __lowercase							:float   )		-> Image:

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


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



