Repository: redis/redis-py
File: redis/client.py (Python)

Code before:
                if not conn.can_read(timeout=timeout):
                    return None
            else:
                conn.connect()
            return conn.read_response(disconnect_on_error=False, push_request=True)

        response = self._execute(conn, try_read)

        if self.is_health_check_response(response):
            # ignore the health check message as user might not expect it
            self.health_check_response_counter -= 1
            return None
        return response

    def is_health_check_response(self, response) -> bool:
        """
        Check if the response is a health check response.
        If there are no subscriptions redis responds to PING command with a
        bulk response, instead of a multi-bulk with "pong" and the response.
        """
        if self.encoder.decode_responses:
            return (
                response
                in [
                    self.health_check_response,  # If there is a subscription
                    self.HEALTH_CHECK_MESSAGE,  # If there is no subscriptions and decode_responses=True
                ]
            )
        else:
            return (
                response
                in [
                    self.health_check_response,  # If there is a subscription
                    self.health_check_response_b,  # If there isn't a subscription and decode_responses=False
                ]
            )

    def check_health(self) -> None:
        conn = self.connection
        if conn is None:
            raise RuntimeError(
                "pubsub connection not set: "
                "did you forget to call subscribe() or psubscribe()?"
            )

        if conn.health_check_interval and time.monotonic() > conn.next_health_check:
            conn.send_command("PING", self.HEALTH_CHECK_MESSAGE, check_health=False)
            self.health_check_response_counter += 1

    def _normalize_keys(self, data) -> Dict:
        """

Review comment (suggestion):
Grammar error: "is" should be "are" when referring to plural "subscriptions". Should read: "If there are no subscriptions and decode_responses=True"
```suggestion
                    self.HEALTH_CHECK_MESSAGE,  # If there are no subscriptions and decode_responses=True
```

Code after:
                if not conn.can_read(timeout=timeout):
                    return None
            else:
                conn.connect()
            return conn.read_response(disconnect_on_error=False, push_request=True)

        response = self._execute(conn, try_read)

        if self.is_health_check_response(response):
            # ignore the health check message as user might not expect it
            self.health_check_response_counter -= 1
            return None
        return response

    def is_health_check_response(self, response) -> bool:
        """
        Check if the response is a health check response.
        If there are no subscriptions redis responds to PING command with a
        bulk response, instead of a multi-bulk with "pong" and the response.
        """
        if self.encoder.decode_responses:
            return (
                response
                in [
                    self.health_check_response,  # If there is a subscription
                    self.HEALTH_CHECK_MESSAGE,  # If there are no subscriptions and decode_responses=True
                ]
            )
        else:
            return (
                response
                in [
                    self.health_check_response,  # If there is a subscription
                    self.health_check_response_b,  # If there isn't a subscription and decode_responses=False
                ]
            )

    def check_health(self) -> None:
        conn = self.connection
        if conn is None:
            raise RuntimeError(
                "pubsub connection not set: "
                "did you forget to call subscribe() or psubscribe()?"
            )

        if conn.health_check_interval and time.monotonic() > conn.next_health_check:
            conn.send_command("PING", self.HEALTH_CHECK_MESSAGE, check_health=False)
            self.health_check_response_counter += 1

    def _normalize_keys(self, data) -> Dict:
        """