def status_in_range(min_value, max_value):
    """ Returns a function that matches the status to a range of values.
    The value is matched if the status code falls between min_value and
    max_value inclusively.
    """
    return lambda m: min_value <= m.status <= max_value