def _wraps(wrapped):
    """Decorator to preserve some basic attributes
    when wrapping a function or class"""
    def decorator(wrapper):
        for attr in ('__module__', '__name__', '__qualname__', '__doc__'):
            setattr(wrapper, attr, getattr(wrapped, attr))
        return wrapper
    return decorator