Copy given string into system clipboard.
436410
def copy(string, **kwargs):
    """"""
    try:
        subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE).communicate(
                string.encode("utf-8"))
    except OSError as why:
        raise XcodeNotFound

    return
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
407301
def copy( self ):
        
        text = []
        for item in self.selectedItems():
            text.append(nativestring(item.text()))
        
        QApplication.clipboard().setText(','.join(text))
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;
    }
1350036
def text=(str)
      data = str.nil? ? "" : str.dup
      Win32::Clipboard.set_data(data)
    end
627604
def copy(string):
    
    win32clipboard.OpenClipboard()
    win32clipboard.EmptyClipboard()
    win32clipboard.SetClipboardText(string)
    win32clipboard.CloseClipboard()
801578
def paste(self):
        """"""
        text = to_text_string(QApplication.clipboard().text())
        if len(text.splitlines()) > 1:
            # Multiline paste
            if self.new_input_line:
                self.on_new_line()
            self.remove_selected_text() # Remove selection, eventually
            end = self.get_current_line_from_cursor()
            lines = self.get_current_line_to_cursor() + text + end
            self.clear_line()
            self.execute_lines(lines)
            self.move_cursor(-len(end))
        else:
            # Standard paste
            ShellBaseWidget.paste(self)
164423
def c_str(string):
    """""""
    if not isinstance(string, str):
        string = string.decode('ascii')
    return ctypes.c_char_p(string.encode('utf-8'))
290803
def copy(self):
        """"""
        if not self.selectedIndexes():
            return
        (row_min, row_max,
         col_min, col_max) = get_idx_rect(self.selectedIndexes())
        index = header = False
        df = self.model().df
        obj = df.iloc[slice(row_min, row_max + 1),
                      slice(col_min, col_max + 1)]
        output = io.StringIO()
        obj.to_csv(output, sep='\t', index=index, header=header)
        if not PY2:
            contents = output.getvalue()
        else:
            contents = output.getvalue().decode('utf-8')
        output.close()
        clipboard = QApplication.clipboard()
        clipboard.setText(contents)
1249849
def from_string(string):
        
        lines = list(clean_lines(string.splitlines()))
        params = {}
        for line in lines:
            for sline in line.split(';'):
                m = re.match(r'(\w+)\s*=\s*(.*)', sline.strip())
                if m:
                    key = m.group(1).strip()
                    val = m.group(2).strip()
                    val = Incar.proc_val(key, val)
                    params[key] = val
        return Incar(params)
993207
public void copy() {
		StringBuffer sb = new StringBuffer();

		sb.append("Text 1 = ");
		if (tf1.getText() != null) {
			sb.append(tf1.getText());
		}
		sb.append("\nText 2 = ");
		if (tf2.getText() != null) {
			sb.append(tf2.getText());
		}
		sb.append("\nText 3 = ");
		if (tf3.getText() != null) {
			sb.append(tf3.getText());
		}
		sb.append("\nText 4 = ");
		if (tf4.getText() != null) {
			sb.append(tf4.getText());
		}

		sb.append("\nNumeric 1 = ");
		if (nf1.getText() != null) {
			sb.append(nf1.getText());
		}
		sb.append("\nNumeric 2 = ");
		if (nf2.getText() != null) {
			sb.append(nf2.getText());
		}
		sb.append("\nNumeric 3 = ");
		if (nf3.getText() != null) {
			sb.append(nf3.getText());
		}

		sb.append("\nEmail = ");
		if (ef1.getText() != null) {
			sb.append(ef1.getText());
		}

		if (drop1.getSelected() != null) {
			sb.append("\nDrop 1 = ").append(drop1.getSelected());
		}

		if (drop2.getSelected() != null) {
			sb.append("\nDrop 2 = ").append(drop2.getSelected());
		}

		sb.append("\nMulti1 = ");
		List selected = multi1.getSelected();

		if (selected != null) {
			for (int i = 0; i < selected.size(); i++) {
				if (i > 0) {
					sb.append(", ");
				}

				sb.append(selected.get(i).toString());
			}
		}

		sb.append("\nMulti2 = ");
		selected = multi2.getSelected();

		if (selected != null) {
			for (int i = 0; i < selected.size(); i++) {
				if (i > 0) {
					sb.append(", ");
				}

				TableEntry entry = (TableEntry) selected.get(i);
				sb.append(entry.getCode());
			}
		}

		sb.append("\nMultiCb = ");
		List selectedOptions = multiCb.getSelected();

		for (int i = 0; i < selectedOptions.size(); i++) {
			if (i > 0) {
				sb.append(", ");
			}

			TableEntry entry = (TableEntry) selectedOptions.get(i);
			sb.append(entry.getCode());
		}

		if (rbSelect.getSelected() != null) {
			String radioValue = rbSelect.getSelected().toString();
			sb.append("\nWRadioButtonSelect = ").append(radioValue);
		}

		if (radioButtonGroup.getSelectedValue() != null) {
			String radioValue = radioButtonGroup.getSelectedValue();
			sb.append("\nRadioButtonGroup = ").append(radioValue);
		}

		sb.append("\nCheckboxes =");

		if (cb1.isSelected()) {
			sb.append(' ').append(cb1.getLabel().getText());
		}

		if (cb2.isSelected()) {
			sb.append(' ').append(cb2.getLabel().getText());
		}

		if (cb3.isSelected()) {
			sb.append(' ').append(cb3.getLabel().getText());
		}

		sb.append('\n');

		ta.setText(sb.toString());
	}
1111250
public static void writeToClipboard(String text) {
        Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        Transferable transferableText = new StringSelection(text);
        systemClipboard.setContents(transferableText, null);
    }
1005293
def FromString(s, **kwargs):
    """"""
    
    f = StringIO.StringIO(s)
    return FromFile(f, **kwargs)
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)
1356895
def _copyDPToClipboard(self):
        """"""
        dp = self._dp_menu_on
        if dp and dp.archived:
            path = dp.fullpath.replace(" ", "\\ ")
            QApplication.clipboard().setText(path, QClipboard.Clipboard)
            QApplication.clipboard().setText(path, QClipboard.Selection)
1030882
public static void copyToClipboard(String string) {
        ClipboardContent content = new ClipboardContent();
        content.putString(string);
        Clipboard.getSystemClipboard().setContent(content);
        logger.info("copy '" + string + "' to clipboard");
    }
944854
def raw(text):
    """"""
    new_string = ''
    for char in text:
        try:
            new_string += escape_dict[char]
        except KeyError:
            new_string += char
    return new_string