def model_to_protobuf(model_instance, _entity_class=datastore.Entity):
 return model_instance._populate_entity(_entity_class).ToPb()

def model_to_protobuf ( model_instance , _entity_class = datastore . Entity ) : return model_instance . _populate_entity ( _entity_class ) . ToPb ( )
encodes a model instance as a protocol buffer .