|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cloudlinux/venv/lib64/python3.11/site-packages/astroid/__pycache__/ |
�
� h� � �\ � 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 �c/builddir/build/BUILD/cloudlinux-venv-1.0.8/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 �
<listcomp>z3TransformVisitor._visit_generic.<locals>.<listcomp>= s'