<'? @1dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZmZmZmZmZmZmZmZddlmZddlmZddlmZdd lmZmZdd l m!Z!m"Z"dd l#m$Z$dd l%m&Z&m'Z'm(Z(Gd dZ)GddZ*Gddej+ddZ,Gdde&Z-ee'eeee.ee.ffZ/GddZ0Gdde0Z1Gdde0Z2Gdde0Z3Gdd e0Z4Gd!d"ej5Z6d7d'Z7Gd(d)Z8d*gZ9d8d.Z:de;fd9d6ZNr)get_python_sourcezNo source for code: 'z':  F)rrcoverage.pythonr#OSErrorrrsplitlinesset statementsexcludedraw_statements raw_excluded raw_classdefsraw_docstrings show_tokens _multiline _all_arcs_missing_arc_fragments)selfrrrr#errs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/coverage/parser.py__init__zPythonParser.__init__%sJMxMM!MMM ,H  !DII 9 9 9 9 9 9 Y--dm<<  Y Y YNt}NNNNOOUXX Y !%  5 5 ),'*ee -0EE+.%%,/55-0EE!35/3?C###s? A) A$$A)regexesstr Set[TLineNo]ct|}tj|}t}t |jdD]/\}}||r||0|S)zFind the lines matching one of a list of regexes. Returns a set of line numbers, the lines that contain a match for one of the regexes in `regexes`. The entire line needn't match, just a part of it. start)rrecompiler) enumerater(searchadd)r4r8combinedregex_cmatchesiltexts r6lines_matchingzPythonParser.lines_matchingestg&&*X&&%%!$*A666  HAu~~e$$  Ac &|jr||j|_d}d}d}d}tj}d}d}d}d} |jJt |j} | D],\} } \} }\}}}|jrJttj | | ddt| |fdd| dd|| tjkr|d z }na| tj kr|d z}nJ| tjkr"| d kr|j| n| tjkr| d kr6| dkr0||jvp|}|s"|r |j||}d}d}n| d kr*|r(||jvrd}|r|j|n| d vr| d z } n| dvr| d z} n| tjkr<|tjkr,|jt+| |d zn<| tjkr,|&||kr t+||d zD] }||j|< d}d}| r>| tjkr.d}|*| }|r||krd}|r|j|d}| }.|sGt5|j|j}|j|t<jj r%|jr tC|j|jd <dSdSdS)zwParse the source to find the interesting facts about its lines. A handful of attributes are updated. rFNTz>10 z>520r<class:@z([{z)]})r)"rrIr-tokenINDENTrrr0printtokenizetok_namegetrDEDENTNAMEr.rCOPSTRINGr/updaterangeNEWLINEr1stripCOMMENT ByteParserrr,_find_statementsr PYBEHAVIORmodule_firstline_1min)r4indentexclude_indent excludingexcluding_decorators prev_toktype first_lineempty first_on_linenestingtokgentoktypettextslineno_elinenorHshould_excludel byte_parsers r6 _raw_parsezPythonParser._raw_parseus < B $ 3 3DL A AD  $|   y$$$ ++AGB #B # =GULWa,7A %))'7;;;;;w0111115555%%%,&&! EL((! EJ&&G##&**7333EH$$C< , : :!$T%8!9!9DOA    : : : :rJlinenorc|dkr|j| |  }n|j||}|S)zAReturn the first line number of the statement including `lineno`.r)r1rV)r4rxs r6rjzPythonParser.first_linesG A::o))6'F7;;;FF_((88F rJlinenosIterable[TLineNo]c fd|DS)zMap the line numbers in `linenos` to the correct first line of the statement. Returns a set of the first lines. c:h|]}|Srj).0rur4s r6 z+PythonParser.first_lines..s%444q""444rJr~)r4rzs` r6 first_lineszPythonParser.first_liness5444G4444rJr(c,||S)z)Implement `FileReporter.translate_lines`.)r)r4r(s r6translate_lineszPythonParser.translate_liness&&&rJarcsIterable[TArc] Set[TArc]c fd|DS)z(Implement `FileReporter.translate_arcs`.cjh|]/\}}||f0Sr~r)rabr4s r6rz.PythonParser.translate_arcs..s:LLLVa##T__Q%7%78LLLrJr~)r4rs` r6translate_arcszPythonParser.translate_arcssLLLLtLLLLrJc |n{#tjttf$r\}t |dr|j}n|jdd}td|j d|jdd|z|d}~wwxYw| |j |_ |j |j z}|j|z }| ||z |_dS)zParse source text to find executable lines, excluded lines, etc. Sets the .excluded and .statements attributes, normalized to the first line of multi-line statements. rxr<rzCouldn't parse 'z' as Python source: z at line N)rwrT TokenErrorIndentationError SyntaxErrorhasattrrxargsrrrr-r+r/r,r*)r4r5rxignorestartss r6 parse_sourcezPythonParser.parse_sources  OO    #%5{C   sH%% (!QF4=FFF8A;336334   (():;; !44$v-**622V;sBAB  BcX|j||jJ|jS)zGet information about the arcs available in the code. Returns a set of line number pairs. Line numbers have been normalized to the first line of multi-line statements. )r2 _analyze_astr4s r6rzPythonParser.arcss4 > !      ~)))~rJc^t|j|j|j}|t |_|jD]Q\}}||}||}||kr|j ||fR|j |_ dS)zkRun the AstArcAnalyzer and save its results. `_all_arcs` is the set of arcs in the code. N) AstArcAnalyzerrr,r1analyzer)r2rrjrCmissing_arc_fragmentsr3)r4aaal1l2fl1fl2s r6rzPythonParser._analyze_asts TY(;T_MM h / /FB//"%%C//"%%Cczz""C:...&)&?###rJDict[TLineNo, int]ctjt}|D]0\}}|dkr ||jvr||jvr ||xxdz cc<1|jD]}||vr||xxdzcc<|S)zYGet a count of exits from that each line. Excluded lines are excluded. rr<) collections defaultdictintrr+r.)r4 exit_countsrrrus r6rzPythonParser.exit_counts,s +6*A#*F*F iikk ! !FBAvvT]""T]"" OOOq OOOO# $ $AKA!#rJr>end executed_arcsOptional[Iterable[TArc]]c|j||jJ|}|r"|dkr|| kr||f|vr||f|jvr||}}|j||fdg}g}|D]\}}|0|dkr(| |f|jvr|| |cSd}nd}||}d|d|} || d ||z } || d |S) z5Provide an English sentence describing a missing arc.NrNNz didn't jump to the function exitzdidn't jump to line {lineno}rxzline rLz , because  or )r3rrVmissing_arc_descriptionformatappendjoin) r4r>rr actual_startfragment_pairsmsgssmsgemsgmsgs r6rz$PythonParser.missing_arc_descriptionGst  & .      .:::   $ !GGv %L - - %LD7 7 7e3E488% ~VV(  JD$|77c{d&AAA#;;SD#FFFFF=DD9D;;c;**D/,////CFDKK|K$D$DFFF KK    {{4   rJ)NNN)rrrrrrr r!)r8r9r r:r r!)rxrr r)rzr{r r:)r(r{r r:)rrr r)r r)r rN)r>rrrrrr r9)__name__ __module__ __qualname____doc__r7rIrwrjrrrrrrrrr~rJr6rrs;#"&!% >D>D>D>D>D@ e:e:e:e:N5555''''MMMM<<<<2    @@@@$>37 +!+!+!+!+!+!+!rJrc8eZdZdZ ddd Zdd ZddZddZdS)r`z3Parse bytecode to understand the structure of code.Nrr9codeOptional[CodeType]rrr r!c||_| ||_dS|J t||dd|_dS#t$r'}t d||j|jpdfz|d}~wwxYw)NexecT) dont_inheritz5Couldn't parse '%s' as Python source: '%s' at line %dr)rrr@rrrrx)r4rrrsynerrs r6r7zByteParser.__init__xs   DIII''' #D(FNNN    K &*fm.@qO  s2 A#"AA#Iterable[ByteParser]cDfdtjDS)z~Iterate over all the code objects nested within this one. The iteration includes `self` as its first value. c3DK|]}tj|VdS))rN)r`r)rcr4s r6 z+ByteParser.child_parsers..s2OO! 491---OOOOOOrJ)rrrs`r6 child_parserszByteParser.child_parserss* POOO|DI7N7NOOOOrJr{c#Kt|jdr(|jD] \}}}|r|V dS|jjddd}|jjddd}d}|jj}d}t ||D]9\}} |r||kr|V|}||z }t jjr | dkr| dz} || z }:||kr|VdSdS)zYield the line numbers possible in this code object. Uses co_lnotab described in Python/compile.c to find the line numbers. Produces a sequence: l0, l1, ... co_linesrNr<) rrr co_lnotabco_firstlinenoziprrbnegative_lnotab) r4rrlinebyte_incrementsline_increments last_line_numline_numbyte_num byte_incr line_incrs r6 _line_numberszByteParser._line_numberss1 49j ) ) "i0022   1dJJJ   #i1!$Q$7O"i1!$Q$7O My/HH(+O_(M(M & &$ 9*=00&(0  )H>1'i46G6G&II%=(()(rJc#lK|D]}|Ed{VdS)zFind the statements in `self.code`. Produce a sequence of line numbers that start statements. Recurses into all code objects reachable from `self.code`. N)rr)r4bps r6razByteParser._find_statementssT$$&& * *B'')) ) ) ) ) ) ) ) ) * *rJr)rr9rrrrr r!)r r)r r{)rrrrr7rrrar~rJr6r`r`us{== $("& (PPPP< * * * * * *rJr`c&eZdZdZd d fd ZxZS) ArcStartaThe information needed to start an arc. `lineno` is the line number the arc starts from. `cause` is an English text fragment used as the `startmsg` for AstArcAnalyzer.missing_arc_fragments. It will be used to describe why an arc wasn't executed, so should fit well into a sentence of the form, "Line 17 didn't run because {cause}." The fragment can include "{lineno}" to have `lineno` interpolated into it. Nrxrcauserr cJt|||Sr)super__new__)clsrxr __class__s r6rzArcStart.__new__swwsFE222rJr)rxrrrr r)rrrrr __classcell__)rs@r6rrsL  33333333333rJrArcz lineno, causec eZdZdZ d d d ZdS) TAddArcFnz&The type for AstArcAnalyzer.add_arc().Nr>rrrrrr r!cdSrr~r4r>rrrs r6__call__zTAddArcFn.__call__s  rJr r>rrrrrrrr r!)rrrrrr~rJr6rrs;00 #"        rJrc2eZdZdZd dZd d Zd d Zd d Zd S)Blocka; Blocks need to handle various exiting statements in their own ways. All of these methods take a list of exits, and a callable `add_arc` function that they can use to add arcs if needed. They return True if the exits are handled, or False if the search should continue up the block stack. exits Set[ArcStart]add_arcrr boolct)zProcess break exits.AssertionErrorr4rrs r6process_break_exitszBlock.process_break_exits rJct)zProcess continue exits.rrs r6process_continue_exitszBlock.process_continue_exitsrrJcdS)zProcess raise exits.Fr~rs r6process_raise_exitszBlock.process_raise_exitsurJcdS)zProcess return exits.Fr~rs r6process_return_exitszBlock.process_return_exitsrrJNrrrrr r)rrrrrrrrr~rJr6rrsn  rJrc*eZdZdZddZdd Zdd ZdS) LoopBlockz@A block on the block stack representing a `for` or `while` loop.r>rr r!c:||_t|_dSr)r>r) break_exitsr4r>s r6r7zLoopBlock.__init__s *-%%rJrrrrrc:|j|dSNT)rr[rs r6rzLoopBlock.process_break_exitss &&&trJcH|D]}||j|j|jdSr )rxr>rr4rrxits r6rz LoopBlock.process_continue_exits s3 7 7C GCJ CI 6 6 6 6trJNr>rr r!r)rrrrr7rrr~rJr6rrsVJJ0000 rJrc*eZdZdZddZddZddZdS) FunctionBlockz>A block on the block stack representing a function definition.r>rnamer9r r!c"||_||_dSrr>r)r4r>rs r6r7zFunctionBlock.__init__s  rJrrrrrc\|D](}||j|j |jd|j)dS)Nzdidn't except from function Trxr>rrr s r6rz!FunctionBlock.process_raise_exitsM  C G TZKrrr9r r!r)rrrrr7rrr~rJr6rrsVHH rJrc:eZdZdZddZdd ZddZddZddZdS)TryBlockz6A block on the block stack representing a `try` block. handler_startOptional[TLineNo] final_startr r!c||_||_t|_t|_t|_t|_dSr)rrr) break_from continue_from raise_from return_from)r4rrs r6r7zTryBlock.__init__+sH*&*-,/EE),*-%%rJrrrrrcL|j|j|dSdSNTF)rrr[rs r6rzTryBlock.process_break_exits8s+   ' O " "5 ) ) )4urJcL|j|j|dSdSr#)rrr[rs r6rzTryBlock.process_continue_exits>s,   '   % %e , , ,4urJc|j"|D]}||j|j|jn#|jJ|j|dSr )rrxrrr r[r s r6rzTryBlock.process_raise_exitsDsl   ) C C D$6 BBBB C#/// O " "5 ) ) )trJcL|j|j|dSdSr#)rr!r[rs r6rzTryBlock.process_return_exitsMs,   '   # #E * * *4urJN)rrrrr r!r) rrrrr7rrrrr~rJr6rr)s~@@ 0 0 0 0  rJrcFeZdZdZddZ dddZddZddZddZddZ dS) WithBlockz7A block on the block stack representing a `with` block.r>rr r!ctjjsJ||_t |_t |_t |_dSr)rrbexit_through_withr>r)rrr!rs r6r7zWithBlock.__init__VsI~//// *-,/EE*-%%rJNrrrrfrom_setOptional[Set[ArcStart]]rcv|D]}||j|j|j|||dS)z*Helper to process the four kinds of exits.NT)rxr>rr[)r4rrr+r s r6_process_exitszWithBlock._process_exitsdsM 7 7C GCJ CI 6 6 6 6   OOE " " "trJc:||||jSr)r.rrs r6rzWithBlock.process_break_exitsqs""5'4?CCCrJc:||||jSr)r.rrs r6rz WithBlock.process_continue_exitsts""5'43EFFFrJc.|||Sr)r.rs r6rzWithBlock.process_raise_exitsws""5'222rJc:||||jSr)r.r!rs r6rzWithBlock.process_return_exitszs""5'43CDDDrJrr)rrrrr+r,r rr) rrrrr7r.rrrrr~rJr6r(r(TsAA 0 0 0 0$-1     DDDDGGGG3333EEEEEErJr(ceZdZdZddZdS) NodeListzA synthetic fictitious node, containing a sequence of nodes. This is used when collapsing optimized if-statements, to represent the unconditional execution of one of the clauses. bodySequence[ast.AST]r r!c8||_|dj|_dSNr)r5rx)r4r5s r6r7zNodeList.__init__s 1gn rJN)r5r6r r!)rrrrr7r~rJr6r4r4~s2 %%%%%%rJr4nounr9r )Callable[[AstArcAnalyzer, ast.AST], None]cdfd }|S) zPA function to make methods for expression-based callable _code_object__ methods.r4rnodeast.ASTr r!c ||}|| |ddd|||| ddd|dS)Nzdidn't run the z on line zdidn't finish the ) line_for_noder)r4r<r>r9s r6!_code_object__expression_callablezG_make_expression_code_method.._code_object__expression_callablesr""4(( eVUD*RD*R*R5*R*RSSS UUFD*Ut*U*Ue*U*UVVVVVrJ)r4rr<r=r r!r~)r9r@s` r6_make_expression_code_methodrAs/WWWWWW -,rJceZdZdZd[d Zd\d Z d]d^dZd_dZd`dZdadZ dbdZ e Z dcdZ e Z e Zddd Zded"Zhd#Zdfd%Z d]dgd,Zdhd.Zdid0Zdjd2Zdkd4Zdld5Zdmd7Zdmd8Zdmd9Zdmd:Zdnd<Zdod=ZeZdpd?Z dqdAZ!e!Z"eZ#eZ$drdBZ%e&j'dCkrdsdEZ(dtdFZ)dudHZ*dvdJZ+dwdLZ,dxdNZ-dydOZ.dzdQZ/e/Z0d{dRZ1d|dSZ2e2Z3d}dUZ4e5dVZ6e5dWZ7e8j9j:r#e5dXZ;e5dYZ<e5dZZ=d Sd S)~rz>Analyze source text with an AST to find executable code paths.rr9r*r: multilineDict[TLineNo, TLineNo]r r!cXtj||_fd|D|_|_t t tj dd}|rBtd|jtd|jt|jt|_ tjt |_g|_t t tj dd|_dS)Nc<h|]}||Sr~)rV)rrurCs r6rz*AstArcAnalyzer.__init__..s'CCC19==A..CCCrJCOVERAGE_AST_DUMPrz Statements: zMultiline map: COVERAGE_TRACK_ARCS)astparse root_noder*rCrrosenvironrVrSast_dumpr)rrrlistr block_stackdebug)r4rr*rCdump_asts ` r6r7zAstArcAnalyzer.__init__s 4CCCC CCC"BJNN+>BBCCDD  % 222 3 3 3 4DN44 5 5 5 T^ $ $ $"uu 5@4KD4Q4Q"(*#bjnn-BAFFGGHH rJctj|jD]/}|jj}t |d|zd}| ||0dS)zExamine the AST tree from `root_node` to determine possible arcs. This sets the `arcs` attribute to be a set of (from, to) line number pairs. _code_object__N)rIwalkrKrrgetattr)r4r< node_namecode_object_handlers r6rzAstArcAnalyzer.analyzescHT^,, * *D/I")$0@90Ld"S"S ".##D)))  * *rJNr>rrrrrc |jr8td|d|d|d|ttd|j||f||&|j||f||fdSdS)z@Add an arc, including message fragments to use if it is missing.z Adding possible arc: (, z): )limitN)rQrSrrrCrrrs r6rzAstArcAnalyzer.add_arcs : ) PUPPcPPdPPPP Q Q Q +B''' ( ( ( ucl###  t/  &s| 4 ; ;T4L I I I I I 0/rJIterable[Block]c*t|jS)z.Yield the blocks in nearest-to-farthest order.)reversedrPrs r6nearest_blockszAstArcAnalyzer.nearest_blockss()))rJr<r=c|jj}tttt jgtft|d|zd}| ||S|j S)z}What is the right line number to use for this node? This dispatches to _line__Node functions where needed. _line__N) rrrr rrIASTrrVrxr4r<rWhandlers r6r?zAstArcAnalyzer.line_for_nodese N+  Xswi01 2 D)i/ 6 6    74== ; rJast.FunctionDefc|j}tjjstjjr|jr|jdj}|S)zSCompute first line number for things that can be decorated (classes and functions).r)rxrrbtrace_decorated_defdef_ast_no_decoratordecorator_list)r4r<rxs r6_line_decoratedzAstArcAnalyzer._line_decoratedsB > - 71T 7" 7,Q/6 rJ ast.Assignc6||jSr)r?valuer4r<s r6 _line__AssignzAstArcAnalyzer._line__Assigns!!$*---rJast.Dictc|jr1|jd|jdjS|jdjS|jSr8)keysrxvaluesros r6 _line__DictzAstArcAnalyzer._line__Dicts@ 9 y|'y|**{1~,,; rJast.Listc^|jr ||jdS|jSr8)eltsr?rxros r6 _line__ListzAstArcAnalyzer._line__Lists. 9 %%dil33 3; rJ ast.ModulecztjjrdS|jr ||jdSdSNr<r)rrbrcr5r?ros r6 _line__ModulezAstArcAnalyzer._line__Module s? > , 1 Y %%dil33 31rJ> ExprPassAssertAssignDeleteGlobalImportNonlocal AnnAssign AugAssign ImportFromrcr|jj}tttt jgttft|d|zd}| ||Stj r||j vrtd|t||hS)aAdd the arcs for `node`. Return a set of ArcStarts, exits from this node to the next. Because a node represents an entire sub-tree (including its children), the exits from a node can be arbitrarily complex:: if something(1): if other(2): doit(3) else: doit(5) There are two exits from line 1: they start at line 3 and line 5. _handle__Nz*** Unhandled: )rrrr rrIrcr rrVrTESTING OK_TO_DEFAULT RuntimeErrorr?rds r6add_arcszAstArcAnalyzer.add_arcss N+  XswiX67 8 D+ 14 8 8    74== { AD$666&'?'?'?@@@T//55667 7rJr5r6 from_startOptional[ArcStart] prev_startsr,ch||J|h}|D]}||}|j||}||jvr/||}|S|}||}|D]#}||j||j$||}|S)auAdd arcs for the body of a compound statement. `body` is the body node. `from_start` is a single `ArcStart` that can be the previous line in flow before this body. `prev_starts` is a set of ArcStarts that can be the previous line. Only one of them should be given. Returns a set of ArcStarts, the exits from this body. ) r?rCrVr*find_non_missing_noderrxrr) r4r5rr body_noderxrjmaybe_body_node prev_starts r6 add_body_arcszAstArcAnalyzer.add_body_arcs=s  )))%,K 3 3I'' 22F++FF;;J00"&"<">    rJ ast.Breakc||}t|d}||htS)Nz*the break on line {lineno} wasn't executedr)r?rrr))r4r<here break_starts r6_handle__BreakzAstArcAnalyzer._handle__BreaksG!!$''t+WXXX    +///uu rJc|j}|j}|j}|rtjjstjjrd}|D]7}||}|||kr||||}8|Jtjjr||||}tjjrt||ddD]A\}}|||||B|||d|||||d|j rr||j d} |j | | } t|dz| D]#} | |jvr||| | }$|Jt|hS)zBAdd arcs for things that can be decorated (classes and functions).Nr<r)rxrjrrbrhrir?rtrace_decorator_line_againrr5rCrVr\r*r) r4r< main_linelastdecsdec_node dec_starttopbot body_startrxs r6_handle_decoratedz AstArcAnalyzer._handle_decorateds ![ "&+"  &~1 S^5X   ! ! ..x88 # T(9(9LLy111 ###~1 ! T9--- ~8 F #D$qrr( 3 3SSHCLL!3!3C!8!8$:L:LS:Q:QRRRR T//Q88)DDD Y(:(:48(D(DEEE y &!// ! == !^// JGG #DFJ77&&F00 T6222%rJ ast.Continuec||}t|d}||htS)Nz-the continue on line {lineno} wasn't executedr)r?rrr))r4r<rcontinue_starts r6_handle__Continuez AstArcAnalyzer._handle__ContinuesH!!$''!$.]^^^ ##^$4555uu rJast.Forc<||j}|jt |t |d}||j|}|D]#}||j ||j $|j }t|tsJ|j }t |d}|jr"||j|}||z}n|||S)Nr=z'the loop on line {lineno} never startedrrz)the loop on line {lineno} didn't complete)r?iterrPrrrrr5rrxrpoprrrrC)r4r<r>rrr my_block else_exitss r6 _handle__ForzAstArcAnalyzer._handle__Fors ""49--   6 6 6777e+TUUU ""49"DD 7 7C LLUCI 6 6 6 6#''))(I.....$e+VWWW ; "++DKJ+OOJ Z EE IIj ! ! ! rJc||j}t|d}||j|}t|d}|||j|z}|S)N-the condition on line {lineno} was never truerr.the condition on line {lineno} was never false)r?rrrr5r)r4r<r>rrs r6 _handle__IfzAstArcAnalyzer._handle__If2s{""49--e+Z[[[ ""49"DDe+[\\\  ##DKJ#GGG rJ)r[ ast.Matchc$||}|}t}d}|jD]}||j}|j}t |t jr'|jd}t |t j't |t jrd}| ||dt|d} || |j | z}|}|s| | |S)NFrTz+the pattern on line {lineno} always matchedz*the pattern on line {lineno} never matchedrr)r?r)casespatternrrIMatchOrpatternsMatchAsrrrr5rC) r4r<r> last_startr had_wildcardcase case_startrrs r6_handle__MatchzAstArcAnalyzer._handle__Match;s&&t,,EJEEE L ( (!// == , #+663%.r2G!#+663gs{33(#'L Z5bccc%F ++DI*+MMM'  & *%%%LrJc||}||jt|}|S)Nr)r?rr5rr4r<r>rs r6_handle__NodeListz AstArcAnalyzer._handle__NodeListRs:""4((""49%"II rJ ast.Raisec||}t|d}||htS)Nz*the raise on line {lineno} wasn't executedr)r?rrr))r4r<r raise_starts r6_handle__RaisezAstArcAnalyzer._handle__RaiseWsG!!$''t+WXXX    +///uu rJ ast.Returnc||}t|d}||htS)Nz+the return on line {lineno} wasn't executedr)r?rrr))r4r<r return_starts r6_handle__ReturnzAstArcAnalyzer._handle__Return^sG!!$'',YZZZ  !!<.111uu rJast.Tryc@|jr!||jd}nd}|jr!||jd}nd}||Jt||}|j|||}||jt|}|jr"d|_ |jrt|_ n|j t}|jrmd}|jD]c} || }|| |||}d} t|| } ||| j| z}d|jr||j|}||z}|jrg|j ||jz|jz|j z|jz} ||j| } |jrt$jjrU|jD]E}|j}|j|}| D]}| |j||F|j}n||j| }|||jrt$jjrU|jD]E}|j}|j|}| D]}| |j||F|j}n||j| }|||j r.|||j | |jrt$jjrU|jD]E}|j}|j|}| D]}| |j||F|j}n||j| }|||r| }|S)Nrrz3the exception caught by line {lineno} didn't happenr)rr)handlersr? finalbodyrrPrrr5rrr)r rrrrrr!rrbfinally_jumps_backrxrr_combine_finally_startsrrrr)r4r<rr try_blockr>r handler_exitslast_handler_start handler_node from_causer final_from final_exits break_linerxr final_exitbreaks continue_line continues return_linereturnss r6 _handle__TryzAstArcAnalyzer._handle__Tryes = ! ..t}Q/?@@MM M > ,,T^A->??KKK(K,C,CC]K88   ***""4((""49%"II > #&*I #} -(+uu $   " " "'*uu = ^48  $  ^ ^ $ 2 2< @ @ %1LL!3]CCC%2"R %m:FFF !3!3L4ER\!3!]!]] ; G&&t{&FFE  >8 $   " " "$%'($%% & ,,T^,TTK# 1>4]&/&:KK !+!2 * 0 7 7v 7 F F*5KKJ LL):FEJJJJK&1FF!99):NP[\\F((000& 7>4c)2)@KK !.!5 - 3 : :& : I I*5KKJ LL):FEJJJJK ) 7II $ < 4_'0'<KK !,!3 + 1 8 8 8 G G*5KKJ LL):FEJJJJK'3GG"::9;PR]^^G))'222 $$ rJrcg}t|D]<}|j3||j|j=d|fd|D}|S)aHelper for building the cause of `finally` branches. "finally" clauses might not execute their exits, and the causes could be due to a failure to execute any of the exits in the try block. So we use the causes from `starts` as the causes for `exits`. Nrrc:h|]}t|jSr~)rrx)rr rs r6rz9AstArcAnalyzer._combine_finally_starts..s%>>>#*e,,>>>rJ)sortedrrrrxr)r4rrcausesr>rs @r6rz&AstArcAnalyzer._combine_finally_startssF^^ G GE{& ek00 0EEFFF F##>>>>>>> rJc0||jx}}||j}d}|rd}tjjrd}|r ||jd}|jt|t|d}| |j|}|D]#}| |j ||j$t}|j} t#| tsJ|| jt|d}|jr"| |j|} || z}n|s|||S) NFTrr=rrrr)r?rrrrbkeep_constant_testr5rPrrrrrrxrr)rrr[rrrC) r4r<r>to_top constant_test top_is_body0rrr rrs r6_handle__WhilezAstArcAnalyzer._handle__Whiles++DI666--di88   L > , ! L  6'' ! 55F   7 7 7888e+Z[[[ ""49"DD 8 8C LLVSY 7 7 7 7#''))(I..... X)***e+[\\\ ; &++DKJ+OOJ Z EE! & *%%% rJast.Withc||}tjjr(|jt |||jt|}tjjr|j }t|t sJt|h}|r"|D]}| |j ||}|jr.|||j||jr.|||j||jr.|||j||S)Nr=r)r?rrbr*rPrr(rr5rrrrrxrrrrrr!r)r4r<r>r with_block with_exitr s r6 _handle__WithzAstArcAnalyzer._handle__Withs""4(( > + <   # #IE$:$:$: ; ; ;""49%"II > + )--//Jj)44 4 44!%)I " 44CLLU3333!$ ((001F RR' ++001I9UU% ))001GSS rJcB||}|jrT||jt| }|D]%}||j| |jd&dS|| |||| dS)Nrzdidn't exit the module)r?r5rrrrxrr4r<r>rr s r6_code_object__Modulez#AstArcAnalyzer._code_object__Module"s""4(( 9 (&&tyXuf=M=M&NNE V V SZ%>>      rJlambdazgenerator expressionzdictionary comprehensionzset comprehensionzlist comprehension)rr9r*r:rCrDr r!rrr)r r])r<r=r r)r<rfr r)r<rlr r)r<rqr r)r<rvr r)r<rzr r)r<r=r r)r5r6rrrr,r r)r<r=r r)r<rr r)r<r4r r)r<rr r)r<r=r r)rrr r!)r<rr r)r<rfr r)r<rr r)r<rr r)r<rr r)r<rr r)r<r4r r)r<rr r)r<rr r)r<rr r)rrrrr r)r<rr r)r<rr r)r<rzr r!)r<rfr r!)r<r$r r!)>rrrrr7rrr`r?rkrp_line__ClassDefru_line__FunctionDef_line__AsyncFunctionDefryr}rrrrrrrrrrrrrr_handle__ClassDefrr_handle__AsyncFor_handle__FunctionDef_handle__AsyncFunctionDefrsys version_inforrrrrrrr_handle__AsyncWithr!r#_code_object__AsyncFunctionDefr&rA_code_object__Lambda_code_object__GeneratorExprrbcomprehensions_are_functions_code_object__DictComp_code_object__SetComp_code_object__ListCompr~rJr6rrsHH I I I ID * * * *"#" JJJJJ **** ....&O    )- M 8888H*./3 BD    ....    2   " # # # # J* (%, 1 7""    . mmmm^    :6' ( ( ( (&?"87AA!=!=>T!U!U ~2T!=!=>X!Y!Y < <=P Q Q!=!=>R!S!STTrJrctxrnrrc|dgditttfvp't|tt t tfS)z:Is `value` simple enough to be displayed on a single line?Nr~)r) frozensetEllipsisrbytesrfloatr9)rns r6_is_simple_valuer?LsC $BCEE9;;AA 455#uc233rJr<r=depthrrSCallable[[str], None]r!cd|z}t|dd}|bd|jd|j}t|dr?t|dsJ|dz }|j|jkr ||jdz }||jz }nd }|d |jj|}d tj |D}|s||d dSt|d krzast_dump..ks6 D% ' ' ' u ' ' 'rJ>r<rz: z {}# mro: {}rZc3$K|] }|jV dSr)r)rrs r6rzast_dump..ys$!Q!Q!*!Q!Q!Q!Q!Q!QrJz z [)rS])rVrx col_offsetrrDrErrrI iter_fieldsrr?rr__mro__rrOrN) r<r@rSrerxlinemarkhead named_fields field_namern next_indentprefixns r6rNrNSs5[F T8T * *F 888t88 4 & & 14!122 2 22 OH$+--t1111 4.0 0H : :t~. : : :D?400L  jjj \  a  $4\!_Q5G$H$H (O E 00 00e00011111 d  vo !- 8 8 J#2Z222F&& 8++%++,,,,E4(( 8mmm$$$<res $#""""""  ******&&&&&&33333333//////////////2222222222T!T!T!T!T!T!T!T!n F*F*F*F*F*F*F*F*Z 3 3 3 3 3%{%e_== 3 3 3          T4hsmXc]&B CDDE >$E2(((((u(((V'E'E'E'E'E'E'E'ET % % % % %sw % % %----o To To To To To To To Th7#(9999999rJ