def payload_satisfies(pred):
    """This wraps a predicate so it is applied to the payloads of intervals.

    The output function expects one or more Intervals as input (depending on
    how many arguments ``pred`` expects) and applies the predicate to the
    payloads of the Intervals instead of the Intervals themselves.

    Arg:
        pred: The predicate to wrap.

    Returns:
        An output function that applies ``pred`` to payloads.
    """
    def new_pred(*interval_args):
        return pred(*[i.payload for i in interval_args])
    return new_pred