


"""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__ (				__lowercase   )	->	Union[str, Any]:
				return EnvironmentCommand()




class snake_case      (  _UpperCamelCase):







		@staticmethod
		def  a_ (					a__      :       ArgumentParser		)       ->						Union[str, Any]:





						'''simple docstring'''







						_A					  =			parser.add_parser("env"		)
						download_parser.set_defaults(func=a__		)







		def  a_ (					self      :       List[Any]		)       ->						Any:





						'''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(a__		)		)

						return info







		@staticmethod
		def  a_ (					a__      :       Optional[Any]		)       ->						List[str]:





						'''simple docstring'''







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



"""simple docstring"""


def      a__ (				__lowercase     ,			__lowercase   )	->	int:
				while a != 0:
								_A  ,		_A					  =			b % a, a
				return b






def      a__ (				__lowercase     ,			__lowercase   )	->	int:
				if gcd(__lowercase     ,			__lowercase   ) != 1:
								_A					  =			f"""mod inverse of {a!r} and {m!r} does not exist"""
								raise ValueError(__lowercase   )
				_A  ,		_A  ,		_A					  =			1, 0, a
				_A  ,		_A  ,		_A					  =			0, 1, m
				while va != 0:
								_A					  =			ua // va
								_A  ,		_A  ,		_A  ,		_A  ,		_A  ,		_A					  =			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
				return ua % m