def chunk_list_with_yield(input_list, num_chunks):
    """
    Split the input list into a specified number of chunks using a generator.

    Args:
    - input_list (list): The list to be evenly divided.
    - num_chunks (int): The desired number of chunks.

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

    Example:
    >>> input_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> num_chunks = 5
    >>> for chunk in chunk_list_with_yield(input_list, num_chunks):
    >>>     print(chunk)  # Output: [1, 2]  [3, 4]  [5, 6]  [7, 8]  [9]
    """
    avg_chunk_size = len(input_list) // num_chunks
    remainder = len(input_list) % num_chunks

    start = 0
    for _ in range(num_chunks):
        chunk_size = avg_chunk_size + 1 if remainder > 0 else avg_chunk_size
        yield input_list[start : start + chunk_size]
        start += chunk_size
        remainder -= 1

    Split the input list into a specified number of chunks using a generator.

    Args:
    - input_list (list): The list to be evenly divided.
    - num_chunks (int): The desired number of chunks.

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

    Example:
    >>> input_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> num_chunks = 5
    >>> for chunk in chunk_list_with_yield(input_list, num_chunks):
    >>>     print(chunk)  # Output: [1, 2]  [3, 4]  [5, 6]  [7, 8]  [9]
    
smoe/utils/operations/operation_list.py