@ndb.transactional
def _mark_context_complete(marker, context, has_errors):

    current = None

    if marker:
        current = marker.key.get()

    if not current:
        return False

    if current and current.complete:
        return False

    current.complete = True
    current.has_errors = has_errors
    current.put()

    # Kick off completion tasks.
    _insert_post_complete_tasks(context)

    return True
Transactionally 'complete' the context.
dataset/ETHPy150Open Workiva/furious/furious/extras/appengine/ndb_persistence.py/_mark_context_complete