def run(filename, command, verbose=False, options=None):
if not options:<EOL><INDENT>options = []<EOL><DEDENT>import test_autoflake<EOL>with test_autoflake.temporary_directory() as temp_directory:<EOL><INDENT>temp_filename = os.path.join(temp_directory,<EOL>os.path.basename(filename))<EOL>import shutil<EOL>shutil.copyfile(filename, temp_filename)<EOL>if <NUM_LIT:0> != subprocess.call(shlex.split(command) +<EOL>['<STR_LIT>', temp_filename] +<EOL>options):<EOL><INDENT>sys.stderr.write('<STR_LIT>' + filename + '<STR_LIT:\n>')<EOL>return False<EOL><DEDENT>try:<EOL><INDENT>file_diff = diff(filename, temp_filename)<EOL>if verbose:<EOL><INDENT>sys.stderr.write(file_diff)<EOL><DEDENT>if check_syntax(filename):<EOL><INDENT>try:<EOL><INDENT>check_syntax(temp_filename, raise_error=True)<EOL><DEDENT>except (SyntaxError, TypeError,<EOL>UnicodeDecodeError, ValueError) as exception:<EOL><INDENT>sys.stderr.write('<STR_LIT>' + filename + '<STR_LIT:\n>' +<EOL>str(exception) + '<STR_LIT:\n>')<EOL>return False<EOL><DEDENT><DEDENT>before_count = pyflakes_count(filename)<EOL>after_count = pyflakes_count(temp_filename)<EOL>if verbose:<EOL><INDENT>print('<STR_LIT>', (before_count, after_count))<EOL><DEDENT>if file_diff and after_count > before_count:<EOL><INDENT>sys.stderr.write('<STR_LIT>' + filename + '<STR_LIT>')<EOL>return False<EOL><DEDENT><DEDENT>except IOError as exception:<EOL><INDENT>sys.stderr.write(str(exception) + '<STR_LIT:\n>')<EOL><DEDENT><DEDENT>return True<EOL>
Run autoflake on file at filename.

    Return True on success.