def _validate_read_indexer(self, key, indexer, axis, raise_missing=False):
ax = self.obj._get_axis(axis)<EOL>if len(key) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>missing = (indexer < <NUM_LIT:0>).sum()<EOL>if missing:<EOL><INDENT>if missing == len(indexer):<EOL><INDENT>raise KeyError(<EOL>"<STR_LIT>".format(<EOL>key=key, axis=self.obj._get_axis_name(axis)))<EOL><DEDENT>if not(self.name == '<STR_LIT>' and not raise_missing):<EOL><INDENT>not_found = list(set(key) - set(ax))<EOL>raise KeyError("<STR_LIT>".format(not_found))<EOL><DEDENT>_missing_key_warning = textwrap.dedent("""<STR_LIT>""")  <EOL>if not (ax.is_categorical() or ax.is_interval()):<EOL><INDENT>warnings.warn(_missing_key_warning,<EOL>FutureWarning, stacklevel=<NUM_LIT:6>)<EOL><DEDENT><DEDENT>
Check that indexer can be used to return a result (e.g. at least one
element was found, unless the list of keys was actually empty).

Parameters
----------
key : list-like
    Target labels (only used to show correct error message)
indexer: array-like of booleans
    Indices corresponding to the key (with -1 indicating not found)
axis: int
    Dimension on which the indexing is being made
raise_missing: bool
    Whether to raise a KeyError if some labels are not found. Will be
    removed in the future, and then this method will always behave as
    if raise_missing=True.

Raises
------
KeyError
    If at least one key was requested but none was found, and
    raise_missing=True.