def METHOD_NAME(iterator, total_len, callback=None):
    """Invoke ``callback`` after each chunk is yielded from ``iterator``.
    Args:
        iterator (Iterator): The iterator, which should yield chunks of data.
        total_len (int): The total length of the iterator.
        callback (Callable[[int, int], None], optional): The callback to invoke after
            each chunk of data is yielded back to the caller. Defaults to None, for no callback.
            It is called with the cumulative size of all chunks yielded thus far and the ``total_len``.
    """
    current_len = 0
    if callback is not None:
        # Call the callback for any initialization
        callback(current_len, total_len)
    for chunk in iterator:
        current_len += len(chunk)
        yield chunk
        if callback is not None:
            callback(current_len, total_len)