xrangeobject.index(value, [start, [stop]]) -> integer --
        return index of value.
        Raise ValueError if the value is not present.

def index(self, i):
        """xrangeobject.index(value, [start, [stop]]) -> integer --
        return index of value.
        Raise ValueError if the value is not present.
        """
        if self.count(i) == 0:
            raise ValueError("{} is not in range".format(i))
        return (i - self._start) // self._step