code: def cloudant_iam(account_name, api_key, **kwargs):
      
      cloudant_session = Cloudant.iam(account_name, api_key, **kwargs)
  
      cloudant_session.connect()
      yield cloudant_session
      cloudant_session.disconnect()
docs: Provides a context manager to create a Cloudant session using IAM
      authentication and provide access to databases, docs etc.
  
      :param account_name: Cloudant account name.
      :param api_key: IAM authentication API key.
  
      For example:
  
      .. code-block:: python
  
          # cloudant context manager
          from cloudant import cloudant_iam
  
          with cloudant_iam(ACCOUNT_NAME, API_KEY) as client:
              # Context handles connect() and disconnect() for you.
              # Perform library operations within this context.  Such as:
              print client.all_dbs()
              # ...