def split(a, n):
    """
    Helper function for splitting up list of any into equal parts (apart from the last one, the rest)
    :param a: list of any, the list of aby to be splitted
    :param n: int, the number of splits
    :return: list of list of any, splitet list of any
    """
    k, m = divmod(len(a), n)
    return (a[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in range(n))