def transform(transform_func):
    """Apply a transformation to a functions return value"""
    def decorator(func):
        @wraps(func)
        def f(*args, **kwargs):
            return transform_func(
                func(*args, **kwargs)
            )
        return f
    return decorator
def transform ( transform_func ) : def decorator ( func ) : @ wraps ( func ) def f ( * args , ** kwargs ) : return transform_func ( func ( * args , ** kwargs ) ) return f return decorator
Apply a transformation to a functions return value