def index(self, key):
if isinstance(key, int):<EOL><INDENT>if <NUM_LIT:0> <= key < len(self.__keys):<EOL><INDENT>return key<EOL><DEDENT>raise IndexError(key)<EOL><DEDENT>elif isinstance(key, str):<EOL><INDENT>try:<EOL><INDENT>return self.__keys.index(key)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise KeyError(key)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError(key)<EOL><DEDENT>
Return the index of the given item.

        :param key:
        :return: