def during_inv():
    """Returns a function that computes whether a temporal interval takes place
    entirely during another temporal interval (i.e. it starts after the other
    interval starts and ends before the other interval ends).
    This is the inverse of the ``during`` predicate; it checks whether the
    second interval takes place during the first interval.

    The output function expects two temporal intervals (dicts with keys 't1'
    and 't2' for the start and end times, respectively). It returns ``True`` if
    the second interval starts strictly after the first interval starts and
    ends strictly before the first interval ends.

    Returns:
        An output function that takes two temporal intervals and returns
        ``True`` if the second interval takes place strictly during the first
        interval.
    """
    return lambda intrvl1, intrvl2: intrvl2['t1'] > intrvl1['t1'] and intrvl2[
        't2'] < intrvl1['t2']
