def _truncate_with_offset(resource, value_list, offset):
    """Truncate a list of dictionaries with a given offset.
    """
    if not offset:
        return resource

    offset = offset.lower()
    for i, j in enumerate(value_list):
        # if offset matches one of the values in value_list,
        # the truncated list should start with the one after current offset
        if j == offset:
            return resource[i + 1:]
        # if offset does not exist in value_list, find the nearest
        # location and truncate from that location.
        if j > offset:
            return resource[i:]
    return []