def chunk(input_list, size):
    """
    Split a list into a list-of-lists.
    If size = 2, [1, 2, 3, 4, 5, 6, 7] becomes [[1,2], [3,4], [5,6], [7]]
    """

    return [input_list[i:i + size] for i in range(0, len(input_list), size)]