


from timeit import timeit
def   _UpperCamelCase				(						lowerCAmelCase_   )						->int:
   if number < 0:
      raise ValueError("""the value of input must not be negative"""   )
   UpperCAmelCase							=     0
   while number:
      number &= number - 1
      result += 1
   return result
def   _UpperCamelCase				(						lowerCAmelCase_   )						->int:
   if number < 0:
      raise ValueError("""the value of input must not be negative"""   )
   UpperCAmelCase							=     0
   while number:
      if number % 2 == 1:
         result += 1
      number >>= 1
   return result
def   _UpperCamelCase				(						)						->None:

   def do_benchmark(lowerCAmelCase_   ) -> None:
      UpperCAmelCase							=     """import __main__ as z"""
      print(F"""Benchmark when {number = }:"""   )
      print(F"""{get_set_bits_count_using_modulo_operator(lowerCAmelCase_   ) = }"""   )
      UpperCAmelCase							=     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_   ) = }"""   )
      UpperCAmelCase							=     timeit(
          """z.get_set_bits_count_using_brian_kernighans_algorithm(25)"""  ,						setup=lowerCAmelCase_  ,						)
      print(F"""timeit() runs in {timing} seconds"""   )

   for number in (2_5, 3_7, 5_8, 0):
      do_benchmark(lowerCAmelCase_   )
      print()


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 benchmark()







def   _UpperCamelCase				(						lowerCAmelCase_  ,						lowerCAmelCase_   )						->int:
   return int((input_a, input_a).count(0   ) == 0   )
def   _UpperCamelCase				(						)						->None:
   assert and_gate(0  ,						0   ) == 0
   assert and_gate(0  ,						1   ) == 0
   assert and_gate(1  ,						0   ) == 0
   assert and_gate(1  ,						1   ) == 1


if __name__ == "__main__":
 test_and_gate()
 print(and_gate(1, 0))
 print(and_gate(0, 0))
 print(and_gate(0, 1))
 print(and_gate(1, 1))



