qBFj%(dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+d dl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2erddl3m4Z4m5Z5ddl6m7Z7ej8ej9fZ:edZ;dZ<Gdde=Z>e)dZ?dZ@GddeAZBGddeAZCGddejDZEeFdejGDZHdZIdZJdZKGd d!eAZLd"ZMd#ZNd$ZOd%ZPd&ZQd'ZRd(ZSd)ZTd*ZUeZVe;d+ZWd,ZXd-ZYd.ZZd/Z[d0Z\d1Z]d2Z^ej_d3krd d4l`maZbdSeLZbdS)5a+ MIT License Copyright (c) 2021 Alex Hall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. N) defaultdict)deepcopy) lru_cache)islice) zip_longest) attrgetter)Path)RLock)detect_encoding) TYPE_CHECKINGAnyCallableDictIterableIteratorListOptionalSequenceSetSizedTupleTypeTypeVarUnioncast) mangled_nameassert_ EnhancedASTEnhancedInstruction Instructionget_instructions) ASTTokensASTText) ASTTextBase)maxsizec"eZdZgffd ZxZS)NotOneValueFoundcf||_tt||dSN)valuessuperr(__init__)selfmsgr+ __class__s AC:\PYTHON\_runtimes\venv\Lib\site-packages\executing/executing.pyr-zNotOneValueFound.__init__:s/  t$$--c22222)__name__ __module__ __qualname__r- __classcell__r0s@r1r(r(9s@!#3333333333r2r(Tct|trGt|dkrtdt|zt |dSt t |d}t|dkrtdt|dkrtd||dS)NrzExpected one value, found %srzExpected one value, found 0z!Expected one value, found several) isinstancerlenr(listtupler)itlsts r1onlyrABs"e r77a<<"#ACGG#KLL LBxx{ r1  C 3xx1}}<=== 3xx!||B3GGG q6Mr2ceZdZdZdZeddZe ddZedZedZ ed Z ed Z e d Z d Zd ZdZedZedZdZdS)Sourcea The source code of a single file and associated metadata. The main method of interest is the classmethod `executing(frame)`. If you want an instance of this class, don't construct it. Ideally use the classmethod `for_frame(frame)`. If you don't have a frame, use `for_filename(filename [, module_globals])`. These methods cache instances by filename, so at most one instance exists per filename. Attributes: - filename - text - lines - tree: AST parsed from text, or None if text is not valid Python All nodes in the tree have an extra `parent` attribute Other methods of interest: - statements_at_line - asttokens - code_qualname c||_d||_d|D|_t t |_d|_i|_d|_ d|_ tj |j||_tj |jD]x}tj|D]/}tt |tt |_0t%|D]"}|j||#yt)}||j|j|_dS#t.t0f$rYdSwxYw)zG Don't call this constructor, see the class docstring. c8g|]}|dS)z )rstrip).0lines r1 z#Source.__init__..rs$<<.get_liness %d3&9&9>JJ Jr2) r;r rrrpcacheget checkcache_for_filename_and_linesr>)rjrLrsrlrtentryrOs `` r1rfzSource.for_filenames h % % %8}}H K K K K K K ##H--X&&&   U  ).IOH %IKKE**8U5\\BBBr2c|di} |||fS#t$rYnwxYw|||x}|||f<|S)N__source_cache_with_lines) _class_localKeyError)rjrLrO source_cacheresults r1rxzSource._for_filename_and_linessv''(CRHH  5 12 2    D 473x3G3GGx/0 s " //cNtj|jj|jdSr*)rp lazycachergrhri)rjrks r1rzSource.lazycaches$ EL4eoFFFFFr2ct|tjr|}|j}|j}|j}n|}|j}|j}|j}|t||f}| di}| |} | sdx} x} } | |} | j }|r | |} | rFt|rt!||| | \} } n!t#|| ||| }|j} |j} | r%t)| h}t+|| k|} n#t,$r t.rYnwxYw| | | | fx||<} t1|g| RS)z Returns an `Executing` object representing the operation currently executing in the given frame or traceback object. __executing_cacheN)r;types TracebackTypetb_frame tb_linenotb_lastif_linenof_lastirgidr|rvrmrQstatements_at_lineis_ipython_cell_codefind_node_ipython NodeFinderr decoratorstatement_containing_noder ExceptionTESTING Executing)rj frame_or_tbtbrkrclasticodekeyexecuting_cacheargsrastmtsrsourcerQ node_finder new_stmtss r1 executingzSource.executings k5#6 7 7 "BKE\FKEEE^FME|RXXu%**+>CC""3'' I'+ +D +59]]5))F;D "55f==E>/55>.?ueU[.\.\OItt*4UE4PV*W*WK#.#5D(3(=I*%>t%D%D$E  U 2333 ) +1$y*H HOC 4&&&&&s.BD33EEc^|j||}t||||S)z Returns an attribute directly associated with this class (as opposed to subclasses), setting default if necessary )__dict__rvsetattr)rjnamedefaultrs r1r|zSource._class_locals2!!$00T6""" r2c0d|j|DS)az Returns the statement nodes overlapping the given line. Returns at most one statement unless semicolons are present. If the `text` attribute is not valid python, meaning `tree` is None, returns an empty set. Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)` should return at least one statement. c,h|]}t|S)r)rHras r1 z,Source.statements_at_line..s0    &d + +   r2)rP)r.rcs r1rzSource.statements_at_lines-     '    r2cnddlm}|j"||j|j|j|_|jS)z Returns an ASTText object for getting the source of specific AST nodes. See http://asttokens.readthedocs.io/en/latest/api-index.html r)r$NrQrL) asttokensr$rTrNrQrL)r.r$s r1asttextzSource.asttextsD &%%%%% = #GDIDI VVVDM}r2cddl}|j[t|dr|j|_n,||j|j|j|_|jS)z Returns an ASTTokens object for getting the source of specific AST nodes. See http://asttokens.readthedocs.io/en/latest/api-index.html rNr$r)rrShasattrrr#rNrQrLr.rs r1rzSource.asttokens(sk  ? "y),, i"&,,..":"+"5"5didiZ^Zg"5"h"hr2czddl}t|dr|S|S)Nrr$)rrrrs r1 _asttext_basezSource._asttext_base8s> 9i ( ( $<<>> !>>## #r2ct|tr/t|}||S|Sr*)r;bytesrCr decode)rencodings r1 decode_sourcezSource.decode_sourceAs@ fe $ $ --f55H==** *Mr2cZttj|jdS)Nr)r ioBytesIOreadline)rs r1r zSource.detect_encodingJs$rz&11:;;A>>r2ct|j|jk|j|j|jf|jS)a Imitates the __qualname__ attribute of functions for code objects. Given: - A function `func` - A frame `frame` for an execution of `func`, meaning: `frame.f_code is func.__code__` `Source.for_frame(frame).code_qualname(frame.f_code)` will be equal to `func.__qualname__`*. Works for Python 2 as well, where of course no `__qualname__` attribute exists. Falls back to `code.co_name` if there is no appropriate qualname. Based on https://github.com/wbolster/qualname (* unless `func` is a lambda nested inside another lambda on the same line, in which case the outer lambda's qualname will be returned for the codes of both lambdas) )rrhrLrRrvco_nameco_firstlinenor.rs r1 code_qualnamezSource.code_qualnameOs@.  DM1222""DL$2E#F UUUr2)TNT)r3r4r5__doc__r- classmethodrmrfrxrrr|rurrrr staticmethodrr rrr2r1rCrCRs.000>\\\[\ CCC[C8  [ GG[G7'7'[7'r  [     U (    $$$\??\?VVVVVr2rCc*eZdZdZdZdZdZdZdS)ra Information about the operation a frame is currently executing. Generally you will just want `node`, which is the AST node being executed, or None if it's unknown. If a decorator is currently being called, then: - `node` is a function or class definition - `decorator` is the expression in `node.decorator_list` being called - `statements == {node}` cL||_||_||_||_||_dSr*)rkrra statementsr)r.rkrrarrs r1r-zExecuting.__init__ws)   "r2cJ|j|jjSr*)rrrkrgr.s r1rzExecuting.code_qualnames{(():;;;r2cd|j|jSr*)rrget_textrars r1rNzExecuting.texts&{((**33DI>>>r2cd|j|jSr*)rrget_text_rangerars r1 text_rangezExecuting.text_ranges&{((**99$)DDDr2N)r3r4r5rr-rrNrrr2r1rrjs_  ###<<<???EEEEEr2rc>eZdZfdZddZddZeZdZdZxZ S)r\crtt|g|_i|_dSr*)r,r\r-stackr^)r.r0s r1r-zQualnameVisitor.__init__s1 ot$$--/// r2Nc |p|j}|j|t|ddr|jdj}n|j}|j||fd|jdS)Ndecorator_listrr.) rrr[getattrrrcr^ setdefaultrM)r.rarrcs r1 add_qualnamezQualnameVisitor.add_qualnames ty $ 4)2 . . !(+2FF[F !!4.#((4:2F2FGGGGGr2ct|tjtjtjfs J|||||jdg}t|tjr |jg}n|j}|D]}| ||j |j tj |D]\}}|dkr t|tj r| |body)r;rU FunctionDefAsyncFunctionDefLambdarrr[rr]pop iter_fieldsASTr=)r.rarchildrenrbfield grandchilds r1visit_FunctionDefz!QualnameVisitor.visit_FunctionDefsu$#2F STTZZVZZZT $%%% *%%% dCJ ' ' ! {HHyH  E JJu        OD11 / /LE5%)) / 5!!!!E4(( /"'//J!*cg66/ :... / /r2cjt|tjsJ||ddS)Nz)r;rUrrr.ras r1 visit_LambdazQualnameVisitor.visit_Lambdas6$ +++++ tZ00000r2ct|tjsJ|||||jdSr*)r;rUClassDefr generic_visitrrrs r1visit_ClassDefzQualnameVisitor.visit_ClassDefsZ$ ----- $ 4    r2r*) r3r4r5r-rrvisit_AsyncFunctionDefrrr6r7s@r1r\r\s HHHH////8/111 r2r\c#JK|]}tt|jVdSr*)r __future__ compiler_flag)rHfnames r1 rs@16GJ,r2cNt||jdt|jzdS)NexecT)flags dont_inherit)compilerh future_flagsco_flags)r matching_codes r1compile_similar_tors3 !]33    r28io8urthglkjdghvljusketgIYRFYUVGHFRTBGVHKGF78678957647698cNtdt|DS)Nc3K|]C}|jdko3t|jto|jdVDdS) LOAD_CONSTz@pyN)opnamer;argvalrr startswith)rHbcs r1rz)is_rewritten_by_pytest..sd  \!_j3&?&?_BIDXDXY^D_D_r2)anyr"rs r1is_rewritten_by_pytestrs8 "4((  r2cBeZdZdZdZdZdZdZdZdZ dZ d Z dS) SentinelNodeFinderNc t|||_||_|jx|_}t ||_|jr"tt||_ nt|_ d|_ | |x|_ j }d td td|drt jn5|drt jt j n|drt jt+t jt jt1t ddt jt jt jt jt jt jt jt j t j!t j" | fd n0|d rSt j#t+t j$t j%t j&t j' | fd  n|d vrt j(t j fd  n|dvrt j)t j fd n|dvrt j*d np|drt j+ t jnB|drt j+ t j( fd ntY|tZ5 fd|D} t j+kr"t]||_/ ddddSta|1|} | s&t jkr|2|nt]| |_/ddddS#1swxYwYdS)NcdSrres r1z-SentinelNodeFinder.__init__..sr2CALL_) BINARY_SUBSCRzSLICE+BINARY_MatMultr) BINARY_POWERBINARY_MULTIPLYBINARY_MATRIX_MULTIPLYBINARY_FLOOR_DIVIDEBINARY_TRUE_DIVIDE BINARY_MODULO BINARY_ADDBINARY_SUBTRACT BINARY_LSHIFT BINARY_RSHIFT BINARY_AND BINARY_XOR BINARY_ORc.t|jSr*r;opr op_types r1r z-SentinelNodeFinder.__init__..Zg%>%>r2UNARY_)UNARY_POSITIVEUNARY_NEGATIVE UNARY_NOT UNARY_INVERTc.t|jSr*rr s r1r z-SentinelNodeFinder.__init__..r"r2) LOAD_ATTR LOAD_METHOD LOOKUP_METHODc4t|jkSr*rrr  instructions r1r z-SentinelNodeFinder.__init__.. LOO{7I$Ir2) LOAD_NAME LOAD_GLOBAL LOAD_FAST LOAD_DEREFLOAD_CLASSDEREFc4t|jkSr*r-r.s r1r z-SentinelNodeFinder.__init__..$r0r2) COMPARE_OPIS_OP CONTAINS_OPc2t|jdkS)Nr)r<opsr s r1r z-SentinelNodeFinder.__init__..'sSZZ1_r2) STORE_SLICE STORE_SUBSCR STORE_ATTRc4t|jkSr*r-r.s r1r z-SentinelNodeFinder.__init__...r0r2c h|]{}tj|D]d}t|rRtt|ddr3|r(t ||kOt t |e|S)ctxN)rUrWr;rrrr)rHstmtrarA extra_filtertyps r1rz.SentinelNodeFinder.__init__..4sHTNNdC((  gdE488#>>   <%% -T22d:: [$'' ;:::r2)3rrkrQrgrr is_pytest frozensetassert_linenosignore_linenosrget_actual_current_instructionr/rtyperrUCall SubscriptLoadBinOpdictPowMultrFloorDivDivModAddSubLShiftRShiftBitAndBitXorBitOrUnaryOpUAddUSubNotInvert AttributeNameCompareStore RuntimeErrorlockrArr=matching_nodesfind_decorator)r.rkrrQrrrop_nameexprsmatchingrArCr/r!rDs @@@@@r1r-zSentinelNodeFinder.__init__s   <' D/55 > ."+N4,@,@"A"AD  "+++D )-)L)LU)S)SS;$%~ 4jj4jj   g & &3 ((CC    ; < <1 (-C(CC    * *. ()C W #'.sIr'B'B$'L#&7!g7 #!j!j::)G?>>>LL    ) ) (+C"x"x' Z   G ?>>>LL E E E-C(CIIIILL b b b(C(CIIIILL > > >+C44LL    ? @ @ ()C-CC    - - ()C-CIIIILLw'' ' - -!Eci#5kk ! - - - - - - - -$D//6677H -sx##E****"8nn - - - - - - - - - - - - - - - - - - -s+6O.AOO Oct|}tt|tjt f|j}t|fdjD}dt|Dd}t||dzj d||t|z dz|dz}td|Ddhk| j}|ddd|}|_|_dS)Nc>g|]}|jjjk|Sr)rcrkrrHinstr.s r1rJz5SentinelNodeFinder.find_decorator..Qs5   {dj111 111r2c.g|]\}}|jdk|S) CALL_FUNCTIONr)rHiros r1rJz5SentinelNodeFinder.find_decorator..Vs3, , , 4{o-- ---r2rSTORE_ch|] }|j SrrrrHros r1rz4SentinelNodeFinder.find_decorator..fs@@@@@@r2rq)rArr;rUrfunction_node_typesrclean_instructionsr enumeraterrr<indexr/rr) r.rrB decoratorsline_instructions last_decorator_instruction_indexdecorator_instructionsdecorator_indexrs ` r1rhz!SentinelNodeFinder.find_decoratorKsE{{ 4#,0C!DEEFFF(      // ::    , , $%677, , ,  ,(  >B C J U U     "3 ,*oo  2 "  @@)?@@@_DUUVVV066t7GHHttt$_5 " r2c:fdt|DS)NcBg|]}|jdvr|jjv|S)) EXTENDED_ARGNOP)rrcrHrns r1rJz9SentinelNodeFinder.clean_instructions..nsC   {"999{$"555 655r2)r"rs` r1ryz%SentinelNodeFinder.clean_instructionsls6    (..    r2c||j}td|Ds d|D}|S)Nc3,K|]}|jdkVdS)JUMP_IF_NOT_DEBUGNrrrws r1rzESentinelNodeFinder.get_original_clean_instructions..}s>   22      r2c(g|]}|jdk |S)rrrrws r1rJzFSentinelNodeFinder.get_original_clean_instructions..s0;"555555r2)ryrrcompile_instructions)r.rs r1get_original_clean_instructionsz2SentinelNodeFinder.get_original_clean_instructionsusx((33    5577      !'F  r2c #K}tfdt|D}t|D]u\}}t|}|Jt j|t jt jt}t j ||| }||n#||wxYwtj dkr@ t||n.#t$r!ts|t!|dz krYwxYwdt|D} t| D]c\} } | | dzz} t#|| jdkt#|| jd kdt| D]\} } | | dzz} | dz } | |kr||} || }| j|jcxkrd vrWnnT| j|jkrD||dzj|| dzjcxkrd krnn|| dztj dkr7t+||D]&\}}t#|o|ot-||'|VwdS) Nc38K|]\}}|jk|VdSr*)r/)rHrsror.s r1rz4SentinelNodeFinder.matching_nodes..sA  4t''' ''''  r2)s)leftrright) rc8g|]\}}|jtk|Sr)rsentinel)rHrsr/s r1rJz5SentinelNodeFinder.matching_nodes..s4"A{%11111r2r:rrr9r8r&)rrArz get_setterrUrNrPStrrfix_missing_locationsrsys version_info handle_jumpsrrr<rrrargr opnames_match)r.rjoriginal_instructionsoriginal_index expr_indexexprsetter replacement instructionsindices index_numsentinel_index new_index original_instnew_instinst1inst2s` r1rgz!SentinelNodeFinder.matching_nodess $ D D F F    $%:;;      !*% 0 0I I  J%%F%%%)799g)))K  %k 2 2 2 F;    #88:: t t 7** /DEEEE !*s5zzA~"="=   &/ &=&=G.7w-?-? S S) >)a-/ ((88?<OPPP ((88?>QRRRR.7w-?-?  ) >)a-/*Q. .. 5n E ' 2 &,[[[[C[[[[[[)-==-nq.@AH' A 6=MMMMALMMMMM!$$Y]333#g--(3-|))QQ u  O% OM%4O4OPPPP = WI I sC(( C5 D'EEct|j|j}t||}||Sr*)rrQrrA find_codesry)r. module_coders r1rz'SentinelNodeFinder.compile_instructionssB(DI>> DOOK0011&&t,,,r2c0tdtdtddgjs!tdtdgz fdg|r|fd|S) Nr co_freevars co_cellvarsc8t|jp|jSr*)is_ipython_cell_code_namer)cs r1r z/SentinelNodeFinder.find_codes..s/ ::Gair2co_names co_varnamesc>tfdDS)Nc3RK|]!}||jkV"dSr*r)rHfrr.s r1rzASentinelNodeFinder.find_codes..matches..sN!$) $r2)all)rchecksr.s`r1matchesz.SentinelNodeFinder.find_codes..matchessA r2c|jD]B}tj|s|r||CdSr*) co_constsinspectiscoder[)rconst code_optionsfinderrs r1rz-SentinelNodeFinder.find_codes..findersf  ~e,,75>>/ ''...u   r2)rrEr[)r. root_coderrrrs` @@@@r1rzSentinelNodeFinder.find_codess ' ( ( } % % } % % G G   ~  :&&=)) F        79   +    * * *        yr2ctt|j}tfdt |D} ||}|jdkr|S|dz })z{ Get the instruction corresponding to the current frame offset, skipping EXTENDED_ARG instructions c38K|]\}}|jk|VdSr*)offset)rHrsrors r1rzDSentinelNodeFinder.get_actual_current_instruction..s@  4{e## ####  r2Trr)r=r"rrArzr)r.rrr{r/s ` r1rIz1SentinelNodeFinder.get_actual_current_instructions,TY7788     $\22       &u-K!^33"" QJE  r2) r3r4r5rr-rhryrrgrrrIrr2r1rrs Fa-a-a-FB   &QQQf--- $$$Lr2rc#Kd}tt||dD]S\}}|jtkrt |jdkd}0|rt |jdkd}M||fVTdS)zz Yields (index, instruction) pairs excluding the basic instructions introduced by the sentinel transformation FNrTr)rrzrrrr)rstart skip_powerrsros r1non_sentinel_instructionsrs J)L115$??  4 ;( " " DK</ 0 0 0J    DK>1 2 2 2J g   r2c#Ktt||d}t||}d} t|\}}t|\} } n#t$rYdSwxYw|r,|j| jcxkrdkrnnt|\} } |j| jcxkodvnco|j| jk}||| | fV)z Yields matching indices and instructions from the new and original instructions, leaving out changes made by the sentinel transformation. NFTr&r)rrzrnext StopIterationrr) roriginal_startrr original_iternew_iterinverted_comparison original_irnew_irs r1walk_both_instructionsr2s 9%:;;^TRRM(u==H9 (,](;(; %J "8nnOE88    FF   -$FFFF;FFFFF"8nnOE8  HO O O O O7O O O O O 2!X\1 -88889s$A A('A(c t|d|dD]\}}} t| rd jvrRd|jvrIt fdt |D}t ||||}|J||||dz<nXg}||dD]"}|||jdvrn#ttt|||||<ndS)a Transforms instructions in place until it looks more like original_instructions. This is only needed in 3.10+ where optimisations lead to more drastic changes after the sentinel transformation. Replaces JUMP instructions that aren't also present in original_instructions with the sections that they jump to until a raise or return. In some other cases duplication found in `original_instructions` is replicated in `instructions`. TrJUMPc3dK|]*\}}|jjkt|dd&|V+dS)_copiedFN)rrr)rHrsrors r1rzhandle_jumps..bsV4{ho55#D)U;;65555r2Nr RETURN_VALUE RAISE_VARARGS) rrrrArz handle_jumpr[AssertionErrorfind_new_matching) rrrrrrnew_instructions orig_section section_instrs @r1rrMsm*:P !1lA; ; ) )  6J uh]H55 ((V=;O-O-O#,\#:#:$/):|U$$ (3332B UUQY.// " $9*++$F))L '' 555#*.OOOP)(,01B>L!!  {  c,// / / FF , 4 4 6uWR[1_45 5 5 5 6 6r2c*t||||D]\}}}}tt|||jdvrRt |||dz}|D] } d| _ |||dz} t || |s g|||dz<|cSdS)a` Returns the section of instructions starting at `start` and ending with a RETURN_VALUE or RAISE_VARARGS instruction. There should be a matching section in original_instructions starting at original_start. If that section doesn't appear elsewhere in original_instructions, then also delete the returned section of instructions. rrTN)rrrrrrcheck_duplicates) rrrr original_jrnew_jrinlinedinlrs r1rrs7M~|U77  2 M5(  mX66777  #D D D|EEAI,=>??G # #" 0*q.1PQL# .C 535 UUQY./NNN E 4r2ctt|D]Y}||kr |||t|z}t|t|krdSt||rdSZdS)z Returns True if a section of original_instructions starting somewhere other than original_i and matching orig_section is found, i.e. orig_section is duplicated. FT)rr<r)rrr dup_startrs r1rrs 345566  " " +I C DUDU8U,UV {  c,// / /55 , 4 4 44  5r2cPtdt||DS)z\ Returns True if the given lists of instructions have matching linenos and opnames. c3K|]A\}}|j|jkpd|jcxko |jkncot||VBdS) POP_BLOCKN)rcrr)rH orig_instdup_insts r1rz!sections_match..s Ix   / Bi.AAAA(/AAAA / )X . . r2)rr)rrs r1rrs> $'|[#A#A  r2c|j|jkpQd|jvod|jvp?|jdko |jdkp)|jdvo |jdkp|jdko |jdkS)Nr PRINT_EXPRPOP_TOP)r*r+r) CALL_METHODrqrr)rrs r1rrs   $ O U\ ! # el " O LL ( FU\Y-F O L< < , +  O LM ) Melo.M r2c|jtjD]M\|ur fd}|cSttr%t D]\}||ur fd}|ccSNdS)Nc&t|Sr*)r)new_noderrYs r1rzget_setter..settersvtX666r2c|<dSr*r)rrrss r1rzget_setter..setters#+ar2)rYrUrr;r=rz)raritemrrsrrYs @@@@r1rrs [Fv.. " " e D== 7 7 7 7 7 7MMM t $ $ "$U++ " "44<<,,,,,,"MMMMM  4r2ct|tjs4tt|j}t|tj4tt|Sr*)r;rUrBrrrY)ras r1rrsPsx((.K&&-sx((.  T " ""r2c#Ktj|D]O}t|dr=tt |tjrt |D]}|VPdS)NrY)rUrWrr;rAssertrZ)rQrarcs r1rGrGs{h'' 4T::CJGG 't,,   r2c"t|jtjs&|j}t|jtj&tjd}t tj|g|_tj|||S)NrE) r;rYrUModulerVrrBr copy_location)rBrQs r1_extract_ipython_statementr sv cj11{cj11 9R==Dch%%&DIdD!!! Kr2cFttjd|S)Nz(|)$)boolrematch) code_names r1rrs 8)DD E EEr2cFttjd|S)Nz'S ""zz%D#-II    D  d?s%AA AAc#Kt|drdg}t|drAt|tjr'|jJt |j|jdz}n|jg}|D]}|VdSdS)Nrc end_linenor)rr;rUrrrrc)ralinenosrcs r1rZrZCstX 4 & & $:dCH+E+E $?...DK1)<==GG{mG  FLLLL  r2)r )PositionNodeFinder)crrrUdisrrrprrr collectionsrcopyr functoolsr itertoolsrroperatorrpathlibr threadingr tokenizer typingr r rrrrrrrrrrrrrr_utilsrrrr r!r"rr#r$asttokens.asttokensr%rrrxrurrr(r8rAobjectrCr NodeVisitorr\sumall_feature_namesrrrrrrrrrrrrrrrfrrGrrr rrrZr_position_node_finderrrrr2r1r&s+0   ######!!!!!!$$$$$$SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSffffffffffffffff0,,,,,,,,//////(<= $ 33333y333  GCLL    UVUVUVUVUVVUVUVUVpEEEEEEEED99999co999~s:D:V  Fvvvvvvvvt &9996555p666(6"      & uww###    FFF QQQ (   wGGGGGGGG#JJJr2