
    Mwg                          G d  de       Zy)c                   :    e Zd ZdZi Zd	dZd Zd Zd Zd Z	d Z
y)
IndexedListz
    List with optimised access by value
    Based on Alex Martelli's recipe

    http://code.activestate.com/recipes/52303-the-auxiliary-dictionary-idiom-for-sequences-with-/
    Nc                     d| _         i | _        |@d| _         t        |      D ]*  \  }}|| j                  |<   t        j	                  | |       , y y )NTF)clean_dict	enumeratelistappend)selfiterableidxvals       R/var/www/horilla/myenv/lib/python3.12/site-packages/openpyxl/utils/indexed_list.py__init__zIndexedList.__init__   sU    

DJ%h/ 'S"%

3D#&'      c                 x    i | _         d}| D ]%  }|| j                   vs|| j                   |<   |dz  }' d| _        y )N       T)r   r   )r
   r   values      r   _rebuild_dictzIndexedList._rebuild_dict   sI    
 	EDJJ&$'

5!q	 
r   c                 V    | j                   s| j                          || j                  v S N)r   r   r   r
   r   s     r   __contains__zIndexedList.__contains__    s$    zz 

""r   c                 4    || v r| j                   |   S t        r   )r   
ValueErrorr   s     r   indexzIndexedList.index%   s    D=::e$$r   c                 ~    || j                   vr/t        |       | j                   |<   t        j                  | |       y y r   )r   lenr   r	   r   s     r   r	   zIndexedList.append*   s3    

" #D	DJJuKKe$ #r   c                 B    | j                  |       | j                  |   S r   )r	   r   r   s     r   addzIndexedList.add/   s    Ezz%  r   r   )__name__
__module____qualname____doc__r   r   r   r   r   r	   r     r   r   r   r      s,     E'#

%
!r   r   N)r   r   r%   r   r   <module>r&      s   -!$ -!r   