def filter_python_files(files):
py_files = []<EOL>for f in files:<EOL><INDENT>extension = os.path.splitext(f)[-<NUM_LIT:1>]<EOL>if extension:<EOL><INDENT>if extension == '<STR_LIT>':<EOL><INDENT>py_files.append(f)<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in open(f, '<STR_LIT:r>').readline():<EOL><INDENT>py_files.append(f)<EOL><DEDENT>elif '<STR_LIT>' in bash('<STR_LIT>'.format(f)).value().lower():<EOL><INDENT>py_files.append(f)<EOL><DEDENT><DEDENT>return py_files<EOL>
Get all python files from the list of files.