





"""simple docstring"""





import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


__A											=		[
    '''EAGER''',
    '''AOT_EAGER''',
    '''INDUCTOR''',
    '''NVFUSER''',
    '''AOT_NVFUSER''',
    '''AOT_CUDAGRAPHS''',
    '''OFI''',
    '''FX2TRT''',
    '''ONNXRT''',
    '''IPEX''',
]
def  __A   (_SCREAMING_SNAKE_CASE     ,   _SCREAMING_SNAKE_CASE=None     ,   _SCREAMING_SNAKE_CASE=None     ,   _SCREAMING_SNAKE_CASE=None			)					->Tuple:





  """simple docstring"""


  lowerCAmelCase__			:Optional[int]											=							True
  while ask_again:
    lowerCAmelCase__			:Tuple											=							input(_lowerCamelCase			)
    try:
      if default is not None and len(_lowerCamelCase			) == 0:
        return default
      return convert_value(_lowerCamelCase			) if convert_value is not None else result
    except Exception:
      if error_message is not None:
        print(_lowerCamelCase			)
def  __A   (_SCREAMING_SNAKE_CASE     ,   _SCREAMING_SNAKE_CASE=[]     ,   _SCREAMING_SNAKE_CASE=None     ,   _SCREAMING_SNAKE_CASE=0			)					->int:





  """simple docstring"""


  lowerCAmelCase__			:Union[str, Any]											=							BulletMenu(_lowerCamelCase     ,   _lowerCamelCase			)
  lowerCAmelCase__			:Dict											=							menu.run(default_choice=_lowerCamelCase			)
  return convert_value(_lowerCamelCase			) if convert_value is not None else result
def  __A   (_SCREAMING_SNAKE_CASE			)					->List[Any]:





  """simple docstring"""


  lowerCAmelCase__			:List[str]											=							int(_lowerCamelCase			)
  return ComputeEnvironment(['LOCAL_MACHINE', 'AMAZON_SAGEMAKER'][value]			)
def  __A   (_SCREAMING_SNAKE_CASE			)					->Dict:





  """simple docstring"""


  lowerCAmelCase__			:str											=							int(_lowerCamelCase			)
  return DistributedType(['NO', 'MULTI_CPU', 'MULTI_XPU', 'MULTI_GPU', 'MULTI_NPU', 'TPU'][value]			)
def  __A   (_SCREAMING_SNAKE_CASE			)					->List[Any]:





  """simple docstring"""


  lowerCAmelCase__			:Tuple											=							int(_lowerCamelCase			)
  return DynamoBackend(DYNAMO_BACKENDS[value]			).value
def  __A   (_SCREAMING_SNAKE_CASE			)					->Optional[int]:





  """simple docstring"""


  lowerCAmelCase__			:List[str]											=							int(_lowerCamelCase			)
  return PrecisionType(['no', 'fp16', 'bf16', 'fp8'][value]			)
def  __A   (_SCREAMING_SNAKE_CASE			)					->List[Any]:





  """simple docstring"""


  lowerCAmelCase__			:int											=							int(_lowerCamelCase			)
  return SageMakerDistributedType(['NO', 'DATA_PARALLEL', 'MODEL_PARALLEL'][value]			)
def  __A   (_SCREAMING_SNAKE_CASE			)					->Any:





  """simple docstring"""


  return {"yes": True, "no": False}[value.lower()]






class 					_lowerCAmelCase   (     argparse.RawDescriptionHelpFormatter       ):
       """simple docstring"""




       def      snake_case						(    self    , __UpperCAmelCase    , __UpperCAmelCase    , __UpperCAmelCase    , __UpperCAmelCase      ):



         '''simple docstring'''

         lowerCAmelCase__			:Union[str, Any]											=							super()._format_usage(lowerCAmelCase__    , lowerCAmelCase__    , lowerCAmelCase__    , lowerCAmelCase__      )
         lowerCAmelCase__			:Any											=							usage.replace('<command> [<args>] '    , ''      )
         return usage





'''simple docstring'''




import string


def 				lowerCAmelCase_   (	_lowerCamelCase:   str					):
		__SCREAMING_SNAKE_CASE       :		Dict           =		""""""
		for i in sequence:
				__SCREAMING_SNAKE_CASE       :		Any           =		ord(_lowerCamelCase					)
				if 65 <= extract <= 90:
						output += chr(1_55 - extract					)
				elif 97 <= extract <= 1_22:
						output += chr(2_19 - extract					)
				else:
						output += i
		return output


def 				lowerCAmelCase_   (	_lowerCamelCase:   str					):
		__SCREAMING_SNAKE_CASE       :		Optional[Any]           =		string.ascii_letters
		__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1]
		return "".join(
		    letters_reversed[letters.index(_lowerCamelCase					)] if c in letters else c for c in sequence					)


def 				lowerCAmelCase_   (	):
		from timeit import timeit

		print("""Running performance benchmarks..."""					)
		__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		"""from string import printable ; from __main__ import atbash, atbash_slow"""
		print(F"> atbash_slow(): {timeit('atbash_slow(printable)'       ,      setup=_lowerCamelCase					)} seconds"					)
		print(F">      atbash(): {timeit('atbash(printable)'       ,      setup=_lowerCamelCase					)} seconds"					)


if __name__ == "__main__":
						for example in ("ABCDEFGH", "123GGjj", "testStringtest", "with space"):
												print(f"{example} encrypted in atbash: {atbash(example)}")
						benchmark()