





'''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  _lowerCAmelCase    (					lowerCamelCase_      :	Optional[int]					):
			return EnvironmentCommand()






class 				__lowercase							(   __lowerCamelCase    ):







	'''simple docstring'''

	@staticmethod
	def     _UpperCAmelCase  (_lowerCamelCase			)				->				int:







				'''simple docstring'''





				__lowercase					    =				parser.add_parser('''env'''			)
				download_parser.set_defaults(func=lowerCamelCase__			)


	def     _UpperCAmelCase  (self			)				->				Any:







				'''simple docstring'''





				__lowercase					    =				huggingface_hub.__version__

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

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

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

							__lowercase					    =				transformers.__version__

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

							__lowercase					    =				accelerate.__version__

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

							__lowercase					    =				xformers.__version__

				__lowercase					    =				{
				    '''`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(lowerCamelCase__			)			)

				return info


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







				'''simple docstring'''





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








import random

class    _lowercase				:

   @staticmethod
   def     UpperCamelCase					(				lowerCamelCase__	:    str       ) ->			tuple[list[int], list[int]]:
         """simple docstring"""





         A_							       =		[ord(lowerCamelCase__       ) for i in text]
         A_							       =		[]
         A_							       =		[]
         for i in plain:
               A_							       =		random.randint(1			,						3_0_0       )
               A_							       =		(i + k) * k
               cipher.append(lowerCamelCase__       )
               key.append(lowerCamelCase__       )
         return cipher, key





   @staticmethod
   def     UpperCamelCase					(				lowerCamelCase__	:    list[int]			,						lowerCamelCase__	:    list[int]       ) ->			str:
         """simple docstring"""





         A_							       =		[]
         for i in range(len(lowerCamelCase__       )       ):
               A_							       =		int((cipher[i] - (key[i]) ** 2) / key[i]       )
               plain.append(chr(lowerCamelCase__       )       )
         return "".join(lowerCamelCase__       )


if __name__ == "__main__":
      __lowercase      ,				__lowercase				      =						Onepad().encrypt("""Hello""")
      print(c, k)
      print(Onepad().decrypt(c, k))





