def _FindIndexToUse(query, indexes):
 if (not query.has_kind()):
  return None
 index_list = __IndexListForQuery(query)
 if (index_list == []):
  return None
 index_match = index_list[0]
 for index in indexes:
  if index_match.Equals(index.definition()):
   return index
 raise apiproxy_errors.ApplicationError(datastore_pb.Error.NEED_INDEX, 'Query requires an index')

def _FindIndexToUse ( query , indexes ) : if ( not query . has_kind ( ) ) : return None index_list = __IndexListForQuery ( query ) if ( index_list == [ ] ) : return None index_match = index_list [ 0 ] for index in indexes : if index_match . Equals ( index . definition ( ) ) : return index raise apiproxy_errors . ApplicationError ( datastore_pb . Error . NEED_INDEX , 'Query requires an index' )
matches the query with one of the composite indexes .