
    Mh                        S r SSKJr  SSKJr  SSKJr  SSKrSSKJ	r	  SSK
Jr  SSKJr  SS	KJr  SS
KJrJr  \(       a  SSKJr  S\	R*                  4   SS jjr S     SS jjrg)zio on the clipboard     )annotations)StringIO)TYPE_CHECKINGN)lib)find_stack_level)check_dtype_backend)ABCDataFrame)
get_optionoption_context)DtypeBackend\s+c                $   UR                  SS5      nUb/  UR                  5       R                  SS5      S:w  a  [        S5      e[	        U5        SS	KJn  SS
KJn  U" 5       n UR                  UR                  S5      =(       d    [        S5      5      nUSS R                  S5      SS SS nU Vs1 s H"  oR                  S5      R                  S5      iM$     n	n[!        U5      S:  a{  [!        U	5      S:X  al  U	R                  5       S:w  aX  Sn [!        US   5      [!        US   R                  S5      5      -
  n
U
S:w  a$  UR#                  S[%        ['        U
5      5      5        U c  UR                  S5      c  Sn [!        U 5      S:  a  UR                  S5      c  SUS'   OA[!        U 5      S:  a2  UR                  S5      S:X  a  [(        R*                  " S[-        5       S9  U" [/        U5      4XS.UD6$ ! [         a     GNsf = fs  snf )a  
Read text from clipboard and pass to :func:`~pandas.read_csv`.

Parses clipboard contents similar to how CSV files are parsed
using :func:`~pandas.read_csv`.

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

dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
    Back-end data type applied to the resultant :class:`DataFrame`
    (still experimental). Behaviour is as follows:

    * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
      (default).
    * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
      DataFrame.

    .. versionadded:: 2.0

**kwargs
    See :func:`~pandas.read_csv` for the full argument list.

Returns
-------
DataFrame
    A parsed :class:`~pandas.DataFrame` object.

See Also
--------
DataFrame.to_clipboard : Copy object to the system clipboard.
read_csv : Read a comma-separated values (csv) file into DataFrame.
read_fwf : Read a table of fixed-width formatted lines into DataFrame.

Examples
--------
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
>>> df.to_clipboard()  # doctest: +SKIP
>>> pd.read_clipboard()  # doctest: +SKIP
     A  B  C
0    1  2  3
1    4  5  6
encodingutf-8N- utf8z3reading from clipboard only supports utf-8 encodingr   )clipboard_get)read_csvzdisplay.encodingi'  

    	   z 		index_coldelim_whitespacer   enginepythonczIread_clipboard with regex separator does not work properly with c engine.
stacklevel)sepdtype_backend)poplowerreplaceNotImplementedErrorr   pandas.io.clipboardr   pandas.io.parsersr   decodegetr
   AttributeErrorsplitlstripcountlen
setdefaultlistrangewarningswarnr   r   )r#   r$   kwargsr   r   r   textlinesxcountsindex_lengths              F/var/www/html/env/lib/python3.13/site-packages/pandas/io/clipboards.pyread_clipboardr>      s   f 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7Ahhsm!!$'F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SSFSSM   8s   $2G< 4)H<
H
	H
c                   UR                  SS5      nUb/  UR                  5       R                  SS5      S:w  a  [        S5      eSS	KJn  Uc  S
nU(       a?   Uc  Sn[        5       nU R                  " U4USS.UD6  UR                  5       nU" U5        gUb  [        R                  " S[        5       S9  [        U [        5      (       a(  [        SS5         U R                   " S0 UD6nSSS5        O[#        U 5      nU" W5        g! [         a     [        R                  " S[        5       S9   Nzf = f! , (       d  f       ND= f)ab  
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	TypeErrorr5   r6   r   
isinstancer	   r   	to_stringstr)	objexcelr#   r7   r   r@   bufr8   objstrs	            r=   to_clipboardrM      s*   2 zz*g.H  0 8 8b AV KABB1}	{*C JJs@g@@<<>D$ 
E')	

 #|$$2D9]],V,F :9 S&#  	MMS+-	 :9s   =D D4'D10D14
E)r#   rH   r$   zDtypeBackend | lib.NoDefault)TN)rJ   zbool | Noner#   z
str | NonereturnNone)__doc__
__future__r   ior   typingr   r5   pandas._libsr   pandas.util._exceptionsr   pandas.util._validatorsr   pandas.core.dtypes.genericr	   pandasr
   r   pandas._typingr   
no_defaultr>   rM   rA       r=   <module>r\      s{     "      4 7 3
 + 25..jT	jT/jT\ 7;AA)3A	Ar[   