def get_prediction(self, exog=None, transform=True, weights=None,
                   row_labels=None, pred_kwds=None):

    ### prepare exog and row_labels, based on base Results.predict
    if transform and hasattr(self.model, 'formula') and exog is not None:
        from patsy import dmatrix
        exog = dmatrix(self.model.data.design_info.builder,
                       exog)

    if exog is not None:
        if row_labels is None:
            if hasattr(exog, 'index'):
                row_labels = exog.index
            else:
                row_labels = None

        exog = np.asarray(exog)
        if exog.ndim == 1 and (self.model.exog.ndim == 1 or
                               self.model.exog.shape[1] == 1):
            exog = exog[:, None]
        exog = np.atleast_2d(exog)  # needed in count model shape[1]
    else:
        exog = self.model.exog
        if weights is None:
            weights = getattr(self.model, 'weights', None)

        if row_labels is None:
            row_labels = getattr(self.model.data, 'row_labels', None)

    # need to handle other arrays, TODO: is delegating to model possible ?
    if weights is not None:
        weights = np.asarray(weights)
        if (weights.size > 1 and
           (weights.ndim != 1 or weights.shape[0] == exog.shape[1])):
            raise ValueError('weights has wrong shape')

    ### end

    if pred_kwds is None:
        pred_kwds = {}
    predicted_mean = self.model.predict(self.params, exog, **pred_kwds)

    covb = self.cov_params()
    var_pred_mean = (exog * np.dot(covb, exog.T).T).sum(1)

    # TODO: check that we have correct scale, Refactor scale #???
    var_resid = self.scale / weights # self.mse_resid / weights
    # special case for now:
    if self.cov_type == 'fixed scale':
        var_resid = self.cov_kwds['scale'] / weights

    dist = ['norm', 't'][self.use_t]
    return PredictionResults(predicted_mean, var_pred_mean, var_resid,
                             df=self.df_resid, dist=dist,
                             row_labels=row_labels)
Decorator for setting up the logger in LoggingMixin subclasses.
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/regression/_prediction.py/get_prediction--crossover with--dataset/ETHPy150Open Shougo/deoplete.nvim/rplugin/python3/deoplete/logger.py/logmethod