def after(f, chain=False):
def decorator(g):<EOL><INDENT>@wraps(g)<EOL>def h(*args, **kargs):<EOL><INDENT>if chain:<EOL><INDENT>return f(g(*args, **kargs))<EOL><DEDENT>else:<EOL><INDENT>r = g(*args, **kargs)<EOL>f(*args, **kargs)<EOL>return r<EOL><DEDENT><DEDENT>return h<EOL><DEDENT>return decorator<EOL>
Runs f with the result of the decorated function.