o �J�h��@s>ddlmZddlZddlmZddlmZGdd�d�ZdS)�)� annotationsN)�IO���o8c@s(eZdZdZdZd dd�Zdd d �Zd S)�GimpPaletteFilez'File handler for GIMP's palette format.�RGB�fp� IO[bytes]�return�NonecCs�dd�td�D�}|��dd�dkrd}t|��td�D]J}|��}|s'nAt�d|�r.qt|�dkr:d }t|��ttt|� �dd ���}t|�d krSd }t |��t |d �t |d �t |d�||<qd� |�|_ dS)NcSsg|]}t|�d�qS)�r)�.0�i�r�QC:\pinokio\api\whisper-webui.git\app\env\lib\site-packages\PIL\GimpPaletteFile.py� <listcomp>sz,GimpPaletteFile.__init__.<locals>.<listcomp>�� s GIMP Paletteznot a GIMP palette files\w+:|#�dzbad palette filer zbad palette entryrr��)�range�readline� SyntaxError�re�match�len�tuple�map�int�split� ValueErrorr�join�palette)�selfr r$�msgr�s�vrrr�__init__s&    *zGimpPaletteFile.__init__�tuple[bytes, str]cCs |j|jfS)N)r$�rawmode)r%rrr� getpalette9s zGimpPaletteFile.getpaletteN)r r r r )r r*)�__name__� __module__� __qualname__�__doc__r+r)r,rrrrrs  r)� __future__rr�typingr�_binaryrrrrrr�<module>s   
Memory