⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib64
/
python3.6
/
lib2to3
/
fixes
/
__pycache__
/
View File Name :
fix_has_key.cpython-36.opt-1.pyc
3 \| � @ sB d Z ddlmZ ddlmZ ddlmZmZ G dd� dej�ZdS )a& Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fixer will change any has_key() method call, regardless of its class. 2) Cases like this will not be converted: m = d.has_key if m(k): ... Only *calls* to has_key() are converted. While it is possible to convert the above to something like m = d.__contains__ if m(k): ... this is currently not done. � )�pytree)� fixer_base)�Name�parenthesizec @ s e Zd ZdZdZdd� 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 C s| | j }|jj|jkr&| jj|j�r&d S |jd�}|d }|j}dd� |d D �}|d j� }|jd�} | rxdd� | D �} |j|j |j|j |j|j|j |jfkr�t|�}t|�d kr�|d }ntj|j|�}d|_tddd �} |r�tddd �}tj|j|| f�} tj|j || |f�}| �r8t|�}tj|j|ft| � �}|jj|j |j|j|j|j|j|j|j|jf k�rrt|�}||_|S )N�negation�anchorc S s g | ]}|j � �qS � )�clone)�.0�nr r �#/usr/lib64/python3.6/fix_has_key.py� <listcomp>R s z'FixHasKey.transform.<locals>.<listcomp>�before�arg�afterc S s g | ]}|j � �qS r )r )r r r r r r V s � � � �in)�prefix�not)�syms�parent�typeZnot_test�pattern�match�getr r Z comparisonZand_testZor_testZtestZlambdefZargumentr �lenr ZNodeZpowerr Zcomp_op�tuple�exprZxor_exprZand_exprZ shift_exprZ arith_exprZtermZfactor) �selfZnode�resultsr r r r r r r Zn_opZn_not�newr r r � transformG sD zFixHasKey.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr$ r r r r r &