Sindbad~EG File Manager
�
Mٜg� � �� � d Z ddlmZ ddlmZ ddlmZ ddlZdZ ddl
Z
dZ d
d�Zer G d � d
ej � Z
er G d� de
j � Zyy# e $ r dZY �Hw xY w# e $ r dZY �Nw xY w)zC
Patched ``BZ2File`` and ``LZMAFile`` to handle pickle protocol 5.
� )�annotations)�PickleBuffer)�PY310NTFc �� � t | t t f� r| S t | t � st | � } | j � S # t
$ r t
| � j d� cY S w xY 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 �D/usr/local/lib/python3.12/site-packages/pandas/compat/compressors.py�flatten_bufferr s_ � � �!�e�Y�'�(����a��&���O��*��u�u�w���� *��!�}�$�$�S�)�)�*�s �A �#A+�*A+c �, � � e Zd Zes
d� fd�Z� xZS � xZS )�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 Zd Zes
d� fd�Z� xZS � xZS )�LZMAFilec �4 �� t �| � t |� � S r r r s �r r zLZMAFile.writeF r r r r! r&