def get_positions_in_range(positions, start, end):
    """
    Return a list of positions (dicts) between start and end (inclusive).
    """
    assert start <= end, "Time `start` must be before `end`."

    def is_in_time_range(pos):
        return pos["time"] >= start and pos["time"] <= end

    return list(filter(is_in_time_range, positions))