def METHOD_NAME():
    parser = argparse.ArgumentParser()
    parser.add_argument('--list-stages', dest='list', action='store_true')
    parser.add_argument('stage', nargs='*', default=STAGES,
                        help='One of %s'%STAGES)
    parser.add_argument('--rpc-extended', dest='extended',
                        action='store_true', help='run extended rpc tests')
    parser.add_argument('--rpc-exclude', dest='exclude',
                        action='store', help='comma separated string of rpc tests to exclude, see qa/rpc-tests/README.md for more')
    parser.add_argument('--rpc-split', dest='split',
                        action='store', help='string in format m:n, see qa/rpc-tests/README.md for more')
    parser.add_argument('--rpc-macrebalance', dest='macrebalance',
                        action='store_true', help='finetune the workload rebalancer for MacOS builds')
    parser.add_argument('--rpc-runonly', dest='runonly',
                        action='store', help='execute only a specific python test, see qa/rpc-tests/README.md for more')                        
    parser.add_argument('--coverage', dest='enable_cov',
                        action='store_true', help='Enables code coverage data collection')
    args = parser.parse_args()
    # Check for list
    if args.list:
        for s in STAGES:
            print(s)
        sys.exit(0)
    # Check validity of stages
    for s in args.stage:
        if s not in STAGES:
            print("Invalid stage '%s' (choose from %s)" % (s, STAGES))
            sys.exit(1)
    # Run the stages
    passed = True
    b_or_g_tests_with_covereage_done = False
    for s in args.stage:
        # Check for rpc test args
        if s == 'rpc':
            options=[]
            if args.extended:
                options.append('-extended')
            if args.exclude:
                options.append('-exclude=' + args.exclude)
            if args.split:
                options.append('-split=' + args.split)
            if args.macrebalance:
                options.append('-macrebalance')
            if args.runonly:
                options.append(args.runonly)
            if args.enable_cov:
                options.append('-coverage')
            passed &= run_stage(s, options)
        # When running tests with coverage enabled, normal calls to btest and gtest are superseded
        # by those defined into the Makefile, as they also include report filtering and submission
        # to Codacy
        elif args.enable_cov and (s == 'btest' or s == 'gtest'):
            if not b_or_g_tests_with_covereage_done:
                passed &= run_stage('b-gtest_with_coverage')
                b_or_g_tests_with_covereage_done = True # "make cov_ci" runs both btest and gtest!
        else:
            passed &= run_stage(s)
    if not passed:
        print("!!! One or more test stages failed !!!")
        sys.exit(1)