<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def request(self, method, *args, **kwargs):
 """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. """

        async_ = check_async(kwargs.pop('async_', None), kwargs, False)
        if async_:
            self._async_session.notify(method, args)
            return

        if kwargs:
            raise ValueError("request got unsupported keyword argument(s): {}"
                             .format(', '.join(kwargs.keys())))

        if self._is_running:
            v = self._yielding_request(method, args)
        else:
            v = self._blocking_request(method, args)
        if not v:
            # EOF
            raise IOError('EOF')
        err, rv = v
        if err:
            info("'Received error: %s", err)
            raise self.error_wrapper(err)
        return rv