def _is_level_reference(self, key, axis=<NUM_LIT:0>):
axis = self._get_axis_number(axis)<EOL>if self.ndim > <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>"<EOL>.format(type=type(self)))<EOL><DEDENT>return (key is not None and<EOL>is_hashable(key) and<EOL>key in self.axes[axis].names and<EOL>not self._is_label_reference(key, axis=axis))<EOL>
Test whether a key is a level reference for a given axis.

To be considered a level reference, `key` must be a string that:
  - (axis=0): Matches the name of an index level and does NOT match
    a column label.
  - (axis=1): Matches the name of a column level and does NOT match
    an index label.

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

Returns
-------
is_level : bool