def _get_connection():
 global COUCHBASE_CONN
 if (COUCHBASE_CONN is None):
  opts = _get_options()
  if opts['password']:
   COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['host'], port=opts['port'], bucket=opts['bucket'], password=opts['password'])
  else:
   COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['host'], port=opts['port'], bucket=opts['bucket'])
 return COUCHBASE_CONN

def _get_connection ( ) : global COUCHBASE_CONN if ( COUCHBASE_CONN is None ) : opts = _get_options ( ) if opts [ 'password' ] : COUCHBASE_CONN = couchbase . Couchbase . connect ( host = opts [ 'host' ] , port = opts [ 'port' ] , bucket = opts [ 'bucket' ] , password = opts [ 'password' ] ) else : COUCHBASE_CONN = couchbase . Couchbase . connect ( host = opts [ 'host' ] , port = opts [ 'port' ] , bucket = opts [ 'bucket' ] ) return COUCHBASE_CONN
global function to access the couchbase connection .