+
    
4i3                         ^ RI t ^ RI Ht ^ RIHtHtHtHtHtHtH	t	H
t
Ht ]! R4      tR t ! R R]4      t]tR R	 lt ! R
 R]],          4      t ! R R]],          4      t ! R R4      tR# )    N)ReferenceType)	IterableOptionalGenericDictIteratorTypeVarTYPE_CHECKINGAnyCallableTc                     V e   V ! 4       # R # N )refs   &./usr/lib/python3/dist-packages/debian/_util.pyresolve_refr      s    O35--    c                      a a ] tR t^t oRtR.t]'       d   V3R lV 3R lltR tV3R lR lt	V3R lR	 lt
V3R
 lR ltV3R lR ltRtVtV ;t# )_CaseInsensitiveStringzCase insensitive string.
    	str_lowerc                $   < V ^8  d   QhRS[ RR/# )   sreturnNstr)format__classdict__s   "r   __annotate__#_CaseInsensitiveString.__annotate__   s     	  	 c 	 d 	 r   c                <   < \         \        V `  V4       R V n        R# ) N)superr   __init__r   )selfr   	__class__s   &&r   r%   _CaseInsensitiveString.__init__   s    ($8;DNr   c                Z    \         P                  W4      pVP                  4       Vn        V# r   )r   __new__lowerr   )clsstr_r   s   && r   r*   _CaseInsensitiveString.__new__   s"    KK"jjlr   c                    < V ^8  d   QhRS[ /# r   r   int)r   r   s   "r   r    r!   $   s     $ $# $r   c                ,    \        V P                  4      # r   )hashr   r&   s   &r   __hash___CaseInsensitiveString.__hash__$   s    DNN##r   c                &   < V ^8  d   QhRS[ RS[ /# r   otherr   )r   )r   r   s   "r   r    r!   '   s      C C r   c                b     V P                   VP                  4       8H  #   \         d     R # i ; i)F)r   r+   AttributeErrorr&   r:   s   &&r   __eq___CaseInsensitiveString.__eq__'   s.    	>>U[[]22 		s    ..c                &   < V ^8  d   QhRS[ RS[/# r9   )r   bool)r   r   s   "r   r    r!   -   s     ! !C !D !r   c                    W8X  * # r   r   r=   s   &&r   __ne___CaseInsensitiveString.__ne__-   s      r   c                    < V ^8  d   QhRS[ /# r0   r   )r   r   s   "r   r    r!   0   s      s r   c                    V P                   # r   r   r5   s   &r   r+   _CaseInsensitiveString.lower0   s    ~~r   rG   )__name__
__module____qualname____firstlineno____doc__	__slots__r
   r%   r*   r6   r>   rC   r+   __static_attributes____classdictcell____classcell__)r'   r   s   @@r   r   r      sP     I	  	 $ $ ! !  r   r   c                0    V ^8  d   QhR\         R\         /# )r   xr   r   )r   s   "r   r    r    7   s      c c r   c                 "    V P                  4       # r   )r+   )rS   s   &r   default_field_sort_keyrU   7   s    779r   c                      a  ] tR t^;t o RtR t]R 4       t]P                  R 4       tR t	RR/R lt
RR/R lt]R	 4       t]R
 4       tR tR tRtV tR# )LinkedListNodec                .    R V n         R V n        Wn        R # r   )_previous_node	next_nodevaluer&   r[   s   &&r   r%   LinkedListNode.__init__?   s    "
r   c                ,    \        V P                  4      # r   )r   rY   r5   s   &r   previous_nodeLinkedListNode.previous_nodeE   s     4..//r   c                V    Ve   \         P                  ! V4      V n        R # R V n        R # r   )weakrefr   rY   r&   nodes   &&r   r_   r`   J   s!     483Cgkk$/r   c                    \         P                  V P                  V P                  4       R V n        R V n        V P                  # r   )rW   
link_nodesr_   rZ   r[   r5   s   &r   removeLinkedListNode.removeO   s5    !!$"4"4dnnE!zzr   skip_currentFc             #  n   "   V'       d   V P                   MT pV'       d   Vx  VP                   pK  R # 5ir   )rZ   r&   ri   rd   s   &$ r   	iter_nextLinkedListNode.iter_nextV   s*      ".t~~4J>>D    55c             #  n   "   V'       d   V P                   MT pV'       d   Vx  VP                   pK  R # 5ir   )r_   rk   s   &$ r   iter_previousLinkedListNode.iter_previous_   s.      &2t!!tJ%%D rn   c                B    V'       d   Wn         V '       d	   Wn        R # R # r   r_   rZ   rs   s   &&r   rf   LinkedListNode.link_nodesh   s     &3#&/# r   c                Z    \         P                  W4       \         P                  W4       R # r   )rW   rf   )
first_nodenew_node	last_nodes   &&&r   _insert_linkLinkedListNode._insert_linkp   s      	!!*7!!(6r   c                r    WJd   WP                   Jg   Q h\        P                  V P                   W4       R # r   )r_   rW   ry   r&   rw   s   &&r   insert_beforeLinkedListNode.insert_beforey   s/    #8J8J(JJJ##D$6$6Gr   c                r    WJd   WP                   Jg   Q h\        P                  WV P                   4       R # r   )rZ   rW   ry   r|   s   &&r   insert_afterLinkedListNode.insert_after~   s+    #(FFF##DDNNCr   )rY   rZ   r_   r[   N)rY   r[   rZ   __weakref__)rI   rJ   rK   rL   rN   r%   propertyr_   setterrg   rl   rp   staticmethodrf   ry   r}   r   rO   rP   r   s   @r   rW   rW   ;   s     GI 0 0 N N"$"&#(& 0 0 7 7H
D Dr   rW   c                      a  ] tR t^t o RtRtRR ltV 3R lR ltV 3R lR lt]	R 4       t
V 3R	 lR
 ltR tR tR tR tR tR tR tR tR tR tR tV 3R lR ltRtV tR# )
LinkedListab  Specialized linked list implementation to support the deb822 parser needs

We deliberately trade "encapsulation" for features needed by this library
to facilitate their implementation.  Notably, we allow nodes to leak and assume
well-behaved calls to remove_node - because that makes it easier to implement
components like Deb822InvalidParagraphElement.
Nc                ^    R V n         R V n        ^ V n        Ve   V P                  V4       R # R # r   )	head_node	tail_node_sizeextend)r&   valuess   &&r   r%   LinkedList.__init__   s.    
KK r   c                    < V ^8  d   QhRS[ /# r0   )rA   )r   r   s   "r   r    LinkedList.__annotate__   s     * *$ *r   c                    V P                   R J# r   )r   r5   s   &r   __bool__LinkedList.__bool__   s    ~~T))r   c                    < V ^8  d   QhRS[ /# r0   r1   )r   r   s   "r   r    r      s       r   c                    V P                   # r   )r   r5   s   &r   __len__LinkedList.__len__   s    zzr   c                N    V P                   e   V P                   P                  # R # r   )r   r[   r5   s   &r   tailLinkedList.tail   s"     (,~~'At~~##KtKr   c                   < V ^8  d   QhRR/# r   r   Nr   )r   r   s   "r   r    r      s     ) )T )r   c                n    V P                   f   \        R4      hV P                  V P                   4       R # )Nzpop from empty list)r   
IndexErrorremove_noder5   s   &r   popLinkedList.pop   s*    >>!233(r   c              #  f   "   V P                   pVf   R # VP                  4        R j  xL
  R #  L5ir   )r   rl   )r&   r   s   & r   
iter_nodesLinkedList.iter_nodes   s)     NN	&&(((s   &1/1c              #  P   "   R  V P                  4        4        Rj  xL
  R#  L5i)c              3   8   "   T F  qP                   x  K  	  R # 5ir   r[   ).0rd   s   & r   	<genexpr>&LinkedList.__iter__.<locals>.<genexpr>   s     =+<4JJ+<   N)r   r5   s   &r   __iter__LinkedList.__iter__   s     =4??+<===s   &$&c              #  t   "   V P                   pVf   R # R VP                  4        4        R j  xL
  R #  L5i)Nc              3   8   "   T F  qP                   x  K  	  R # 5ir   r   )r   ns   & r   r   *LinkedList.__reversed__.<locals>.<genexpr>   s     ?%>GG%>r   )r   rp   )r&   r   s   & r   __reversed__LinkedList.__reversed__   s.     NN	?Y%<%<%>???s   -868c                J   WP                   J d(   VP                  V n         V P                   f   R V n        M0WP                  J d"   VP                  V n        V P                  f   Q hV P                  ^ 8  g   Q hV ;P                  ^,          un        VP                  4        R # r   )r   rZ   r   r_   r   rg   rc   s   &&r   r   LinkedList.remove_node   sx    >>!!^^DN~~%!%^^#!//DN >>---zzA~~

a
r   c                v    V P                   f   V P                  V4      # V P                  WP                   4      # r   )r   appendr}   r\   s   &&r   insert_at_headLinkedList.insert_at_head   s0    >>!;;u%%!!%88r   c                   \        V4      pV P                  f   W n        W n        MIV P                  f   Q hV P                  VJg   Q hV P                  Vn        W P                  n        W n        V ;P
                  ^,          un        V# r   )rW   r   r   r_   rZ   r   )r&   r[   rd   s   && r   r   LinkedList.append   ss    e$>>!!N!N >>--- >>---!%D'+NN$!N

a
r   c                8    V P                  \        V4      V4      # r   )insert_node_beforerW   r&   r[   existing_nodes   &&&r   r}   LinkedList.insert_before   s    &&~e'<mLLr   c                8    V P                  \        V4      V4      # r   )insert_node_afterrW   r   s   &&&r   r   LinkedList.insert_after   s    %%nU&;]KKr   c                   V P                   f   \        R4      hVP                  f   VP                  e   \        R4      hVP	                  V4       W P                   J d   Wn         V ;P
                  ^,          un        V# Nz,List is empty; node argument cannot be validz&New node must not already be inserted!)r   
ValueErrorrZ   r_   r}   r   r&   rw   r   s   &&&r   r   LinkedList.insert_node_before   sj    >>!KLL)X-C-C-OEFF##H-NN*%N

a
r   c                   V P                   f   \        R4      hVP                  f   VP                  e   \        R4      hVP	                  V4       W P                   J d   Wn         V ;P
                  ^,          un        V# r   )r   r   rZ   r_   r   r   r   s   &&&r   r   LinkedList.insert_node_after   sj    >>!KLL)X-C-C-OEFF""8,NN*%N

a
r   c                :    V F  pV P                  V4       K  	  R # r   )r   )r&   r   vs   && r   r   LinkedList.extend  s    AKKN r   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r    r     s      t r   c                0    R V n         R V n        ^ V n        R # r   r   r   r   r5   s   &r   clearLinkedList.clear  s    
r   )r   r   r   r   r   )rI   rJ   rK   rL   rM   rN   r%   r   r   r   r   r   r   r   r   r   r   r   r}   r   r   r   r   r   rO   rP   r   s   @r   r   r      s      4I * *  L L) )
)>@9&ML


 r   r   c                      a  ] tR tRt o RtRR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	V 3R lR lt
V 3R lR lt]tR tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR tRtV tR# )
OrderedSeti  zA set-like object that preserves order when iterating over it

We use this to keep track of keys in Deb822Dict, because it's much faster
to look up if a key is in a set than in a list.
Nc                r    / V n         \        4       V n        Vf   . pV F  pV P                  V4       K  	  R # r   )_OrderedSet__tabler   _OrderedSet__orderaddr&   iterableitems   && r   r%   OrderedSet.__init__  s4     !|HDHHTN r   c                $   < V ^8  d   QhRS[ RR/# r   r   r   Nr   )r   r   s   "r   r    OrderedSet.__annotate__!  s        r   c                    W9  d-   V P                   P                  V4      p W P                  V&   R # R #   \         d    T P                   P	                  T4       h i ; ir   )r   r   r   	Exceptionr   r&   r   rd   s   && r   r   OrderedSet.add!  sZ    
 <<&&t,D%)T"   ((.s	   5 (Ac                $   < V ^8  d   QhRS[ RR/# r   r   )r   r   s   "r   r    r   .  s     ' '3 '4 'r   c                |    V P                   V,          pV P                   V V P                  P                  V4       R # r   )r   r   r   r   s   && r   rg   OrderedSet.remove.  s0     ||D!LL  &r   c                0   < V ^8  d   QhRS[ S[,          /# r0   r   r   )r   r   s   "r   r    r   5  s     " "(3- "r   c                ,    \        V P                  4      # r   )iterr   r5   s   &r   r   OrderedSet.__iter__5  s    DLL!!r   c                0   < V ^8  d   QhRS[ S[,          /# r0   r   )r   r   s   "r   r    r   9  s     , ,hsm ,r   c                >    \        \        V P                  4      4      # r   )r   reversedr   r5   s   &r   r   OrderedSet.__reversed__9  s    HT\\*++r   c                    < V ^8  d   QhRS[ /# r0   r1   )r   r   s   "r   r    r   =  s     ! ! !r   c                ,    \        V P                  4      # r   )lenr   r5   s   &r   r   OrderedSet.__len__=  s    4<<  r   c                &   < V ^8  d   QhRS[ RS[/# )r   r   r   )r   rA   )r   r   s   "r   r    r   @  s     $ $ $ $r   c                    WP                   9   # r   )r   r&   r   s   &&r   __contains__OrderedSet.__contains__@  s     ||##r   c                :    V F  pV P                  V4       K  	  R # r   )r   r   s   && r   r   OrderedSet.extendH  s    DHHTN r   c                $   < V ^8  d   QhRS[ RR/# r   r   )r   r   s   "r   r    r   N  s     1 1s 1t 1r   c                P    V P                  WP                  P                  4       R# )z2Re-order the given item so it is "last" in the setN)_reorderr   r   r   s   &&r   
order_lastOrderedSet.order_lastN  s    dLL//0r   c                $   < V ^8  d   QhRS[ RR/# r   r   )r   r   s   "r   r    r   R  s     9 9 9 9r   c                P    V P                  WP                  P                  4       R# )z3Re-order the given item so it is "first" in the setN)r   r   r   r   s   &&r   order_firstOrderedSet.order_firstR  s    dLL778r   c                *   < V ^8  d   QhRS[ RS[ RR/# r   r   reference_itemr   Nr   )r   r   s   "r   r    r   V  s'     U U Uc Ud Ur   c                   a a W8X  d   \        R4      hS P                  V,          oS P                  VVV 3R l4       R# )zTRe-order the given item so appears directly after the reference item in the sequence*Cannot re-order an item relative to itselfc                 <   < SP                   P                  V S4      # r   )r   r}   rS   reference_noder&   s   &r   <lambda>)OrderedSet.order_before.<locals>.<lambda>[  s    dll&@&@N&Sr   Nr   r   r   r&   r   r  r  s   f&&@r   order_beforeOrderedSet.order_beforeV  s2    !IJJn5dSTr   c                *   < V ^8  d   QhRS[ RS[ RR/# r  r   )r   r   s   "r   r    r   ]  s'     T T TS TT Tr   c                   a a W8X  d   \        R4      hS P                  V,          oS P                  VVV 3R l4       R# )zURe-order the given item so appears directly before the reference item in the sequencer	  c                 <   < SP                   P                  V S4      # r   )r   r   r  s   &r   r  (OrderedSet.order_after.<locals>.<lambda>b  s    dll&?&?>&Rr   Nr  r  s   f&&@r   order_afterOrderedSet.order_after]  s2    !IJJn5dRSr   c                    V P                   V,          pV P                  P                  V4       V! VP                  4      pW@P                   V&   R # r   )r   r   r   r[   )r&   r   
reinserterrd   rw   s   &&&  r   r   OrderedSet._reorderd  s>    
 ||D!  &djj)%Tr   )__order__tabler   )rI   rJ   rK   rL   rM   r%   r   rg   r   r   r   r   r   r   r   r  r  r  r   rO   rP   r   s   @r   r   r     s      ' '" ", ,! !$ $ F1 19 9U UT T& &r   r   )rb   r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   _strIrU   rW   r   r   r   r   r   <module>r      sw     !   CL.
S B 	FDWQZ FDRE EP`& `&r   