



'''simple docstring'''


from timeit import timeit







def 				__lowerCamelCase				(   A__    )       ->	int:






   """simple docstring"""
   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 				__lowerCamelCase				(   A__    )       ->	int:






   """simple docstring"""
   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 				__lowerCamelCase				(   )       ->	None:






   """simple docstring"""

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

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()






'''simple docstring'''


import math

class  SCREAMING_SNAKE_CASE :






    """simple docstring"""





    def __init__(  self      :					Union[str, Any]  ,						UpperCamelCase__      :					Optional[Any]=0 ):  # a graph with Node 0,1,...,N-1


       """simple docstring"""







       UpperCamelCase					=  n
       UpperCamelCase					=  [
           [math.inf for j in range(0  ,						UpperCamelCase__ )] for i in range(0  ,						UpperCamelCase__ )
       ]  # adjacency matrix for weight
       UpperCamelCase					=  [
           [math.inf for j in range(0  ,						UpperCamelCase__ )] for i in range(0  ,						UpperCamelCase__ )
       ]  # dp[i][j] stores minimum distance from i to j






    def  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Tuple ):


       """simple docstring"""







       UpperCamelCase					=  w






    def  A       (  self      :					str ):


       """simple docstring"""







       for k in range(0  ,						self.n ):
          for i in range(0  ,						self.n ):
             for j in range(0  ,						self.n ):
                UpperCamelCase					=  min(self.dp[i][j]  ,						self.dp[i][k] + self.dp[k][j] )






    def  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					str  ,						UpperCamelCase__      :					List[Any] ):


       """simple docstring"""







       return self.dp[u][v]


if __name__ == "__main__":
   _lowerCamelCase	:       List[str]      	=	Graph(5)
   graph.add_edge(0, 2, 9)
   graph.add_edge(0, 4, 10)
   graph.add_edge(1, 3, 5)
   graph.add_edge(2, 3, 7)
   graph.add_edge(3, 0, 10)
   graph.add_edge(3, 1, 2)
   graph.add_edge(3, 2, 1)
   graph.add_edge(3, 4, 6)
   graph.add_edge(4, 1, 3)
   graph.add_edge(4, 2, 4)
   graph.add_edge(4, 3, 9)
   graph.floyd_warshall()
   graph.show_min(1, 4)
   graph.show_min(0, 3)

