def setRange(self, arg1, arg2=None):
        if arg2 is None:
            firstText = RangeUtil.getAdjacentTextElement(arg1, arg1, True, False)
            lastText = RangeUtil.getAdjacentTextElement(arg1, arg1, False, False)

            if (firstText is None)  or  (lastText is None):
                return False

            startPoint = RangeEndPoint(firstText, 0)
            endPoint = RangeEndPoint(lastText, lastText.length)

        else:
            startPoint = arg1
            endPoint = arg2

        assert (startPoint.getNode().ownerDocument ==
                    endPoint.getNode().ownerDocument)

        self._setRange(startPoint, endPoint)
        self.m_range = None
testing if the users are able to change the publish method if it is
dataset/ETHPy150Open pyjs/pyjs/pyjswidgets/pyjamas/selection/Range.py/Range.setRange--crossover with--dataset/ETHPy150Open eoyilmaz/anima/tests/ui/test_version_creator.py/VersionCreatorTester.test_users_can_change_the_publish_state_if_they_are_the_owner