def ndb_delete(self, entity_or_key):
    if ndb is not None and isinstance(entity_or_key, ndb.Model):
      key = entity_or_key.key
    else:
      key = entity_or_key
    self.ndb_deletes.append(key)
Like delete(), but for NDB entities/keys.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/src/mapreduce/context.py/_MutationPool.ndb_delete