def METHOD_NAME():
    parser = argparse.ArgumentParser('PG Repack Script')
    parser.add_argument('--tables', nargs="*")
    parser.add_argument('--table-size-limit', dest='size_limit', type=int, default=10,
                        help='Only consider tables larger than this size (GB)')
    parser.add_argument('--dead-tup-ratio', dest='dead_tup_ratio_limit', type=float, default=0.1,
                        help='Only consider tables with a ratio of live tuples to dead tuples above this limit')
    parser.add_argument('--pg-repack', help='Path to pg_repack', required=True)
    parser.add_argument('-d', '--database', help='Name of the database', required=True)
    parser.add_argument('-v', dest='verbosity', help="Verbose logging. Specify multiple times (up to 3).", action='count', default=0)
    parser.add_argument('--dry-run', action='store_true')
    parser.add_argument('--host', help='Name of the host')
    parser.add_argument('-p', '--port', help='Port number')
    parser.add_argument('-U', '--username', help='Name of the user')
    parser.add_argument('-W', '--password', help='Password of the user')
    parser.add_argument('-k', '--no-superuser-check', dest='no_superuser_check', help='skip superuser checks in client', action='store_true')
    args = parser.parse_args()
    setup_logging(args.verbosity)
    logger.info('\n-------- Starting pg_repack run --------\n')
    size_limit_bytes = args.size_limit * GB
    tables = [
        table for table in get_table_info(dbname=args.database, table_names=args.tables, host=args.host, port=args.port, username=args.username, password=args.password)
        if table.should_repack(size_limit_bytes, args.dead_tup_ratio_limit)
    ]
    table_names = [table.table_name for table in tables]
    if not table_names:
        logger.info('No tables to pack')
        sys.exit(0)
    logger.info('Preparing to repack: %s', table_names)
    for table in tables:
        logger.debug('\t%s', table)
    repack_command = [args.pg_repack, '--no-order', '--wait-timeout=30', f'--dbname={args.database}' ] + [f'--table={table}' for table in table_names]
    additional_args = {'port': args.port, 'username': args.username, 'host': args.host}
    for key, value in additional_args.items():
        if value:
           add_params = f'--{key}={value}'
           repack_command.append(add_params)
    if args.no_superuser_check:
        repack_command.append('-k')
    if not args.password:
        repack_command.append('-w')
    try:
        cpu_count = multiprocessing.cpu_count()
        jobs = min(len(table_names), cpu_count // 2)
    except NotImplementedError:
        jobs = 1
    if jobs > 1:
        repack_command += [f'--jobs={jobs}']
    if args.dry_run:
        repack_command += ['--dry-run']
    if args.verbosity >= 3:
        repack_command += ['--elevel=DEBUG']
    logger.info('Running pg_repack:\n\t%s', ' '.join(repack_command))
    process = subprocess.Popen(repack_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
    output, error_output = process.communicate()
    returncode = process.poll()
    logger.info(f'\nSTDOUT:\n{output}\nSTDERR:\n{error_output}')
    post_tables = [
        table for table in get_table_info(dbname=args.database, host=args.host, port=args.port,
                                          username=args.username, password=args.password)
        if table.table_name in table_names
    ]
    log_state(tables, post_tables)
    return returncode