


'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


a_   :      int				    =      {
    "configuration_vision_encoder_decoder": ["VisionEncoderDecoderConfig", "VisionEncoderDecoderOnnxConfig"]
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      str				    =      ["VisionEncoderDecoderModel"]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      Union[str, Any]				    =      ["TFVisionEncoderDecoderModel"]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      Union[str, Any]				    =      ["FlaxVisionEncoderDecoderModel"]

if TYPE_CHECKING:
 from .configuration_vision_encoder_decoder import VisionEncoderDecoderConfig, VisionEncoderDecoderOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_vision_encoder_decoder import VisionEncoderDecoderModel

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_vision_encoder_decoder import TFVisionEncoderDecoderModel

 try:
  if not is_flax_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_flax_vision_encoder_decoder import FlaxVisionEncoderDecoderModel

else:
 import sys

 a_   :      str				    =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





'''simple docstring'''






from timeit import timeit






def 		_A			(lowerCAmelCase__					:int						)				->					int:




     '''simple docstring'''



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






def 		_A			(lowerCAmelCase__					:int						)				->					int:




     '''simple docstring'''



     if number < 0:
          raise ValueError('the value of input must not be negative'						)
     _a      =							0
     while number:
          if number % 2 == 1:
               result += 1
          number >>= 1
     return result






def 		_A			()				->					None:




     '''simple docstring'''



     def do_benchmark(lowerCAmelCase__					:int						) -> None:
          _a      =							'import __main__ as z'
          print(f'Benchmark when {number = }:'						)
          print(f'{get_set_bits_count_using_modulo_operator(lowerCAmelCase__						) = }'						)
          _a      =							timeit('z.get_set_bits_count_using_modulo_operator(25)'			,  setup=lowerCAmelCase__						)
          print(f'timeit() runs in {timing} seconds'						)
          print(f'{get_set_bits_count_using_brian_kernighans_algorithm(lowerCAmelCase__						) = }'						)
          _a      =							timeit(
              'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'			,  setup=lowerCAmelCase__			,  )
          print(f'timeit() runs in {timing} seconds'						)

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 benchmark()

