def __init__(
        self,
        cluster: Cluster,
        bucket_name: str,
        scope_name: str,
        async_cluster: Optional[AsyncCluster] = None,
    ) -> None:
        """
        Initializes a CouchbaseKVStore.

        Args:
            cluster (Cluster): Couchbase cluster object
            bucket_name (str): Name of the bucket to use for the key-value store
            scope_name (str): Name of the scope to use for the key-value store
            async_cluster (Optional[AsyncCluster]): Async Couchbase cluster object

        """
        if not isinstance(cluster, Cluster):
            raise ValueError(
                f"cluster should be an instance of couchbase.Cluster, "
                f"got {type(cluster)}"
            )
        self._cluster = cluster
        self._acluster = None

        if async_cluster:
            if not isinstance(async_cluster, AsyncCluster):
                raise ValueError(
                    f"async_cluster should be an instance of acouchbase.Cluster, "
                    f"got {type(async_cluster)}"
                )
            self._acluster = async_cluster

        # Check if bucket exists
        if not self._check_bucket_exists(bucket_name):
            raise ValueError(
                f"Bucket {bucket_name} does not exist. "
                " Please create the bucket before using."
            )
        self._bucketname: str = bucket_name
        self._bucket = self._cluster.bucket(bucket_name)

        # Get a list of all the scopes and collections in the bucket
        self._scope_collection_map = self._list_scope_and_collections()
        if scope_name not in self._scope_collection_map:
            raise ValueError(
                f"Scope {scope_name} does not exist in bucket {self._bucketname}. "
                "Please create the scope before use."
            )
        self._scopename = scope_name
        self._scope = self._bucket.scope(scope_name)

        if self._acluster:
            self._abucket = self._acluster.bucket(bucket_name)
            self._ascope = self._abucket.scope(scope_name)

        Initializes a CouchbaseKVStore.

        Args:
            cluster (Cluster): Couchbase cluster object
            bucket_name (str): Name of the bucket to use for the key-value store
            scope_name (str): Name of the scope to use for the key-value store
            async_cluster (Optional[AsyncCluster]): Async Couchbase cluster object

        
llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-couchbase/llama_index/storage/kvstore/couchbase/base.py