def ndb_put(self, entity):
    """Like put(), but for NDB entities."""
    assert ndb is not None and isinstance(entity, ndb.Model)
    entity_size = len(entity._to_pb().Encode())
    if (self.ndb_puts.length >= self.max_entity_count or
        (self.ndb_puts.size + entity_size) > self.max_pool_size):
      self.__flush_ndb_puts()
    self.ndb_puts.append(entity, entity_size)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/mapreduce/context.py/MutationPool.ndb_put/original