@classmethod
  def from_entity(cls, entity):
    if cls.kind() != entity.kind():
      raise KindError('Class %s cannot handle kind \'%s\'' %
                      (repr(cls), entity.kind()))

    entity_values = cls._load_entity_values(entity)
    instance = cls(None, _from_entity=True, **entity_values)
    if entity.is_saved():
      instance._entity = entity
      del instance._key_name
      del instance._key
    elif entity.key().has_id_or_name():
      instance._key = entity.key()
    return instance
Converts the entity representation of this model to an instance.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/Model.from_entity