<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def DeserializeMessage(self, response_type, data):
 """Deserialize the given data as method_config.response_type."""

        try:
            message = encoding.JsonToMessage(response_type, data)
        except (exceptions.InvalidDataFromServerError,
                messages.ValidationError, ValueError) as e:
            raise exceptions.InvalidDataFromServerError(
                'Error decoding response "%s" as type %s: %s' % (
                    data, response_type.__name__, e))
        return message