def METHOD_NAME(carry: Carry, iter_num_and_x: Tuple[ScalarInt, X]) -> Tuple[Carry, Y]:
    # Unpack iter_num and x.
    iter_num, x = iter_num_and_x
    # Compute body function.
    carry, y = f(carry, x)
    # Conditions for iteration number.
    _is_first: bool = iter_num == 0
    _is_multiple: bool = (iter_num % log_rate == 0) & (
        iter_num != _length - _remainder
    )
    _is_remainder: bool = iter_num == _length - _remainder
    _is_last: bool = iter_num == _length - 1
    # Update progress bar, if first of log_rate.
    _callback(_is_first, _set_running, (y, log_rate))
    # Update progress bar, if multiple of log_rate.
    _callback(_is_multiple, _update_tqdm, (y, log_rate))
    # Update progress bar, if remainder.
    _callback(_is_remainder, _update_tqdm, (y, _remainder))
    # Close progress bar, if last iteration.
    _callback(_is_last, _close_tqdm, (y, None))
    return carry, y