def write_file(name, text, opts):
    if opts.dryrun:
        return
    fname = os.path.join(opts.destdir, "%s.%s" % (name, opts.suffix))
    if not opts.force and os.path.isfile(fname):
        print 'File %s already exists, skipping.' % fname
    else:
        print 'Creating file %s.' % fname
        f = open(fname, 'w')
        f.write(text)
        f.close()
Write the output file for module/package <name>.
dataset/ETHPy150Open Netflix/security_monkey/generate_docs.py/write_file