'Return the data needed to fit a model for imputation.
The data is used to impute variable `vname`, and therefore
only includes cases for which `vname` is observed.
Values of type `PatsyFormula` in `init_kwds` or `fit_kwds` are
processed through Patsy and subset to align with the model\'s
endog and exog.
Parameters
vname : string
The variable for which the fitting data is returned.
Returns
endog : DataFrame
Observed values of `vname`.
exog : DataFrame
Regression design matrix for imputing `vname`.
init_kwds : dict-like
The init keyword arguments for `vname`, processed through Patsy
as required.
fit_kwds : dict-like
The fit keyword arguments for `vname`, processed through Patsy
as required.'

def get_fitting_data(self, vname):

    ix = self.ix_obs[vname]
    formula = self.conditional_formula[vname]
    (endog, exog) = patsy.dmatrices(formula, self.data, return_type='dataframe')
    endog = np.asarray(endog.iloc[(ix, 0)])
    exog = np.asarray(exog.iloc[ix, :])
    init_kwds = self._process_kwds(self.init_kwds[vname], ix)
    fit_kwds = self._process_kwds(self.fit_kwds[vname], ix)
    return (endog, exog, init_kwds, fit_kwds)
