<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def phi(self, Xpred, degrees=None):
 """ Compute the design matrix for this model using the degrees given by the index array in degrees :param array-like Xpred: inputs to compute the design matrix for :param array-like degrees: array of degrees to use [default=range(self.degree+1)] :returns array-like phi: The design matrix [degree x #samples x #dimensions] """

        assert Xpred.shape[1] == self.X.shape[1], "Need to predict with same shape as training data."
        if degrees is None:
            degrees = range(self.basis.degree+1)
        tmp_phi = np.empty((len(degrees), Xpred.shape[0], Xpred.shape[1]))
        for i, w in enumerate(degrees):
            # Objective function
            tmpX = self._phi(Xpred, w)
            tmp_phi[i] = tmpX * self.weights[[w], :]
        return tmp_phi