def unpack_list(a_list):
    """
    =================================================================================================
    unpack_list(a_list)
    
    This is a recursive function which takes a list of lists of... and returns a single list
    containing all elements of the input lists.
    
    =================================================================================================
    Arguments:
    
    a_list  ->  A list of an arbitrary number of sublists
    
    =================================================================================================
    Returns: A list containing all elements of all sublists.
    
    =================================================================================================
    """
    # Initialize the output list
    outlist = []
    # loop over the elements in the input list
    for element in a_list:
        # If the element is a list or a tuple
        if type(element) in [list, tuple]:
            # then use unpack_list() to unpack the
            # element and add that value to theoutlist
            outlist += unpack_list(element)
        # Otherwise,
        else:
            # Add the element to the list
            outlist.append(element)
    # and return the output list once the loop finishes
    return outlist