docs: def bulk_set_project_owners(project_owners, **kwargs):
      """
          Set the project owner of multiple projects at once.
          Accepts a list of JSONObjects which look like:
              {
               'project_id': XX,
               'user_id'   : YY,
               'view'      : 'Y'/ 'N'
               'edit'      : 'Y'/ 'N'
               'share'      : 'Y'/ 'N'
              }
             """
      
      project_ids = [po.project_id for po in project_owners]
  
      existing_projowners = db.DBSession.query(ProjectOwner).filter(ProjectOwner.project_id.in_(project_ids)).all()
  
      #Create a lookup based on the unique key for this table (project_id, user_id)
      po_lookup = {}
      
      for po in existing_projowners:
          po_lookup[(po.project_id, po.user_id)] = po
  
      for project_owner in project_owners:
          #check if the entry is already there
          if po_lookup.get((project_owner.project_id, project_owner.user_id)):
              continue
  
          new_po = ProjectOwner()
          new_po.project_id = project_owner.project_id
          new_po.user_id    = project_owner.user_id
          new_po.view       = project_owner.view
          new_po.edit       = project_owner.edit
          new_po.share      = project_owner.share
  
          db.DBSession.add(new_po)
  
      db.DBSession.flush()