<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handle_reply(self, msg):
 """Handle a reply message related to the current request. Reply messages not related to the current request go up to the base class method. Parameters msg : Message object The reply message to dispatch. """

        # this may also result in reply_cb being None if no
        # reply_cb was passed to the request method
        if msg.mid is not None:
            _request, reply_cb, _inform_cb, user_data, timeout_handle = \
                self._pop_async_request(msg.mid, None)
        else:
            request, _reply_cb, _inform_cb, _user_data, timeout_handle = \
                self._peek_async_request(None, msg.name)
            if request is not None and request.mid is None:
                # we didn't send a mid so this is the request we want
                _request, reply_cb, _inform_cb, user_data, timeout_handle = \
                    self._pop_async_request(None, msg.name)
            else:
                reply_cb, user_data = None, None

        if timeout_handle is not None:
            self.ioloop.remove_timeout(timeout_handle)

        if reply_cb is None:
            reply_cb = super(AsyncClient, self).handle_reply
            # override user_data since handle_reply takes no user_data
            user_data = None

        try:
            if user_data is None:
                reply_cb(msg)
            else:
                reply_cb(msg, *user_data)
        except Exception:
            e_type, e_value, trace = sys.exc_info()
            reason = "\n".join(traceback.format_exception(
                e_type, e_value, trace, self._tb_limit))
            self._logger.error("Callback reply %s FAIL: %s" %
                               (msg.name, reason))