

'''simple docstring'''
from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

_snake_case         =  typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
_snake_case         =  typing.Union[np.floataa, int, float]  # noqa: UP007







def  _A		(     snake_case		,							snake_case					)      ->     Optional[int]:
   return np.sqrt(np.sum((np.asarray(a__					) - np.asarray(a__					)) ** 2					)					)







def  _A		(     snake_case		,							snake_case					)      ->     Union[str, Any]:
   return sum((va - va) ** 2 for va, va in zip(a__		,							a__					)					) ** (1 / 2)


if __name__ == "__main__":







    def  _A		(     )      ->     str:
       from timeit import timeit

       print("Without Numpy"					)
       print(
           timeit(
               "euclidean_distance_no_np([1, 2, 3], [4, 5, 6])"		,							number=1_00_00		,							globals=globals()		,							)					)
       print("With Numpy"					)
       print(
           timeit(
               "euclidean_distance([1, 2, 3], [4, 5, 6])"		,							number=1_00_00		,							globals=globals()		,							)					)

    benchmark()






'''simple docstring'''
from timeit import timeit







def  _A		(     snake_case					)      ->     int:
   if number < 0:
      raise ValueError("the value of input must not be negative"					)
   _lowercase      :				Union[str, Any]      					=       0
   while number:
      number &= number - 1
      result += 1
   return result







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







def  _A		(     )      ->     None:

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

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


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()






