Your IP : 18.224.45.82


Current Path : /lib64/python3.6/lib2to3/fixes/__pycache__/
Upload File :
Current File : //lib64/python3.6/lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-36.opt-1.pyc

3


 \&�@s:dZddlmZddlmZmZmZGdd�dej�ZdS)zA Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) �)�
fixer_base)�	BlankLine�syms�tokenc@s"eZdZdZde�Zdd�ZdS)�FixItertoolsImportsTzT
              import_from< 'from' 'itertools' 'import' imports=any >
              cCsl|d}|jtjks|jr$|g}n|j}x�|ddd�D]z}|jtjkrV|j}|}n|jtjkrfdS|jd}|j}|dkr�d|_|j�q:|dkr:|j	�|d	d
kr�dnd|_q:W|jdd�p�|g}d
}	x0|D](}|	o�|jtj
k�r�|j�q�|	d
N}	q�Wx*|�r,|djtj
k�r,|j�j��qW|j�p@t|dd��sR|j
dk�rh|j}
t�}|
|_|SdS)N�imports�r�imap�izip�ifilter�ifilterfalse�izip_longest��f�filterfalse�zip_longestT�value)r	r
r)rr
���)�typerZimport_as_name�childrenr�NAMEr�STAR�removeZchanged�COMMA�pop�getattr�parent�prefixr)�selfZnodeZresultsrrZchild�memberZ	name_node�member_nameZremove_comma�p�r"�;/usr/lib64/python3.6/lib2to3/fixes/fix_itertools_imports.py�	transformsB




zFixItertoolsImports.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�localsZPATTERNr$r"r"r"r#rs
rN)	�__doc__Zlib2to3rZlib2to3.fixer_utilrrrZBaseFixrr"r"r"r#�<module>s

?>