def all_subs(bounds):
    """given a list of tuples specifying the bounds of an array, all_subs()
       returns a list of all the tuples of subscripts for that array."""
    idx_list = []
    for i in range(len(bounds)):
        this_dim = bounds[i]
        lo,hi = this_dim[0],this_dim[1]   # bounds for this dimension
        this_dim_idxs = range(lo,hi+1)    # indexes for this dimension
        idx_list.append(this_dim_idxs)

    return idx2subs(idx_list)
def all_subs ( bounds ) : idx_list = [ ] for i in range ( len ( bounds ) ) : this_dim = bounds [ i ] lo , hi = this_dim [ 0 ] , this_dim [ 1 ] this_dim_idxs = range ( lo , hi + 1 ) idx_list . append ( this_dim_idxs ) return idx2subs ( idx_list )
given a list of tuples specifying the bounds of an array, all_subs()
       returns a list of all the tuples of subscripts for that array.