def METHOD_NAME(pool, use_cloud_pickle):
    def submit_direct(func, *args, **kwargs):
        return pool.submit(func, *args, **kwargs)
    def submit_cloud_pickle(func, *args, **kwargs):
        from cloudpickle import dumps
        return pool.submit(_run_cloud_pickled_function, dumps(func), *args, **kwargs)
    return submit_cloud_pickle if use_cloud_pickle else submit_direct