L i%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/m0Z0m1Z1m2Z2erddl3m4Z4m5Z5ddl6m7Z7ejpejrfZ:edZ;dZ<Gdde=Z>e)dZ?dZ@GddeAZBGddeAZCGddejZEeFdejDZHdZIdZJdZKGd d!eAZLd"ZMd#ZNd$ZOd%ZPd&ZQd'ZRd(ZSd)ZTd*ZUeZVe;d+ZWd,ZXd-ZYd.ZZd/Z[d0Z\d1Z]d2Z^ejd3k\rd d4l`maZbyeLZby)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)NotOneValueFoundc:||_tt||yN)valuessuperr(__init__)selfmsgr+ __class__s Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/executing/executing.pyr-zNotOneValueFound.__init__:s  t-c2)__name__ __module__ __qualname__r- __classcell__r0s@r1r(r(9s!#33r2r(Tc"t|tr3t|dk7rtdt|zt |dSt t |d}t|dk(r tdt|dkDr td||dS)NrzExpected one value, found %srzExpected one value, found 0z!Expected one value, found several) isinstancerlenr(listtupler)itlsts r1onlyrABs"e r7a<"#ACG#KL LBx{ r1 C 3x1}<== 3x!|B3GG q6Mr2ceZdZdZdZeddZe ddZedZedZ edZ ed Z e d Z d Zd Zd ZedZedZdZy)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||_dj||_|Dcgc]}|jdc}|_t t |_d|_i|_ d|_ d|_ tj|j||_tj|jD]m}tj|D]%}t!t"|t!t"|_'t'|D] }|j|j)|"ot+}|j-|j|j.|_ ycc}w#t0t2f$rYywxYw)zG Don't call this constructor, see the class docstring. z Nfilename)rGjointextrstriplinesrr=_nodes_by_linetree _qualnames _asttokens_asttextastparsewalkiter_child_nodesrrparent node_linenosappendQualnameVisitorvisit qualnames SyntaxError ValueError)r.rGrKlinenodechildlinenovisitors r1r-zSource.__init__js; ! GGEN 6;.get_liness%%d3&9>J Jr2) r;r rormcacheget checkcache_for_filename_and_linesr>)rgrGrprirqentryrKs `` r1rczSource.for_filenames h %8}H K ##H-X&   U ).IOOH %KE**8U5\BBr2cx|jdi} |||fS#t$rYnwxYw|||x}|||f<|S)N__source_cache_with_lines) _class_localKeyError)rgrGrK source_cacheresults r1ruzSource._for_filename_and_liness`''(CRH  5 12 2   47x3GGx/0 s  ''cltj|jj|jyr*)rm lazycacherdrerf)rgrhs r1r~zSource.lazycaches" ELL44eooFr2ct|tjr'|}|j}|j}|j }n|}|j }|j}|j}|t||f}|jdi}|j|} | sdx} x} } |j|} | j}|rv | j|} | rDt|rt!||| | \} } n't#|| ||| }|j$} |j&} | rt)| h}t+|| k|} | | | | fx||<} t1|g| S#t,$r t.rY)wxYw)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_lastirdidryrsrjrMstatements_at_lineis_ipython_cell_codefind_node_ipython NodeFinderr| decoratorstatement_containing_noder ExceptionTESTING Executing)rg frame_or_tbtbrhr`lasticodekeyexecuting_cacheargsr^stmtsrsourcerM node_finder new_stmtss r1 executingzSource.executings} k5#6#6 7BKKE\\FKKEE^^FMME||RXu%**+>C""3''+ +D +59]]5)F;;D"55f=E/5.?ueU[.\OIt*4UE4PV*WK#.#5#5D(3(=(=I%>t%D$E  U 23 ) +1$y*H HOC 4&&& !sA5E E E cX|jj||}t||||S)z Returns an attribute directly associated with this class (as opposed to subclasses), setting default if necessary )__dict__rssetattr)rgnamedefaultr|s r1ryzSource._class_locals+!!$0T6" r2cX|j|Dchc] }t|c}Scc}w)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. )rLr)r.r`r^s r1rzSource.statements_at_lines4$    '  &d +   s'cddlm}|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$rMrG) asttokensr$rPrIrMrG)r.r$s r1asttextzSource.asttexts7 & == #DIIDII VDM}}r2cddl}|jnt|dr+|jj|_|jS|j |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)rrOhasattrrr#rIrMrGr.rs r1rzSource.asttokens(sn  ?? "y),"&,,.":":#,"5"5diidiiZ^ZgZg"5"hr2cbddl}t|dr|jS|jS)Nrr$)rrrrs r1 _asttext_basezSource._asttext_base8s( 9i (<<> !>># #r2crt|tr&tj|}|j |S|Sr*)r;bytesrCr decode)rencodings r1 decode_sourcezSource.decode_sourceAs2 fe $--f5H==* *Mr2cXttj|jdS)Nr)r ioBytesIOreadline)rs r1r zSource.detect_encodingJs#rzz&1::;A>>r2ct|j|jk(|jj |j |j f|j S)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) )rrerGrNrsco_nameco_firstlineno)r.rs r1 code_qualnamezSource.code_qualnameOsE.   DMM12""DLL$2E2E#F UUr2)TNT)r3r4r5__doc__r- classmethodrjrcrur~rryrrrrrr staticmethodrr rr2r1rCrCRs.0>\\ CC8  GG7'7'r      (  $??Vr2rCc(eZdZdZdZdZdZdZy)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}` cJ||_||_||_||_||_yr*)rhrr^ statementsr)r.rhrr^rrs r1r-zExecuting.__init__ws%   "r2c`|jj|jjSr*)rrrhrdr.s r1rzExecuting.code_qualnames!{{(():):;;r2ch|jjj|jSr*)rrget_textr^rs r1rIzExecuting.texts${{((*33DII>>r2ch|jjj|jSr*)rrget_text_ranger^rs r1 text_rangezExecuting.text_ranges${{((*99$))DDr2N)r3r4r5rr-rrIrrr2r1rrjs #<?Er2rc>eZdZfdZddZddZeZdZdZxZ S)rXcFtt| g|_i|_yr*)r,rXr-stackrZ)r.r0s r1r-zQualnameVisitor.__init__s ot-/ r2c.|xs |j}|jj|t|ddr|jdj }n |j }|j j||fdj|jy)Ndecorator_listrr.) rrrWgetattrrr`rZ setdefaultrH)r.r^rr`s r1 add_qualnamezQualnameVisitor.add_qualnamess tyy $ 4)2 .((+22F[[F !!4.#((4::2FGr2ct|tjtjtjfsJ||j |||j jdg}t|tjr|jg}n |j}|D]}|j||j j|j jtj|D]{\}}|dk(r t|tjr|j|8t|tsI|D].}t|tjs|j|0}y)Nzbody)r;rQ FunctionDefAsyncFunctionDefLambdarrrWrrYpop iter_fieldsASTr=)r.r^rchildrenr_field grandchilds r1visit_FunctionDefz!QualnameVisitor.visit_FunctionDefs"$#2F2F STZVZZT $% *% dCJJ ' {HyyH E JJu      OOD1 /LE5%) 5!E4("'/J!*cgg6 :./  /r2c`t|tjsJ|j|dy)Nz)r;rQrrr.r^s r1 visit_LambdazQualnameVisitor.visit_Lambdas&$ +++ tZ0r2ct|tjsJ|j||j ||j j yr*)r;rQClassDefr generic_visitrrrs r1visit_ClassDefzQualnameVisitor.visit_ClassDefs@$ --- $ 4  r2r*) r3r4r5r-rrvisit_AsyncFunctionDefrrr6r7s@r1rXrXs% H/8/1 r2rXc#PK|]}tt|j ywr*)r __future__ compiler_flag).0fnames r1 rs"16GJ,,s$&cXt||jdt|jzdS)NexecT)flags dont_inherit)compilere future_flagsco_flags)r matching_codes r1compile_similar_tors/ !!]333  r28io8urthglkjdghvljusketgIYRFYUVGHFRTBGVHKGF78678957647698c8tdt|DS)Nc3K|]L}|jdk7xr7t|jtxr|jj dNyw) LOAD_CONSTz@pyN)opnamer;argvalro startswith)rbcs r1rz)is_rewritten_by_pytest..sI  \!_j3&?_BIIDXDXY^D__sAA)anyr"rs r1is_rewritten_by_pytestrs! "4( r2c@eZdZdZdZdZdZdZdZdZ dZ d Z y) SentinelNodeFinderNct|||_||_|jx|_}t ||_|j rtt||_ nt|_ d|_ |j|x|_ j}d}td} td} |jdrt j"} n~|jdr"t j$} t j&} nK|jdrt j(} t+t j,t j.t1t ddt j2t j4t j6t j8t j:t j<t j>t j@t jBt jD |fd}nQ|jd r`t jF} t+t jHt jJt jLt jN |fd }n|d vr&t jP} t j&} fd }n|dvr&t jR} t j&} fd}n|dvrt jT} d}nt|jdr!t jV} t j$} nB|jdr&t jV} t jP} fd}n tY|tZ5|D chc]e} t!j\| D]K} t_| | r=t_t1| dd| r&|| rta| | k(rtctd| Mg} } } | t jVk(rtg| |_4 dddytk|jm| }|s%| t j"k(r|jo|ntg||_4dddycc} } w#1swYyxYw)Ncyrres 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_ORc0t|jSr*r;oprop_types r1rz-SentinelNodeFinder.__init__..Zg%>r2UNARY_)UNARY_POSITIVEUNARY_NEGATIVE UNARY_NOT UNARY_INVERTc0t|jSr*rrs r1rz-SentinelNodeFinder.__init__..rr2) LOAD_ATTR LOAD_METHOD LOOKUP_METHODc4t|jk(Sr*rrr instructions r1rz-SentinelNodeFinder.__init__.. LO{7I7I$Ir2) LOAD_NAME LOAD_GLOBAL LOAD_FAST LOAD_DEREFLOAD_CLASSDEREFc4t|jk(Sr*r(r)s r1rz-SentinelNodeFinder.__init__..$r+r2) COMPARE_OPIS_OP CONTAINS_OPc2t|jdk(S)Nr)r<opsrs r1rz-SentinelNodeFinder.__init__..'sSZ1_r2) STORE_SLICE STORE_SUBSCR STORE_ATTRc4t|jk(Sr*r(r)s r1rz-SentinelNodeFinder.__init__...r+r2ctx)8rrhrMrdrr is_pytest frozensetassert_linenosignore_linenosrget_actual_current_instructionr*rtyperrQCall SubscriptLoadBinOpdictPowMultrFloorDivDivModAddSubLShiftRShiftBitAndBitXorBitOrUnaryOpUAddUSubNotInvert AttributeNameCompareStore RuntimeErrorlockrSr;rrrrAr|r=matching_nodesfind_decorator)r.rhrrMrrrop_name extra_filterr;typstmtr^exprsmatchingr*rs @@r1r-zSentinelNodeFinder.__init__sV   <<' D/5 >>"+N4,@"AD "++D )-)L)LU)SS;$$% 4j4j   g &((C    ; <--C((C    *))C WW #'.sIr'B$'LL#&77!gg77 #!jj!jj::::))G?L    )++C"xx"xx'' ZZ   G ?L E E--C((CIL b b((C((CIL > >++C4L    ? @))C--C    -))C--CILw' ' -"HHTNdC(gdE48#>%,T2d: [$''Ecii#5k ! - -$D//67Hsxx##E*"8n - - - - -s&Q%A*Q'Q?AQQQ(ct|}tt|tjt f|j }t||j|jDcgc]'}|j|jjk(r|)}}t|Dcgc]\}}|jdk(r|c}}d}t||dzjjd||t|z dz|dz}t|Dchc]}|jc}dhk(|j!|j"} |ddd| } | |_||_ycc}wcc}}wcc}w)N CALL_FUNCTIONrSTORE_)rArr;rQrfunction_node_typesrclean_instructionsrr`rhr enumeraterrr<indexr*rr|) r.rrc decoratorsinstline_instructionsi last_decorator_instruction_indexdecorator_instructionsdecorator_indexrs r1r_z!SentinelNodeFinder.find_decoratorKs{E{ 4#,,0C!DEF((  // : {{djj111   %%67, 4{{o- ,  ,(  >B C J J U U  "3 ,*o  2"  )?@@_DUUV066t7G7GHtt$_5 " 3 , As),E$%E)E/ct|Dcgc]*}|jdvr|j|jvr|,c}Scc}w)N) EXTENDED_ARGNOP)r"rr`r?)r.rros r1rkz%SentinelNodeFinder.clean_instructionslsH). {{"99{{$"5"55    s/Ac|j|j}td|jDs|Dcgc]}|jdk7r|}}|Scc}w)Nc3:K|]}|jdk(yw)JUMP_IF_NOT_DEBUGNr)rros r1rzESentinelNodeFinder.get_original_clean_instructions..}s"  22 srz)rkrrcompile_instructionsr)r.r|ros r1get_original_clean_instructionsz2SentinelNodeFinder.get_original_clean_instructionsusn((3   557  "(;;"55F  sAc #pKj}tfdt|D}t|D]:\}}t|}|Jt j |t j t jt}t j||| j}||tjdk\r t||t|D cgc]\} } | j"tk(r| } } } t| D][\} } | | dzz} t%|j'| j(dk(t%|j'| j(dk(]t| D]\} } | | dzz} | dz }||k7r||}||}|j(|j(cxk(rd vr^nn[|j*|j*k7rB||dzj(||dzj(cxk7rd k(rnn|j'|dztjdkr1t-||D]"\}}t%|xr|xr t/||$|=y#||wxYw#t$rts|t!|dz krYowxYwcc} } ww) Nc3FK|]\}}|jk(r|ywr*)r*)rrqror.s r1rz4SentinelNodeFinder.matching_nodes..s+ 4t'''  !)s)leftrright) rr:rr r4r3r!)r}rArl get_setterrQrErGStrsentinelfix_missing_locationsr|sys version_info handle_jumpsrrr<rrrrargr opnames_match)r.rdoriginal_instructionsoriginal_index expr_indexexprsetter replacement instructionsrqr*indices index_numsentinel_index new_index original_instnew_instinst1inst2s` r1r^z!SentinelNodeFinder.matching_nodess $ D D F $%:;   !*% 0I  J%F% %%))779gg)K  % %k 2 ;  #88: t 7* /DE'0 &="A{%%1G.7w-? S) >)a-/ ((8??<OP ((8??>QR  S.7w-? ) >)a-/*Q. . 5n E ' 2 &,,[C[[)--=-nq.@AHH' A 6==MALM!$$Y]3##g-(3-|)Q u  O% OM%4OPQ  = WI t !*s5zA~"=   sOB.J62I;J6 J*J68J0E$J6; JJ6 J-(J6+J-- J6ct|j|j}t|j |}|j |Sr*)rrMrrA find_codesrk)r. module_coders r1r|z'SentinelNodeFinder.compile_instructionss:(DII> DOOK01&&t,,r2ctdtdtddgjstdtdgz fdg|rj|fd|S) Nr co_freevars co_cellvarscHt|jxs |jSr*)is_ipython_cell_code_namer)cs r1rz/SentinelNodeFinder.find_codes..s/ :Gaiir2co_names co_varnamesc0tfdDS)Nc3TK|]}||jk(!ywr*r)rfrr.s r1rzASentinelNodeFinder.find_codes..matches..s*!$)) $s%()all)rchecksr.s`r1matchesz.SentinelNodeFinder.find_codes..matchess r2c|jD]9}tj|s|rj||;yr*) co_constsinspectiscoderW)rconst code_optionsfinderrs r1rz-SentinelNodeFinder.find_codes..findersA ~~e,5> ''.u  r2)rr<rW)r. root_coderrrrs` @@@@r1rzSentinelNodeFinder.find_codess ' ( } % } % G   ~~ :&=) F   9     *  yr2ctt|j}tfdt |D} ||}|j dk7r|S|dz })z{ Get the instruction corresponding to the current frame offset, skipping EXTENDED_ARG instructions c3FK|]\}}|jk(r|ywr*)offset)rrqrors r1rzDSentinelNodeFinder.get_actual_current_instruction..s) 4{{e#  rrvr)r=r"rrArlr)r.rrrmr*s ` r1r@z1SentinelNodeFinder.get_actual_current_instructionsf,TYY78  $\2   &u-K!!^3"" QJE r2) r3r4r5r|r-r_rkr}r^r|rr@rr2r1rrs5 Fa-FB &Qf- $Lr2rc#Kd}tt||dD]V\}}|jtk(rt |j dk(d}4|rt |j dk(d}Q||fXyw)zz Yields (index, instruction) pairs excluding the basic instructions introduced by the sentinel transformation FNrTr )rrlrrrr)rstart skip_powerrqros r1non_sentinel_instructionsrsx J)L15$? 4 ;;( " DKK</ 0J   DKK>1 2J g  sA3A5c#Ktt||d}t||}d} t|\}}t|\} } |r0|j | j cxk7rdk(rnnt|\} } |j | j cxk(xrdvncxr|j | j k7}||| | f#t$rYywxYww)z Yields matching indices and instructions from the new and original instructions, leaving out changes made by the sentinel transformation. NFr!r)rrlrnext StopIterationrr) roriginal_startrr original_iternew_iterinverted_comparison original_irnew_irs r1walk_both_instructionsr2s 9%:;^TRM(u=H  (,](; %J "8nOE8 $$F;F"8nOE8  HOO O7O O 2!!X\\1 -88    s)&C B>A9C > C C  C  C c t|d|dD]\}}} t| rd jvrFd|jvr8t fdt |D}t ||||}|J||||dznKg}||dD]#}|j ||jdvs#nttt|||||ny)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`. rJUMPc3tK|]/\}}|jjk(rt|dds|1yw)_copiedFN)rrr)rrqrors r1rzhandle_jumps..bs94{{hoo5#D)U;s58Nr RETURN_VALUE RAISE_VARARGS) rrrrArl handle_jumprWAssertionErrorfind_new_matching) rrrrrrnew_instructions orig_section section_instrs @r1rrMs :P !1lA; )  6J uh]H5(V=;O;O-O#,\#:$/):|U$ (3332B UUQY/ " $9*+$F)L '' 5#**.OO) )(,01BL!  { c,/ /  , 4uWR[1_5 5 6s A1B4Bct||||D]j\}}}}tt|||jdvs,t |||dz}|D] } d| _ |||dz} t || |sg|||dz|cSy)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~|U7 2 M5(  mX67   #D D|EEAI>?G #"  #0*q.QL# .C35 UUQY/N  r2ctt|D]@}||k(r |||t|z}t|t|kryt||s@yy)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 r1rrsf 3456  " +I C DU8UV { c,/ / , 4 r2c:tdt||DS)z\ Returns True if the given lists of instructions have matching linenos and opnames. c3K|]T\}}|j|jk(xs$d|jcxk(xr|jk(ncxr t||Vyw) POP_BLOCKN)r`rr)r orig_instdup_insts r1rz!sections_match..s` Ix    / Bi..A(//A / )X .  /sAA)rr)rrs r1rrs' $'|[#A r2c>|j|jk(xsd|jvxrd|jvxsc|jdk(xr|jdk(xsA|jdvxr|jdk(xs |jdk(xr|jdk(S)Nr PRINT_EXPRPOP_TOP)r%r&r$ CALL_METHODrgr{)rrs r1rrs   $ O U\\ ! # ell " O LLL ( FU\\Y-F O LL< < , +  O LLM ) Mello.M r2c|jtjD]G\|ur fd}|cStts%t D]\}||us fd}|ccSIy)Nct|Sr*)r)new_noderrUs r1rzget_setter..settersvtX66r2c|<yr*r)rrrqs r1rzget_setter..setters #+ar2)rUrQrr;r=rl)r^ritemrrqrrUs @@@@r1rrsu [[Fv. " e D= 7M t $$U+ "44<,"M  " " r2ct|tjs5tt|j }t|tjs5tt|Sr*)r;rQrcrrrU)r^s r1rrsAsxx(K&--sxx(  T ""r2c#Ktj|D]G}t|dstt |tj s4t |D]}|Iyw)NrU)rQrSrr;rAssertrV)rMr^r`s r1r>r>sTh'4T:CJJG&t,    s%A##A# A#cFt|jtjs1|j}t|jtjs1tjd}t tj |g|_tj|||S)NrE) r;rUrQModulerRrrcr copy_location)rcrMs r1_extract_ipython_statementr sl cjj1{{cjj1 99R=Dchh%&DIdD! Kr2c@ttjd|S)Nz(|)$)boolrematch) code_names r1rrs 8)D EEr2c@ttjd|S)Nz'S>S"%%D#--I  d?   s+A!A!! A-,A-c# Kt|drsg}t|drLt|tjr2|jJt |j |jdz}n |j g}|D]}|yyw)Nr` end_linenor)rr;rQrrrr`)r^linenosr`s r1rVrVCsytX 4 &:dCHH+E??. ..DKK1)<=G{{mG FL sBB)r )PositionNodeFinder)crrrQdisrrrmrrr collectionsrcopyr functoolsr itertoolsrroperatorrpathlibr threadingr tokenizer typingr r rrrrrrrrrrrrrr_utilsrrrr r!r"rr#r$asttokens.asttokensr%rrrjrrrrr(r8rAobjectrCr NodeVisitorrXsumall_feature_namesrrrrrrrrrrrrrrr]rr>rrrrrrVr_position_node_finderrrrr2r1rs0   #!$SSSSSff,/(<(<=$ 3y3  CL  UVVUVpEED9coo9~:D:V:V  Fvvt &965p6(6"  & w##  F Q ( wG#Jr2