def _to_entity(self, entity):
    super(Expando, self)._to_entity(entity)

    if self._dynamic_properties is None:
      self._dynamic_properties = {}

    for key, value in self._dynamic_properties.iteritems():
      entity[key] = value

    all_properties = set(self._dynamic_properties.iterkeys())
    all_properties.update(self.properties().iterkeys())
    for key in entity.keys():
      if key not in all_properties:
        del entity[key]
Store to entity, deleting dynamic properties that no longer exist.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/Expando._to_entity