def get_real_function(function):
    """
    Unwraps decorated function to get the real one.

    Wrappers should set ``__wrapped__`` attribute with original function.
    """
    real_function = function
    while hasattr(real_function, "__wrapped__"):
        real_function = real_function.__wrapped__
    return real_function