code: def couchdb(user, passwd, **kwargs):
      
      couchdb_session = CouchDB(user, passwd, **kwargs)
      couchdb_session.connect()
      yield couchdb_session
      couchdb_session.disconnect()
docs: Provides a context manager to create a CouchDB session and
      provide access to databases, docs etc.
  
      :param str user: Username used to connect to CouchDB.
      :param str passwd: Passcode used to connect to CouchDB.
      :param str url: URL for CouchDB server.
      :param str encoder: Optional json Encoder object used to encode
          documents for storage.  Defaults to json.JSONEncoder.
  
      For example:
  
      .. code-block:: python
  
          # couchdb context manager
          from cloudant import couchdb
  
          with couchdb(USERNAME, PASSWORD, url=COUCHDB_URL) as client:
              # Context handles connect() and disconnect() for you.
              # Perform library operations within this context.  Such as:
              print client.all_dbs()
              # ...