def _normalize_index(self, index):
        if index is None:
            return None
        if index < 0:
            index = self.end
        else:
            index += self.start
            if index > self.end:
                index = self.end
        return index
dataset/ETHPy150Open neovim/python-client/neovim/api/buffer.py/Range._normalize_index/original