
    Pwg                        d Z ddlmZ ddlmZ ddlmZ 	 ddlZdZ	 ddl
Z
dZ	 	 	 	 ddZer G d	 d
ej                        Zer G d de
j                        Zyy# e	$ r dZY Hw xY w# e	$ r dZY Nw xY w)zC
Patched ``BZ2File`` and ``LZMAFile`` to handle pickle protocol 5.
    )annotations)PickleBuffer)PY310NTFc                    t        | t        t        f      r| S t        | t              st        |       } 	 | j	                         S # t
        $ r t        |       j                  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)bs    P/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/compat/compressors.pyflatten_bufferr      s_     !eY'(a&O*uuw *!}$$S))*s   A #A+*A+c                  ,     e Zd Zes
d fdZ xZS  xZS )BZ2Filec                4    t         |   t        |            S Nsuperwriter   selfr   	__class__s     r   r   zBZ2File.write7        w}^A%677    returnint__name__
__module____qualname__r   r   __classcell__r   s   @r   r   r   4       8 8 r   r   c                  ,     e Zd Zes
d fdZ xZS  xZS )LZMAFilec                4    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   z-bytes | bytearray | memoryview | PickleBufferr   zbytes | bytearray | memoryview)__doc__
__future__r   pickler   pandas.compat._constantsr   bz2has_bz2ImportErrorlzmahas_lzmar   r   r)    r   r   <module>r5      s    #  *GH
*4*#*0 
8#++ 
8 
84== 
8 e  G  Hs"   A A( A%$A%(A21A2