<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blocking_request(self, msg, timeout=None, use_mid=None):
 """Send a request messsage and wait for its reply. Parameters msg : Message object The request Message to send. timeout : float in seconds How long to wait for a reply. The default is the the timeout set when creating the AsyncClient. use_mid : boolean, optional Whether to use message IDs. Default is to use message IDs if the server supports them. Returns ------- reply : Message object The reply message received. informs : list of Message objects A list of the inform messages received. """

        assert (get_thread_ident() != self.ioloop_thread_id), (
            'Cannot call blocking_request() in ioloop')
        if timeout is None:
            timeout = self._request_timeout

        f = Future()  # for thread safety
        tf = [None]   # Placeholder for tornado Future for exception tracebacks
        def blocking_request_callback():
            try:
                tf[0] = frf = self.future_request(msg, timeout=timeout,
                                                  use_mid=use_mid)
            except Exception:
                tf[0] = frf = tornado_Future()
                frf.set_exc_info(sys.exc_info())
            gen.chain_future(frf, f)

        self.ioloop.add_callback(blocking_request_callback)

        # We wait on the future result that should be set by the reply
        # handler callback. If this does not occur within the
        # timeout it means something unexpected went wrong. We give it
        # an extra second to deal with (unlikely?) slowness in the
        # rest of the code.
        extra_wait = 1
        wait_timeout = timeout
        if wait_timeout is not None:
            wait_timeout = wait_timeout + extra_wait
        try:
            return f.result(timeout=wait_timeout)
        except TimeoutError:
            raise RuntimeError('Unexpected error: Async request handler did '
                               'not call reply handler within timeout period')
        except Exception:
            # Use the tornado future to give us a usable traceback
            tf[0].result()
            assert False