Examine the response and raise an error is something is off

def _process_response(cls, response):
        """
        Examine the response and raise an error is something is off
        """
        if len(response) != 1:
            raise BadResponseError("Malformed response: {}".format(response))

        stats = list(itervalues(response))[0]
        if not len(stats):
            raise BadResponseError("Malformed response for host: {}".format(stats))

        return stats