def _hashed_indexing_key(self, key):
from pandas.core.util.hashing import hash_tuples, hash_tuple<EOL>if not isinstance(key, tuple):<EOL><INDENT>return hash_tuples(key)<EOL><DEDENT>if not len(key) == self.nlevels:<EOL><INDENT>raise KeyError<EOL><DEDENT>def f(k, stringify):<EOL><INDENT>if stringify and not isinstance(k, str):<EOL><INDENT>k = str(k)<EOL><DEDENT>return k<EOL><DEDENT>key = tuple(f(k, stringify)<EOL>for k, stringify in zip(key, self._have_mixed_levels))<EOL>return hash_tuple(key)<EOL>
validate and return the hash for the provided key

*this is internal for use for the cython routines*

Parameters
----------
key : string or tuple

Returns
-------
np.uint64

Notes
-----
we need to stringify if we have mixed levels