util.py 文件源码

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

项目:FeatureHub 作者: HDI-Project 项目源码 文件源码
def run_isolated(f, *args):
    """Execute `f(args)` in an isolated environment.

    First, uses dill to serialize the function. Unfortunately, pickle is unable
    to serialize some functions, so we must serialize and deserialize the
    function ourselves.
    """
    f_dill = dill.dumps(f)
    with Pool(1) as pool:
        return pool.apply(_get_function_and_execute, (f_dill, *args))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号