# Pastebin q8hwTY9n Somewhat ugly, but ``` b = __builtins__.copy() b['d'] = d g{"__builtins__"} = b l = {"handler": handler, "event": event} ret = eval("handler(event)", g, l) ``` might work?