'''simple docstring'''





import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_huggingface_suite,
    require_multi_gpu,
    require_single_gpu,
)
from accelerate.utils import patch_environment




@require_huggingface_suite
class        __A      ( unittest.TestCase	):



    def 					_lowercase						(self    :    Any ):
         UpperCAmelCase_           =   inspect.getfile(accelerate.test_utils )
         UpperCAmelCase_           =   os.path.sep.join(
             mod_file.split(os.path.sep )[:-1] + ["scripts", "external_deps", "test_metrics.py"] )

         from accelerate.test_utils.scripts.external_deps import test_metrics  # noqa: F401

         UpperCAmelCase_           =   test_metrics



    @require_cpu
    def 					_lowercase						(self    :    Union[str, Any] ):
         debug_launcher(self.test_metrics.main   ,			num_processes=1 )



    @require_cpu
    def 					_lowercase						(self    :    List[str] ):
         debug_launcher(self.test_metrics.main )



    @require_single_gpu
    def 					_lowercase						(self    :    Union[str, Any] ):
         self.test_metrics.main()






    @require_multi_gpu
    def 					_lowercase						(self    :    str ):
         print(f"""Found {torch.cuda.device_count()} devices.""" )
         UpperCAmelCase_           =   ['''torchrun''', f"""--nproc_per_node={torch.cuda.device_count()}""", self.test_file_path]
         with patch_environment(omp_num_threads=1 ):
              execute_subprocess_async(A_   ,			env=os.environ.copy() )









import string


def 			UpperCamelCase(  __UpperCamelCase							:		str ):
		for key in range(len(string.ascii_uppercase ) ):
				lowerCAmelCase_			:     List[Any]									= ''''''
				for symbol in message:
						if symbol in string.ascii_uppercase:
								lowerCAmelCase_			:     Optional[int]									= string.ascii_uppercase.find(__UpperCamelCase )
								lowerCAmelCase_			:     Optional[int]									= num - key
								if num < 0:
										lowerCAmelCase_			:     int									= num + len(string.ascii_uppercase )
								lowerCAmelCase_			:     int									= translated + string.ascii_uppercase[num]
						else:
								lowerCAmelCase_			:     Optional[int]									= translated + symbol
				print(f"""Decryption using Key #{key}: {translated}""" )


def 			UpperCamelCase(  ):
		lowerCAmelCase_			:     Dict									= input('''Encrypted message: ''' )
		lowerCAmelCase_			:     List[str]									= message.upper()
		decrypt(__UpperCamelCase )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()





