'Get the position of an entry or raise :exc:`ValueError`.
:param key: The key to be looked up.
.. versionchanged:: 0.5
This used to raise :exc:`IndexError`, which was inconsistent
with the list API.'

def index(self, key):

    if isinstance(key, string_types):
        for (idx, (item, quality)) in enumerate(self):
            if self._value_matches(key, item):
                return idx
        raise ValueError(key)
    return list.index(self, key)
