human
Complete this python program:
def cfunc(sig, locals={}, cache=False, **options):
assistant
#Here is the Python code you requested.

    """This decorator is used to compile a Python function into a C callback
    usable with foreign C libraries.
    Usage::
    @cfunc("float64(float64, float64)", nopython=True, cache=True)
    def add(a, b):
    return a + b
    """
    sig = sigutils.normalize_signature(sig)
    def wrapper(func):
        from .ccallback import CFunc
        res = CFunc(func, sig, locals=locals, options=options)
        if cache:
            res.enable_caching()
        res.compile()
        return res
    return wrapper