Put the given string into the given clipboard.
342436
def put(text, cbname):
    
    global _lastSel
    _checkTkInit()
    if cbname == 'CLIPBOARD':
        _theRoot.clipboard_clear()
        if text:
            # for clipboard_append, kwds can be -displayof, -format, or -type
            _theRoot.clipboard_append(text)
        return
    if cbname == 'PRIMARY':
        _lastSel = text
        _theRoot.selection_handle(ch_handler, selection='PRIMARY')
        # we need to claim/own it so that ch_handler is used
        _theRoot.selection_own(selection='PRIMARY')
        # could add command arg for a func to be called when we lose ownership
        return
    raise RuntimeError("Unexpected clipboard name: "+str(cbname))
838169
def _insert_text_buf(self, line, idx):
        """"""
        self._bytes_012[idx] = 0
        self._bytes_345[idx] = 0
        # Crop text if necessary
        I = np.array([ord(c) - 32 for c in line[:self._n_cols]])
        I = np.clip(I, 0, len(__font_6x8__)-1)
        if len(I) > 0:
            b = __font_6x8__[I]
            self._bytes_012[idx, :len(I)] = b[:, :3]
            self._bytes_345[idx, :len(I)] = b[:, 3:]
1047132
def _copy_cell_text(self):
        
        txt = self.currentItem().text()
        QtWidgets.QApplication.clipboard().setText(txt)
800194
def copy_to_clipboard(i): # pragma: no cover 
    

    s=i['string']

    failed=False
    ee=''

    # Try to load pyperclip (seems to work fine on Windows)
    try:
       import pyperclip
    except Exception as e:
       ee=format(e)
       failed=True
       pass

    if not failed:
       pyperclip.copy(s)
    else:
       failed=False

       # Try to load Tkinter
       try:
          from Tkinter import Tk
       except ImportError as e:
          ee=format(e)
          failed=True
          pass

       if failed:
          failed=False
          try:
             from tkinter import Tk
          except ImportError as e:
             ee=format(e)
             failed=True
             pass

       if failed:
          return {'return':1, 'error':'none of pyperclip/Tkinter/tkinter packages is installed'}

       # Copy to clipboard
       try:
          r = Tk()
          r.withdraw()
          r.clipboard_clear()
          r.clipboard_append(s)
          r.destroy()
       except Exception as e:
          return {'return':1, 'error':'problem copying string to clipboard ('+format(e)+')'}

    return {'return':0}
1139055
def insertData(self, offset: int, string: str) -> None:
        """"""
        self._insert_data(offset, string)
32501
public static void copyToClipboard(String text) {
		final StringSelection stringSelection = new StringSelection(text);
		final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
		clipboard.setContents(stringSelection, stringSelection);
	}
643586
def insert(text)
      raise "must be passed string" unless text.is_a?(String)

      snippet = Snippet.new_text(core, text)
      snippet.snippet_tags.each do |tag_info|
        visit tag_info[:tag]
      end

      context = Context.new(nil)
      insert_func(snippet, context).join($/)
    end
1144819
def insert_text(self, string):
        """
        self.l_buffer.insert_text(string, self.argument_reset)
        self.finalize()
924672
def puts(s='', newline=True, stream=STDOUT):
    """"""
    max_width_ctx = _get_max_width_context()
    if max_width_ctx:
        cols, separator = max_width_ctx[-1]
        s = max_width(s, cols, separator)

    if newline:
        s = tsplit(s, NEWLINES)
        s = map(str, s)
        indent = ''.join(INDENT_STRINGS)

        s = (str('\n' + indent)).join(s)

    _str = ''.join((
        ''.join(INDENT_STRINGS),
        str(s),
        '\n' if newline else ''
    ))
    stream(_str)
407301
def copy( self ):
        
        text = []
        for item in self.selectedItems():
            text.append(nativestring(item.text()))
        
        QApplication.clipboard().setText(','.join(text))
767517
public void copyToClipboard(final int rowIndex, final int colIndex, final int width, final int height) {
        final StringBuilder sb = new StringBuilder();
        if (rowIndex == 0 && colIndex == 0 && width == getColumnCount() && height == getRowCount()) {
            for (int i = 0; i < width; i++) {
                sb.append(getColumnName(i));
                if (i < height - 1) {
                    sb.append("\t");
                }
            }
            sb.append("\n");
        }

        for (int row = rowIndex; row < rowIndex + height; row++) {
            for (int col = colIndex; col < colIndex + width; col++) {
                Object value = getValueAt(row, col);
                if (value == null) {
                    value = "";
                } else if (value instanceof JComponent) {
                    value = WidgetUtils.extractText((JComponent) value);
                }
                sb.append(value);
                sb.append("\t");
            }
            sb.deleteCharAt(sb.length() - 1);
            sb.append("\n");
        }
        final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        final StringSelection stsel = new StringSelection(sb.toString());

        clipboard.setContents(stsel, stsel);
    }
1165644
def _add_from_str(self, s):
        """"""

        if sys.version_info[0] < 3 and isinstance(s, str):
            s = s.decode('utf-8')

        for line in s.split("\n"):
            self._parse_line(line)
1216346
def copyText( self ):
        
        view = self.currentWebView()
        QApplication.clipboard().setText(view.page().selectedText())
941721
def insert_text_to(cursor, text, fmt):
    """"""
    while True:
        index = text.find(chr(8))  # backspace
        if index == -1:
            break
        cursor.insertText(text[:index], fmt)
        if cursor.positionInBlock() > 0:
            cursor.deletePreviousChar()
        text = text[index+1:]
    cursor.insertText(text, fmt)
572940
def write(self, string):
        """"""
        string = string.rstrip()
        if string:  # Don't log empty lines
            self.logger.critical(string)
262498
def _add_info_from_string(self, text):
        """"""
        match = MemoryRegion.info_re.match(text)
        assert match is not None

        name = match.group(1)
        kb_count = int(match.group(2))
        self.info[name] = kb_count * 1024
458922
protected final void putString(String s) {
        ensureCapacity(position + (s.length() * 2) + 1);

        System.arraycopy(s.getBytes(), 0, buffer, position, s.length());
        position += s.length();
        buffer[position++] = 0;
    }