def recurse_ex(func, func_locals, **kwargs):
    """auto-handles original *args and **kwargs.
    Use it like recurse_ex(myfunc,locals(),changed=changed-1)
    """
    co=func.func_code
    args = tuple([ kwargs.pop(co.co_varnames[i], func_locals[co.co_varnames[i]])
                   for i in range(co.co_argcount) ])
    if co.co_flags & 0x04:
        i+=1
        args+=func_locals[co.co_varnames[i]]
    if co.co_flags & 0x08:
        kwargs.update(func_locals[co.co_varnames[i+1]]) #TODO:reverse priority?
    return func(*args,**kwargs)
auto-handles original *args and **kwargs.
    Use it like recurse_ex(myfunc,locals(),changed=changed-1)
    
recipes/Python/491265_Automatic_Recursion/recipe-491265.py