def ast2pyfunc(astbody):
    """
    Compile and retrieve Python function
    """
    code_object = compile(astbody, filename='<ast>', mode='exec')
    exec(code_object)
    return locals()[astbody.body[-1].name]
