o
    vh                     @  s   d Z ddlmZ ddlmZ ddlmZ zddlZdZW n e	y'   dZY nw zddl
Z
dZW n e	y;   dZY nw dddZerLG dd dejZerYG d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                 C  sP   t | ttfr	| S t | tst| } z|  W S  ty'   t| d Y S 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    r   W/var/www/html/hyperkenya/venv/lib/python3.10/site-packages/pandas/compat/compressors.pyflatten_buffer   s   


r   c                      *   e Zd Zesd fddZ  ZS   ZS )BZ2Filer   intc                      t  t|S Nsuperwriter   selfr   	__class__r   r   r   7      zBZ2File.writer   r   __name__
__module____qualname__r   r   __classcell__r   r   r   r   r   4       r   c                      r   )LZMAFiler   r   c                   r   r   r   r   r   r   r   r   F   r    zLZMAFile.writer!   r"   r   r   r   r   r(   C   r'   r(   )r   r   r   r   )__doc__
__future__r   pickler   pandas.compat._constantsr   bz2has_bz2ImportErrorlzmahas_lzmar   r   r(   r   r   r   r   <module>   s,    
