def chunks(l, n):
    """
    Yield successive n-sized chunks from l.

    :param l: list to split
    :param n: number of elements wanted in each list split
    """
    n = 1 if n <= 0 else n
    for i in range(0, len(l), n):
        yield l[i:i + n]
