def parse_response(self, block=True, timeout=0):
        "Parse the response from a publish/subscribe command"
        conn = self.connection
        if conn is None:
            raise RuntimeError(
                'pubsub connection not set: '
                'did you forget to call subscribe() or psubscribe()?')

        self.check_health()

        if not block and not conn.can_read(timeout=timeout):
            return None
        response = self._execute(conn, conn.read_response)

        if conn.health_check_interval and \
                response == self.health_check_response:
            # ignore the health check message as user might not expect it
            return None
        return response
Parse the response from a publish/subscribe command
stackoverflow/venv/lib/python3.6/site-packages/redis/client.py