Your IP : 3.128.201.71


Current Path : /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-35.pyc



��Yf&�@sOdZddlmZddlmZmZmZGdd�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 >
              cCs�|d}|jtjks&|jr2|g}n	|j}x�|ddd�D]�}|jtjkry|j}|}n;|jtjkr�dS|jtjks�t�|jd}|j}|dkr�d|_|j	�qO|dkrO|j
�|d	d
krdnd|_qOW|jdd�p1|g}d
}	x=|D]5}|	rl|jtjkrl|j	�qA|	d
N}	qAWx0|r�|djtjkr�|j�j	�q}W|jp�t
|dd�s�|jdkr�|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�AssertionError�removeZchanged�COMMA�pop�getattr�parent�prefixr)�selfZnodeZresultsrrZchildZmemberZ	name_nodeZmember_nameZremove_comma�p�r!�H/opt/alt/python35/lib64/python3.5/lib2to3/fixes/fix_itertools_imports.py�	transformsD
			
		




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

?>