def decorate(func):
    """decorate(func) -> func

    Gets the decorator list from a function and if found,
    applies the decorators in order and returns the transformed
    function.
    """    
    funclist = _pop_funclist(func)
    if funclist is None: return func
    f = func
    for d in funclist:
        if callable(d):
            f = d(f)
    return f
decorate(func) -> func

    Gets the decorator list from a function and if found,
    applies the decorators in order and returns the transformed
    function.
    
recipes/Python/286147_FunctiDecorators_Hacking/recipe-286147.py