U if&@s:dZddlmZddlmZmZmZGdddejZdS)zA Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) ) fixer_base) BlankLinesymstokenc@s"eZdZdZdeZddZdS)FixItertoolsImportsTzT import_from< 'from' 'itertools' 'import' imports=any > c Csp|d}|jtjks|js"|g}n|j}|dddD]}|jtjkrR|j}|}n,|jtjkrddS|jtjkstt|jd}|j}|dkrd|_| q6|dkr6| |ddkrdnd |_q6|jddp|g}d } |D]*}| r|jtj kr| q| d N} q|r4|d jtj kr4| q |jsJt |d drV|jdkrl|j} t}| |_|SdS) Nimportsr)ZimapZizipZifilter)Z ifilterfalseZ izip_longestf filterfalse zip_longestTvalue)typerZimport_as_namechildrenrNAMErSTARAssertionErrorremoveZchangedCOMMApopgetattrparentprefixr) selfZnodeZresultsrrZchildmemberZ name_node member_nameZ remove_commaprH/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_itertools_imports.py transformsH      zFixItertoolsImports.transformN)__name__ __module__ __qualname__Z BM_compatiblelocalsZPATTERNr rrrrrs rN) __doc__Zlib2to3rZlib2to3.fixer_utilrrrZBaseFixrrrrrs