def MakeEntityForQuery(query, *path):
 pseudo_pb = entity_pb.EntityProto()
 pseudo_pb.mutable_entity_group()
 pseudo_pk = pseudo_pb.mutable_key()
 pseudo_pk.set_app(query.app())
 if query.has_name_space():
  pseudo_pk.set_name_space(query.name_space())
 for i in xrange(0, len(path), 2):
  pseudo_pe = pseudo_pk.mutable_path().add_element()
  pseudo_pe.set_type(path[i])
  if isinstance(path[(i + 1)], basestring):
   pseudo_pe.set_name(path[(i + 1)])
  else:
   pseudo_pe.set_id(path[(i + 1)])
 return pseudo_pb

def MakeEntityForQuery ( query , * path ) : pseudo_pb = entity_pb . EntityProto ( ) pseudo_pb . mutable_entity_group ( ) pseudo_pk = pseudo_pb . mutable_key ( ) pseudo_pk . set_app ( query . app ( ) ) if query . has_name_space ( ) : pseudo_pk . set_name_space ( query . name_space ( ) ) for i in xrange ( 0 , len ( path ) , 2 ) : pseudo_pe = pseudo_pk . mutable_path ( ) . add_element ( ) pseudo_pe . set_type ( path [ i ] ) if isinstance ( path [ ( i + 1 ) ] , basestring ) : pseudo_pe . set_name ( path [ ( i + 1 ) ] ) else : pseudo_pe . set_id ( path [ ( i + 1 ) ] ) return pseudo_pb
make an entity to be returned by a pseudo-kind query .