def new_client(self, **kwargs) -> tuple["Client", "MQTTErrorCode"]:
        """
        Get a paho.mqtt client connected to this container.
        Check the returned object is_connected() method before use

        Usage of this method is required for versions <2;
        versions >=2 will wait for log messages to determine container readiness.
        There is no way to pass arguments to new_client in versions <2,
        please use an up-to-date version.

        Args:
            **kwargs: Keyword arguments passed to `paho.mqtt.client`.

        Returns:
            client: MQTT client to connect to the container.
            error: an error code or MQTT_ERR_SUCCESS.
        """
        try:
            from paho.mqtt.client import CallbackAPIVersion, Client
            from paho.mqtt.enums import MQTTErrorCode
        except ImportError as i:
            raise ImportError("'pip install paho-mqtt' required for MosquittoContainer.new_client") from i

        err = MQTTErrorCode.MQTT_ERR_SUCCESS
        if self.client is None:
            self.client = Client(
                client_id=MosquittoContainer.TESTCONTAINERS_CLIENT_ID,
                callback_api_version=CallbackAPIVersion.VERSION2,
                userdata=self,
                **kwargs,
            )
            self.client._connect_timeout = 1.0

            # connect() is a blocking call:
            err = self.client.connect(self.get_container_host_ip(), int(self.get_exposed_port(self.MQTT_PORT)))
            self.client.loop_start()  # launch a thread to call loop() and dequeue the message

        return self.client, err

        Get a paho.mqtt client connected to this container.
        Check the returned object is_connected() method before use

        Usage of this method is required for versions <2;
        versions >=2 will wait for log messages to determine container readiness.
        There is no way to pass arguments to new_client in versions <2,
        please use an up-to-date version.

        Args:
            **kwargs: Keyword arguments passed to `paho.mqtt.client`.

        Returns:
            client: MQTT client to connect to the container.
            error: an error code or MQTT_ERR_SUCCESS.
        
modules/mqtt/testcontainers/mqtt/__init__.py