def index(self, key):
        """ Return the index of the given item.

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

        :param key:
        :return: