def METHOD_NAME(args, cwd):
    with fs.cd(cwd):
        exit_code = __main__.main(["-c"] + args)
    return (
        PIOCoreRPC.thread_stdout.get_value_and_reset(),
        PIOCoreRPC.thread_stderr.get_value_and_reset(),
        exit_code,
    )