def setup_arg_parser(default, commands, description):
    command_help = format_command_help(default, commands)

    arg_parser = argparse.ArgumentParser(
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description=description,
        epilog=(command_help))

    arg_parser.add_argument('command',
                            help=('choose a command to run'
                                  + (', running '
                                     + default.__name__
                                     + ' by default'
                                     if (default is not None
                                         and default in commands)
                                     else '')),
                            type=str,
                            choices=[command.__name__
                                     for command in commands],
                            nargs='?')

    arg_parser.add_argument('argument',
                            help='argument to the command',
                            type=str,
                            nargs='*')

    arg_parser.add_argument(
        '-c',
        '--config',
        help='specify a configuration file',
        type=str,
        default=DEFAULT_CONFIG_FILENAME)

    arg_parser.add_argument(
        '-o',
        '--option',
        help='override a configuration option',
        type=str,
        nargs=2,
        metavar=('key', 'value'),
        action='append')

    arg_parser.add_argument(
        '-i',
        '--interactive',
        action='store_true',
        help='drop to interactive prompt after COMMAND')

    arg_parser.add_argument(
        '--verbosity',
        type=str,
        choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
        action='store',
        help="choose the console logger's verbosity")

    arg_parser.add_argument(
        '-v',
        action='store_true',
        help="shortcut for --verbosity DEBUG")

    arg_parser.add_argument(
        '-j', '--processes',
        nargs=1,
        type=int,
        action='store',
        help="set number of parallel processes used")

    arg_parser.add_argument(
        '--print-timings',
        action='store_true',
        help="print logged timings")

    if AUTO_COMPLETION:
        argcomplete.autocomplete(arg_parser)

    return arg_parser
Setup the argument parser for the experiment
dataset/ETHPy150Open duerrp/pyexperiment/pyexperiment/experiment.py/setup_arg_parser