





import argparse

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


_lowerCamelCase						:     Tuple		   =	[
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]





def 						_lowerCAmelCase						(      __magic_name__	:Any  ,							__magic_name__	:List[Any]=None  ,							__magic_name__	:Union[str, Any]=None  ,							__magic_name__	:Optional[int]=None      ):
					UpperCAmelCase_		=  True
					while ask_again:
										UpperCAmelCase_		=  input(lowercase__      )
										try:
															if default is not None and len(lowercase__      ) == 0:
																				return default
															return convert_value(lowercase__      ) if convert_value is not None else result
										except Exception:
															if error_message is not None:
																				print(lowercase__      )





def 						_lowerCAmelCase						(      __magic_name__	:Optional[Any]  ,							__magic_name__	:int=[]  ,							__magic_name__	:str=None  ,							__magic_name__	:Any=0      ):
					UpperCAmelCase_		=  BulletMenu(lowercase__  ,							lowercase__      )
					UpperCAmelCase_		=  menu.run(default_choice=lowercase__      )
					return convert_value(lowercase__      ) if convert_value is not None else result





def 						_lowerCAmelCase						(      __magic_name__	:int      ):
					UpperCAmelCase_		=  int(lowercase__      )
					return ComputeEnvironment(['''LOCAL_MACHINE''', '''AMAZON_SAGEMAKER'''][value]      )





def 						_lowerCAmelCase						(      __magic_name__	:Optional[int]      ):
					UpperCAmelCase_		=  int(lowercase__      )
					return DistributedType(['''NO''', '''MULTI_CPU''', '''MULTI_XPU''', '''MULTI_GPU''', '''MULTI_NPU''', '''TPU'''][value]      )





def 						_lowerCAmelCase						(      __magic_name__	:Any      ):
					UpperCAmelCase_		=  int(lowercase__      )
					return DynamoBackend(DYNAMO_BACKENDS[value]      ).value





def 						_lowerCAmelCase						(      __magic_name__	:List[Any]      ):
					UpperCAmelCase_		=  int(lowercase__      )
					return PrecisionType(['''no''', '''fp16''', '''bf16''', '''fp8'''][value]      )





def 						_lowerCAmelCase						(      __magic_name__	:Optional[Any]      ):
					UpperCAmelCase_		=  int(lowercase__      )
					return SageMakerDistributedType(['''NO''', '''DATA_PARALLEL''', '''MODEL_PARALLEL'''][value]      )





def 						_lowerCAmelCase						(      __magic_name__	:List[str]      ):
					return {"yes": True, "no": False}[value.lower()]



class       snake_case__						(		argparse.RawDescriptionHelpFormatter							):






							'''simple docstring'''



							def 							UpperCamelCase      (       self  :       str					,			lowerCAmelCase_  :       int					,			lowerCAmelCase_  :       Optional[int]					,			lowerCAmelCase_  :       Optional[Any]					,			lowerCAmelCase_  :       List[str]   )       ->		Tuple:
												UpperCAmelCase_		=  super()._format_usage(lowerCAmelCase_					,			lowerCAmelCase_					,			lowerCAmelCase_					,			lowerCAmelCase_   )
												UpperCAmelCase_		=  usage.replace('''<command> [<args>] '''					,			''''''   )
												return usage






"""simple docstring"""






from diffusers.utils.testing_utils import require_onnxruntime






@require_onnxruntime
class lowerCAmelCase__      :






			'''simple docstring'''



			pass