
    `Vg5                    p    d Z ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZmZ d
ddZ	 d	 	 	 	 	 dd	Zy)z io on the clipboard     )annotations)StringION)find_stack_level)ABCDataFrame)
get_optionoption_contextc                   |j                  dd      }|.|j                         j                  dd      dk7  rt        d      dd	lm} dd
lm}  |       }	 |j                  |j                  d      xs t        d            }|dd j                  d      dd dd }|D ch c]"  }|j                  d      j                  d      $ }}t        |      dkD  rxt        |      dk(  rj|j                         dk7  rWd} t        |d         t        |d   j                  d            z
  }	|	dk7  r$|j!                  dt#        t%        |	                   | |j                  d      d} t        |       dkD  r|j                  d      d|d<   nAt        |       dkD  r3|j                  d      dk(  rt'        j(                  dt+                       |t-        |      fd| i|S # t        $ r Y hw xY wc c}w )aj  
    Read text from clipboard and pass to read_csv.

    Parameters
    ----------
    sep : str, default '\s+'
        A string or regex delimiter. The default of '\s+' denotes
        one or more whitespace characters.

    **kwargs
        See read_csv for the full argument list.

    Returns
    -------
    DataFrame
        A parsed DataFrame object.
    encodingutf-8N- utf8z3reading from clipboard only supports utf-8 encodingr   )clipboard_get)read_csvzdisplay.encodingi'  

    	   z 		index_coldelim_whitespace\s+enginepythonczIread_clipboard with regex separator does not work properly with c engine.
stacklevelsep)poplowerreplaceNotImplementedErrorpandas.io.clipboardr   pandas.io.parsersr   decodegetr   AttributeErrorsplitlstripcountlen
setdefaultlistrangewarningswarnr   r   )
r   kwargsr
   r   r   textlinesxcountsindex_lengths
             U/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/pandas/io/clipboards.pyread_clipboardr9      s   $ zz*g.H  0 8 8b AV K!"WXX1*?D{{6::j1SZ@R5ST %Lt$Sb)#2.E 277Aahhsm!!$'7F7
5zA~#f+*vzz|q/@ 58}s58??5+A'BB1k4l0C+DE {vzz"45= 3x!|

8,4#x	SA&**X.#5W')	

 HTN66v66M   8s   -G  "'G0 	G-,G-c                h   |j                  dd      }|.|j                         j                  dd      dk7  rt        d      dd	lm} |d
}|r>	 |d}t               } | j                  |f|dd| |j                         } ||       y|t        j                  dt                      t        | t              r(t        dd      5   | j                   di |}ddd       nt#        |       } |       y# t        $ r" t        j                  dt                      Y vw xY w# 1 sw Y   @xY w)a  
    Attempt to write text representation of object to the system clipboard
    The clipboard can be then pasted into Excel for example.

    Parameters
    ----------
    obj : the object to write to the clipboard
    excel : bool, defaults to True
            if True, use the provided separator, writing in a csv
            format for allowing easy pasting into excel.
            if False, write a string representation of the object
            to the clipboard
    sep : optional, defaults to tab
    other keywords are passed to to_csv

    Notes
    -----
    Requirements for your platform
      - Linux: xclip, or xsel (with PyQt4 modules)
      - Windows:
      - OS X:
    r
   r   Nr   r   r   z&clipboard only supports utf-8 encodingr   )clipboard_setTr   )r   r
   zAto_clipboard in excel mode requires a single character separator.r   z7to_clipboard with excel=False ignores the sep argument.zdisplay.max_colwidth )r    r!   r"   
ValueErrorr$   r;   r   to_csvgetvalue	TypeErrorr0   r1   r   
isinstancer   r   	to_stringstr)	objexcelr   r2   r
   r;   bufr3   objstrs	            r8   to_clipboardrH   [   s4   2 zz*g.H  0 8 8b AV KABB1}	{*C CJJs@g@@<<>D$ 
E')	

 #|$2D9 	-"S]],V,F	- 	- S&#  	MMS+-		- 	-s   <C: 
D(:(D%$D%(D1)r   )r   rC   )TN)rE   zbool | Noner   z
str | NonereturnNone)__doc__
__future__r   ior   r0   pandas.util._exceptionsr   pandas.core.dtypes.genericr   pandasr   r   r9   rH   r<       r8   <module>rR      sI     "   4 3G7V 7;AA)3A	ArQ   