






'''simple docstring'''







from timeit import timeit





def 				SCREAMING_SNAKE_CASE_ (UpperCamelCase   )   -> int:
							if number < 0:
														raise ValueError("""the value of input must not be negative"""   )
							lowerCamelCase__      :			Optional[int] 						= 0
							while number:
														number &= number - 1
														result += 1
							return result





def 				SCREAMING_SNAKE_CASE_ (UpperCamelCase   )   -> int:
							if number < 0:
														raise ValueError("""the value of input must not be negative"""   )
							lowerCamelCase__      :			Optional[Any] 						= 0
							while number:
														if number % 2 == 1:
																					result += 1
														number >>= 1
							return result





def 				SCREAMING_SNAKE_CASE_ ()   -> None:

							def do_benchmark(UpperCamelCase   ) -> None:
														lowerCamelCase__      :			Union[str, Any] 						= """import __main__ as z"""
														print(f'''Benchmark when {number = }:'''   )
														print(f'''{get_set_bits_count_using_modulo_operator(UpperCamelCase   ) = }'''   )
														lowerCamelCase__      :			Union[str, Any] 						= 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   ) = }'''   )
														lowerCamelCase__      :			int 						= 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'''







_A			:    List[str]					  ='''0.21.0'''

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
			from .utils import rich

