def expand_cols_deep(sheet, cols, row, depth=0):  # depth == 0 means drill all the way
    'expand all visible columns of containers to the given depth (0=fully)'
    ret = []
    for col in cols:
        newcols = _addExpandedColumns(col, row, sheet.columns.index(col))
        if depth != 1:  # countdown not yet complete, or negative (indefinite)
            ret.extend(expand_cols_deep(sheet, newcols, row, depth-1))
    return ret
expand all visible columns of containers to the given depth (0=fully)