def index (self, elem):
        """
        Returns index of element in the SortedSet.
        Raises ValueError if the element is not present.
        """
        if len(self) == 0:
            raise ValueError ('%s is not in the SortedSet' % elem)

        index = bisect.bisect_left(self.elements, elem)

        if index == len(self) or cmp(self.elements[index], elem):
            raise ValueError ('%s is not in the SortedSet' % elem)
        else:
            return index
dataset/ETHPy150Open crypt3lx2k/Tripcode-Dictionary-Tools/tdt/collections/SortedSet.py/SortedSet.index/original