def split_list_with_yield(input_list, split_length, drop_last=False):
    """
    Split a list into sublists using a generator, each with a length of split_length.

    Args:
    - input_list (list): The list to be split.
    - split_length (int): Length of each sublist.
    - drop_last (bool): Whether to drop the last sublist if its length is insufficient. Default is False.

    Yields:
    - list of lists: Sublists yielded one at a time.

    Example:
    >>> input_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> split_length = 5
    >>> result = split_list_with_yield(input_list, split_length, drop_last=False)
    >>> for sublist in result:
    >>>     print(sublist)  # Output: [1, 2, 3, 4, 5]  [6, 7, 8, 9]
    """
    if split_length <= 0:
        raise ValueError("split_length must be a positive integer!")

    num_elements = len(input_list)
    num_splits = num_elements // split_length

    start = 0
    for _ in range(num_splits):
        sublist = input_list[start : start + split_length]
        yield sublist
        start += split_length

    if not drop_last and start < num_elements:
        sublist = input_list[start:]
        yield sublist

    Split a list into sublists using a generator, each with a length of split_length.

    Args:
    - input_list (list): The list to be split.
    - split_length (int): Length of each sublist.
    - drop_last (bool): Whether to drop the last sublist if its length is insufficient. Default is False.

    Yields:
    - list of lists: Sublists yielded one at a time.

    Example:
    >>> input_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> split_length = 5
    >>> result = split_list_with_yield(input_list, split_length, drop_last=False)
    >>> for sublist in result:
    >>>     print(sublist)  # Output: [1, 2, 3, 4, 5]  [6, 7, 8, 9]
    
smoe/utils/operations/operation_list.py