def _check_label_or_level_ambiguity(self, key, axis=<NUM_LIT:0>):
if self.ndim > <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>"<EOL>.format(type=type(self)))<EOL><DEDENT>axis = self._get_axis_number(axis)<EOL>other_axes = (ax for ax in range(self._AXIS_LEN) if ax != axis)<EOL>if (key is not None and<EOL>is_hashable(key) and<EOL>key in self.axes[axis].names and<EOL>any(key in self.axes[ax] for ax in other_axes)):<EOL><INDENT>level_article, level_type = (('<STR_LIT>', '<STR_LIT:index>')<EOL>if axis == <NUM_LIT:0> else<EOL>('<STR_LIT:a>', '<STR_LIT>'))<EOL>label_article, label_type = (('<STR_LIT:a>', '<STR_LIT>')<EOL>if axis == <NUM_LIT:0> else<EOL>('<STR_LIT>', '<STR_LIT:index>'))<EOL>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>).format(key=key,<EOL>level_article=level_article,<EOL>level_type=level_type,<EOL>label_article=label_article,<EOL>label_type=label_type)<EOL>raise ValueError(msg)<EOL><DEDENT>
Check whether `key` is ambiguous.

By ambiguous, we mean that it matches both a level of the input
`axis` and a label of the other axis.

Parameters
----------
key: str or object
    label or level name
axis: int, default 0
    Axis that levels are associated with (0 for index, 1 for columns)

Raises
------
ValueError: `key` is ambiguous