code: def update_work_as_completed(self, worker_id, work_id, other_values=None,
                                 error=None):
      
      client = self._datastore_client
      try:
        with client.transaction() as transaction:
          work_key = client.key(KIND_WORK_TYPE, self._work_type_entity_id,
                                KIND_WORK, work_id)
          work_entity = client.get(work_key, transaction=transaction)
          if work_entity['claimed_worker_id'] != worker_id:
            return False
          work_entity['is_completed'] = True
          if other_values:
            work_entity.update(other_values)
          if error:
            work_entity['error'] = text_type(error)
          transaction.put(work_entity)
      except Exception:
        return False
      return True
docs: Updates work piece in datastore as completed.
  
      Args:
        worker_id: ID of the worker which did the work
        work_id: ID of the work which was done
        other_values: dictionary with additonal values which should be saved
          with the work piece
        error: if not None then error occurred during computation of the work
          piece. In such case work will be marked as completed with error.
  
      Returns:
        whether work was successfully updated