import random


def fragment_list(tot_len, n_frags):
    """
    A little function to help trouble shoot list_chunker. Creates a list of lists
    by randomly fragmenting range(tot_len) into n_frags list

    Args:
        tot_len: the total number of elements in the lists
        n_frags: the number of lists

    Returns: a list of list
    """

    indices = random.sample(range(tot_len), n_frags)
    indices.sort()
    start = 0
    list_of_list = []
    for i in range(n_frags):
        list_of_list.append(range(start, indices[i], 1))
        start = indices[i]
    list_of_list.append(range(indices[n_frags - 1], tot_len, 1))

    return [item for item in list_of_list if len(item) > 0]