code: def get_collections(kwdb, libtype="*"):
      
      collections = kwdb.get_collections(libtype=libtype)
      for result in collections:
          url = flask.url_for(".doc_for_library", collection_id=result["collection_id"])
          result["url"] = url
  
      return collections
docs: Get list of collections from kwdb, then add urls necessary for hyperlinks