+
    V<Ui
                     @   ^ RI t ^ RIt^ RIt^ RIHtHtHt ^ RIHtHt ^ RI	H
t
HtHtHtHtHtHtHt ^ RIHt ]! R4      t]! R4      tR R	 ltR
 R ltR R ltR R ltR R ltR]R]/R ltR R ltR R ltR R ltR R lt ! R R] 4      t!R t"R"R  lt#R! t$R# )#    N)OrderedDictCounterdefaultdict)	FrameTypeTracebackType)IteratorListTupleIterableCallableUnionTypeVarMapping)ASTTextTRc                $    V ^8  d   QhR\         /# )   
max_length)int)formats   "2/usr/lib/python3/dist-packages/stack_data/utils.py__annotate__r      s      c     c                     \        V 4      V8  dI   V\        V4      ,
          ^,          pV\        V4      ,
          V,
          pV RV V,           W) R ,           p V # )r   N)len)seqr   middlerightlefts   &&&  r   truncater!      sT    
3x*c&k)a/CK'%/%4j6!CL0Jr   c                \    V ^8  d   QhR\         \        ,          R\        \        ,          /# )r   itreturn)r   r   r	   )r   s   "r   r   r      s"     * * *Q *r   c                 @    \        \        P                  ! V 4      4      # N)listr   fromkeys)r#   s   &r   unique_in_orderr)      s    $$R())r   c                r    V ^8  d   QhR\         R\        P                  R\        \        \        3,          /# )r   atoknoder$   )r   astASTr
   r   )r   s   "r   r   r      s-      W CGG c3h r   c                    \        V\        \        RR4      4      '       d9   \        WP                  4      w  r#\        WP
                  R,          4      w  rEW%3# V P                  VRR7      w  w  r&w  rVW%^,           3# )z
Returns a pair of numbers representing a half open range
(i.e. suitable as arguments to the `range()` builtin)
of line numbers of the given AST nodes.

match_caseF)padded )
isinstancegetattrr-   
line_rangepatternbodyget_text_positions)r+   r,   start_end_startend_s   &&     r   r6   r6      sp     $\2677 ||4 yy}5z#66tE6J
HSAg~r   c                ~    V ^8  d   QhR\         \        ,          R\        \        \        \        3,          ,          /# )r   lstr$   )r	   r   r   r
   bool)r   s   "r   r   r   ,   s+     + +$q' +huQW~&> +r   c              #     aaaaa"   \        V 4      o\        P                  ! V V3R  lR7       F  w  poV'       dd   \        S4      oR.\	        S4      ,          oV3R lp\        S4       F/  oV! VV3R l4      oSe   V! VVV3R l4       V! VV3R l4       K1  	  M\        P                  ! R4      o\        SS4       Rj  xL
  K  	  R#  L
5i)	c                    < SV ,          ^8  # )   r2   )xcountss   &r   <lambda>"highlight_unique.<locals>.<lambda>/   s    Qr   keyFc                 F   <  V ! 4       pRST&   T#   \          d     R # i ; i)NT)
ValueError)fihighlighteds   & r   highlight_index)highlight_unique.<locals>.highlight_index4   s3     A "&A "   s      c                  &   < S P                  S4      # r&   indexgroupitems   r   rG   rH   =   s    D0Ar   Nc                  6   < SP                  SS ^,           4      #    rS   )firstrV   rW   s   r   rG   rH   ?   s    EKKeai,Hr   c                  H   < RS RRR1,          P                  S4      ,
          # )rZ   Nr3   rS   rU   s   r   rG   rH   @   s    U4R4[->->t-D(Dr   T)r   	itertoolsgroupbyr'   r   setrepeatzip)r@   	is_commonrP   rF   r[   rV   rO   rW   s   &  @@@@@r   highlight_uniquerc   ,   s     S\F%--c7NO	5KE 'CJ.K E
'(AB$#$HI DE	 # $**40Kuk***+ P* 	+s   B>CCCc                0    V ^8  d   QhR\         R\         /# )r   rE   r$   )r   )r   s   "r   r   r   G   s       a r   c                     V # r&   r2   )rE   s   &r   identityrf   G   s    Hr   mapperrJ   c             #   D  "   \        \        W04      4      p\        P                  ! \	        V \        V4      4      R  R7       FU  w  rV\	        V!  w  rxV'       d   \        W'4       Rj  xL
  K-  \	        V!  w  rV! \        V4      \        V	4      4      x  KW  	  R#  L45i)c                 "    V ^,          ^,          # rY   r2   )ts   &r   rG   #collapse_repeated.<locals>.<lambda>O   s    !A$q'r   rI   N)r'   mapr]   r^   ra   rc   )r@   	collapserrg   rJ   keyedis_highlightedrV   original_grouphighlighted_groupkeyed_groupr>   s   &$$$       r   collapse_repeatedrs   K   s     SE!*!2!2%e,-!" -0K)6222 "34NKD0${2CDD" 3s   A'B )B*5B c                R    V ^8  d   QhR\         \        \        3,          R\        /# r   frame_or_tbr$   )r   r   r   rA   )r   s   "r   r   r   Y   s$     7 7%	= 89 7d 7r   c                     \        \        V \        P                  \        P                  34      4       \        V \        P                  34      # r&   )assert_r4   typesr   r   rv   s   &r   is_framer{   Y   s4    J{U__e6I6I$JKLkEOO#566r   c                    V ^8  d   QhR\         \        \        3,          R\        \         \        \        3,          ,          /# ru   )r   r   r   r   )r   s   "r   r   r   ^   s4     & &E)]":; &yZgOgIh@i &r   c              #      "   T pV'       d2   Vx  \        V4      '       d   VP                  pK+  VP                  pK9  R # 5ir&   )r{   f_backtb_next)rv   currents   & r   
iter_stackr   ^   s4     5@G
GnnGooG s
   
A 3A c                t    V ^8  d   QhR\         \        \        3,          R\        \        \        3,          /# ru   )r   r   r   r
   r   )r   s   "r   r   r   h   s.     ; ;%	=(@"A ;eIWZNF[ ;r   c                 n    \        V 4      '       d   W P                  3# V P                  V P                  3# r&   )r{   f_linenotb_frame	tb_linenorz   s   &r   frame_and_linenor   h   s3    0000##[%:%:::r   c          	          V ^8  d   QhR\         \        ,          R\        \        .\        3,          R\        \        \
        \        ,          3,          /# )r   iterablekey_funcr$   )r   r   r   r   r   r	   )r   s   "r   r   r   o   sB       xQ7G GTUW[\]W^T^L_ r   c                p    \        \        4      pV  F   pW!! V4      ,          P                  V4       K"  	  V# )a  
Create a dictionary from an iterable such that the keys are the result of evaluating a key function on elements
of the iterable and the values are lists of elements all of which correspond to the key.

>>> def si(d): return sorted(d.items())
>>> si(group_by_key_func("a bb ccc d ee fff".split(), len))
[(1, ['a', 'd']), (2, ['bb', 'ee']), (3, ['ccc', 'fff'])]
>>> si(group_by_key_func([-1, 0, 1, 3, 6, 8, 9, 2], lambda x: x % 2))
[(0, [0, 6, 8, 2]), (1, [-1, 1, 3, 9])]
)r   r'   append)r   r   resultrW   s   &&  r   group_by_key_funcr   o   s4     Fx~%%d+ Mr   c                   4   a  ] tR t^t o RtR tR t]tRtV t	R# )cached_propertyz
A property that is only computed once per instance and then replaces itself
with an ordinary attribute. Deleting the attribute resets the property.

Based on https://github.com/pydanny/cached-property/blob/master/cached_property.py
c                4    VP                   V n         Wn        R # r&   __doc__func)selfr   s   &&r   __init__cached_property.__init__   s    ||	r   c                x    Vf   V # V P                  V4      ;q1P                  V P                   P                  &   V# r&   )r   __dict____name__)r   obj_clsvalues   &&& r   cached_property_wrapper'cached_property.cached_property_wrapper   s4    ;K3799S>ATYY//0r   r   N)
r   
__module____qualname____firstlineno__r   r   r   __get____static_attributes____classdictcell__)__classdict__s   @r   r   r      s      &Gr   r   c           	         a ^ RI p^ RIHp  ! V3R lR\        V! R4      4      4      pV! RR7      p VP	                  WV 4      pVP                  4       #   \
         d    Tp TP                  4       # i ; i)r   N)get_lexer_by_namec                   6   <a a ] tR t^t oV V3R ltRtVtV ;t# )'_pygmented_with_ranges.<locals>.MyLexerc              3    <a"   ^ o\         SV `  V4       Fh  w  r#\        ;QJ d    V3R lS 4       F  '       g   K   RM	  RM! V3R lS 4       4      '       d   VP                  pS\	        V4      ,          oW#3x  Kj  	  R# 5i)r   c              3   T   <"   T F  w  rVSu;8*  ;'       d    V8  Mu x  K  	  R # 5ir&   r2   ).0r:   r=   lengths   &  r   	<genexpr>E_pygmented_with_ranges.<locals>.MyLexer.get_tokens.<locals>.<genexpr>   s#     Fvu,,,,vs   %(TFN)super
get_tokensanyExecutingNoder   )r   textttyper   r   	__class__rangess   &&  @r   r   2_pygmented_with_ranges.<locals>.MyLexer.get_tokens   sc     F % 24 83FvF333FvFFF!//E#e*$l"	 !9s   6BB)Br2   )r   r   r   r   r   r   r   __classcell__)r   r   r   s   @@r   MyLexerr      s     	# 	#r   r   python3F)stripnl)pygmentspygments.lexersr   type	highlight	Exception
splitlines)	formattercoder   r   r   r   lexerrO   s   &&f     r   _pygmented_with_rangesr      sy    1#$(34 # E"E((i@ !!##  !!##s   A A43A4c                 \    V '       g$   \        V\        4      '       d   \        V4      pVhR # r&   )r4   strAssertionError)	conditionerrors   &&r   rx   rx      s&    eS!!"5)E r   c                 `     \        V 4      #    R \        T 4      P                  ,          u # ; i)z<unprintable %s object>)r   r   r   )r   s   &r   some_strr      s/    @5z@(4;+?+???s   
 -) )%r-   r]   ry   collectionsr   r   r   r   r   typingr   r	   r
   r   r   r   r   r   	asttokensr   r   r   r!   r)   r6   rc   rf   rs   r{   r   r   r   objectr   r   rx   r   r2   r   r   <module>r      s    
   9 9 *  
 CLCL*+6E Eh E7
&;$&f &,$,@r   