U
    aW                     @   s  d Z ddlmZmZ ddlmZ ddlmZm	Z	m
Z
 ddlZejdkZerTeZeZneZdZdZdZd	Zd
ZdZdZdZdZdZdZdZdZG dd de Z!G dd de"Z#G dd de#Z$G dd de#Z%G dd de$Z&G dd de$Z'G dd  d e$Z(G d!d" d"e$Z)G d#d$ d$e$Z*G d%d& d&e$Z+G d'd( d(e#e	Z,G d)d* d*e#e	Z-G d+d, d,e#e	Z.G d-d. d.e#e
Z/G d/d0 d0e#e	Z0G d1d2 d2e#eZ1ee%ee&ee'ee(ee)ee*ee+ee,ee/ee0ee1ee-ee.iZ2G d3d4 d4e1Z3dS )5z
Handle the NBT (Named Binary Tag) data format

For more information about the NBT format:
https://minecraft.gamepedia.com/NBT_format
    )Structerror)GzipFile)MutableMappingMutableSequenceSequenceN)         r                  	   
         c                   @   s   e Zd ZdZdS )MalformedFileErrorz Exception raised on parse error.N)__name__
__module____qualname____doc__ r   r   #/home/brian/mcmap/coffee/nbt/nbt.pyr   #   s   r   c                   @   sh   e Zd ZdZdZdddZdd Zdd Zd	d
 Zdd Z	dd Z
dddZdd Zdd Zdd ZdS )TAGz'TAG, a variable with an intrinsic name.Nc                 C   s   || _ || _d S N)namevalue)selfr   r   r   r   r   __init__,   s    zTAG.__init__c                 C   s   t | jjd S r   NotImplementedError	__class__r   r   bufferr   r   r   _parse_buffer1   s    zTAG._parse_bufferc                 C   s   t | jjd S r   r!   r$   r   r   r   _render_buffer4   s    zTAG._render_bufferc                 C   s(   | j j| jrd| j nd d |   S )z:Return Unicode string with class, name and unnested value.z(%r) z: )r#   r   r   valuestrr   r   r   r   tag_info8   s    zTAG.tag_infoc                 C   s
   t | jS )zWReturn Unicode string of unnested value. For iterators, this
        returns a summary.unicoder   r*   r   r   r   r)   >   s    zTAG.valuestrc                 C   s
   t | jS )z"Return Unicode string of tag name.)r-   r   r*   r   r   r   namestrC   s    zTAG.namestrr   c                 C   s   d| |    S )zfReturn formated Unicode string of self, where iterable items are
        recursively listed in detail.	r+   )r   indentr   r   r   pretty_treeG   s    zTAG.pretty_treec                 C   s
   t | jS )zReturn a unicode string with the result in human readable format.
        Unlike valuestr(), the result is recursive for iterators till at least
        one level deep.r,   r*   r   r   r   __unicode__M   s    zTAG.__unicode__c                 C   s
   t | jS )zReturn a string (ascii formated for Python 2, unicode for Python 3)
        with the result in human readable format. Unlike valuestr(), the result
         is recursive for iterators till at least one level deep.)strr   r*   r   r   r   __str__S   s    zTAG.__str__c                 C   s   d| j j| jt| f S )zReturn a string (ascii formated for Python 2, unicode for Python 3)
        describing the class, name and id for debugging purposes.z<%s(%r) at 0x%x>)r#   r   r   idr*   r   r   r   __repr__]   s
      zTAG.__repr__)NN)r   )r   r   r   r   r6   r    r&   r'   r+   r)   r.   r2   r3   r5   r7   r   r   r   r   r   (   s   


r   c                       s2   e Zd ZdZd	 fdd	Zdd Zdd Z  ZS )
_TAG_Numericz6_TAG_Numeric, comparable to int with an intrinsic nameNc                    s$   t t| || |r | | d S r   )superr8   r    r&   r   r   r   r%   r#   r   r   r    g   s    z_TAG_Numeric.__init__c                 C   s    | j || j jd | _d S )Nr   )fmtunpackreadsizer   r$   r   r   r   r&   m   s    z_TAG_Numeric._parse_bufferc                 C   s   | | j| j d S r   )writer<   packr   r$   r   r   r   r'   r   s    z_TAG_Numeric._render_buffer)NNN)r   r   r   r   r    r&   r'   __classcell__r   r   r;   r   r8   d   s   r8   c                   @   s(   e Zd ZeZedZdd Zdd ZdS )_TAG_End>bc                 C   s.   | j |dd }|dkr*td| d S )Nr	   r   z/A Tag End must be rendered as '0', not as '%d'.)r<   r=   r>   
ValueError)r   r%   r   r   r   r   r&   z   s
    z_TAG_End._parse_bufferc                 C   s   | d d S N    )r@   r$   r   r   r   r'      s    z_TAG_End._render_bufferN)	r   r   r   TAG_ENDr6   r   r<   r&   r'   r   r   r   r   rC   v   s   rC   c                   @   s   e Zd ZdZeZedZdS )TAG_Bytez&Represent a single tag storing 1 byte.rD   N)r   r   r   r   TAG_BYTEr6   r   r<   r   r   r   r   rI      s   rI   c                   @   s   e Zd ZdZeZedZdS )	TAG_Shortz'Represent a single tag storing 1 short.z>hN)r   r   r   r   	TAG_SHORTr6   r   r<   r   r   r   r   rK      s   rK   c                   @   s   e Zd ZdZeZedZdS )TAG_Intz%Represent a single tag storing 1 int.z>iN)r   r   r   r   TAG_INTr6   r   r<   r   r   r   r   rM      s   rM   c                   @   s   e Zd ZdZeZedZdS )TAG_Longz&Represent a single tag storing 1 long.z>qN)r   r   r   r   TAG_LONGr6   r   r<   r   r   r   r   rO      s   rO   c                   @   s   e Zd ZdZeZedZdS )	TAG_Floatz@Represent a single tag storing 1 IEEE-754 floating point number.z>fN)r   r   r   r   	TAG_FLOATr6   r   r<   r   r   r   r   rQ      s   rQ   c                   @   s   e Zd ZdZeZedZdS )
TAG_DoublezURepresent a single tag storing 1 IEEE-754 double precision floating
    point number.z>dN)r   r   r   r   
TAG_DOUBLEr6   r   r<   r   r   r   r   rS      s   rS   c                       s   e Zd ZdZeZd fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Z  ZS )TAG_Byte_Arrayzt
    TAG_Byte_Array, comparable to a collections.UserList with
    an intrinsic name whose values must be bytes
    Nc                    s$   t t| j|d |r | | d S Nr   )r9   rU   r    r&   r   r   r%   r;   r   r   r       s    zTAG_Byte_Array.__init__c                 C   s    t |d}t||j| _d S Nr%   )rM   	bytearrayr>   r   r   r%   lengthr   r   r   r&      s    
zTAG_Byte_Array._parse_bufferc                 C   s,   t t| j}|| |t| j d S r   )rM   lenr   r'   r@   bytesr\   r   r   r   r'      s    
zTAG_Byte_Array._render_bufferc                 C   s
   t | jS r   r^   r   r*   r   r   r   __len__   s    zTAG_Byte_Array.__len__c                 C   s
   t | jS r   iterr   r*   r   r   r   __iter__   s    zTAG_Byte_Array.__iter__c                 C   s
   || j kS r   r   r   itemr   r   r   __contains__   s    zTAG_Byte_Array.__contains__c                 C   s
   | j | S r   re   r   keyr   r   r   __getitem__   s    zTAG_Byte_Array.__getitem__c                 C   s   || j |< d S r   re   r   rj   r   r   r   r   __setitem__   s    zTAG_Byte_Array.__setitem__c                 C   s   | j |= d S r   re   ri   r   r   r   __delitem__   s    zTAG_Byte_Array.__delitem__c                 C   s   | j || d S r   r   insertrl   r   r   r   rp      s    zTAG_Byte_Array.insertc                 C   s   dt | j S )Nz[%i byte(s)]r`   r*   r   r   r   r)      s    zTAG_Byte_Array.valuestrc                 C   s   dd dd | jD  d S )N[,c                 S   s   g | ]}t |qS r   )r-   .0xr   r   r   
<listcomp>   s     z.TAG_Byte_Array.__unicode__.<locals>.<listcomp>]joinr   r*   r   r   r   r3      s    zTAG_Byte_Array.__unicode__c                 C   s   dd dd | jD  d S )Nrq   rr   c                 S   s   g | ]}t |qS r   )r4   rs   r   r   r   rv      s     z*TAG_Byte_Array.__str__.<locals>.<listcomp>rw   rx   r*   r   r   r   r5      s    zTAG_Byte_Array.__str__)NN)r   r   r   r   TAG_BYTE_ARRAYr6   r    r&   r'   ra   rd   rh   rk   rm   rn   rp   r)   r3   r5   rB   r   r   r;   r   rU      s   rU   c                       s~   e Zd ZdZeZd fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Z  ZS )TAG_Int_Arrayzv
    TAG_Int_Array, comparable to a collections.UserList with
    an intrinsic name whose values must be integers
    Nc                    s$   t t| j|d |r | | d S rV   )r9   r{   r    r&   rX   r;   r   r   r       s    zTAG_Int_Array.__init__c                 C   s   t dt| d | _dS )2 Adjust struct format description to length given >iNr   r4   r<   r   r]   r   r   r   
update_fmt   s    zTAG_Int_Array.update_fmtc                 C   s6   t |dj}| | t| j|| jj| _d S rY   rM   r   r   listr<   r=   r>   r?   r\   r   r   r   r&      s    
zTAG_Int_Array._parse_bufferc                 C   s:   t | j}| | t|| || jj| j  d S r   r^   r   r   rM   r'   r@   r<   rA   r\   r   r   r   r'      s    

zTAG_Int_Array._render_bufferc                 C   s
   t | jS r   r`   r*   r   r   r   ra     s    zTAG_Int_Array.__len__c                 C   s
   t | jS r   rb   r*   r   r   r   rd     s    zTAG_Int_Array.__iter__c                 C   s
   || j kS r   re   rf   r   r   r   rh     s    zTAG_Int_Array.__contains__c                 C   s
   | j | S r   re   ri   r   r   r   rk     s    zTAG_Int_Array.__getitem__c                 C   s   || j |< d S r   re   rl   r   r   r   rm     s    zTAG_Int_Array.__setitem__c                 C   s   | j |= d S r   re   ri   r   r   r   rn     s    zTAG_Int_Array.__delitem__c                 C   s   | j || d S r   ro   rl   r   r   r   rp     s    zTAG_Int_Array.insertc                 C   s   dt | j S )Nz[%i int(s)]r`   r*   r   r   r   r)     s    zTAG_Int_Array.valuestr)NN)r   r   r   r   TAG_INT_ARRAYr6   r    r   r&   r'   ra   rd   rh   rk   rm   rn   rp   r)   rB   r   r   r;   r   r{      s   r{   c                       s~   e Zd ZdZeZd fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Z  ZS )TAG_Long_Arrayzw
    TAG_Long_Array, comparable to a collections.UserList with
    an intrinsic name whose values must be integers
    Nc                    s$   t t| j|d |r | | d S rV   )r9   r   r    r&   rX   r;   r   r   r    &  s    zTAG_Long_Array.__init__c                 C   s   t dt| d | _dS )r|   r}   qNr   r   r   r   r   r   +  s    zTAG_Long_Array.update_fmtc                 C   s6   t |dj}| | t| j|| jj| _d S rY   r   r\   r   r   r   r&   0  s    
zTAG_Long_Array._parse_bufferc                 C   s:   t | j}| | t|| || jj| j  d S r   r   r\   r   r   r   r'   5  s    

zTAG_Long_Array._render_bufferc                 C   s
   t | jS r   r`   r*   r   r   r   ra   <  s    zTAG_Long_Array.__len__c                 C   s
   t | jS r   rb   r*   r   r   r   rd   ?  s    zTAG_Long_Array.__iter__c                 C   s
   || j kS r   re   rf   r   r   r   rh   B  s    zTAG_Long_Array.__contains__c                 C   s
   | j | S r   re   ri   r   r   r   rk   E  s    zTAG_Long_Array.__getitem__c                 C   s   || j |< d S r   re   rl   r   r   r   rm   H  s    zTAG_Long_Array.__setitem__c                 C   s   | j |= d S r   re   ri   r   r   r   rn   K  s    zTAG_Long_Array.__delitem__c                 C   s   | j || d S r   ro   rl   r   r   r   rp   N  s    zTAG_Long_Array.insertc                 C   s   dt | j S )Nz[%i long(s)]r`   r*   r   r   r   r)   R  s    zTAG_Long_Array.valuestr)NN)r   r   r   r   TAG_LONG_ARRAYr6   r    r   r&   r'   ra   rd   rh   rk   rm   rn   rp   r)   rB   r   r   r;   r   r     s   r   c                       s^   e Zd ZdZeZd fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Z  ZS )
TAG_StringzW
    TAG_String, comparable to a collections.UserString with an
    intrinsic name
    Nc                    s$   t t| || |r | | d S r   )r9   r   r    r&   r:   r;   r   r   r    ]  s    zTAG_String.__init__c                 C   s:   t |d}||j}t||jkr*t |d| _d S )NrZ   utf-8)rK   r>   r   r^   StructErrordecode)r   r%   r]   r>   r   r   r   r&   c  s
    
zTAG_String._parse_bufferc                 C   s0   | j d}tt|}|| || d S )Nr   )r   encoderK   r^   r'   r@   )r   r%   Zsave_valr]   r   r   r   r'   j  s    
zTAG_String._render_bufferc                 C   s
   t | jS r   r`   r*   r   r   r   ra   q  s    zTAG_String.__len__c                 C   s
   t | jS r   rb   r*   r   r   r   rd   t  s    zTAG_String.__iter__c                 C   s
   || j kS r   re   rf   r   r   r   rh   w  s    zTAG_String.__contains__c                 C   s
   | j | S r   re   ri   r   r   r   rk   z  s    zTAG_String.__getitem__c                 C   s   | j S r   re   r*   r   r   r   r7   ~  s    zTAG_String.__repr__)NNN)r   r   r   r   
TAG_STRINGr6   r    r&   r'   ra   rd   rh   rk   r7   rB   r   r   r;   r   r   V  s   r   c                       s   e Zd ZdZeZd" fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd# fd d!	Z  ZS )$TAG_ListzO
    TAG_List, comparable to a collections.UserList with an intrinsic name
    Nc                    s>   t t| || |r |j| _nd | _g | _|r:| | d S r   )r9   r   r    r6   tagIDtagsr&   )r   typer   r   r%   r;   r   r   r      s    
zTAG_List.__init__c                 C   sJ   t |dj| _g | _t|d}t|jD ]}| jt| j |d q(d S rY   )rI   r   r   r   rM   rangeappendTAGLIST)r   r%   r]   ru   r   r   r   r&     s
    
zTAG_List._parse_bufferc                 C   sn   t | j| tt| j}|| t| jD ]6\}}|j| jkr^td|||j| jf || q2d S )Nz4List element %d(%s) has type %d != container type %d)	rI   r   r'   rM   r^   r   	enumerater6   rE   )r   r%   r]   r~   tagr   r   r   r'     s    
zTAG_List._render_bufferc                 C   s
   t | jS r   r^   r   r*   r   r   r   ra     s    zTAG_List.__len__c                 C   s
   t | jS r   )rc   r   r*   r   r   r   rd     s    zTAG_List.__iter__c                 C   s
   || j kS r   r   rf   r   r   r   rh     s    zTAG_List.__contains__c                 C   s
   | j | S r   r   ri   r   r   r   rk     s    zTAG_List.__getitem__c                 C   s   || j |< d S r   r   rl   r   r   r   rm     s    zTAG_List.__setitem__c                 C   s   | j |= d S r   r   ri   r   r   r   rn     s    zTAG_List.__delitem__c                 C   s   | j || d S r   )r   rp   rl   r   r   r   rp     s    zTAG_List.insertc                 C   s   dt | jt| j jf S )Nz%i entries of type %sr^   r   r   r   r   r*   r   r   r   r7     s     
zTAG_List.__repr__c                 C   s   dt | jt| j jf S )Nz
[%i %s(s)]r   r*   r   r   r   r)     s    zTAG_List.valuestrc                 C   s   dd dd | jD  d S )Nrq   , c                 S   s   g | ]}|  qS r   r0   rt   r   r   r   r   rv     s     z(TAG_List.__unicode__.<locals>.<listcomp>rw   ry   r   r*   r   r   r   r3     s    zTAG_List.__unicode__c                 C   s   dd dd | jD  d S )Nrq   r   c                 S   s   g | ]}|  qS r   r0   r   r   r   r   rv     s     z$TAG_List.__str__.<locals>.<listcomp>rw   r   r*   r   r   r   r5     s    zTAG_List.__str__r   c                    sd   t t|  g}t| jrZ|d  d  | fdd| jD  |d  d  d|S )Nr/   {c                    s   g | ]}|  d  qS r	   r2   r   r1   r   r   rv     s     z(TAG_List.pretty_tree.<locals>.<listcomp>}
)r9   r   r2   r^   r   r   extendry   r   r1   outputr;   r   r   r2     s    
zTAG_List.pretty_tree)NNNN)r   )r   r   r   r   TAG_LISTr6   r    r&   r'   ra   rd   rh   rk   rm   rn   rp   r7   r)   r3   r5   r2   rB   r   r   r;   r   r     s"   r   c                       s   e Zd ZdZeZd" fdd	Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd# fd d!	Z  ZS )$TAG_CompoundzZ
    TAG_Compound, comparable to a collections.OrderedDict with an
    intrinsic name
    Nc                    s8   t t|   g | _|r || _nd| _|r4| | d S )Nr(   )r9   r   r    r   r   r&   )r   r%   r   r;   r   r   r      s    zTAG_Compound.__init__c                 C   sz   t |d}|jtkrqvq t|dj}zt|j  }W n" tk
rV   td|j Y nX ||_| j	| |
| q d S )NrZ   zUnrecognised tag type %d)rI   r   rH   r   r   KeyErrorrE   r   r   r   r&   )r   r%   r   r   r   r   r   r   r&     s    

zTAG_Compound._parse_bufferc                 C   sD   | j D ].}t|j| t|j| || q|d d S rF   )r   rI   r6   r'   r   r   r@   )r   r%   r   r   r   r   r'     s
    
zTAG_Compound._render_bufferc                 C   s
   t | jS r   r   r*   r   r   r   ra     s    zTAG_Compound.__len__c                 c   s   | j D ]}|jV  qd S r   r   r   ri   r   r   r   rd     s    
zTAG_Compound.__iter__c                 C   sZ   t |tr|t| jkS t |trB| jD ]}|j|kr( dS q(dS t |trV|| jkS dS )NTF)
isinstanceintr^   r   
basestringr   r   r   rj   r   r   r   r   rh     s    





zTAG_Compound.__contains__c                 C   s`   t |tr| j| S t |trJ| jD ]}|j|kr$|  S q$td| ntdt|j d S )NzTag %s does not existz=key needs to be either name of tag, or index of tag, not a %s)	r   r   r   r   r   r   	TypeErrorr   r   r   r   r   r   rk     s    





zTAG_Compound.__getitem__c                 C   sv   t |tstdt |tr(|| j|< nJt |trr||_t| jD ]"\}}|j|krB|| j|<  d S qB| j| d S )Nzvalue must be an nbt.TAG)	r   r   AssertionErrorr   r   r   r   r   r   )r   rj   r   r~   r   r   r   r   rm   "  s    



zTAG_Compound.__setitem__c                 C   s>   t |tr| j|= n&t |tr2| j| | ntdd S )Nz3key needs to be either name of tag, or index of tag)r   r   r   r   removerk   rE   ri   r   r   r   rn   /  s    


zTAG_Compound.__delitem__c                 C   s   dd | j D S )Nc                 S   s   g | ]
}|j qS r   rW   r   r   r   r   rv   9  s     z%TAG_Compound.keys.<locals>.<listcomp>r   r*   r   r   r   keys8  s    zTAG_Compound.keysc                 c   s   | j D ]}|j|fV  qd S r   r   )r   r   r   r   r   	iteritems;  s    
zTAG_Compound.iteritemsc                 C   s   dd dd | jD  d S )Nr   r   c                 S   s   g | ]}|  qS r   r0   r   r   r   r   rv   A  s     z,TAG_Compound.__unicode__.<locals>.<listcomp>r   r   r*   r   r   r   r3   @  s    zTAG_Compound.__unicode__c                 C   s   dd dd | jD  d S )Nr   r   c                 S   s   g | ]}|  qS r   r0   r   r   r   r   rv   D  s     z(TAG_Compound.__str__.<locals>.<listcomp>r   r   r*   r   r   r   r5   C  s    zTAG_Compound.__str__c                 C   s   dt | j S )Nz{%i Entries}r   r*   r   r   r   r)   F  s    zTAG_Compound.valuestrr   c                    sd   t t|  g}t| jrZ|d  d  | fdd| jD  |d  d  d|S )Nr/   r   c                    s   g | ]}|  d  qS r   r   r   r   r   r   rv   M  s     z,TAG_Compound.pretty_tree.<locals>.<listcomp>r   r   )r9   r   r2   r^   r   r   r   ry   r   r;   r   r   r2   I  s    
zTAG_Compound.pretty_tree)NN)r   )r   r   r   r   TAG_COMPOUNDr6   r    r&   r'   ra   rd   rh   rk   rm   rn   r   r   r3   r5   r)   r2   rB   r   r   r;   r   r     s"   	r   c                       s>   e Zd ZdZd fdd	ZdddZdddZd	d
 Z  ZS )NBTFilezRepresent an NBT file object.Nc              	      s   t t|   || _t| j| _d}|r<|| _t|d| _nP|r^t	|drR|j
| _|| _d}n.|rt	|drt|j
| _t|d| _n
d| _d}| jr|   |rz| j  W n ttfk
r   Y nX d| _dS )a  
        Create a new NBTFile object.
        Specify either a filename, file object or data buffer.
        If filename of file object is specified, data should be GZip-compressed.
        If a data buffer is specified, it is assumed to be uncompressed.

        If filename is specified, the file is closed after reading and writing.
        If file object is specified, the caller is responsible for closing the
        file.
        Trbr   FfileobjN)r9   r   r    filenamerI   r6   r   r   filehasattrr   
parse_filecloseAttributeErrorIOErrorr   r   r%   r   	closefiler;   r   r   r    ]  s4    

zNBTFile.__init__c              
   C   s   d}|rt |d| _nD|r8t|dr,|j| _|| _d}n"|rZt|drN|j| _t |d| _| jrzTt| jd}|j| jkrt| jdj}| 	| j || _|r| j
  ntdW q tk
r } ztdW 5 d	}~X Y qX ntd
d	S )z-Completely parse a file, extracting all tags.Tr   r   Fr   rZ   z"First record is not a Compound Tagz,Partial File Parse: file possibly truncated.NzHNBTFile.parse_file(): Need to specify either a filename or a file object)r   r   r   r   r   rI   r   r6   r   r&   r   r   r   rE   )r   r   r%   r   r   r   r   er   r   r   r     s>    

zNBTFile.parse_filec              	   C   s   d}|rd| _ || _d}nV|r2|| _ t|d| _n>|rLd| _ t|dd| _n$| j rbt| j d| _n| jsptdt| j| j t| j| j | | j z| j	  W n t
tfk
r   Y nX |rz| j  W n t
tfk
r   Y nX dS )zWrite this NBT file to a file.TNFwb)r   modezHNBTFile.write_file(): Need to specify either a filename or a file object)r   r   r   rE   rI   r6   r'   r   r   flushr   r   r   r   r   r   r   
write_file  s:    zNBTFile.write_filec                 C   sF   | j r&d| jj| j tj| jt| f S d| jjtj| jt| f S dS )z
        Return a string (ascii formated for Python 2, unicode
        for Python 3) describing the class, name and id for
        debugging purposes.
        z<%s(%r) with %s(%r) at 0x%x>z<%s with %s(%r) at 0x%x>N)r   r#   r   r   r   r6   r*   r   r   r   r7     s         zNBTFile.__repr__)NNN)NNN)NNN)	r   r   r   r   r    r   r   r7   rB   r   r   r;   r   r   Z  s
   +
#
#r   )4r   structr   r   r   Zgzipr   collectionsr   r   r   sysversion_infoZ_PY3r4   r-   r   Zxranger   rH   rJ   rL   rN   rP   rR   rT   rz   r   r   r   r   r   	Exceptionr   objectr   r8   rC   rI   rK   rM   rO   rQ   rS   rU   r{   r   r   r   r   r   r   r   r   r   r   <module>   sz   
<:87-S|               