def get_matching_indexes(self, possible_hash, possible_range):
matches = [<EOL>index<EOL>for index in self.iter_query_indexes()<EOL>if index.hash_key in possible_hash<EOL>]<EOL>range_matches = [<EOL>index for index in matches if index.range_key in possible_range<EOL>]<EOL>if range_matches:<EOL><INDENT>return range_matches<EOL><DEDENT>return matches<EOL>
Get all indexes that could be queried on using a set of keys.

If any indexes match both hash AND range keys, indexes that only match
the hash key will be excluded from the result.

Parameters
----------
possible_hash : set
    The names of fields that could be used as the hash key
possible_range : set
    The names of fields that could be used as the range key