

def _worker(future, fn, args, kwargs):
    if (not future.set_running_or_notify_cancel()):
        return
    try:
        result = fn(*args, **kwargs)
    except BaseException as e:
        future.set_exception(e)
    else:
        future.set_result(result)

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/thread_executor.py _worker/original