def during():
    """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).

    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 first interval starts strictly after the second interval starts and
    ends strictly before the second interval ends.

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