def get_client(self) -> "Client":
        """
        Creates and connects a client, caching the result in `self.client`
        returning that if it exists.

        Connection attempts are retried using `@wait_container_is_ready`.

        Returns:
            a client from the paho library
        """
        if self.client:
            return self.client
        client, err = self.new_client()
        # 0 is a conventional "success" value in C, which is falsy in python
        if err:
            # retry, maybe it is not available yet
            raise ConnectionError(f"Failed to establish a connection: {err}")
        if not client.is_connected():
            raise TimeoutError("The Paho MQTT secondary thread has not connected yet!")
        self.client = client
        return client

        Creates and connects a client, caching the result in `self.client`
        returning that if it exists.

        Connection attempts are retried using `@wait_container_is_ready`.

        Returns:
            a client from the paho library
        
modules/mqtt/testcontainers/mqtt/__init__.py