u'''Paste windows clipboard. If enable_ipython_paste_list_of_lists is 
        True then try to convert tabseparated data to repr of list of lists or 
        repr of array
331338
def ipython_paste(self,e):
        '''
        if self.enable_win32_clipboard:
                txt=clipboard.get_clipboard_text_and_convert(
                                                self.enable_ipython_paste_list_of_lists)
                if self.enable_ipython_paste_for_paths:
                        if len(txt)<300 and (u"\t" not in txt) and (u"\n" not in txt):
                                txt=txt.replace(u"\\", u"/").replace(u" ", ur"\ ")
                self.insert_text(txt)
84407
def paste_format(self):
        

        row, col, tab = self.grid.actions.cursor

        selection = self.get_selection()
        if selection:
            # Use selection rather than cursor for top left cell if present
            row, col = [tl if tl is not None else 0
                        for tl in selection.get_bbox()[0]]

        cell_attributes = self.grid.code_array.cell_attributes

        string_data = self.grid.main_window.clipboard.get_clipboard()
        format_data = ast.literal_eval(string_data)

        ca = format_data["cell_attributes"]
        rh = format_data["row_heights"]
        cw = format_data["col_widths"]

        assert isinstance(ca, types.ListType)
        assert isinstance(rh, types.DictType)
        assert isinstance(cw, types.DictType)

        # Cell attributes

        for selection_params, tab, attrs in ca:
            base_selection = Selection(*selection_params)
            shifted_selection = base_selection.shifted(row, col)
            if "merge_area" not in attrs:
                # Do not paste merge areas because this may have
                # inintended consequences for existing merge areas
                new_cell_attribute = shifted_selection, tab, attrs
                cell_attributes.append(new_cell_attribute)

        # Row heights
        row_heights = self.grid.code_array.row_heights
        for __row, __tab in rh:
            row_heights[__row+row, tab] = rh[__row, __tab]

        # Column widths
        col_widths = self.grid.code_array.col_widths
        for __col, __tab in cw:
            col_widths[__col+col, tab] = cw[(__col, __tab)]
728384
def _get_pasteas_data(self, dim, obj):
        

        if dim == 0:
            return [[repr(obj)]]
        elif dim == 1:
            return [[repr(o)] for o in obj]
        elif dim == 2:
            return [map(repr, o) for o in obj]
1101149
def _textToTable(self, text, separator='\t'):
        
        table = None
        if text.startswith('[[') or text.startswith('(('):
            try:
                # maybe it's already formated as a list e.g. "[['1','2'],[...]]"
                # check it:
                t = eval(text)
            # has to be a 2d-list:
                if isinstance(t, list) and isinstance(t[0], list):
                    table = t
            except SyntaxError:
                # not a valid list
                pass
        if not table:
            # create the list from the clipboard-text
            # therefore the text has to be formated like this:
                # "1\t2\3\n4\t5\6\n"
            table = text.split('\n')
            n = 0
            while n < len(table):
                sline = table[n].split(separator)
                if sline != ['']:
                    table[n] = sline
                else:
                    table.pop(n)
                    n -= 1
                n += 1
        return table
982180
def copy_selection_to_clipboard(self): # ()
        '''
        if self.enable_win32_clipboard and self.enable_selection and self.selection_mark >= 0:
                selection_mark = min(self.selection_mark,len(self.line_buffer))
                cursor = min(self.point,len(self.line_buffer))
                if self.selection_mark == -1:
                        return
                begin = min(cursor, selection_mark)
                end = max(cursor, selection_mark)
                toclipboard = u"".join(self.line_buffer[begin:end])
                clipboard.SetClipboardText(toclipboard)
163261
def _restore_clipboard_text(self, backup: str):
        """"""
        # Pasting takes some time, so wait a bit before restoring the content. Otherwise the restore is done before
        # the pasting happens, causing the backup to be pasted instead of the desired clipboard content.
        time.sleep(0.2)
        self.clipboard.text = backup if backup is not None else ""
795797
def paste( self ):
        
        text = nativestring(QApplication.clipboard().text())
        for tag in text.split(','):
            tag = tag.strip()
            if ( self.isTagValid(tag) ):
                self.addTag(tag)
759285
def copy_selection(self, _cut=False):
        
        new_document, clipboard_data = self.document.cut_selection()
        if _cut:
            self.document = new_document

        self.selection_state = None
        return clipboard_data
787416
def paste(_ = nil)
      data = +""
      if 0 != User32.open( 0 )
        hclip = User32.get( CF_UNICODETEXT )
        if hclip && 0 != hclip
          pointer_to_data = Kernel32.lock( hclip )
          # Windows Unicode is ended by two null bytes, so get the whole string
          size = Kernel32.size( hclip )
          data << pointer_to_data.get_bytes( 0, size - 2 )
          data.force_encoding("UTF-16LE")
          Kernel32.unlock( hclip )
        end
        User32.close( )
      end
      data
    end
417238
public boolean pasteTopicsFromClipboard() {
    boolean result = false;

    if (this.lockIfNotDisposed()) {
      try {
        final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        if (Utils.isDataFlavorAvailable(clipboard, MMDTopicsTransferable.MMD_DATA_FLAVOR)) {
          try {
            final NBMindMapTopicsContainer container = (NBMindMapTopicsContainer) clipboard.getData(MMDTopicsTransferable.MMD_DATA_FLAVOR);
            if (container != null && !container.isEmpty()) {

              final Topic[] selected = this.getSelectedTopics();

              if (selected.length > 0) {
                for (final Topic s : selected) {
                  for (final Topic t : container.getTopics()) {
                    final Topic newTopic = new Topic(this.model, t, true);
                    newTopic.removeExtra(Extra.ExtraType.TOPIC);
                    newTopic.moveToNewParent(s);
                    MindMapUtils.ensureVisibility(newTopic);
                  }
                }
              }

              doLayout();
              revalidate();
              repaint();

              fireNotificationMindMapChanged(true);
              result = true;
            }
          } catch (final Exception ex) {
            LOGGER.error("Can't get clipboard data", ex);
          }
        } else if (Utils.isDataFlavorAvailable(clipboard, DataFlavor.stringFlavor)) {
          try {
            final int MAX_TEXT_LEN = 96;
            String clipboardText = (String) clipboard.getContents(null).getTransferData(DataFlavor.stringFlavor);

            if (clipboardText != null) {
              clipboardText = clipboardText.trim();

              final String topicText;
              final String extraNoteText;

              if (clipboardText.length() > MAX_TEXT_LEN) {
                topicText = clipboardText.substring(0, MAX_TEXT_LEN) + "...";
                extraNoteText = clipboardText;
              } else {
                topicText = clipboardText;
                extraNoteText = null;
              }

              final Topic[] selectedTopics = this.getSelectedTopics();

              if (selectedTopics.length > 0) {
                for (final Topic s : selectedTopics) {
                  final Topic newTopic;
                  if (extraNoteText == null) {
                    newTopic = new Topic(this.model, s, topicText);
                  } else {
                    newTopic = new Topic(this.model, s, topicText, new ExtraNote(extraNoteText));
                  }
                  MindMapUtils.ensureVisibility(newTopic);
                }

                doLayout();
                revalidate();
                repaint();

                fireNotificationMindMapChanged(true);
                result = true;
              }

            }
          } catch (Exception ex) {
            LOGGER.error("Can't get clipboard text", ex);
          }
        }
      } finally {
        this.unlock();
      }
    }
    return result;
  }
51920
def paste(self, mimeData):
        
        if self.isActive():
            self.delete()
        elif self._qpart.textCursor().hasSelection():
            self._qpart.textCursor().deleteChar()

        text = bytes(mimeData.data(self.MIME_TYPE)).decode('utf8')
        lines = text.splitlines()
        cursorLine, cursorCol = self._qpart.cursorPosition
        if cursorLine + len(lines) > len(self._qpart.lines):
           for i in range(cursorLine + len(lines) - len(self._qpart.lines)):
               self._qpart.lines.append('')

        with self._qpart:
            for index, line in enumerate(lines):
                currentLine = self._qpart.lines[cursorLine + index]
                newLine = currentLine[:cursorCol] + \
                          self._indentUpTo(currentLine, cursorCol) + \
                          line + \
                          currentLine[cursorCol:]
                self._qpart.lines[cursorLine + index] = newLine
        self._qpart.cursorPosition = cursorLine, cursorCol
1136642
def paste_action_callback(self, *event):
        """"""
        if react_to_event(self.view, self.oc_list_ctrl.tree_view, event) and self.oc_list_ctrl.active_entry_widget is None:
            global_clipboard.paste(self.model, limited=['outcomes'])
            return True
505764
def paste(self,e):
        '''
        if self.enable_win32_clipboard:
                txt=clipboard.get_clipboard_text_and_convert(False)
                self.insert_text(txt)
781272
def copy(string, **kwargs):
    """"""
    window = Tk()
    window.withdraw()
    window.clipboard_clear()
    window.clipboard_append(string)
    window.destroy()
    return
1172073
def paste(**kwargs):
    """"""
    window = Tk()
    window.withdraw()
    d = window.selection_get(selection = 'CLIPBOARD')
    return d
1133151
def cut
      str = selection_text
      unless str.empty?
        Clipboard.copy str
        self.selection_text = '' if editable?
      end
    end
899182
def p_print_list_tab(p):
    
    p[0] = make_sentence('PRINT_TAB',
                         make_typecast(TYPE.ubyte, p[2], p.lineno(1)))