def _append_custom(self, insert, input, before_prompt=False, *args, **kwargs):
        """ A low-level method for appending content to the end of the buffer.

        If 'before_prompt' is enabled, the content will be inserted before the
        current prompt, if there is one.
        """
        # Determine where to insert the content.
        cursor = self._control.textCursor()
        if before_prompt and (self._reading or not self._executing):
            self._flush_pending_stream()
            cursor._insert_mode=True
            cursor.setPosition(self._append_before_prompt_pos)
        else:
            if insert != self._insert_plain_text:
                self._flush_pending_stream()
            cursor.movePosition(QtGui.QTextCursor.End)

        # Perform the insertion.
        result = insert(cursor, input, *args, **kwargs)
        return result
 A low-level method for appending content to the end of the buffer.

        If 'before_prompt' is enabled, the content will be inserted before the
        current prompt, if there is one.
        
angrmanagement/vendor/qtconsole/console_widget.py