code: def partial_resids(results, focus_exog):
      """
      Returns partial residuals for a fitted model with respect to a
      'focus predictor'.
  
      Parameters
      ----------
      results : results instance
          A fitted regression model.
      focus col : int
          The column index of model.exog with respect to which the
          partial residuals are calculated.
  
      Returns
      -------
      An array of partial residuals.
  
      References
      ----------
      RD Cook and R Croos-Dabrera (1998).  Partial residual plots in
      generalized linear models.  Journal of the American Statistical
      Association, 93:442.
      """
  
      # TODO: could be a method of results
      # TODO: see Cook et al (1998) for a more general definition
  
      # The calculation follows equation (8) from Cook's paper.
      model = results.model
      resid = model.endog - results.predict()
  
      if isinstance(model, (GLM, GEE)):
          resid *= model.family.link.deriv(results.fittedvalues)
      elif isinstance(model, (OLS, GLS, WLS)):
          pass  # No need to do anything
      else:
          raise ValueError(
              "Partial residuals for '%s' not implemented."
              % type(model)
          )
  
      if type(focus_exog) is str:
          focus_col = model.exog_names.index(focus_exog)
      else:
          focus_col = focus_exog
  
      focus_val = results.params[focus_col] * model.exog[:, focus_col]
  
      return focus_val + resid
  
imports: from statsmodels.compat.pandas import Appender
  from statsmodels.compat.python import lrange, lzip
  import numpy
  import pandas
  from patsy import dmatrix
  from statsmodels.genmod.generalized_estimating_equations import GEE
  from statsmodels.genmod.generalized_linear_model import GLM
  from statsmodels.graphics import utils
  from statsmodels.nonparametric.smoothers_lowess import lowess
  from statsmodels.regression.linear_model import GLS, OLS, WLS
  from statsmodels.sandbox.regression.predstd import wls_prediction_std
  from statsmodels.tools.tools import maybe_unwrap_results
  from ._regressionplots_doc import _plot_added_variable_doc, _plot_ceres_residuals_doc, _plot_influence_doc, _plot_leverage_resid2_doc, _plot_partial_residuals_doc
label_desc: Use image node_id 19 for calling a global function with example usage: partial_resids(results, focus_exog) and returns: unknown