/opt/cloudlinux/venv/lib/python3.11/site-packages/astroid/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/astroid/__pycache__/transforms.cpython-311.pyc (5021B)
§
šå쑺‰ã ó\ — d dl mZ d dlZd dlmZ d dlmZ erd dlmZ G d„ d¦ « Z dS )é )ÚannotationsN)Ú
TYPE_CHECKING)Ú_invalidate_cache)ÚNodeNGc óF — e Zd ZdZd„ Zdd„Zd„ Zd„ Zddd„Zddd„Z d
„ Z
d S )ÚTransformVisitoraP A 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 — t j t ¦ « | _ d S ©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 |k r nŒ=|S )zdCall matching transforms for the given node if any and return the
transformed node.
)Ú __class__r r )r r Úclsr Útransform_funcÚ predicateÚrets r Ú
_transformzTransformVisitor._transform s} € ð Œnˆà”_ SÔ)ˆ
Ø)3ð
ð
Ñ%ˆN˜IØÐ I I¨d¡O¤OÐ Ø$�n TÑ*Ô*�ð �?Ý%Ñ'Ô'Ð'Ø�DØ”= CÒ'Ð'à�EøØˆr c óØ — t |d¦ « rF|j D ]>}t ||¦ « }| |¦ « }||k rt |||¦ « Œ?| |¦ « S )NÚ_astroid_fields)Úhasattrr ÚgetattrÚ_visit_genericÚsetattrr )r r ÚnameÚvalueÚvisiteds r Ú_visitzTransformVisitor._visit2 sy € Ý�4Ð*Ñ+Ô+ð 1ØÔ,ð
1ð
1�Ý dÑ+Ô+�Ø×-Ò-¨eÑ4Ô4�ؘeÒ#Ð#ݘD $¨Ñ0Ô0Ð0øØ�Š˜tÑ$Ô$Ð$r c ó ‡ — t |t ¦ « rˆ fd„|D ¦ « S t |t ¦ « rt ˆ fd„|D ¦ « ¦ « S |rt |t ¦ « r|S ‰ |¦ « S )Nc ó: •— g | ]}‰ |¦ « ‘ŒS © ©r ©Ú.0Úchildr s €r ú
z3TransformVisitor._visit_generic..= s' ø€ ÐAÐAÐA°5�D×'Ò'¨Ñ.Ô.ÐAÐAÐAr c 3 óB •K — | ]}‰ |¦ « V — Œd S r
r) r* s €r ú z2TransformVisitor._visit_generic..? s1 øè è € ÐFÐF¸˜×,Ò,¨UÑ3Ô3ÐFÐFÐFÐFÐFÐFr )Ú
isinstancer
ÚtupleÚstrr% )r r s ` r r 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Ñ Ô Ð r NÚNonec óJ — | j | ||f¦ « dS )a7 Register `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Ú transformr s r Úregister_transformz#TransformVisitor.register_transformE s* € ð
Œ˜
Ô#×*Ò*¨I°yÐ+AÑBÔBÐBÐBÐBr c óJ — | j | ||f¦ « dS )zUnregister the given transform.N)r Úremover6 s r Úunregister_transformz%TransformVisitor.unregister_transformO s( € àŒ˜
Ô#×*Ò*¨I°yÐ+AÑBÔBÐBÐBÐBr c ó, — | |¦ « 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.visitS s € ð �{Š{˜6Ñ"Ô"Ð"r )r r r r r
)r r3 )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r% r r9 r<