<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cmdDeleteUntilEndOfBlock(self, cmd, count):
 """ C and D """

        cursor = self._qpart.textCursor()
        for _ in range(count - 1):
            cursor.movePosition(QTextCursor.Down, QTextCursor.KeepAnchor)
        cursor.movePosition(QTextCursor.EndOfBlock, QTextCursor.KeepAnchor)
        _globalClipboard.value = cursor.selectedText()
        cursor.removeSelectedText()
        if cmd == _C:
            self.switchMode(Insert)

        self._saveLastEditSimpleCmd(cmd, count)