



"""simple docstring"""





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        a__     (				lowerCAmelCase__				):
      return EnvironmentCommand()


class 				lowercase__       (   SCREAMING_SNAKE_CASE				):







       '''simple docstring'''


       @staticmethod
       def 					lowercase__    (							_UpperCAmelCase      :  ArgumentParser   )			->						Optional[int]:


             '''simple docstring'''




             UpperCAmelCase_      			=							parser.add_parser("env"   )
             download_parser.set_defaults(func=_UpperCAmelCase   )



       def 					lowercase__    (							self      :  Optional[int]   )			->						List[str]:


             '''simple docstring'''




             UpperCAmelCase_      			=							huggingface_hub.__version__

             UpperCAmelCase_      			=							"not installed"
             UpperCAmelCase_      			=							"NA"
             if is_torch_available():
                   import torch

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

             UpperCAmelCase_      			=							"not installed"
             if is_transformers_available():
                   import transformers

                   UpperCAmelCase_      			=							transformers.__version__

             UpperCAmelCase_      			=							"not installed"
             if is_accelerate_available():
                   import accelerate

                   UpperCAmelCase_      			=							accelerate.__version__

             UpperCAmelCase_      			=							"not installed"
             if is_xformers_available():
                   import xformers

                   UpperCAmelCase_      			=							xformers.__version__

             UpperCAmelCase_      			=							{
                 "`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(_UpperCAmelCase   )   )

             return info







       @staticmethod
       def 					lowercase__    (							_UpperCAmelCase      :  List[Any]   )			->						str:


             '''simple docstring'''




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









"""simple docstring"""





from maths.prime_check import is_prime
def        a__     (				lowerCAmelCase__				):
      if not isinstance(lowerCAmelCase__     ,      lowerCAmelCase__				):
            UpperCAmelCase_      			=							f"""Input value of [number={number}] must be an integer"""
            raise TypeError(lowerCAmelCase__				)
      if is_prime(lowerCAmelCase__				) and is_prime(number + 2				):
            return number + 2
      else:
            return -1


if __name__ == "__main__":
  import doctest

  doctest.testmod()




