def gis_download_kml(record_id, filename, session_id_name, session_id, user_id=None):
 if user_id:
  auth.s3_impersonate(user_id)
 result = gis.download_kml(record_id, filename, session_id_name, session_id)
 db.commit()
 return result

def gis_download_kml ( record_id , filename , session_id_name , session_id , user_id = None ) : if user_id : auth . s3_impersonate ( user_id ) result = gis . download_kml ( record_id , filename , session_id_name , session_id ) db . commit ( ) return result
download a kml file - will normally be done asynchronously if there is a worker alive .