def model_from_protobuf(pb, _entity_class=datastore.Entity):
 entity = _entity_class.FromPb(pb, default_kind=Expando.kind())
 return class_for_kind(entity.kind()).from_entity(entity)

def model_from_protobuf ( pb , _entity_class = datastore . Entity ) : entity = _entity_class . FromPb ( pb , default_kind = Expando . kind ( ) ) return class_for_kind ( entity . kind ( ) ) . from_entity ( entity )
decodes a model instance from a protocol buffer .