def _drop_axis(self, labels, axis, level=None, errors='<STR_LIT>'):
axis = self._get_axis_number(axis)<EOL>axis_name = self._get_axis_name(axis)<EOL>axis = self._get_axis(axis)<EOL>if axis.is_unique:<EOL><INDENT>if level is not None:<EOL><INDENT>if not isinstance(axis, MultiIndex):<EOL><INDENT>raise AssertionError('<STR_LIT>')<EOL><DEDENT>new_axis = axis.drop(labels, level=level, errors=errors)<EOL><DEDENT>else:<EOL><INDENT>new_axis = axis.drop(labels, errors=errors)<EOL><DEDENT>result = self.reindex(**{axis_name: new_axis})<EOL><DEDENT>else:<EOL><INDENT>labels = ensure_object(com.index_labels_to_array(labels))<EOL>if level is not None:<EOL><INDENT>if not isinstance(axis, MultiIndex):<EOL><INDENT>raise AssertionError('<STR_LIT>')<EOL><DEDENT>indexer = ~axis.get_level_values(level).isin(labels)<EOL>if errors == '<STR_LIT>' and indexer.all():<EOL><INDENT>raise KeyError('<STR_LIT>'.format(labels))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>indexer = ~axis.isin(labels)<EOL>labels_missing = (axis.get_indexer_for(labels) == -<NUM_LIT:1>).any()<EOL>if errors == '<STR_LIT>' and labels_missing:<EOL><INDENT>raise KeyError('<STR_LIT>'.format(labels))<EOL><DEDENT><DEDENT>slicer = [slice(None)] * self.ndim<EOL>slicer[self._get_axis_number(axis_name)] = indexer<EOL>result = self.loc[tuple(slicer)]<EOL><DEDENT>return result<EOL>
Drop labels from specified axis. Used in the ``drop`` method
internally.

Parameters
----------
labels : single label or list-like
axis : int or axis name
level : int or level name, default None
    For MultiIndex
errors : {'ignore', 'raise'}, default 'raise'
    If 'ignore', suppress error and existing labels are dropped.