def run_loop(self, request_cb, notification_cb,<EOL>setup_cb=None, err_cb=None):
if err_cb is None:<EOL><INDENT>err_cb = sys.stderr.write<EOL><DEDENT>self._err_cb = err_cb<EOL>def filter_request_cb(name, args):<EOL><INDENT>name = self._from_nvim(name)<EOL>args = walk(self._from_nvim, args)<EOL>try:<EOL><INDENT>result = request_cb(name, args)<EOL><DEDENT>except Exception:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>.format(name, args, format_exc_skip(<NUM_LIT:1>)))<EOL>self._err_cb(msg)<EOL>raise<EOL><DEDENT>return walk(self._to_nvim, result)<EOL><DEDENT>def filter_notification_cb(name, args):<EOL><INDENT>name = self._from_nvim(name)<EOL>args = walk(self._from_nvim, args)<EOL>try:<EOL><INDENT>notification_cb(name, args)<EOL><DEDENT>except Exception:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>.format(name, args, format_exc_skip(<NUM_LIT:1>)))<EOL>self._err_cb(msg)<EOL>raise<EOL><DEDENT><DEDENT>self._session.run(filter_request_cb, filter_notification_cb, setup_cb)<EOL>
Run the event loop to receive requests and notifications from Nvim.

        This should not be called from a plugin running in the host, which
        already runs the loop and dispatches events to plugins.