'Create (transpose) of the design matrix of the formula within
namespace. Extra arguments are passed to each term instance. If
the formula just contains an intercept, then the keyword
argument \'nrow\' indicates the number of rows (observations).'

def __call__(self, *args, **kw):

    if ('namespace' in kw):
        namespace = kw['namespace']
    else:
        namespace = self.namespace
    allvals = []
    intercept = False
    iindex = 0
    for t in self.terms:
        t = copy.copy(t)
        t.namespace = namespace
        val = t(*args, **kw)
        isintercept = False
        if hasattr(t, 'termname'):
            if (t.termname == 'intercept'):
                intercept = True
                isintercept = True
                interceptindex = iindex
                allvals.append(None)
        if ((val.ndim == 1) and (not isintercept)):
            val.shape = (1, val.shape[0])
            allvals.append(val)
        elif (not isintercept):
            allvals.append(val)
        iindex += 1
    if (not intercept):
        try:
            allvals = np.concatenate(allvals)
        except:
            pass
    else:
        nrow = kw.get('nrow', (-1))
        if (allvals != []):
            if (interceptindex > 0):
                n = allvals[0].shape[1]
            else:
                n = allvals[1].shape[1]
            allvals[interceptindex] = np.ones((1, n), np.float64)
            allvals = np.concatenate(allvals)
        elif (nrow <= 1):
            raise ValueError("with    only    intercept    in    formula,    keyword    'nrow'    argument    needed")
        else:
            allvals = I(nrow=nrow)
            allvals.shape = ((1,) + allvals.shape)
    return np.squeeze(allvals)
