def box(t, t_start, t_stop):
    """Return a box-shape (Theta-function) that is zero before `t_start` and
    after `t_stop` and one elsewehere.

    Parameters:

        t (scalar, numpy.ndarray): Time point or time grid
        t_start (scalar): First value of `t` for which the box has value 1
        t_stop (scalar): Last value of `t` for which the box has value 1

    Returns:

        box_shape (numpy.ndarray(float)): If `t` is an array, `box_shape` is
            an array of the same size as `t` If `t` is scalar, `box_shape` is
            an array of size 1 (which for all intents and purposes can be used
            like a float)
    """
    if t < t_start:
        return 0.0
    if t > t_stop:
        return 0.0
    return 1.0