def reify_arrays(arrays, dims, copy=True):
    """
    Reify arrays, given the supplied dimensions. If copy is True,
    returns a copy of arrays else performs this inplace.
    """
    arrays = ({ k : AttrDict(**a) for k, a in arrays.iteritems() }
        if copy else arrays)

    for n, a in arrays.iteritems():
        a.shape = tuple(dims[v].extent_size if isinstance(v, str) else v
            for v in a.shape)

    return arrays
Reify arrays, given the supplied dimensions. If copy is True,
    returns a copy of arrays else performs this inplace.