Ë
    pPêjIF  ã                  ó’  — U d Z ddlmZ ddlZddlZddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% ddl&m'Z' dd	l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. dd
l/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z;  G d„ d«      Z<i d e<d«      “d e<d«      “d e<d«      “d e<d«      “d e<d«      “d e<d«      “d e<d«      “d e<d «      “d! e<d"«      “d# e<d$«      “d% e<d&«      “d' e<d(«      “d) e<d*«      “d+ e<d,«      “d- e<d,«      “d. e<d/«      “d0 e<d1«      “d2 e<d3«      i¥Z=d4e>d5<    e<d6d7¬8«       e<d9d7¬8«       e<d:d7¬8«       e<d;d7¬8«       e<d<d=¬8«      d>œZ?d4e>d?<   d@Z@dAZA G dB„ dC«      ZB	 	 	 	 	 	 	 	 	 	 dMdD„ZC	 	 	 	 	 	 	 	 	 	 	 	 dNdE„ZDdOdF„ZE G dG„ dHe'«      ZFdPdI„ZGdQdJ„ZHdRdK„ZIdSdL„ZJy)Tz¶Generate source code formatted as HTML, with bottlenecks annotated and highlighted.

Various heuristics are used to detect common issues that cause slower than
expected performance.
é    )ÚannotationsN)Úescape)ÚFinal)ÚBuildResult)ÚAssignmentStmtÚCallExprÚClassDefÚ	DecoratorÚDictionaryComprehensionÚ
ExpressionÚForStmtÚFuncDefÚGeneratorExprÚ	IndexExprÚ
LambdaExprÚ
MemberExprÚMypyFileÚNamedTupleExprÚNameExprÚNewTypeExprÚNodeÚOpExprÚRefExprÚ	TupleExprÚTypedDictExprÚTypeInfoÚTypeVarExprÚVarÚWithStmt)ÚTraverserVisitor)ÚAnyTypeÚInstanceÚ
ProperTypeÚTypeÚ	TypeOfAnyÚget_proper_type)ÚFancyFormatter)ÚFuncIR)ÚModuleIR)ÚCallCÚLoadLiteralÚ
LoadStaticÚValue)ÚMapperc                  ó   — e Zd ZdZddd„Zy)Ú
Annotationz(HTML annotation for compiled source codec                ó    — || _         || _        y ©N)ÚmessageÚpriority)Úselfr3   r4   s      úS/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypyc/annotate.pyÚ__init__zAnnotation.__init__6   s   € ð ˆŒð
 !ˆ�ó    N©é   )r3   Ústrr4   ÚintÚreturnÚNone©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r7   © r8   r6   r0   r0   3   s
   „ Ù2õ!r8   r0   ÚPyNumber_AddzGeneric "+" operation.ÚPyNumber_SubtractzGeneric "-" operation.ÚPyNumber_MultiplyzGeneric "*" operation.ÚPyNumber_TrueDividezGeneric "/" operation.ÚPyNumber_FloorDividezGeneric "//" operation.ÚPyNumber_PositivezGeneric unary "+" operation.ÚPyNumber_NegativezGeneric unary "-" operation.ÚPyNumber_AndzGeneric "&" operation.ÚPyNumber_OrzGeneric "|" operation.ÚPyNumber_XorzGeneric "^" operation.ÚPyNumber_LshiftzGeneric "<<" operation.ÚPyNumber_RshiftzGeneric ">>" operation.ÚPyNumber_InvertzGeneric "~" operation.ÚPyObject_CallzGeneric call operation.ÚPyObject_CallObjectÚPyObject_RichComparezGeneric comparison operation.ÚPyObject_GetItemzGeneric indexing operation.ÚPyObject_SetItemzGeneric indexed assignment.r   Úop_hintsz4"functools.partial" is inefficient in compiled code.é   ©r4   zQ"itertools.chain" is inefficient in compiled code (hint: replace with for loops).z4"itertools.groupby" is inefficient in compiled code.zb"itertools.islice" is inefficient in compiled code (hint: replace with for loop over index range).zB"copy.deepcopy" tends to be slow. Make a shallow copy if possible.é   )zfunctools.partialzitertools.chainzitertools.groupbyzitertools.islicezcopy.deepcopyÚstdlib_hintszÅ.collapsible {
    cursor: pointer;
}

.content {
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}

.hint {
    display: inline;
    border: 1px solid #ccc;
    padding: 5px;
}
ab  document.querySelectorAll('.collapsible').forEach(function(collapsible) {
    collapsible.addEventListener('click', function() {
        const content = this.nextElementSibling;
        if (content.style.display === 'none') {
            content.style.display = 'block';
        } else {
            content.style.display = 'none';
        }
    });
});
c                  ó   — e Zd ZdZdd„Zy)ÚAnnotatedSourcez.Annotations for a single compiled source file.c                ó    — || _         || _        y r2   )Úpathr   )r5   r_   r   s      r6   r7   zAnnotatedSource.__init__�   s   € ØˆŒ	Ø&ˆÕr8   N)r_   r;   r   údict[int, list[Annotation]]r=   r>   r?   rD   r8   r6   r]   r]   Š   s
   „ Ù8ô'r8   r]   c           
     óL  — g }|j                  «       D ]h  \  }}|j                  |   j                  }|j                  |   j                  }|€J ‚ |j                  t        |xs d|||j                  |«      «       Œj t        |«      }	t        | d«      5 }
|
j                  |	«       d d d «       t        t        j                  t        j                  d«      }|j                  t        j                  j!                  | «      ddd¬«      }t#        d|› d�«       y # 1 sw Y   ŒtxY w)	Nz<source>ÚwFÚnoneT)Ú	underlineÚboldz
Wrote z -- open in browser to view
)ÚitemsÚgraphr_   ÚtreeÚappendÚgenerate_annotationsÚtypesÚgenerate_html_reportÚopenÚwriter'   ÚsysÚstdoutÚstderrÚstyleÚosÚabspathÚprint)Ú	html_fnamÚresultÚmodulesÚmapperr   ÚmodÚmod_irr_   rh   ÚhtmlÚfÚ	formatterÚ	formatteds                r6   Úgenerate_annotated_htmlr€   ’   s  € ð €KØ—}‘}“ò 
‰ˆˆVØ�|‰|˜CÑ ×%Ñ%ˆØ�|‰|˜CÑ ×%Ñ%ˆØÐÐÐØˆ×ÑÜ  Ò!3¨°T¸6À6Ç<Á<ÐQWÓXõ	
ð	
ô   Ó,€DÜ	ˆi˜Ó	ð  Ø	�‰�Œ÷ô œsŸz™z¬3¯:©:°uÓ=€IØ—‘¤§¡§¡°	Ó :¸FÈdÐY]�Ó^€IÜ	ˆH�Y�KÐ<Ð
=Õ>÷ð ús   ÂDÄD#c                ó:  — i }|j                   D ]  }|j                  t        ||«      «       Œ t        ||«      }|j                  D ]  }|j                  |«       Œ |j                  |j                  «       |j                  D ]
  }	|	|v sŒ||	= Œ t        | |«      S r2   )	Ú	functionsÚupdateÚfunction_annotationsÚASTAnnotateVisitorÚdefsÚacceptÚannsÚignored_linesr]   )
r_   rh   ÚirÚtype_mapry   rˆ   Úfunc_irÚvisitorÚdefnÚlines
             r6   rj   rj   ¦   s�   € ð €DØ—<‘<ò 9ˆØ�‰Ô(¨°$Ó7Õ8ð9ä  ¨6Ó2€GØ—	‘	ò ˆØ�‰�GÕðà‡K�K�—‘ÔØ×%Ñ%ò ˆØ�4Š<Ø�T‘
ðô ˜4 Ó&Ð&r8   c                óÈ  — i }| j                   D �]O  }|j                  D �]<  }t        |t        «      sŒ|j                  }d}|dk(  r.t        |j                  d   «      }|dv rd}�n«|rd|› d�}�n¡d}�n�|dk(  r/t        |j                  d   «      }|d	k(  rd}�nw|rd
|› d�}�nmd}�ni|dk(  r&t        |j                  d   «      }|rd|› d�}�nBd}�n>|t        v rt        |   }�n+|dv �r&t        |j                  d   t        «      �rt        |j                  d   t        «      rë| j                  dk7  rÜ|j                  d   }	t        |j                  d   j                  «      }|j                  j                  |«      }
|
rŽ|
j                  r‚|	j                   dk(  rs|	j"                  dk(  rd|
j                  j$                  t&        v rt&        |
j                  j$                     }n*t        |
j                  t(        «      r
d|› d�dz   }nd|› d�}|s�Œ÷t        |t        «      rt+        |«      }|j-                  |j.                  g «      j1                  |«       �Œ? �ŒR |S )z'Generate annotations based on mypyc IR.NÚCPyObject_GetAttrr:   )Ú__prepare__ÚGeneratorExitÚStopIterationzGet non-native attribute "ú".zDynamic attribute lookup.ÚPyObject_SetAttrÚ__mypyc_attrs__zSet non-native attribute "zDynamic attribute set.ÚPyObject_VectorcallMethodr   zCall non-native method "z:" (it may be defined in a non-native class, or decorated).zDynamic method call.)ÚCPyDict_GetItemÚCPyDict_SetItemÚ__top_level__ÚstaticÚglobalszAccess global "z" through namespace z=dictionary (hint: access is faster if you can make it Final).zAccess "z&" through global namespace dictionary.)ÚblocksÚopsÚ
isinstancer*   Úfunction_nameÚget_str_literalÚargsrW   r,   r+   Únamer;   ÚvalueÚnamesÚgetÚnodeÚ	namespaceÚ
identifierÚfullnamer[   r   r0   Ú
setdefaultr�   ri   )rŒ   rh   rˆ   ÚblockÚopr¤   ÚannÚ	attr_nameÚmethod_nameÚloadÚsyms              r6   r„   r„   ¶   s=  € ð )+€DØ—‘ó <=ˆØ—)‘)ó ;	=ˆBÜ˜"œeÕ$Ø×'Ñ'�Ø/3�ØÐ.Ò.Ü /°·±¸±
Ó ;�IØ Ð$UÑUð #šÙ"Ø :¸9¸+ÀRÐHšà9šØÐ/Ò/Ü /°·±¸±
Ó ;�IØ Ð$5Ò5à"šÙ"Ø :¸9¸+ÀRÐHšà6šØÐ8Ò8Ü"1°"·'±'¸!±*Ó"=�KÙ"Ø 8¸¸ÐEð  Ašà4šØœXÑ%Ü" 4™.’CØÐCÒCä" 2§7¡7¨1¡:¬zÕ:Ü& r§w¡w¨q¡z´;Ô?Ø#ŸL™L¨OÒ;à!Ÿw™w q™z˜Ü" 2§7¡7¨1¡:×#3Ñ#3Ó4˜Ø"Ÿj™jŸn™n¨TÓ2˜áØ #§¢Ø $§¡°(Ò :Ø $§¡°9Ò <à"Ÿx™x×0Ñ0´LÑ@Ü&2°3·8±8×3DÑ3DÑ&E¡Ü!+¨C¯H©H´cÔ!:à&5°d°VÐ;OÐ$PØ&eñ%fñ !$ð
 )1°°Ð6\Ð&] ÛÜ! #¤sÔ+Ü(¨›o˜Ø—O‘O B§G¡G¨RÓ0×7Ñ7¸Ö<òw;	=ð<=ðz €Kr8   c                  óÂ   ‡ — e Zd ZdZdd„Zdˆ fd„Zdˆ fd„Zdˆ fd„Zdˆ fd„Zdd„Z	dˆ fd„Z
dˆ fd	„Zdˆ fd
„Zdd„Zdˆ fd„Zdˆ fd„Zdd„Zdˆ fd„Zd d!d„Zd"d„Zˆ xZS )#r…   z6Generate annotations from mypy AST and inferred types.c                óZ   — i | _         t        «       | _        d| _        || _        || _        y ©Nr   )rˆ   Úsetr‰   Ú
func_depthr‹   ry   )r5   r‹   ry   s      r6   r7   zASTAnnotateVisitor.__init__ý   s(   € Ø13ˆŒ	Ü'*£uˆÔØˆŒØ ˆŒØˆ�r8   c               óº   •— | j                   dkD  r| j                  |d«       | xj                   dz  c_         t        ‰| �  |«       | xj                   dz  c_         y )Nr   zoA nested function object is allocated each time statement is executed. A module-level function would be faster.r:   )r¸   ÚannotateÚsuperÚvisit_func_def©r5   ÚoÚ	__class__s     €r6   r¼   z!ASTAnnotateVisitor.visit_func_def  sN   ø€ Ø�?‰?˜QÒØ�M‰MØð=ôð
 	�Š˜1Ñ�Ü‰Ñ˜qÔ!Ø�Š˜1ÑŽr8   c               ó^   •— | j                  |j                  gd«       t        ‰| �  |«       y )NzFor loop)Úcheck_iterationÚexprr»   Úvisit_for_stmtr½   s     €r6   rÃ   z!ASTAnnotateVisitor.visit_for_stmt  s&   ø€ Ø×Ñ˜aŸf™f˜X zÔ2Ü‰Ñ˜qÕ!r8   c               ó\   •— | j                  |j                  d«       t        ‰| �  |«       y )NÚComprehension)rÁ   Ú	sequencesr»   Úvisit_dictionary_comprehensionr½   s     €r6   rÇ   z1ASTAnnotateVisitor.visit_dictionary_comprehension  s$   ø€ Ø×Ñ˜QŸ[™[¨/Ô:Ü‰Ñ.¨qÕ1r8   c               ó\   •— | j                  |j                  d«       t        ‰| �  |«       y )NzComprehension or generator)rÁ   rÆ   r»   Úvisit_generator_exprr½   s     €r6   rÉ   z'ASTAnnotateVisitor.visit_generator_expr  s%   ø€ Ø×Ñ˜QŸ[™[Ð*FÔGÜ‰Ñ$ QÕ'r8   c                ó,  — |D ]�  }| j                  |«      }t        |t        «      r| j                  ||› d�«       Œ:t        |t        «      sŒK|j
                  j                  dv sŒd| j                  ||› d|j
                  j                  › d�«       Œ‘ y )Nz3 uses generic operations (iterable has type "Any").)ztyping.Iterableztyping.Iteratorztyping.Sequenceztyping.MutableSequencez: uses generic operations (iterable has the abstract type "z").)Úget_typer    r!   rº   r"   Útyper«   )r5   ÚexpressionsÚkindrÂ   Útyps        r6   rÁ   z"ASTAnnotateVisitor.check_iteration  s‘   € Øò 	ˆDØ—-‘- Ó%ˆCÜ˜#œwÔ'Ø—‘˜d t fÐ,_Ð$`ÕaÜ˜C¤Õ*¨s¯x©x×/@Ñ/@ð Eò 0ð —‘ØØ�fÐVÐWZ×W_ÑW_×WhÑWhÐViÐilÐmõñ	r8   c               óÒ  •— t         ‰| �  |«       | j                  dk(  rÈ|j                  D ]'  }| j                  j                  |j                  «       Œ) |j                  j                  D ]x  }t        |t        «      r&| j                  j                  |j                  «       Œ9t        |t        «      sŒJ| j                  j                  |j                  j                  «       Œz y y r¶   )r»   Úvisit_class_defr¸   Úbase_type_exprsr‰   Úaddr�   r†   Úbodyr    r   r
   Úfunc)r5   r¾   ÚbaseÚsr¿   s       €r6   rÑ   z"ASTAnnotateVisitor.visit_class_def+  s±   ø€ Ü‰Ñ Ô"Ø�?‰?˜aÒà×)Ñ)ò 2�Ø×"Ñ"×&Ñ& t§y¡yÕ1ð2ð —V‘V—[‘[ò 8�Ü˜a¤Ô0à×&Ñ&×*Ñ*¨1¯6©6Õ2Ü ¤9Õ-ð ×&Ñ&×*Ñ*¨1¯6©6¯;©;Õ7ñ8ð  r8   c               óv  •— |j                   D ]š  }t        |t        «      sŒt        |j                  t        «      sŒ/|j                  j
                  }t        |t        «      sŒVt        d„ |j                  D «       «      sŒs| j                  |d|j                  › d�dz   dz   d¬«       Œœ t        ‰| �1  |«       y )Nc              3  óŽ   K  — | ]=  }t        |t        «      xr' |j                  xr |j                  j                  d k(  –— Œ? y­w)zcontextlib.contextmanagerN)r    r   r¨   r«   )Ú.0Úds     r6   ú	<genexpr>z5ASTAnnotateVisitor.visit_with_stmt.<locals>.<genexpr>@  sK   è ø€ ò ð ô # 1¤gÓ.ò KØŸF™FòKàŸF™FŸO™OÐ/JÑJóKñùs   ‚AAú"z&" uses @contextmanager, which is slow z*in compiled code. Use a native class with z+"__enter__" and "__exit__" methods instead.rX   rY   )rÂ   r    r   Úcalleer   r¨   r
   ÚanyÚ
decoratorsrº   r¤   r»   Úvisit_with_stmt)r5   r¾   rÂ   r¨   r¿   s       €r6   rá   z"ASTAnnotateVisitor.visit_with_stmt;  s®   ø€ Ø—F‘Fò 	ˆDÜ˜$¤Õ)¬j¸¿¹ÄgÕ.NØ—{‘{×'Ñ'�Ü˜d¤IÕ.Üñ ð "&§¡ô	õ ð Ÿ™Ø Ø §	¡	˜{Ð*PÐQØJñKàKñLð &'ð &õ ð	ô" 	‰Ñ Õ"r8   c               ó~  •— d}| j                   dk(  rœ|j                  }t        |j                  t        t        t
        f«      r|j                  j                  }|j                  s t        |t        t        t        t        f«      rd}|r%| j                  j                  |j                  «       t        ‰| �A  |«       y )NFr   T)r¸   Úrvaluer    r   r   r   ÚanalyzedÚis_alias_defr   r   r   r   r‰   rÓ   r�   r»   Úvisit_assignment_stmt)r5   r¾   Úspecial_formrä   r¿   s       €r6   ræ   z(ASTAnnotateVisitor.visit_assignment_stmtO  sŒ   ø€ ØˆØ�?‰?˜aÒØ*+¯(©(ˆHÜ˜!Ÿ(™(¤X¬y¼&Ð$AÔBØŸ8™8×,Ñ,�Ø�~Š~¤Øœ;¬¼Ä{ÐSô"ð  $�Ùà×"Ñ"×&Ñ& q§v¡vÔ.Ü‰Ñ% aÕ(r8   c               ól   — t         j                  |j                  «      x}r| j                  ||«       y y r2   )r[   r§   r«   rº   )r5   r¾   r¯   s      r6   Úvisit_name_exprz"ASTAnnotateVisitor.visit_name_expr^  s/   € Ü×"Ñ" 1§:¡:Ó.Ð.ˆ3Ð.Ø�M‰M˜!˜SÕ!ð /r8   c               óŒ   •— t         ‰| �  |«       t        j                  |j                  «      x}r| j                  ||«       y y r2   )r»   Úvisit_member_exprr[   r§   r«   rº   )r5   r¾   r¯   r¿   s      €r6   rë   z$ASTAnnotateVisitor.visit_member_exprb  s=   ø€ Ü‰Ñ! !Ô$Ü×"Ñ" 1§:¡:Ó.Ð.ˆ3Ð.Ø�M‰M˜!˜SÕ!ð /r8   c               ó2  •— t         ‰| �  |«       t        |j                  t        «      rR|j                  j
                  dk(  r9t        |j                  «      dk(  r!|j                  d   }| j                  |«       y t        |j                  t        «      rät        |j                  j                  t        «      rÀ|j                  j                  }| j                  j                  j                  |«      }|r|j                  r|€@|j
                  j                  d«      s%| j!                  |d|j"                  › d�dz   d«       y |r2|j$                  r%| j!                  |d|j"                  › d	�d
z   d«       y y y t        |j                  t        «      rƒt        |j                  j                  t&        «      r^|j                  j                  }| j                  j)                  |j                  «      r"| j!                  |d|j"                  › d�d«       y y y y )Nzbuiltins.isinstancerZ   r:   z	builtins.z*Creating an instance of non-native class "z" zis slow.zClass "z " is only partially native, and z!constructing an instance is slow.zCalling a decorated function ("z'") is inefficient, even if it's native.)r»   Úvisit_call_exprr    rÞ   r   r«   Úlenr£   Úcheck_isinstance_argr¨   r   ry   Ú
type_to_irr§   Úis_ext_classÚ
startswithrº   r¤   Úis_augmentedr
   Úis_native_ref_expr)r5   r¾   ÚargÚinfoÚclass_irÚ	decoratorr¿   s         €r6   rí   z"ASTAnnotateVisitor.visit_call_exprg  s¡  ø€ Ü‰Ñ Ô"ä�q—x‘x¤Ô)Ø—‘×!Ñ!Ð%:Ò:Ü�A—F‘F“˜qÒ à—&‘&˜‘)ˆCØ×%Ñ% cÕ*Ü˜Ÿ™¤'Ô*¬z¸!¿(¹(¿-¹-ÌÔ/RØ—8‘8—=‘=ˆDØ—{‘{×-Ñ-×1Ñ1°$Ó7ˆHÙ ×!6Ò!6ØÐ ¨¯©×)AÑ)AÀ+Ô)Nà—‘ØÐCÀDÇIÁIÀ;ÈbÐQÐT^Ñ^Ð`aõñ ˜h×3Ò3Ø—‘ØØ˜dŸi™i˜[Ð(HÐIØ9ñ:àõ	ð 4�ô ˜Ÿ™¤'Ô*¬z¸!¿(¹(¿-¹-ÌÔ/SØŸ™Ÿ™ˆIØ�{‰{×-Ñ-¨a¯h©hÔ7Ø—‘ØØ5°i·n±nÐ5EÐEmÐnØõð 8ð 0TÐ*r8   c                óD  — t        |t        «      r]t        |j                  t        «      rB|j                  j                  r+| j                  |d|j                  j                  › d�«       y y y t        |t        «      r#|j                  D ]  }| j                  |«       Œ y y )Nz/Expensive isinstance() check against protocol "r•   )
r    r   r¨   r   Úis_protocolrº   r¤   r   rf   rï   )r5   rõ   Úitems      r6   rï   z'ASTAnnotateVisitor.check_isinstance_arg‰  s…   € Ü�cœ7Ô#Ü˜#Ÿ(™(¤HÔ-°#·(±(×2FÒ2FØ—‘ØÐJÈ3Ï8É8Ï=É=È/ÐY[Ð\õð 3GÐ-ô ˜œYÔ'ØŸ	™	ò 0�Ø×)Ñ)¨$Õ/ñ0ð (r8   c               óH   •— | j                  |d«       t        ‰| �	  |«       y )NzhA new object is allocated for lambda each time it is evaluated. A module-level function would be faster.)rº   r»   Úvisit_lambda_exprr½   s     €r6   rý   z$ASTAnnotateVisitor.visit_lambda_expr“  s&   ø€ Ø�‰Øð9ô	
ô
 	‰Ñ! !Õ$r8   c                ó¨   — t        |t        «      rt        ||¬«      }| j                  j	                  |j
                  g «      j                  |«       y )NrY   )r    r;   r0   rˆ   r¬   r�   ri   )r5   r¾   r¯   r4   s       r6   rº   zASTAnnotateVisitor.annotate›  s;   € Ü�cœ3ÔÜ˜S¨8Ô4ˆCØ�	‰	×Ñ˜QŸV™V RÓ(×/Ñ/°Õ4r8   c                ó„   — | j                   j                  |«      }|rt        |«      S t        t        j
                  «      S r2   )r‹   r§   r&   r!   r%   Úunannotated)r5   ÚeÚts      r6   rË   zASTAnnotateVisitor.get_type   s5   € Ø�M‰M×Ñ˜aÓ ˆÙÜ" 1Ó%Ð%Ü”y×,Ñ,Ó-Ð-r8   )r‹   údict[Expression, Type]ry   r.   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )rÍ   zlist[Expression]rÎ   r;   r=   r>   )r¾   r	   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )r¾   r   r=   r>   )rõ   r   r=   r>   )r¾   r   r=   r>   r9   )r¾   r   r¯   zstr | Annotationr4   r<   r=   r>   )r  r   r=   r#   )r@   rA   rB   rC   r7   r¼   rÃ   rÇ   rÉ   rÁ   rÑ   rá   ræ   ré   rë   rí   rï   rý   rº   rË   Ú__classcell__)r¿   s   @r6   r…   r…   ú   sW   ø„ Ù@óõ	õ"õ2õ(óõ 8õ #õ()ó"õ"õ
 óD0õ%ô5÷
.r8   r…   c                óp   — t        | t        «      r&t        | j                  t        «      r| j                  S y r2   )r    r+   r¥   r;   )Úvs    r6   r¢   r¢   §  s%   € Ü�!”[Ô!¤j°·±¼#Ô&>Ø�w‰wˆØr8   c                óp   — t        d„ | D «       «      }| D �cg c]  }|j                  |k(  sŒ|‘Œ c}S c c}w )Nc              3  ó4   K  — | ]  }|j                   –— Œ y ­wr2   rY   )rÚ   Úas     r6   rÜ   zget_max_prio.<locals>.<genexpr>®  s   è ø€ Ò, !�1—:•:Ñ,ùs   ‚)Úmaxr4   )rˆ   Úmax_prior	  s      r6   Úget_max_prior  ­  s1   € ÜÑ, tÔ,Ó,€HØÖ6�!˜qŸz™z¨XÓ5ŠAÒ6Ð6ùÒ6s   —3¬3c                ó”  — g }|j                  d«       |j                  dt        › d�«       |j                  d«       |j                  d«       | D �]
  }|j                  d|j                  › d�«       |j                  d«       |j                  }t	        |j                  «      5 }|j                  «       }d d d «       t        «      D ]~  \  }}t        |«      }|d	z   }d
|z  }	||v rGt        ||   «      }
|
D �cg c]  }|j                  ‘Œ }}dj                  |«      }t        |	||¬«      }n|	dz   |z   }|j                  |«       Œ€ |j                  d«       �Œ |j                  d«       |j                  t        «       |j                  d«       |j                  d«       dj                  |«      S # 1 sw Y   �ŒxY wc c}w )Nz<html>
<head>
z<style>
z	
</style>z</head>
z<body>
z<h2><tt>z</tt></h2>
z<pre>r:   z%5dú )Ú	hint_htmlú  z</pre>z<script>z	</script>z</body></html>
Ú )ri   ÚCSSr_   r   rm   Ú	readlinesÚ	enumerater   r  r3   ÚjoinÚcolorize_lineÚJS)Úsourcesr|   ÚsrcÚsrc_annsr}   ÚlinesÚir×   r�   Úlinenumrˆ   r	  Úann_strsÚhints                 r6   rl   rl   ²  s’  € Ø€DØ‡K�KÐ"Ô#Ø‡K�K�)œC˜5 
Ð+Ô,Ø‡K�K�ÔØ‡K�K�
ÔØó ˆØ�‰�h˜sŸx™x˜j¨Ð5Ô6Ø�‰�GÔØ—?‘?ˆÜ�#—(‘(‹^ð 	"˜qØ—K‘K“MˆE÷	"ä˜eÓ$ò 	‰DˆAˆqÜ�q“	ˆAØ�q‘5ˆDØ˜d‘lˆGØ�xÑÜ# H¨T¡NÓ3�Ø/3Ö4¨!˜AŸI›IÐ4�Ð4Ø—x‘x Ó)�Ü! '¨1¸Ô=‘à˜d‘N QÑ&�Ø�K‰K˜�Nð	ð 	�‰�HÖð%ð( 	‡K�K�
ÔØ‡K�K”„OØ‡K�K�Ôà‡K�KÐ"Ô#Ø�7‰7�4‹=Ð÷+	"ñ 	"üò 5s   Â&F8Ã;GÆ8G	c                óX   — dt        | «      z  dz   }d| › d|› d�}d|› d|› d�}d|› |› d	�S )
Nr  r  z8<div class="collapsible" style="background-color: #fcc">z</div>z<div class="content">z<div class="hint">z</div></div>z<span>z</span>)rî   )r  r×   r  Úhint_prefixÚ	line_spanÚhint_divs         r6   r  r  Ô  sV   € Øœ˜G›Ñ$ tÑ+€KØJÈ7È)ÐSUÐVWÐUXÐX^Ð_€IØ& { mÐ3EÀiÀ[ÐP\Ð]€HØ�I�;˜x˜j¨Ð0Ð0r8   )
rv   r;   rw   r   rx   zdict[str, ModuleIR]ry   r.   r=   r>   )r_   r;   rh   r   rŠ   r)   r‹   r  ry   r.   r=   r]   )rŒ   r(   rh   r   r=   r`   )r  r-   r=   z
str | None)rˆ   úlist[Annotation]r=   r$  )r  zlist[AnnotatedSource]r=   r;   )r  r;   r×   r;   r  r;   r=   r;   )KrC   Ú
__future__r   Úos.pathrs   ro   r|   r   Útypingr   Ú
mypy.buildr   Ú
mypy.nodesr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úmypy.traverserr    Ú
mypy.typesr!   r"   r#   r$   r%   r&   Ú	mypy.utilr'   Úmypyc.ir.func_irr(   Úmypyc.ir.module_irr)   Úmypyc.ir.opsr*   r+   r,   r-   Úmypyc.irbuild.mapperr.   r0   rW   Ú__annotations__r[   r  r  r]   r€   rj   r„   r…   r¢   r  rl   r  rD   r8   r6   ú<module>r2     s¸  ðòõ #ã Û 
Ý Ý å "÷÷ ÷ ÷ ÷ ÷ õ õ6 ,ß V× VÝ $Ý #Ý 'ß >Ó >Ý '÷!ñ !ðØ‘JÐ7Ó8ðà™Ð$<Ó=ðð ™Ð$<Ó=ðð ™:Ð&>Ó?ð	ð
 ™JÐ'@ÓAðð ™Ð$BÓCðð ™Ð$BÓCðð ‘JÐ7Ó8ðð ‘:Ð6Ó7ðð ‘JÐ7Ó8ðð ‘zÐ";Ó<ðð ‘zÐ";Ó<ðð ‘zÐ":Ó;ðð ‘ZÐ 9Ó:ðð ™:Ð&?Ó@ðð  ™JÐ'FÓGð!ð" ™
Ð#@ÓAð#ð$ ™
Ð#@ÓAñ%€ˆ%ó ñ, $Ø>Èôñ "Ø[Øôñ $Ø>Èôñ #ØlØôñ  ØLÐWXôñ€ˆeó ð(€ð$€÷'ñ 'ð?Øð?Ø'ð?Ø2Eð?ØOUð?à	ó?ð('Ø
ð'Øð'Ø#+ð'Ø7Mð'ØW]ð'àó'ó AôHj.Ð)ô j.óZó7ó
ôD1r8   