def _test(code, setup_py, show_output, log):
    d = tempfile.mkdtemp()
    try:
        filename = op.join(d, "setup.py")

        cmd = [sys.executable, filename]
        log.write(" | Running %s, content below\n" % " ".join(cmd))
        log.writelines([" | | %s\n" % line for line in code.splitlines()])

        fp = open(filename, "wt")
        try:
            fp.write(code)
        finally:
            fp.close()

        buf = BytesIO()
        st = logged_run(cmd, buf)

        # FIXME: handle this correctly
        log.write(" | return of the command is %d and output is\n" % st)
        val = buf.getvalue()
        if val:
            log.writelines([" | | %s\n" % line for line in val.splitlines()])
            log.write("\n")
        else:
            log.write(" | (None)\n")
        log.write("\n")
        return st == 0
    finally:
        shutil.rmtree(d)
dataset/ETHPy150Open cournape/Bento/bento/convert/utils.py/_test/original