





"""simple docstring"""





import logging
import os

from .state import PartialState





class        _lowerCamelCase      (       logging.LoggerAdapter ):


						@staticmethod
						def     snake_case_   (__a		) ->   Optional[int]:
								UpperCamelCase   =	PartialState()
								return not main_process_only or (main_process_only and state.is_main_process)




						def     snake_case_   (self   ,							__a   ,							__a   ,							*__a   ,							**__a		) ->   Union[str, Any]:
								if PartialState._shared_state == {}:
										raise RuntimeError(
										    "You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility."		)
								UpperCamelCase   =	kwargs.pop("main_process_only"   ,							__a		)
								UpperCamelCase   =	kwargs.pop("in_order"   ,							__a		)

								if self.isEnabledFor(__a		):
										if self._should_log(__a		):
												UpperCamelCase   ,				UpperCamelCase   =	self.process(__a   ,							__a		)
												self.logger.log(__a   ,							__a   ,							*__a   ,							**__a		)

										elif in_order:
												UpperCamelCase   =	PartialState()
												for i in range(state.num_processes		):
														if i == state.process_index:
																UpperCamelCase   ,				UpperCamelCase   =	self.process(__a   ,							__a		)
																self.logger.log(__a   ,							__a   ,							*__a   ,							**__a		)
														state.wait_for_everyone()



def       a__					(					_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE = None    ):




		"""simple docstring"""


		if log_level is None:
				UpperCamelCase   =	os.environ.get("ACCELERATE_LOG_LEVEL"  ,	_SCREAMING_SNAKE_CASE    )
		UpperCamelCase   =	logging.getLogger(_SCREAMING_SNAKE_CASE    )
		if log_level is not None:
				logger.setLevel(log_level.upper()    )
				logger.root.setLevel(log_level.upper()    )
		return MultiProcessAdapter(_SCREAMING_SNAKE_CASE  ,	{}    )













"""simple docstring"""





import string


def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


		for key in range(len(string.ascii_uppercase    )    ):
				UpperCamelCase   =	""
				for symbol in message:
						if symbol in string.ascii_uppercase:
								UpperCamelCase   =	string.ascii_uppercase.find(_SCREAMING_SNAKE_CASE    )
								UpperCamelCase   =	num - key
								if num < 0:
										UpperCamelCase   =	num + len(string.ascii_uppercase    )
								UpperCamelCase   =	translated + string.ascii_uppercase[num]
						else:
								UpperCamelCase   =	translated + symbol
				print(F"Decryption using Key #{key}: {translated}"    )


def       a__					(					):




		"""simple docstring"""


		UpperCamelCase   =	input("Encrypted message: "    )
		UpperCamelCase   =	message.upper()
		decrypt(_SCREAMING_SNAKE_CASE    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()






