class_docstr: This handler handles connection and execution of the Couchbase statements.
docstr: Set up connections required by the handler.
  
  Returns:
      The connected cluster.
docstr_tok: ["Set","up","connections","required","by","the","handler",".","Returns",":","The","connected","cluster","."]
code: def connect(self):
      """
      Set up connections required by the handler.
  
      Returns:
          The connected cluster.
      """
      if self.is_connected:
          return self.cluster
  
      auth = PasswordAuthenticator(
          self.connection_data.get("user"),
          self.connection_data.get("password"),
          # NOTE: If using SSL/TLS, add the certificate path.
          # We strongly reccomend this for production use.
          # cert_path=cert_path
      )
  
      options = ClusterOptions(auth)
  
      if "cloud.couchbase.com" in self.connection_data.get("host"):
          options.apply_profile("wan_development")
  
          endpoint = f"couchbases://{self.connection_data.get('host')}"
      else:
          endpoint = f"couchbase://{self.connection_data.get('host')}"
  
      cluster = Cluster(
          endpoint,
          options,
      )
  
      try:
          cluster.wait_until_ready(
              timedelta(seconds=self.DEFAULT_TIMEOUT_SECONDS)
          )
          self.is_connected = cluster.connected
          self.cluster = cluster
      except UnAmbiguousTimeoutException:
          self.is_connected = False
          raise
  
      return self.cluster
  
imports: from datetime import timedelta
  from collections import OrderedDict
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.utilities import log
  from mindsdb_sql.parser.ast.base import ASTNode
  import pandas
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from couchbase.auth import PasswordAuthenticator
  from couchbase.cluster import Cluster
  from couchbase.exceptions import UnAmbiguousTimeoutException
  from couchbase.options import ClusterOptions
  from couchbase.exceptions import KeyspaceNotFoundException, CouchbaseException
label_desc: Use image node_id 2 for calling the CouchbaseHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self