





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



def      __lowerCamelCase   (							a_     :		int							)			->      int:






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



def      __lowerCamelCase   (							a_     :		int							)			->      int:






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



def      __lowerCamelCase   (							)			->      None:






      def do_benchmark(a_     :		int							) -> None:
            __SCREAMING_SNAKE_CASE   :Dict						=  '''import __main__ as z'''
            print(f'''Benchmark when {number = }:'''							)
            print(f'''{get_set_bits_count_using_modulo_operator(SCREAMING_SNAKE_CASE__							) = }'''							)
            __SCREAMING_SNAKE_CASE   :List[Any]						=  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__							) = }'''							)
            __SCREAMING_SNAKE_CASE   :str						=  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()


import platform
from argparse import ArgumentParser

import huggingface_hub

from .. import __version__ as version
from ..utils import is_accelerate_available, is_torch_available, is_transformers_available, is_xformers_available
from . import BaseDiffusersCLICommand
def 						_snake_case(    SCREAMING_SNAKE_CASE__			:	Union[str, Any]      )							->      Union[str, Any]:





    '''simple docstring'''






    return EnvironmentCommand()


class  A						(							_UpperCAmelCase ):







    """simple docstring"""





    @staticmethod
    def 						snake_case__     (      lowercase_ :       ArgumentParser		)->    Dict:





        '''simple docstring'''







        A__          =   parser.add_parser('env'		)
        download_parser.set_defaults(func=lowercase_		)


    def 						snake_case__     (      self :       List[Any]		)->    List[str]:





        '''simple docstring'''







        A__          =   huggingface_hub.__version__

        A__          =   'not installed'
        A__          =   'NA'
        if is_torch_available():
            import torch

            A__          =   torch.__version__
            A__          =   torch.cuda.is_available()

        A__          =   'not installed'
        if is_transformers_available():
            import transformers

            A__          =   transformers.__version__

        A__          =   'not installed'
        if is_accelerate_available():
            import accelerate

            A__          =   accelerate.__version__

        A__          =   'not installed'
        if is_xformers_available():
            import xformers

            A__          =   xformers.__version__

        A__          =   {
            '`diffusers` version': version,
            'Platform': platform.platform(),
            'Python version': platform.python_version(),
            'PyTorch version (GPU?)': F'{pt_version} ({pt_cuda_available})',
            'Huggingface_hub version': hub_version,
            'Transformers version': transformers_version,
            'Accelerate version': accelerate_version,
            'xFormers version': xformers_version,
            'Using GPU in script?': '<fill in>',
            'Using distributed or parallel set-up in script?': '<fill in>',
        }

        print('\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n'		)
        print(self.format_dict(lowercase_		)		)

        return info


    @staticmethod
    def 						snake_case__     (      lowercase_ :       int		)->    Optional[Any]:





        '''simple docstring'''







        return "\n".join([F'- {prop}: {val}' for prop, val in d.items()]		) + "\n"

