code: def index(self, key):
          
          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)
docs: Return the index of the given item.
  
          :param key:
          :return: