code: def add(self, key):
          
          if key not in self.map:
              self.map[key] = len(self.items)
              self.items.append(key)
          return self.map[key]
docs: Add `key` as an item to this OrderedSet, then return its index.
  
          If `key` is already in the OrderedSet, return the index it already
          had.