def partial_safe_wraps(wrapped_func, *args, **kwargs):
    """
    A version of `functools.wraps` that is safe to wrap a partial in.
    """
    if isinstance(wrapped_func, functools.partial):
        return partial_safe_wraps(wrapped_func.func)
    else:
        return functools.wraps(wrapped_func)
A version of `functools.wraps` that is safe to wrap a partial in.