def setSelectionRange(self, pos, length):
        if length < 0:
            # throw new IndexOutOfBoundsException("Length must be a positive integer. Length: " + length);
            console.error("Length must be a positive integer. Length: " + length)

        if (pos < 0) or (length + pos > len(self.getText())):
            #throw new IndexOutOfBoundsException("From Index: " + pos + "  To Index: " + (pos + length) + "  Text Length: " + getText().length());
            console.error("From Index: %d " % pos + (pos + length) % "  To Index: %d " + "  Text Length: %d " % len(self.getText()))

        element = self.getElement()
        element.setSelectionRange(pos, pos + length)
dataset/ETHPy150Open pyjs/pyjs/pyjswidgets/pyjamas/ui/TextBoxBase.py/TextBoxBase.setSelectionRange/swapped operands of `%`