test_load.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:backend.ai-client-py 作者: lablup 项目源码 文件源码
def run_execute_code(kid):
    if kid is not None:
        begin = time.monotonic()
        console = []
        run_id = token_hex(8)
        while True:
            result = Kernel(kid).execute(run_id, sample_code)
            console.extend(result['console'])
            if result['status'] == 'finished':
                break
        stdout = ''.join(rec[1] for rec in console if rec[0] == 'stdout')
        end = time.monotonic()
        print(stdout)
        return end - begin
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号