parameters: (
          self,
          data: ClipboardData,
          paste_mode: PasteMode = PasteMode.EMACS,
          count: int = 1,
      )
return_statement: return Document(text=new_text, cursor_position=new_cursor_position)
docstring: Return a new :class:`.Document` instance which contains the result if
          we would paste this data at the current cursor position.
  
          :param paste_mode: Where to paste. (Before/after/emacs.)
          :param count: When >1, Paste multiple times.
docstring_summary: Return a new :class:`.Document` instance which contains the result if
          we would paste this data at the current cursor position.
docstring_tokens: Return a new : class : . Document instance which contains the result if we would paste this data at the current cursor position .
function: def paste_clipboard_data(
          self,
          data: ClipboardData,
          paste_mode: PasteMode = PasteMode.EMACS,
          count: int = 1,
      ) -> "Document":
          """
          Return a new :class:`.Document` instance which contains the result if
          we would paste this data at the current cursor position.
  
          :param paste_mode: Where to paste. (Before/after/emacs.)
          :param count: When >1, Paste multiple times.
          """
          before = paste_mode == PasteMode.VI_BEFORE
          after = paste_mode == PasteMode.VI_AFTER
  
          if data.type == SelectionType.CHARACTERS:
              if after:
                  new_text = (
                      self.text[: self.cursor_position + 1]
                      + data.text * count
                      + self.text[self.cursor_position + 1 :]
                  )
              else:
                  new_text = (
                      self.text_before_cursor + data.text * count + self.text_after_cursor
                  )
  
              new_cursor_position = self.cursor_position + len(data.text) * count
              if before:
                  new_cursor_position -= 1
  
          elif data.type == SelectionType.LINES:
              l = self.cursor_position_row
              if before:
                  lines = self.lines[:l] + [data.text] * count + self.lines[l:]
                  new_text = "\n".join(lines)
                  new_cursor_position = len("".join(self.lines[:l])) + l
              else:
                  lines = self.lines[: l + 1] + [data.text] * count + self.lines[l + 1 :]
                  new_cursor_position = len("".join(self.lines[: l + 1])) + l + 1
                  new_text = "\n".join(lines)
  
          elif data.type == SelectionType.BLOCK:
              lines = self.lines[:]
              start_line = self.cursor_position_row
              start_column = self.cursor_position_col + (0 if before else 1)
  
              for i, line in enumerate(data.text.split("\n")):
                  index = i + start_line
                  if index >= len(lines):
                      lines.append("")
  
                  lines[index] = lines[index].ljust(start_column)
                  lines[index] = (
                      lines[index][:start_column]
                      + line * count
                      + lines[index][start_column:]
                  )
  
              new_text = "\n".join(lines)
              new_cursor_position = self.cursor_position + (0 if before else 1)
  
          return Document(text=new_text, cursor_position=new_cursor_position)
function_tokens: def paste_clipboard_data ( self , data : ClipboardData , paste_mode : PasteMode = PasteMode . EMACS , count : int = 1 , ) -> "Document" : before = paste_mode == PasteMode . VI_BEFORE after = paste_mode == PasteMode . VI_AFTER if data . type == SelectionType . CHARACTERS : if after : new_text = ( self . text [ : self . cursor_position + 1 ] + data . text * count + self . text [ self . cursor_position + 1 : ] ) else : new_text = ( self . text_before_cursor + data . text * count + self . text_after_cursor ) new_cursor_position = self . cursor_position + len ( data . text ) * count if before : new_cursor_position -= 1 elif data . type == SelectionType . LINES : l = self . cursor_position_row if before : lines = self . lines [ : l ] + [ data . text ] * count + self . lines [ l : ] new_text = "\n" . join ( lines ) new_cursor_position = len ( "" . join ( self . lines [ : l ] ) ) + l else : lines = self . lines [ : l + 1 ] + [ data . text ] * count + self . lines [ l + 1 : ] new_cursor_position = len ( "" . join ( self . lines [ : l + 1 ] ) ) + l + 1 new_text = "\n" . join ( lines ) elif data . type == SelectionType . BLOCK : lines = self . lines [ : ] start_line = self . cursor_position_row start_column = self . cursor_position_col + ( 0 if before else 1 ) for i , line in enumerate ( data . text . split ( "\n" ) ) : index = i + start_line if index >= len ( lines ) : lines . append ( "" ) lines [ index ] = lines [ index ] . ljust ( start_column ) lines [ index ] = ( lines [ index ] [ : start_column ] + line * count + lines [ index ] [ start_column : ] ) new_text = "\n" . join ( lines ) new_cursor_position = self . cursor_position + ( 0 if before else 1 ) return Document ( text = new_text , cursor_position = new_cursor_position )