def METHOD_NAME():
    from optparse import OptionParser
    repl = _get_repl()
    parser = OptionParser(prog='repl', description='Process REPL options')
    parser.add_option('--port', dest='port',
                      help='the port to connect back to')
    parser.add_option('--execution-mode', dest='backend',
                      help='the backend to use')
    parser.add_option('--enable-attach', dest='enable_attach', 
                      action="store_true", default=False,
                      help='enable attaching the debugger via $attach')
    (options, args) = parser.parse_args()
    backend_type = repl.BasicReplBackend
    backend_error = None
    if options.backend is not None and options.backend.lower() != 'standard':
        try:
            split_backend = options.backend.split('.')
            backend_mod_name = '.'.join(split_backend[:-1])
            backend_name = split_backend[-1]
            backend_type = getattr(__import__(backend_mod_name, fromlist=['*']), backend_name)
        except repl.UnsupportedReplException:
            backend_error = sys.exc_info()[1].reason
        except:
            backend_error = traceback.format_exc()
    # fix sys.path so that cwd is where the project lives.
    sys.path[0] = '.'
    # remove all of our parsed args in case we have a launch file that cares...
    sys.argv = args or ['']
    try:
        backend = backend_type()
    except repl.UnsupportedReplException:
        backend_error = sys.exc_info()[1].reason
        backend = repl.BasicReplBackend()
    except Exception:
        backend_error = traceback.format_exc()
        backend = repl.BasicReplBackend()
    repl.BACKEND = backend
    backend.connect(int(options.port))
    if options.enable_attach:
        backend.init_debugger()
    if backend_error is not None:
        sys.stderr.write('Error using selected REPL back-end:\n')
        sys.stderr.write(backend_error + '\n')
        sys.stderr.write('Using standard backend instead\n')
    # execute code on the main thread which we can interrupt
    backend.execution_loop()    