A functools.wraps helper that handles partial objects on Python 2.

def wraps(wrapped):
    """A functools.wraps helper that handles partial objects on Python 2."""
    if isinstance(wrapped, functools.partial):
        return six.wraps(wrapped, assigned=_PARTIAL_VALID_ASSIGNMENTS)
    else:
        return six.wraps(wrapped)