



"""simple docstring"""
from timeit import timeit

def       _snake_case						(						UpperCamelCase						:		int						):
 if number < 0:
  raise ValueError("""the value of input must not be negative"""						)
 UpperCAmelCase	:					Tuple	=	0
 while number:
  number &= number - 1
  result += 1
 return result

def       _snake_case						(						UpperCamelCase						:		int						):
 if number < 0:
  raise ValueError("""the value of input must not be negative"""						)
 UpperCAmelCase	:					Dict	=	0
 while number:
  if number % 2 == 1:
   result += 1
  number >>= 1
 return result

def       _snake_case						(						):

 def do_benchmark(UpperCamelCase						:		int						) -> None:
  UpperCAmelCase	:					Dict	=	"""import __main__ as z"""
  print(F"Benchmark when {number = }:"						)
  print(F"{get_set_bits_count_using_modulo_operator(UpperCamelCase						) = }"						)
  UpperCAmelCase	:					List[str]	=	timeit("""z.get_set_bits_count_using_modulo_operator(25)"""			,		setup=UpperCamelCase						)
  print(F"timeit() runs in {timing} seconds"						)
  print(F"{get_set_bits_count_using_brian_kernighans_algorithm(UpperCamelCase						) = }"						)
  UpperCAmelCase	:					str	=	timeit(
      """z.get_set_bits_count_using_brian_kernighans_algorithm(25)"""			,		setup=UpperCamelCase			,		)
  print(F"timeit() runs in {timing} seconds"						)

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


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()





"""simple docstring"""
from collections.abc import Callable

import numpy as np

def       _snake_case						(						UpperCamelCase						:		Callable			,		UpperCamelCase						:		float			,		UpperCamelCase						:		float			,		UpperCamelCase						:		float			,		UpperCamelCase						:		float						):
 UpperCAmelCase	:					Any	=	int(np.ceil((x_end - xa) / step_size						)						)
 UpperCAmelCase	:					Optional[Any]	=	np.zeros((n + 1,)						)
 UpperCAmelCase	:					Optional[int]	=	ya
 UpperCAmelCase	:					int	=	xa

 for k in range(UpperCamelCase						):
  UpperCAmelCase	:					Optional[int]	=	y[k] + step_size * ode_func(UpperCamelCase			,		y[k]						)
  UpperCAmelCase	:					Optional[int]	=	y[k] + (
      (step_size / 2) * (ode_func(UpperCamelCase			,		y[k]						) + ode_func(x + step_size			,		UpperCamelCase						))
  )
  x += step_size

 return y


if __name__ == "__main__":
      import doctest

      doctest.testmod()
