def iter_all_children(obj, skipContainers=False):
    if hasattr(obj, 'get_children') and len(obj.get_children()) > 0:
        for child in obj.get_children():
            if not skipContainers:
                yield child
            # could use `yield from` in python 3...
            for grandchild in iter_all_children(child, skipContainers):
                yield grandchild
    else:
        yield obj
Returns an iterator over all childen and nested children using
dataset/ETHPy150Open plotly/plotly.py/plotly/matplotlylib/mplexporter/utils.py/iter_all_children