Your IP : 3.12.151.11
�
c��f| � �V � d dl mZ d dl mZ d dlmZmZ G d� dej � � ZdS )� )�pytree)�
fixer_base)�Name�parenthesizec � � e Zd ZdZdZd� ZdS )� FixHasKeyTa�
anchor=power<
before=any+
trailer< '.' 'has_key' >
trailer<
'('
( not(arglist | argument<any '=' any>) arg=any
| arglist<(not argument<any '=' any>) arg=any ','>
)
')'
>
after=any*
>
|
negation=not_test<
'not'
anchor=power<
before=any+
trailer< '.' 'has_key' >
trailer<
'('
( not(arglist | argument<any '=' any>) arg=any
| arglist<(not argument<any '=' any>) arg=any ','>
)
')'
>
>
>
c
�J � | j }|j j |j k r!| j � |j � � rd S |� d� � }|d }|j }d� |d D � � }|d � � � }|� d� � } | rd� | D � � } |j |j |j |j
|j |j |j
|j fv rt |� � }t! |� � dk r |d }nt# j |j |� � }d
|_ t) dd
�� � }
|r-t) d
d
�� � }t# j |j ||
f� � }
t# j |j ||
|f� � }| r:t |� � }t# j |j |ft- | � � z � � }|j j |j |j |j |j |j |j |j |j |j f v rt |� � }||_ |S )N�negation�anchorc �6 � g | ]}|� � � ��S � ��clone��.0�ns �@/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_has_key.py�
<listcomp>z'FixHasKey.transform.<locals>.<listcomp>R s � �7�7�7��!�'�'�)�)�7�7�7� �before�arg�afterc �6 � g | ]}|� � � ��S r
r r s r r z'FixHasKey.transform.<locals>.<listcomp>V s � �.�.�.�1�Q�W�W�Y�Y�.�.�.r � � � �in)�prefix�not)�syms�parent�type�not_test�pattern�match�getr r �
comparison�and_test�or_test�test�lambdef�argumentr �lenr �Node�powerr �comp_op�tuple�expr�xor_expr�and_expr�
shift_expr�
arith_expr�term�factor)
�self�node�resultsr r
r r r r r �n_op�n_not�news
r � transformzFixHasKey.transformG s � ��y���K���
�-�-��L���t�{�+�+�
.� �4��;�;�z�*�*����"�����7�7�W�X�%6�7�7�7���e�n�"�"�$�$�����G�$�$��� /�.�.��.�.�.�E��8������
���d�i���t�}�N� N� N��s�#�#�C��v�;�;�!����A�Y�F�F��[���V�4�4�F���
��D��%�%�%��� <���s�+�+�+�E��;�t�|�e�T�]�;�;�D��k�$�/�C��v�+>�?�?��� A��s�#�#�C��+�d�j�3�&�5��<�<�*?�@�@�C��;������D�M� $�
�t�� $���� $��T�Z� 9� 9� 9� �s�#�#�C���
��
r N)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr? r
r r r r &