






'''simple docstring'''






import argparse
import os
import platform

import numpy as np
import psutil
import torch

from accelerate import __version__ as version
from accelerate.commands.config import default_config_file, load_config_from_file

from ..utils import is_npu_available, is_xpu_available




def        _SCREAMING_SNAKE_CASE  (       A  :       Optional[Any]=None  )    -> Union[str, Any]:







   """simple docstring"""
   if subparsers is not None:
      __snake_case				:      List[Any]     							= subparsers.add_parser('env'  )
   else:
      __snake_case				:      Optional[Any]     							= argparse.ArgumentParser('Accelerate env command'  )

   parser.add_argument(
       '--config_file'  ,		default=__UpperCamelCase  ,		help='The config file to use for the default values in the launching script.'  )

   if subparsers is not None:
      parser.set_defaults(func=__UpperCamelCase  )
   return parser




def        _SCREAMING_SNAKE_CASE  (       A  :       Union[str, Any]  )    -> List[str]:







   """simple docstring"""
   __snake_case				:      List[Any]     							= torch.__version__
   __snake_case				:      int     							= torch.cuda.is_available()
   __snake_case				:      Any     							= is_xpu_available()
   __snake_case				:      Any     							= is_npu_available()

   __snake_case				:      Optional[int]     							= 'Not found'
   # Get the default from the config file.
   if args.config_file is not None or os.path.isfile(__UpperCamelCase  ):
      __snake_case				:      Optional[Any]     							= load_config_from_file(args.config_file  ).to_dict()

   __snake_case				:      List[Any]     							= {
       '`Accelerate` version': version,
       'Platform': platform.platform(),
       'Python version': platform.python_version(),
       'Numpy version': np.__version__,
       'PyTorch version (GPU?)': F"""{pt_version} ({pt_cuda_available})""",
       'PyTorch XPU available': str(__UpperCamelCase  ),
       'PyTorch NPU available': str(__UpperCamelCase  ),
       'System RAM': F"""{psutil.virtual_memory().total / 10_24 ** 3:.2f} GB""",
   }
   if pt_cuda_available:
      __snake_case				:      Optional[Any]     							= torch.cuda.get_device_name()

   print('\nCopy-and-paste the text below in your GitHub issue\n'  )
   print('\n'.join([F"""- {prop}: {val}""" for prop, val in info.items()]  )  )

   print('- `Accelerate` default config:' if args.config_file is None else '- `Accelerate` config passed:'  )
   __snake_case				:      List[Any]     							= (
       '\n'.join([F"""\t- {prop}: {val}""" for prop, val in accelerate_config.items()]  )
       if isinstance(__UpperCamelCase  ,		__UpperCamelCase  )
       else F"""\t{accelerate_config}"""
   )
   print(__UpperCamelCase  )

   __snake_case				:      int     							= accelerate_config

   return info




def        _SCREAMING_SNAKE_CASE  (       )    -> int:







   """simple docstring"""
   __snake_case				:      Optional[int]     							= env_command_parser()
   __snake_case				:      Tuple     							= parser.parse_args()
   env_command(__UpperCamelCase  )
   return 0


if __name__ == "__main__":
      raise SystemExit(main())







'''simple docstring'''






def        _SCREAMING_SNAKE_CASE  (				A  :       list  )    -> list:







   """simple docstring"""
   __snake_case				:      Tuple     							= False
   while is_sorted is False:  # Until all the indices are traversed keep looping
      __snake_case				:      Optional[Any]     							= True
      for i in range(0  ,		len(A  ) - 1  ,		2  ):  # iterating over all even indices
         if input_list[i] > input_list[i + 1]:
            __snake_case							,__snake_case				:      int     							= input_list[i + 1], input_list[i]
            # swapping if elements not in order
            __snake_case				:      List[Any]     							= False

      for i in range(1  ,		len(A  ) - 1  ,		2  ):  # iterating over all odd indices
         if input_list[i] > input_list[i + 1]:
            __snake_case							,__snake_case				:      Tuple     							= input_list[i + 1], input_list[i]
            # swapping if elements not in order
            __snake_case				:      Any     							= False
   return input_list


if __name__ == "__main__":
      print('''Enter list to be sorted''')
      __A    	=   [int(x) for x in input().split()]
      # inputing elements of the list in one line
      __A    	=   odd_even_sort(input_list)
      print('''The sorted list is''')
      print(sorted_list)