<s> from __future__ import print_function , unicode_literals <EOL> import os <EOL> import re <EOL> import subprocess <EOL> import sys <EOL> module_exclusions = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def scan_for_modules ( ) : <EOL> return [ entry <EOL> for entry in os . listdir ( os . getcwd ( ) ) <EOL> if ( ( os . path . isdir ( entry ) or entry . endswith ( "<STR_LIT>" ) ) and <EOL> entry not in module_exclusions ) ] <EOL> def main ( ) : <EOL> cur_dir = os . path . dirname ( __file__ ) <EOL> os . chdir ( os . path . join ( cur_dir , "<STR_LIT:..>" , "<STR_LIT:..>" ) ) <EOL> modules = sys . argv [ <NUM_LIT:1> : ] <EOL> if not modules : <EOL> modules = scan_for_modules ( ) <EOL> p = subprocess . Popen ( [ '<STR_LIT>' ] + modules , <EOL> stderr = subprocess . PIPE , <EOL> stdout = subprocess . PIPE , <EOL> close_fds = True ) <EOL> contents = p . stdout . readlines ( ) <EOL> exclusions = { } <EOL> with open ( os . path . join ( cur_dir , "<STR_LIT>" ) , "<STR_LIT:r>" ) as fp : <EOL> for line in fp : <EOL> if not line . startswith ( "<STR_LIT:#>" ) : <EOL> exclusions [ line . rstrip ( ) ] = <NUM_LIT:1> <EOL> for line in contents : <EOL> line = line . rstrip ( ) <EOL> test_line = re . sub ( r'<STR_LIT>' , r'<STR_LIT>' , line , <NUM_LIT:1> ) <EOL> test_line = re . sub ( r'<STR_LIT>' , r'<STR_LIT>' , test_line ) <EOL> if ( test_line not in exclusions and <EOL> not test_line . startswith ( module_exclusions ) ) : <EOL> print ( line ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
