


"""simple docstring"""







from timeit import timeit




def      UpperCAmelCase__ (lowerCAmelCase_     ):




					'''simple docstring'''


					if number < 0:
										raise ValueError("the value of input must not be negative"     )
					__SCREAMING_SNAKE_CASE		     =       0
					while number:
										number &= number - 1
										result += 1
					return result




def      UpperCAmelCase__ (lowerCAmelCase_     ):




					'''simple docstring'''


					if number < 0:
										raise ValueError("the value of input must not be negative"     )
					__SCREAMING_SNAKE_CASE		     =       0
					while number:
										if number % 2 == 1:
															result += 1
										number >>= 1
					return result




def      UpperCAmelCase__ ():




					'''simple docstring'''


					def do_benchmark(lowerCAmelCase_     ) -> None:
										__SCREAMING_SNAKE_CASE		     =       'import __main__ as z'
										print(f"""Benchmark when {number = }:"""     )
										print(f"""{get_set_bits_count_using_modulo_operator(lowerCAmelCase__     ) = }"""     )
										__SCREAMING_SNAKE_CASE		     =       timeit("z.get_set_bits_count_using_modulo_operator(25)"						,		setup=lowerCAmelCase__     )
										print(f"""timeit() runs in {timing} seconds"""     )
										print(f"""{get_set_bits_count_using_brian_kernighans_algorithm(lowerCAmelCase__     ) = }"""     )
										__SCREAMING_SNAKE_CASE		     =       timeit(
										    "z.get_set_bits_count_using_brian_kernighans_algorithm(25)"						,		setup=lowerCAmelCase__						,		)
										print(f"""timeit() runs in {timing} seconds"""     )

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


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							benchmark()




"""simple docstring"""







from __future__ import annotations




def      UpperCAmelCase__ (lowerCAmelCase_     ):




					'''simple docstring'''


					if len(lowerCAmelCase_     ) < 2:
										raise ValueError("Monogons and Digons are not polygons in the Euclidean space"     )
					if any(i <= 0 for i in nums     ):
										raise ValueError("All values must be greater than 0"     )
					__SCREAMING_SNAKE_CASE		     =       nums.copy()
					copy_nums.sort()
					return copy_nums[-1] < sum(copy_nums[:-1]     )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
