
    z%i|                     X    	 d dl mZ d dl mZ d dlmZmZ  G d dej                        Zy)   )pytree)
fixer_base)Nameparenthesizec                       e Zd ZdZdZd Zy)	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                  k(  r&| j                  j                  |j                        ry |j                  d      }|d   }|j                  }|d   D cg c]  }|j                          }}|d   j                         }	|j                  d      }
|
r|
D cg c]  }|j                          }
}|	j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  fv rt        |	      }	t!        |      dk(  r|d   }n t#        j$                  |j&                  |      }d|_        t)        d	d
      }|r/t)        dd
      }t#        j$                  |j*                  ||f      }t#        j$                  |j                  |	||f      }|
r8t        |      }t#        j$                  |j&                  |ft-        |
      z         }|j                  j                  |j                  |j.                  |j0                  |j2                  |j4                  |j6                  |j8                  |j:                  |j&                  f	v rt        |      }||_        |S c c}w c c}w )Nnegationanchorbeforeargafter        in)prefixnot)symsparenttypenot_testpatternmatchgetr   clone
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   nr   r   r   n_opn_notnews                 M/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/lib2to3/fixes/fix_has_key.py	transformzFixHasKey.transformG   s   yyKK-LLt{{+ ;;z*"%,X%67!'')77en""$G$(-.1QWWY.E.88diit}}N Ns#Cv;!AYF[[V4FD%s+E;;t||eT];Dkk$//Cv+>?s#C++djj3&5<*?@C;;DMM $t $ $TZZ 9 9 s#C

7 8 /s   ?J&J+N)__name__
__module____qualname__BM_compatiblePATTERNr7        r6   r   r   &   s    MG<&r>   r   N) r   r   
fixer_utilr   r   BaseFixr   r=   r>   r6   <module>rB      s)   :   +G
"" Gr>   