def __IndexListForQuery(query):
 (required, kind, ancestor, props) = datastore_index.CompositeIndexForQuery(query)
 if (not required):
  return []
 index_pb = entity_pb.Index()
 index_pb.set_entity_type(kind)
 index_pb.set_ancestor(bool(ancestor))
 for (name, direction) in datastore_index.GetRecommendedIndexProperties(props):
  prop_pb = entity_pb.Index_Property()
  prop_pb.set_name(name)
  prop_pb.set_direction(direction)
  index_pb.property_list().append(prop_pb)
 return [index_pb]

def __IndexListForQuery ( query ) : ( required , kind , ancestor , props ) = datastore_index . CompositeIndexForQuery ( query ) if ( not required ) : return [ ] index_pb = entity_pb . Index ( ) index_pb . set_entity_type ( kind ) index_pb . set_ancestor ( bool ( ancestor ) ) for ( name , direction ) in datastore_index . GetRecommendedIndexProperties ( props ) : prop_pb = entity_pb . Index_Property ( ) prop_pb . set_name ( name ) prop_pb . set_direction ( direction ) index_pb . property_list ( ) . append ( prop_pb ) return [ index_pb ]
get the composite index definition used by the query .