
    cMh                        d Z ddlmZ ddlmZ ddlmZ 	 ddlZdZn# e	$ r dZY nw xY w	 ddl
Z
dZn# e	$ r dZY nw xY wddZer G d dej                  Zer G d de
j                  ZdS dS )zC
Patched ``BZ2File`` and ``LZMAFile`` to handle pickle protocol 5.
    )annotations)PickleBuffer)PY310NTFb-bytes | bytearray | memoryview | PickleBufferreturnbytes | bytearray | memoryviewc                   t          | t          t          f          r| S t          | t                    st          |           } 	 |                                 S # t
          $ r% t          |                               d          cY S w xY w)z
    Return some 1-D `uint8` typed buffer.

    Coerces anything that does not match that description to one that does
    without copying if possible (otherwise will copy).
    A)
isinstancebytes	bytearrayr   rawBufferError
memoryviewtobytes)r   s    Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pandas/compat/compressors.pyflatten_bufferr      s     !eY'(( a&& OO*uuww * * *!}}$$S)))))*s   A ,BBc                  ,     e Zd Zes
d fdZ xZS  xZS )BZ2Filer   intc                `    t                                          t          |                    S Nsuperwriter   selfr   	__class__s     r   r   zBZ2File.write7   #     ww}}^A%6%6777    r   r   __name__
__module____qualname__r   r   __classcell__r   s   @r   r   r   4   Y         		88 8 8 8 8 8 8 8 8 8		8 		8 		8 		8r!   r   c                  ,     e Zd Zes
d fdZ xZS  xZS )LZMAFiler   r   c                `    t                                          t          |                    S r   r   r   s     r   r   zLZMAFile.writeF   r    r!   r"   r#   r(   s   @r   r+   r+   C   r)   r!   r+   )r   r   r   r	   )__doc__
__future__r   pickler   pandas.compat._constantsr   bz2has_bz2ImportErrorlzmahas_lzmar   r   r+    r!   r   <module>r7      sM    # " " " " "       * * * * * *JJJGG   GGGKKKHH   HHH* * * *0  8
8 
8 
8 
8 
8#+ 
8 
8 
8  8
8 
8 
8 
8 
84= 
8 
8 
8 
8 
88 8s    ''2 <<