def request(self, method, *args, **kwargs):
async_ = check_async(kwargs.pop('<STR_LIT>', None), kwargs, False)<EOL>if async_:<EOL><INDENT>self._async_session.notify(method, args)<EOL>return<EOL><DEDENT>if kwargs:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>.format('<STR_LIT:U+002CU+0020>'.join(kwargs.keys())))<EOL><DEDENT>if self._is_running:<EOL><INDENT>v = self._yielding_request(method, args)<EOL><DEDENT>else:<EOL><INDENT>v = self._blocking_request(method, args)<EOL><DEDENT>if not v:<EOL><INDENT>raise IOError('<STR_LIT>')<EOL><DEDENT>err, rv = v<EOL>if err:<EOL><INDENT>info("<STR_LIT>", err)<EOL>raise self.error_wrapper(err)<EOL><DEDENT>return rv<EOL>
Send a msgpack-rpc request and block until as response is received.

        If the event loop is running, this method must have been called by a
        request or notification handler running on a greenlet. In that case,
        send the quest and yield to the parent greenlet until a response is
        available.

        When the event loop is not running, it will perform a blocking request
        like this:
        - Send the request
        - Run the loop until the response is available
        - Put requests/notifications received while waiting into a queue

        If the `async_` flag is present and True, a asynchronous notification
        is sent instead. This will never block, and the return value or error
        is ignored.