def postorderArgs (limit=sys.getrecursionlimit(), testFn=isIterable, *args) :
    if len(args) == 1:
        return (args[0],)
    else:
        deq = _deque((x,0) for x in args)
        stack = []
        result = []
        while deq :
            arg, level = deq.popleft()
            if testFn(arg) and level<limit :
                deq = _deque( [(x, level+1) for x in arg] + list(deq))
            else :
                if stack :
                    while stack and level <= stack[-1][1] :
                        result.append(stack.pop()[0])
                    stack.append((arg, level))
                else :
                    stack.append((arg, level))
        while stack :
            result.append(stack.pop()[0])

        return tuple(result)
Construct a pooling matrix, optionally with overlapping pools
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/util/arguments.py/postorderArgs--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/utils/pooling.py/pooling_matrix