<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def spread_stats(stats, spreader=False):
 """Iterates all descendant statistics under the given root statistics. When ``spreader=True``, each iteration yields a descendant statistics and `spread()` function together. You should call `spread()` if you want to spread the yielded statistics also. """

    spread = spread_t() if spreader else True
    descendants = deque(stats)
    while descendants:
        _stats = descendants.popleft()
        if spreader:
            spread.clear()
            yield _stats, spread
        else:
            yield _stats
        if spread:
            descendants.extend(_stats)