code: def _checkAndConvertIndex(self, index):
          
          if index < 0:
              index = len(self) + index
          if index < 0 or index >= self._doc.blockCount():
              raise IndexError('Invalid block index', index)
          return index
docs: Check integer index, convert from less than zero notation