docs: def _mark_context_complete(marker, context, has_errors):
      """Transactionally 'complete' the context."""
  
      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