bg VdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddl m!Z!ddl m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl.m0Z0ddl1m2Z2erddl%m3Z3e j4dkrej5Z6ej7Z8ej7Z9ej7Z:nej;Z6ej<Z8ej=Z9ej>Z:e2dZ?e j@jAde$ZBdd!pd"zZCd#eBzeCzZDGd$d%ejEjFejEjGZHd&eeId'e jJd(ejKd)dfd*ZLd+dd(ejKd'e jJd,ed)eMf d-ZNd.ed/e+d)ee jJejKffd0ZOd1fd2ed,ed3eePgdfd)eejKfd4ZQ dqd5ejRd2eId6eePd/ee+d)df d7ZSd8eTd)ePfd9ZUd/ee+d)eeVfd:ZWd8eTd)ePfd;ZXd8eTd)eMfd<ZYd=eePd>eMd)ePfd?ZZd@eePdAeeMdBeePdCeeTd)ePf dDZ[dEeVdFePdGePd)dfdHZ\d)eMfdIZ]ej^dJej_dKej`dLejadMiZbiejcdNejddOejedPejfdQejgdRejhdSejidTejjdUejkdVejldWejmdXejndYejodZejpd[ejqd\ejrd]ejsd^ejtd_ejud`ejvdaejwdbejxdcejyddiZzdeej{d)eej{fdfZ|ej}dghdieId)eeVePffdjZ~GdkdlejZdmed)eMfdnZdoed)efdpZdS)rz5Rewrite assertion AST to produce nice error messages.N)Path)PurePath)Callable)Dict)IO)Iterable)Iterator)List)Optional)Sequence)Set)Tuple) TYPE_CHECKING)Union)DEFAULT_REPR_MAX_SIZE)saferepr)version)util)format_explanation)Config)Session) absolutepath) fnmatch_ex)StashKey)AssertionStaterz-pytest-.pyTco.c eZdZdZdeddfdZdeeddfdZe j j j Z d ded eeeeefd eejdee j jfd Z d e j jdeejfd ZdejddfdZdedddefdZdededddefdZdedddefdZdeddfdZdeddfdZdeeefdefdZejdkr"ejdkrddl m!Z!nddl"m!Z!dede!fdZ#dSdS)!AssertionRewritingHookz1PEP302/PEP451 import hook which rewrites asserts.configreturnNc||_ |d|_n#t$r ddg|_YnwxYwd|_i|_t |_d|_dh|_ i|_ d|_ dS)N python_filesz test_*.pyz *_test.pyFconftest) r%getinifnpats ValueErrorsession_rewritten_namesset _must_rewrite _writing_pyc_basenames_to_check_rewrite_marked_for_rewrite_cache_session_paths_checked)selfr%s j/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/assertion/rewrite.py__init__zAssertionRewritingHook.__init__Fs  5 --77DKK 5 5 5& 4DKKK 5*. 13'*uu",6<(:<&&+###s $::r-c"||_d|_dS)NF)r-r4)r5r-s r6 set_sessionz"AssertionRewritingHook.set_sessionVs &+###namepathtargetc|jrdS|jjt}|||rdS|d|z|||}|O|jHt|j tj j r$tj|jsdS|j}||||sdStj||||jS)Nzfind_module called for: %s)loadersubmodule_search_locations)r1r%stashassertstate_key_early_rewrite_bailouttrace _find_specorigin isinstancer? importlib machinerySourceFileLoaderosr<exists_should_rewriterspec_from_file_locationr@)r5r;r<r=statespecfns r6 find_specz AssertionRewritingHook.find_spec]s    4 !/2  & &tU 3 3 4 047888tT** L{"dk9+>+OPP#7>>$+.. # 4B##D"e44 4~55  '+'F 6   r:rPcdSN)r5rPs r6 create_modulez$AssertionRewritingHook.create_modules tr:modulec|jJ|jjJt|jj}|jjt }||j|j<tj }t|}|r+t|}|sd}| d||j ddtz}||z }t|||j } | a| d|t!||j\} } |r.d|_ t%|| | |d|_n%#d|_wxYwn| d|t'| |jdS)NFzread only directory: z rewriting Tzfound cached rewritten pyc for )__spec__rFrr%rArBr.__name__sysdont_write_bytecode get_cache_dir try_makedirsrDr;PYC_TAIL _read_pyc _rewrite_testr1 _write_pycexec__dict__) r5rWrQrOwrite cache_dirok cache_namepycco source_stats r6 exec_modulez"AssertionRewritingHook.exec_modules***%111 &/( ) ) !/213fo.++!"%%  Ai((B A ?I??@@@WSbS\H, *$r3 , , : KK+R++ , , ,+B <">> ? ? ? R!!!!!s D(( D1rOrc|j|jsd|_|jjD]q}t|t j}|jt j |ddr|d}|d|jvrdSt| d}|j D]7}t j |rdSt||rdS8|||rdS|d|dS) a'A fast way to get out of rewriting modules. Profiling has shown that the call to PathFinder.find_spec (inside of the find_spec from this class) is a major slowdown, so, this method tries to filter what we're sure won't be rewritten before getting to it. NTrr"Frz early skip of rewriting module: )r-r4 _initialpathsstrsplitrKsepr2addr<splitextr with_suffixr+dirnamer_is_marked_for_rewriterD)r5r;rO initial_pathpartsr<pats r6rCz-AssertionRewritingHook._early_rewrite_bailoutsT < #D,G #*.D ' $ : U U L))//77044RW5E5EeBi5P5PQR5STTTT 3 98 8 85++E22;  Cws## uu#t$$ uu   & &tU 3 3 5 =t==>>>tr:rQctj|dkr|d|dS|jA|jt |r|d|dSt|}|jD]-}t||r|d|dS.| ||S)Nz conftest.pyzrewriting conftest file: Tz.matched test file (was specified on cmdline): zmatched test file ) rKr<basenamerDr- isinitpathrrr+rrx)r5r;rQrOfn_pathr{s r6rMz&AssertionRewritingHook._should_rewrites 7  B  = 0 0 KK:B:: ; ; ;4 < #|&&|B'7'788  SRSSTTTt2,,;  C#w''  777888tt **4777r:c  |j|S#t$r`|jD]J}||ks||dzr*|d|d|dd|j|<YdSKd|j|<YdSwxYw)Nr"zmatched marked file z (from )TF)r3KeyErrorr0 startswithrD)r5r;rOmarkeds r6rxz-AssertionRewritingHook._is_marked_for_rewrites 1$7 7   ,  6>>T__Vc\%B%B>KK Qt Q Qf Q Q QRRR;?D248444" 49D *4 055 s AA9* A98A9namesct|tj|j}|D]l}tj|}t |jpds7t|j t|s| |m|j ||jdS)zMark import names as needing to be rewritten. The named module or package as well as any nested modules will be rewritten on import. N)r/ intersectionr\modules differencer.AssertionRewriteris_rewrite_disabled__doc__rG __loader__type_warn_already_importedr0updater3clear)r5ralready_importedr;mods r6 mark_rewritez#AssertionRewritingHook.mark_rewrites JJ # #CK 0 0 ; ;Drfsdr:rrDc t|d}n#t$rYdSwxYw|5 tj|}t |j}|j}|d}n4#t$r'}|d|d|Yd}~ddddSd}~wwxYwt|dkr|d|z ddddS|ddtj j kr|d|z ddddS|dd d kr|d |z ddddS|d d } t | d |dzkr|d|z ddddS|d d} t | d |dzkr|d|z ddddS tj|} n4#t$r'}|d|d|Yd}~ddddSd}~wwxYwt!| t"js|d|z ddddS| cdddS#1swxYwYdS)zsPossibly read a pytest pyc containing rewritten code. Return rewritten code if successful or None if not. rNz _read_pyc(z ): OSError z&_read_pyc(%s): invalid pyc (too short)z-_read_pyc(%s): invalid pyc (bad magic number)rrz._read_pyc(%s): invalid pyc (unsupported flags)rlittlerz_read_pyc(%s): out of datez+_read_pyc(%s): invalid pyc (incorrect size)z): marshal.load error z _read_pyc(%s): not a code object)rrrKrrrrrlenrHrr from_bytesrload ExceptionrGrCodeType) rrjrDr stat_resultrrdatar mtime_data size_datarks r6raraes #t__ tt ## '&//K ,--E&D772;;DD    E5v55!55 6 6 6444########   t99   E:VC D D D######## 8y~2 2 2 EAFJ K K K######## !9+ + + EBVK L L L%########&!B$Z >>*h / /5:3E E E E.7 8 8 8-########.BK >>)X . .$2C C C E?&H I I I5########6 b!!BB    E@v@@Q@@ A A A444?########: "en--  E4v= > > >E########FG##################s !!IAA-,I- B7BIB%I,I I3;I;;IGI H #H4IH  ,IIIIr module_pathcNt||||dS)z%Rewrite the assert statements in mod.N)rrun)rrrr%s r6rrs*k662266s;;;;;r:objc~ttj}t||ddS)aGet a safe repr of an object for assertion error messages. The assertion formatting (util.format_explanation()) requires newlines to be escaped since they are a special character for it. Normally assertion.util.format_explanation() does this but for a custom repr it is possible to contain one of the special escape sequences, especially '\n{' and '\n}' are likely to be present in JSON reprs. maxsize \n)_get_maxsize_for_safereprr_configrr)rrs r6 _safereprrs6( 55G C ) ) ) 1 1$ > >>r:cr||dnd}|dkrdS|dkr tdzStS)zJGet `maxsize` configuration for saferepr based on the given config object.Nverboserr) getoptionr)r% verbositys r6rrsG/5/A  +++qIA~~tA~~$r))  r:cddg}t|ts$t|}|d|D]\}}|||}|S)zFormat the custom assertion message given. For strings this simply replaces newlines with '\n~' so that util.format_explanation() will preserve them instead of escaping newlines. For other objects saferepr() is used first. )r ~)%%%)rr)rGrqrappendr)rreplacesr1r2s r6_format_assertmsgr sj{+H c3  (smm'''""Bkk"b!! Jr:cjt|rdS t|d S#t$rYdSwxYw)NFr[T)callablehasattrr)rs r6_should_repr_global_namer sO}}u3 ++++ tts $ 22 explanationsis_orcld|rdpd|zdz}|ddS)N(z or z and rrr)joinr)rr explanations r6_format_booloprs?)64W::<HHH3NK   sD ) ))r:opsresultsexplseach_objcttt|||D]!\}}} | }n#t$rd}YnwxYw|rn"tj/t j||||||dz}||S|S)NTr)ziprangerrr _reprcompare) rrrriresexpldonecustoms r6_call_reprcomparer"s E#c((OOWe<< 3 7DD   DDD    E  $"3q68A;QHH  M Ks7 AAlinenoorigrcNtjtj|||dSdSrTr_assertion_pass)r#r$rs r6_call_assertion_passr(s. ' VT400000('r:c"tjrdndS)zCheck if any plugins implement the pytest_assertion_pass hook in order not to generate explanation unnecessarily (might be expensive).TFr&rUr:r6_check_if_assertion_pass_implr*s' 244U2r:znot %sz~%sz-%sz+%s|^&z<>+-*/z//rz==z!=z>=**iszis notinznot in@nodec#jK|Vtj|D]}t|Ed{VdS)zARecursively yield node and all its children in depth-first order.N)riter_child_nodes traverse_node)r8childs r6r;r;sV JJJ%d++(( ''''''''''((r:rrsrcc i d g d td fd }tjtj|j}|D]\}}\}}}}|tjkr |dkr| % n|tjkr |dvr dz n|tjkr |dvr dz s3 ||d| dkr|tjkr|d kr|vrOt dkr<|t d zt|z } d d|  d <n5|vr d d| d <n |d||@|tj tj hvr |f r.|vr* || S) z._write_and_reset*sY(((WWU^^2244;;DAAM UU r:assertz([{rz)]},ror&N) r/tokenizeioBytesIOreadlineNAMEOPrrtrNEWLINE ENDMARKER)r=rGtokenstprr#offset_lineoffset_in_trimmedrBrCrDrErFs @@@@@r6_get_assertion_exprsrY sSC EE#'M55J rz#7 8 8F17''-F$VVa   6X#5#5"MM  &X[  Vu__ x{""v  ' T&'']+++v&&&&!hk 1 1fmmZ''CJJ!OO(.U2Y(?#d))(K% %b *<+<*< =E"IIz)) %b '6' 2E"IILLgvg///  """"((*<===  """" '633 T"""v&&& Jr:ceZdZdZdeedeededdffd Zde j ddfd Z e d ede fd Zdefd Zd e jde jfdZd e jde jfdZdede jde jfdZdede jfdZd e jdefdZd,dZde jde jfdZde jdee jeffdZde jdee jfdZ de!dee!effdZ"de jdee jeffdZ#de j$dee jeffdZ%d e j&dee jeffd!Z'd"e j(dee jeffd#Z)d$e j*dee jeffd%Z+d&e j,dee j,effd'Z-d(e jdee jeffd)Z.d*e j/dee jeffd+Z0xZ1S)-ra Assertion rewriting implementation. The main entrypoint is to call .run() with an ast.Module instance, this will then find all the assert statements and rewrite them to provide intermediate values and a detailed assertion error. See http://pybites.blogspot.be/2011/07/behind-scenes-of-pytests-new-assertion.html for an overview of how this works. The entry point here is .run() which will iterate over all the statements in an ast.Module and for each ast.Assert statement it finds call .visit() with it. Then .visit_Assert() takes over and is responsible for creating new ast statements to replace the original assert statement: it rewrites the test of an assertion to provide intermediate values and replace it with an if statement which raises an assertion error with a detailed explanation in case the expression is false and calls pytest_assertion_pass hook if expression is true. For this .visit_Assert() uses the visitor pattern to visit all the AST nodes of the ast.Assert.test field, each visit call returning an AST node and the corresponding explanation string. During this state is kept in several instance attributes: :statements: All the AST statements which will replace the assert statement. :variables: This is populated by .variable() with each variable used by the statements so that they can all be set to None at the end of the statements. :variable_counter: Counter to create new unique variables needed by statements. Variables are created using .variable() and have the form of "@py_assert0". :expl_stmts: The AST statements which will be executed to get data from the assertion. This is the code which will construct the detailed assertion message that is used in the AssertionError or for the pytest_assertion_pass hook. :explanation_specifiers: A dict filled by .explanation_param() with %-formatting placeholders and their corresponding expressions to use in the building of an assertion message. This is used by .pop_format_context() to build a message. :stack: A stack of the explanation_specifiers dicts maintained by .push_format_context() and .pop_format_context() which allows to build another %-formatted string while already building one. :variables_overwrite: A dict filled with references to variables that change value within an assert. This happens when a variable is reassigned with the walrus operator This state, except the variables_overwrite, is reset on every new assert statement visited and used by the other visitors. rr%rr&Nct||_||_||d|_nd|_||_i|_dS)Nenable_assertion_pass_hookF)superr7rr%r*r\rvariables_overwrite)r5rr%r __class__s r6r7zAssertionRewriter.__init__sk &  .4mm,//D + +/4D + 35   r:rc|jsdSt|dd}|du}|||rdSd}d}|jD]}|rxt|tjr^t|jtrDtj dkr |jj}n |jj }||rdSd}n3t|tj r|j dkr |j dkrnn|dz }t|tjr|jr|jdjn|jtj dkr1t jd d d t jd d d g}n*t jd d t jd d g}fd|D}||j||<|g}|rC|} t j| D]\} } t| t(rg} t+| D]\} }t|tjr)| ||H| |t|tjr||t7| | | t| tjr/t| tjs|| |AdSdS)z5Find all assert statements in *mod* and rewrite them.N docstringrrF __future__rrbuiltins @py_builtinsr# col_offsetz_pytest.assertion.rewrite @pytest_arc@g|]}tj|gdS)rre)rImport).0aliasr#s r6 z)AssertionRewriter.run..s9   AFCJwv! < < <   r:)bodygetattrrrGrExprvalueastStrr\rs ImportFromlevelrW FunctionDefdecorator_listr#rkpop iter_fieldslist enumerateAssertextendvisitrASTsetattrexpr)r5rdocexpect_docstringpositemaliasesimportsnodesr8r;fieldnewrr<r#s @r6rzAssertionRewriter.runsXx  Fc;--$; ?t77<>> d### r:rc |}|jtjtj|tjg|tj|tjS)zGive *expr* a name.)r statementsrrAssignNameStoreLoad)r5rr;s r6assignzAssertionRewriter.assigns^}} sz38D#)+++F+F*GNNOOOxchjj)))r:c.|d|S)z Call saferepr on the expression.r)helper)r5rs r6displayzAssertionRewriter.displays{{;---r:r;argsctjdtj}tj||tj}tj|t |gS)zCall a helper in this module.rg)rrr AttributeCallry)r5r;rpy_nameattrs r6rzAssertionRewriter.helper sL(<44}WdCHJJ77xd4jj"---r:ctjdtj}tj||tjS)z!Return the builtin called *name*.rd)rrrr)r5r; builtin_names r6builtinzAssertionRewriter.builtins3x ;; }\4<<3tD$9::;;; 15#I.i$&&r:cRi|_|j|jdS)aCreate a new formatting context. The format context is used for when an explanation wants to have a variable value formatted in the assertion message. In this case the value required can be added using .explanation_param(). Finally .pop_format_context() is used to format a string of %-formatted values as added by .explanation_param(). N)rstackr)r5s r6push_format_contextz%AssertionRewriter.push_format_context"s+<># $566666r: expl_exprc |j}|jr|jd|_d|D}t j|t |}t j|t j |}dtt|j z}|j r|j||jt jt j|t jg|t j|t jS)aZFormat the %-formatted string with current format context. The expl_expr should be an str ast.expr instance constructed from the %-placeholders created by .explanation_param(). This will add the required code to format said string to .expl_stmts and return the ast.Name instance of the formatted string. roc,g|]}t|SrU)rq)rjkeys r6rlz8AssertionRewriter.pop_format_context..:s666s 666r:z @py_format)rrwrkeysrrryvaluesBinOpModrqrrr\format_variablesr expl_stmtsrrrr)r5rcurrentr format_dictformr;s r6pop_format_contextz$AssertionRewriter.pop_format_context/s*.."" : 9*.*R.D '66w||~~666htT'..*:*:%;%;<< yCGII{;;c$t'<"="=>>>  * /  ! ( ( . . . sz38D#)+++F+F*GNNOOOxchjj)))r:r8ct|tjsJ||}||||fS)z1Handle expressions we don't have custom code for.)rGrrrrr)r5r8rs r6 generic_visitzAssertionRewriter.generic_visitCsP$)))))kk$D**4<<+<+<====r:assert_c  t|jtjr\t |jjdkr?ddlm}ddl}|j J| |dd|j |j g|_ g|_ tj|_|jrg|_g|_g|_|||j\}}tjtj|}|jr|t5|}|jr|d|j}d} nt5d }d } tjt5| tj|} tj|tj| } tjd tj } |d | } tj!| | gg}tj"|d}g}|#|j|$||d |}tK|j&|j }tj'|d tQ|j t5||}tj)|d|j|gzg}|g}tj)|||}|j $||jrMd|jD}tj*|tWd}|j $|n7|j}|j $tj)||g|jr!|d|j}d|z}nt5d }d |z}tj|tjt5|}||}|d |} tjd tj } tj!| | gg}tj"|d}|$||j rMd|j D}tj*|tWd}|j $||j D])}tY|D]}tj-||*|j S)a.Return the AST statements to replace the ast.Assert instance. This rewrites the test of an assertion to provide intermediate values and replace it with an if statement which raises an assertion error with a detailed explanation in case the expression is false. rrrNz5assertion is always true, perhaps remove parentheses?)categoryrr#r z >assert rzassert AssertionError_format_explanationr(r*cZg|](}tj|tj)SrUrrrrjr;s r6rlz2AssertionRewriter.visit_Assert..s748CHT39;;//r:cZg|](}tj|tj)SrUrrs r6rlz2AssertionRewriter.visit_Assert..s*PPP$ 44PPPr:).rGtestrrreltsrrwarningsr warn_explicitr#rr itertoolscountrr\rrrrr}UnaryOpNotrrqmsgrrAddrrrRaiser|rrYrroastNumIfrastNameConstantr; copy_location)r5rrr top_conditionrnegationr assertmsggluestrerr_explanationerr_msgerr_namefmtexcraise_statements_failfmt_passr$hook_call_passhook_impl_teststatements_pass main_testr clear_formatrmtemplaterstmtr8s r6 visit_AssertzAssertionRewriter.visit_AssertIs  glCI . . 3w|7H3I3IQ3N3N H H H H H H OOO#///  " "**K)~ #   +-$& ) 1 1  * 2/1D !02 *,   """%)ZZ %=%=" {;swyy-88  *B ))&*=*=>>C{ $ KK(;W[II &"2JJ #!iwCHHOi 3799oFFGx 0#(**==H++3W==C(8cUB//CYsD))F O  " "4? 3 3 3  " "6 * * *{{#8#>>H' 44W^DD X *7>**4LL N!V ;<<>"22N ..Ox/JJI O " "9 - - -$ 5<@ > >{ 6 KK(;W[II *[8 "2JJ '+5 yCGIIvk7J7JKKH))(33C++3S99Cx 0#(**==H(8cUB//CYsD))F KK    > *PPPPPIJy/$*?*?@@E O " "5 ) ) )O 1 1D%d++ 1 1!$0000 1r:ctj|dgg}|jj}tjt |tjg|g}|d|}tj tj ||g}tj || |t |}|| |fSNlocalsr )rrrr=idComparerqInrBoolOpOrIfExprr)r5r;locs target_idinlocsdoreprrrs r6visit_NamedExprz!AssertionRewriter.visit_NamedExprsx X..B77KN VI.. TFCC7>>z#&((VV$455yt||D116)3D3DEET++D1111r:ctj|dgg}tjt |jtjg|g}|d|}tjtj ||g}tj || |t |j}|| |fSr) rrrrrqrrrrrrrr)r5r;rrrrrs r6 visit_NamezAssertionRewriter.visit_Namesx X..B77VDG__svxxj4&AA7>>z#&((VV$455yt||D116$'??CCT++D1111r:boolopc 6|}|tjgtj}tj|dtj}t t|jtj }|j x}}|j }t|j dz } |t|j D]'\} } | rg} |j tj| | g| |_ t| tjrt| jt(rm| jjjd|j d| DvrC|}| j|j| jjj<|| jj_||| \}}|tjtj|tjg||t;|}tj||gg}|j tj|| | krc|} |r&tj tj!| } g}|j tj| |g|x|_ })||_ ||_ |"d|tG|}||}tj|tj|$|fS)Nrrc<g|]}t|d|jS)r)r r)rjast_exprs r6rlz2AssertionRewriter.visit_BoolOp..s:$"8T22 r:r)%rrrr rrrrGoprrrrrrrzrrrleft namedExprr=rr^r}rrrrrqrrorrrrr)r5rres_var expl_listapprrmsave fail_savelevelsrv fail_innercond pytest_temprr expl_formatcallinner expl_templates r6 visit_BoolOpzAssertionRewriter.visit_BoolOps--//KKSXZZ 8 899 mIx<<Jvy#&1122o%tO V]##a'   """fm,," /" /DAq 3-/ &&svdJ'C'CDDD",q#+..3"169553 ((. bqb(9#'--//K, ((3AFM$  $ $ & & & 1 IC KK CHWcikk$B$B#CSII J J J11&,,??K8C+33D O " "38D>> 2 2 26zz!$8;swyy$77D(*&&svdE2'>'>???)..$# $4iOO &&}55x,,d.D.DT.J.JJJr:unaryct|jj}||j\}}|t j|j|}|||fzfSrT) UNARY_MAPrr_r}operandrrr)r5rpattern operand_res operand_explrs r6 visit_UnaryOpzAssertionRewriter.visit_UnaryOpsZEH./$(JJu}$=$=! \kk#+eh <<==G|o---r:binopc t|jj}||j\}}||j\}}d|d|d|d}|tj||j|}||fS)Nr r) BINOP_MAPrr_r}rrightrrr) r5rsymbol left_expr left_expl right_expr right_explrrs r6 visit_BinOpzAssertionRewriter.visit_BinOp s58-.#zz%*55 9!%EK!8!8 J<)<*>??8Hh ;;kk(##))$,,s*;*;<< ==h==4=== Jr:starredc~||j\}}tj||j}|d|zfS)Nr0)r}rprStarredctx)r5r1rr new_starreds r6 visit_StarredzAssertionRewriter.visit_Starred6s;JJw}-- Tk#w{33 C$J&&r:rct|jtjs||S||j\}}|tj||j tj}| | |}d}|||||j fz}||fS)Nz%s {%s = %s.%s }) rGr4rrrr}rprrrrr)r5rrp value_explrr.r{rs r6visit_Attributez!AssertionRewriter.visit_Attribute<s$(CH-- ,%%d++ + JJtz22zkk#-ty#(**EEFF))$,,s*;*;<<"h*di@@Dyr:compc t|jtjr/|jjjvrj|jj|_t|jtr|jj|jjj< |j\}}t|jtj tj frd|d}fdtt|jD}d|D}d|D}ttt|j|j|j}g}g} |g} |D]\} } } t| tr\t|tjrB| jj|jkr-| j_| j|j< | \}}t| tj tj frd|d}| |t&| j}| t+||d|d|}|t+|tj || g|g}jtj|| g|||}}dtj| tjtj|tjtj|tjtj| tj}t|jdkr'tj tj|}n|d }||fS) Nrrc8g|]}SrU)r)rjrr5s r6rlz3AssertionRewriter.visit_Compare..Ts!GGGQGGGr:cZg|](}tj|tj)SrU)rrrrjrs r6rlz3AssertionRewriter.visit_Compare..Us*EEE!chq#(**--EEEr:cZg|](}tj|tj)SrUrr>s r6rlz3AssertionRewriter.visit_Compare..Vs*GGGAsx39;;//GGGr:rr"rr)rrGrrrrr^rr=r}rrrrrr comparatorsrrrr_rqrrrrrAndrr)r5r:left_resr res_variables load_names store_namesitrsymsrrr next_operandnext_res next_explsymrres_expr expl_callrs` r6 visit_ComparezAssertionRewriter.visit_CompareFs   """ di * * ty|t?W/W/W0 DI di + +    $  # #jj33) di#+sz!: ; ; )(I(((IGGGG%DH 2F2FGGG EE}EEE GGGGG s48}}%%tx1A B B*#% 6 6 Ar<<33 !x22 !!'*hk99)- #&!(K#'**\":": Hi,cj(ABB -, ,,, NN8 $ $ $BL)C KKs $ $ $33#33 33D LL & & &{8bTH:>>H O " "3:{1~.>#I#I J J J"*IiHHKK  IdCHJJ ' ' Ij#(** - - IeSXZZ ( ( Igsxzz * *    tx==1  Jswyy*==CCQ-CD**4+B+B9+M+MNNNNr:rJ)2r[rrrr rqrrr7rModuler staticmethodrrrrrrrrrrrrrr~rrr{r rrrrrrr rrrr rr0r3r6r9rrN __classcell__)r_s@r6rrWs66p 6#C= 62:62B 6LQ 6  6 6 6 6 6 6U(szU(dU(U(U(U(n2s2t222\2#*38***** .CH......3.sx.CH.... =C=CM==== 'ch '3 ' ' ' ' 7 7 7 7*CH*****(>#'>eCHcM.B>>>> sCJs4>ssssj 2I 2% 32G 2 2 2 22sx2E#(C-,@22221K3:1K%# 2F1K1K1K1Kf.3;.533G....   uSXs]/C    sxE#(C-,@B'S['U3;;K5L'''' CMeCHcM6J7O#+7O%# 2F7O7O7O7O7O7O7O7Or:rrgc tj|dnS#tttf$rYdSt $rYdSt $r!}|jtjkrYd}~dSd}~wwxYwdS)z~Attempt to create the given directory and sub-directories exist. Returns True if successful or if it already exists. T)exist_okFN) rKmakedirsFileNotFoundErrorNotADirectoryErrorFileExistsErrorPermissionErrorrrEROFS)rgrs r6r_r_s  I----- 1? Cuu uu  7ek ! !55555  4s%A) A) A)A$#A$$A) file_pathctjdkrrsN;;     666666))))))$$$$$$"""""""!!!!! ((((((&&&&&&""""""1000000v IlO \F \FFI&O WF WF-(+,..", ? ?g ? ? + ,  g %iiiiiY]99=;OiiiX  5  " 49N      $      2dFuR^U^5S/T=KN.. ..$,cUD[$9. en....h"&# << < <#< V  <  <<<< ?6 ?c ? ? ? ?!hv&6!8C=!!!!6c,&T*#*t*****  # d^ C=v   (11C1s1t1111 3t3333 Wh E38UCHe T  Is J J J   J   GS  GS Hc GS L$ GT FD It FC GT  FC! "GT# $GTFDIxFDIxK/   6((HSW$5((((Q3e3S#X333 3lfOfOfOfOfOfOfOfORDT, 0T 0d 0 0 0 0 0 0r: