def divide_list(input_list, n):

    """ Split a list into 'n' number of chunks of approximately equal length.

    Based on example given here:
        https://stackoverflow.com/questions/2130016/splitting-a-list-of-into-n-parts-of-approximately-equal-length

    :param input_list: list
        list to be split
    :param n: int
        number of chunks to split list into
    :return: list
        list of lists (chunks)
    """

    avg = len(input_list) / float(n)
    last = 0.0
    divided = []

    while last < len(input_list):
        divided.append(input_list[int(last):int(last + avg)])
        last += avg

    return divided