CasperSecurity

Current Path : /lib/python3.10/lib2to3/fixes/__pycache__/
Upload File :
Current File : //lib/python3.10/lib2to3/fixes/__pycache__/fix_operator.cpython-310.pyc

o

��bcb
�@sNdZddlZddlmZddlmZmZmZm	Z	dd�Z
Gdd�dej�ZdS)	a�Fixer for operator functions.

operator.isCallable(obj)       -> callable(obj)
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj)   -> isinstance(obj, collections.abc.Sequence)
operator.isMappingType(obj)    -> isinstance(obj, collections.abc.Mapping)
operator.isNumberType(obj)     -> isinstance(obj, numbers.Number)
operator.repeat(obj, n)        -> operator.mul(obj, n)
operator.irepeat(obj, n)       -> operator.imul(obj, n)
�N)�
fixer_base)�Call�Name�String�touch_importcs�fdd�}|S)Ncs
�|_|S�N)�
invocation)�f��s��1/usr/lib/python3.10/lib2to3/fixes/fix_operator.py�decszinvocation.<locals>.decr)rrrr
r
rsrc@s�eZdZdZdZdZdZdeeed�Zdd�Z	e
d	�d
d��Ze
d�d
d��Ze
d�dd��Z
e
d�dd��Ze
d�dd��Ze
d�dd��Ze
d�dd��Zdd�Zd d!�Zd"d#�Zd$S)%�FixOperatorT�prez�
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              z'(' obj=any ')'z�
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              )�methods�objcCs"|�||�}|dur|||�SdSr)�
_check_method)�self�node�results�methodrrr
�	transform+s
�zFixOperator.transformzoperator.contains(%s)cC�|�||d�S)N�contains��_handle_rename�rrrrrr
�_sequenceIncludes0�zFixOperator._sequenceIncludeszcallable(%s)cCs"|d}ttd�|��g|jd�S)Nr�callable��prefix)rr�cloner")rrrrrrr
�_isCallable4szFixOperator._isCallablezoperator.mul(%s)cCr)N�mulrrrrr
�_repeat9rzFixOperator._repeatzoperator.imul(%s)cCr)N�imulrrrrr
�_irepeat=rzFixOperator._irepeatz(isinstance(%s, collections.abc.Sequence)cC�|�||dd�S)N�collections.abc�Sequence��_handle_type2abcrrrr
�_isSequenceTypeA�zFixOperator._isSequenceTypez'isinstance(%s, collections.abc.Mapping)cCr))Nr*�Mappingr,rrrr
�_isMappingTypeEr/zFixOperator._isMappingTypezisinstance(%s, numbers.Number)cCr))N�numbers�Numberr,rrrr
�
_isNumberTypeIr/zFixOperator._isNumberTypecCs|dd}||_|��dS)Nrr)�value�changed)rrr�namerrrr
rMszFixOperator._handle_renamecCsFtd||�|d}|��tdd�||g��g}ttd�||jd�S)Nrz, �.�
isinstancer!)rr#r�joinrrr")rrr�module�abcr�argsrrr
r-RszFixOperator._handle_type2abccCs^t|d|ddj�}t|tjj�r-d|vr|St|d�f}|j|}|�|d|�dS)N�_rrr;rzYou should use '%s' here.)	�getattrr5r9�collectionsr<�Callable�strr�warning)rrrr�sub�invocation_strrrr
rXs
zFixOperator._check_methodN)�__name__�
__module__�__qualname__�
BM_compatible�orderrr�dict�PATTERNrrrr$r&r(r.r1r4rr-rrrrr
rs4
�






r)
�__doc__�collections.abcr@�lib2to3r�lib2to3.fixer_utilrrrrr�BaseFixrrrrr
�<module>s
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY