o
    ä¤g·  ã                   @  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   ú[/var/www/html/ecg_monitoring/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,    ÿÿ
þ