

from timeit import timeit







def _a (       SCREAMING_SNAKE_CASE		:			Any		)    ->    List[str]:

 """simple docstring"""






 if number < 0:
  raise ValueError('the value of input must not be negative'		)
 __lowerCAmelCase:   Optional[Any]   	=      0
 while number:
  number &= number - 1
  result += 1
 return result







def _a (       SCREAMING_SNAKE_CASE		:			List[Any]		)    ->    int:

 """simple docstring"""






 if number < 0:
  raise ValueError('the value of input must not be negative'		)
 __lowerCAmelCase:   Union[str, Any]   	=      0
 while number:
  if number % 2 == 1:
   result += 1
  number >>= 1
 return result







def _a (       )    ->    List[str]:

 """simple docstring"""






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

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


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  benchmark()






"""simple docstring"""


UpperCAmelCase__     						=  {
    """meter""": """m""",
    """kilometer""": """km""",
    """megametre""": """Mm""",
    """gigametre""": """Gm""",
    """terametre""": """Tm""",
    """petametre""": """Pm""",
    """exametre""": """Em""",
    """zettametre""": """Zm""",
    """yottametre""": """Ym""",
}
# Exponent of the factor(meter)
UpperCAmelCase__     						=  {
    """m""": 0,
    """km""": 3,
    """Mm""": 6,
    """Gm""": 9,
    """Tm""": 1_2,
    """Pm""": 1_5,
    """Em""": 1_8,
    """Zm""": 2_1,
    """Ym""": 2_4,
}






def 			__UpperCAmelCase    (	lowercase      ,lowercase      ,lowercase						):







  """simple docstring"""
  _UpperCAmelCase         =					from_type.lower().strip("""s"""						)
  _UpperCAmelCase         =					to_type.lower().strip("""s"""						)

  _UpperCAmelCase         =					UNIT_SYMBOL.get(lowercase      ,lowercase						)
  _UpperCAmelCase         =					UNIT_SYMBOL.get(lowercase      ,lowercase						)

  if from_sanitized not in METRIC_CONVERSION:
    _UpperCAmelCase         =					(
        f'''Invalid \'from_type\' value: {from_type!r}.\n'''
        f'''Conversion abbreviations are: {", ".join(lowercase						)}'''
    )
    raise ValueError(lowercase						)
  if to_sanitized not in METRIC_CONVERSION:
    _UpperCAmelCase         =					(
        f'''Invalid \'to_type\' value: {to_type!r}.\n'''
        f'''Conversion abbreviations are: {", ".join(lowercase						)}'''
    )
    raise ValueError(lowercase						)
  _UpperCAmelCase         =					METRIC_CONVERSION[from_sanitized]
  _UpperCAmelCase         =					METRIC_CONVERSION[to_sanitized]
  _UpperCAmelCase         =					1

  if from_exponent > to_exponent:
    _UpperCAmelCase         =					from_exponent - to_exponent
  else:
    _UpperCAmelCase         =					-(to_exponent - from_exponent)

  return value * pow(10      ,lowercase						)


if __name__ == "__main__":
    from doctest import testmod

    testmod()
