def compile_function(name, code, globs):
    """
    Given a *code* string, compile it with globals *globs* and return
    the function named *name*.
    """
    co = compile(code.rstrip(), "<string>", "single")
    ns = {}
    eval(co, globs, ns)
    return ns[name]

    Given a *code* string, compile it with globals *globs* and return
    the function named *name*.
    
numba/tests/support.py