def check(args):
if args.files:<EOL><INDENT>dir_paths = args.files<EOL><DEDENT>else:<EOL><INDENT>dir_paths = [path for path in sys.path<EOL>if os.path.isdir(path)]<EOL><DEDENT>options = []<EOL>if args.expand_star_imports:<EOL><INDENT>options.append('<STR_LIT>')<EOL><DEDENT>if args.imports:<EOL><INDENT>options.append('<STR_LIT>' + args.imports)<EOL><DEDENT>if args.remove_all_unused_imports:<EOL><INDENT>options.append('<STR_LIT>')<EOL><DEDENT>if args.remove_duplicate_keys:<EOL><INDENT>options.append('<STR_LIT>')<EOL><DEDENT>if args.remove_unused_variables:<EOL><INDENT>options.append('<STR_LIT>')<EOL><DEDENT>filenames = dir_paths<EOL>completed_filenames = set()<EOL>while filenames:<EOL><INDENT>try:<EOL><INDENT>name = os.path.realpath(filenames.pop(<NUM_LIT:0>))<EOL>if not os.path.exists(name):<EOL><INDENT>continue<EOL><DEDENT>if name in completed_filenames:<EOL><INDENT>sys.stderr.write(<EOL>colored(<EOL>'<STR_LIT>' + name + '<STR_LIT:\n>',<EOL>YELLOW))<EOL>continue<EOL><DEDENT>else:<EOL><INDENT>completed_filenames.update(name)<EOL><DEDENT>if os.path.isdir(name):<EOL><INDENT>for root, directories, children in os.walk(unicode(name)):<EOL><INDENT>filenames += [os.path.join(root, f) for f in children<EOL>if f.endswith('<STR_LIT>') and<EOL>not f.startswith('<STR_LIT:.>')]<EOL>directories[:] = [d for d in directories<EOL>if not d.startswith('<STR_LIT:.>')]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>verbose_message = '<STR_LIT>' + name<EOL>sys.stderr.write(colored(verbose_message + '<STR_LIT:\n>', YELLOW))<EOL>if not run(os.path.join(name),<EOL>command=args.command,<EOL>verbose=args.verbose,<EOL>options=options):<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>except (UnicodeDecodeError, UnicodeEncodeError) as exception:<EOL><INDENT>print(exception, file=sys.stderr)<EOL>continue<EOL><DEDENT><DEDENT>return True<EOL>
Run recursively run autoflake on directory of files.

    Return False if the fix results in broken syntax.