def _set_focus(self, index):
        """
        index -- index into this list, any index out of range will
            raise an IndexError, except when the list is empty and
            the index passed is ignored.

        This function may call self._focus_changed when the focus
        is modified, passing the new focus position to the
        callback just before changing the old focus setting.
        That method may be overridden on the
        instance with set_focus_changed_callback().

        >>> ml = MonitoredFocusList([9, 10, 11])
        >>> ml._set_focus(2); ml._get_focus()
        2
        >>> ml._set_focus(0); ml._get_focus()
        0
        >>> ml._set_focus(-2)
        Traceback (most recent call last):
        ...
        IndexError: focus index is out of range: -2
        """
        if not self:
            self._focus = 0
            return
        if index < 0 or index >= len(self):
            raise IndexError, (index,) % 'focus index is out of range: %s'
        if index != int(index):
            raise IndexError, 'invalid focus index: %s' % (index,)
        index = int(index)
        if index != self._focus:
            self._focus_changed(index)
        self._focus = index
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/monitored_list.py/MonitoredFocusList._set_focus/swapped operands of `%`