§ |<ˆjÇ ãó\—ddlmZddlZddlmZddlmZerddlmZGd„d¦«Z dS)é)Ú annotationsN)Ú TYPE_CHECKING)Ú_invalidate_cache)ÚNodeNGcóF—eZdZdZd„Zdd„Zd„Zd„Zddd „Zddd „Z d „Z d S)ÚTransformVisitoraPA visitor for handling transforms. The standard approach of using it is to call :meth:`~visit` with an *astroid* module and the class will take care of the rest, walking the tree and running the transforms for each encountered node. Based on its usage in AstroidManager.brain, it should not be reinstantiated. cóB—tjt¦«|_dS©N)Ú collectionsÚ defaultdictÚlistÚ transforms)Úselfs úd/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/astroid/transforms.pyÚ__init__zTransformVisitor.__init__s€Ý%Ô1µ$Ñ7Ô7ˆŒˆˆóÚnoderÚreturncó¬—|j}|j|}|D]<\}}|� ||¦«r*||¦«}|�t¦«|}|j|krnŒ=|S)zdCall matching transforms for the given node if any and return the transformed node. )Ú __class__rr)rrÚclsrÚtransform_funcÚ predicateÚrets rÚ _transformzTransformVisitor._transforms}€ðŒnˆà”_ SÔ)ˆ Ø)3ð ð Ñ %ˆN˜IØÐ  I I¨d¡O¤OÐ Ø$�n TÑ*Ô*�ð�?Ý%Ñ'Ô'Ð'Ø�DØ”= CÒ'Ð'à�EøØˆ rcóØ—t|d¦«rF|jD]>}t||¦«}| |¦«}||krt |||¦«Œ?| |¦«S)NÚ_astroid_fields)ÚhasattrrÚgetattrÚ_visit_genericÚsetattrr)rrÚnameÚvalueÚvisiteds rÚ_visitzTransformVisitor._visit2sy€Ý �4Ð*Ñ +Ô +ð 1ØÔ,ð 1ð 1�Ý  dÑ+Ô+�Ø×-Ò-¨eÑ4Ô4�ؘeÒ#Ð#ݘD $¨Ñ0Ô0Ð0øØ�Š˜tÑ$Ô$Ð$rcó‡—t|t¦«rˆfd„|D¦«St|t¦«rtˆfd„|D¦«¦«S|rt|t¦«r|S‰ |¦«S)Ncó:•—g|]}‰ |¦«‘ŒS©©r ©Ú.0Úchildrs €rú z3TransformVisitor._visit_generic..=s'ø€ÐAÐAÐA°5�D×'Ò'¨Ñ.Ô.ÐAÐAÐArc3óB•K—|]}‰ |¦«V—ŒdSr r)r*s €rú z2TransformVisitor._visit_generic..?s1øèè€ÐFÐF¸˜×,Ò,¨UÑ3Ô3ÐFÐFÐFÐFÐFÐFr)Ú isinstancer ÚtupleÚstrr%)rrs` rr zTransformVisitor._visit_generic;s–ø€Ý �d�DÑ !Ô !ð BØAÐAÐAÐA¸DÐAÑAÔAÐ AÝ �d�EÑ "Ô "ð GÝÐFÐFÐFÐFÀÐFÑFÔFÑFÔFÐ FØð •z $­Ñ,Ô,ð ØˆKà�{Š{˜4Ñ Ô Ð rNÚNonecóJ—|j| ||f¦«dS)a7Register `transform(node)` function to be applied on the given astroid's `node_class` if `predicate` is None or returns true when called with the node as argument. The transform function may return a value which is then used to substitute the original node in the tree. N)rÚappend©rÚ node_classÚ transformrs rÚregister_transformz#TransformVisitor.register_transformEs*€ð Œ˜ Ô#×*Ò*¨I°yÐ+AÑBÔBÐBÐBÐBrcóJ—|j| ||f¦«dS)zUnregister the given transform.N)rÚremover6s rÚunregister_transformz%TransformVisitor.unregister_transformOs(€à Œ˜ Ô#×*Ò*¨I°yÐ+AÑBÔBÐBÐBÐBrcó,—| |¦«S)z²Walk the given astroid *tree* and transform each encountered node. Only the nodes which have transforms registered will actually be replaced or changed. )r%)rÚmodules rÚvisitzTransformVisitor.visitSs€ð �{Š{˜6Ñ"Ô"Ð"r)rrrrr )rr3) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr%r r9r<r?r(rrrrsª€€€€€ððð8ð8ð8ððððð(%ð%ð%ð!ð!ð!ðCðCðCðCðCðCðCðCðCðCð#ð#ð#ð#ð#rr) Ú __future__rr ÚtypingrÚastroid.contextrÚastroidrrr(rrúrHsŸðð #Ð"Ð"Ð"Ð"Ð"àÐÐÐØ Ð Ð Ð Ð Ð à-Ð-Ð-Ð-Ð-Ð-àðØÐÐÐÐÐðI#ðI#ðI#ðI#ðI#ñI#ôI#ðI#ðI#ðI#r