'Converts the entity representation of this model to an instance.
Converts datastore.Entity instance to an instance of cls.
Args:
entity: Entity loaded directly from datastore.
Raises:
KindError when cls is incorrect model for entity.'

@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)
    if entity.key().has_id_or_name():
        entity_values['key'] = entity.key()
    return cls(None, _from_entity=entity, **entity_values)
