human
Complete this python program:
def main(in_base, out_base, files, codes, outfile=None, showasm=0, showast=0, do_verify=0, py=0, deob=0):
assistant
#Here is the Python program you requested.

    """in_base     base directory for input files
    out_base    base directory for output files (ignored when
    files       list of filenames to be uncompyled (relative to src_base)
    outfile     write output to this filename (overwrites out_base)
    For redirecting output to
    - <filename>                outfile=<filename> (out_base is ignored)
    - files below out_base      out_base=...
    - stdout                    out_base=None, outfile=None
    """
    def _get_outstream(outfile):
        dir = os.path.dirname(outfile)
        failed_file = (outfile + '_failed')
        if os.path.exists(failed_file):
            os.remove(failed_file)
        try:
            os.makedirs(dir)
        except OSError:
            pass
        return open(outfile, 'w')
    of = outfile
    tot_files = okay_files = failed_files = verify_failed_files = 0
    for code in codes:
        version = sys.version[:3]
        with open(code, 'r') as f:
            co = compile(f.read(), '', 'exec')
        uncompyle(sys.version[:3], co, sys.stdout, showasm=showasm, showast=showast, deob=deob)
    for file in files:
        infile = os.path.join(in_base, file)
        if of:
            outstream = _get_outstream(outfile)
        elif (out_base is None):
            outstream = sys.stdout
        else:
            outfile = os.path.join(out_base, file)
            if py:
                outfile = outfile[:(-1)]
            else:
                outfile += '_dis'
            outstream = _get_outstream(outfile)
        try:
            uncompyle_file(infile, outstream, showasm, showast, deob)
            tot_files += 1
        except KeyboardInterrupt:
            if outfile:
                outstream.close()
                os.remove(outfile)
            raise
        except:
            failed_files += 1
            sys.stderr.write(("###    Can't    uncompyle    %s\n" % infile))
            if outfile:
                outstream.close()
                os.rename(outfile, (outfile + '_failed'))
            import traceback
            traceback.print_exc()
        else:
            if outfile:
                outstream.close()
            if do_verify:
                try:
                    verify.compare_code_with_srcfile(infile, outfile)
                    print '+++    okay    decompyling', infile, __memUsage()
                    okay_files += 1
                except verify.VerifyCmpError as e:
                    verify_failed_files += 1
                   ...