def main(args):
    opt = parse_options(args)
    osutils.mkdir_p("logs")
    abspath = os.path.abspath("logs")
    name = opt.file

    if opt.query:
        if opt.catalog is None:
            raise Exception("--query also requires a --catalog")

        with open(opt.query, 'r') as f:
            qt = f.read()

        target_alg = CCAlgebra(emit_print=EMIT_FILE)
        if opt.platform == 'grappa':
            target_alg = GrappaAlgebra(emit_print=EMIT_FILE)
        ClangProcessor(FromFileCatalog.load_from_file(opt.catalog))\
            .write_source_code(qt, name, target_alg=target_alg)

    if opt.platform == 'grappa':
        runner = GrappalangRunner()
        runner.run(name, abspath)
    elif opt.platform == 'cpp':
        try:
            runner = ClangRunner()
            runner.run(name, abspath)
        except subprocess.CalledProcessError as e:
            print (name) % 'cpp runner for %s failed'
            print e.output
            raise
dataset/ETHPy150Open uwescience/raco/c_test_environment/run_query.py/main/swapped operands of `%`