def cursorAtSpaceEnd(block):
            cursor = QTextCursor(block)
            cursor.setPosition(block.position() + len(blockIndentation(block)))
            return cursor
def unlock(self, key):
    if self._tokens[key] > 0:
      self._tokens[key] -= 1