@tornado.gen.coroutine
def try_hook(task, hookname, loctx, label, argfunc=None):
    try:
        hook = yield two.symbols.find_symbol(task.app, loctx, hookname)
    except:
        hook = None
        
    if hook and twcommon.misc.is_typed_dict(hook, 'code'):
        ctx = two.evalctx.EvalPropContext(task, loctx=loctx, level=LEVEL_EXECUTE, forbid=two.evalctx.EVALCAP_MOVE)
        try:
            if argfunc:
                args = argfunc()
            else:
                args = None
            yield ctx.eval(hook, evaltype=EVALTYPE_RAW, locals=args)
        except Exception as ex:
            task.log.warning('Caught exception (%s): %s', label, ex, exc_info=task.app.debugstacktraces)
Get MPLSVPN instances from DB by the given id.
dataset/ETHPy150Open erkyrath/tworld/lib/two/execute.py/try_hook--crossover with--dataset/ETHPy150Open openstack/networking-edge-vpn/neutron/neutron/services/mplsvpn/plugin.py/MPLSVPNDriverPlugin.delete_mplsvpn