쑺 \ 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 ZddZd Zd ZdddZdddZ 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)collectionsdefaultdictlist
transforms)selfs d/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/astroid/transforms.py__init__zTransformVisitor.__init__ s %1$77 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 predicaterets r
_transformzTransformVisitor._transform s} n_S)
)3
%NI IIdOO $nT** ?%'''D=C''Er c t |d rF|j D ]>}t || }| | }||k rt ||| ?| | S )N_astroid_fields)hasattrr getattr_visit_genericsetattrr )r r namevaluevisiteds r _visitzTransformVisitor._visit2 sy 4*++ 1,
1
1d++--e44e##D$000t$$$r c t |t r fd|D S t |t rt fd|D S |rt |t r|S | S )Nc : g | ]} | S r .0childr s r