def write_file(self, what, filename, data):
log.info("<STR_LIT>", what, filename)<EOL>if sys.version_info >= (<NUM_LIT:3>,):<EOL><INDENT>data = data.encode("<STR_LIT:utf-8>")<EOL><DEDENT>if not self.dry_run:<EOL><INDENT>f = open(filename, '<STR_LIT:wb>')<EOL>f.write(data)<EOL>f.close()<EOL><DEDENT>
Write `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.