code: def test_plot_influence(self, close_figures):
      infl = self.res.get_influence()
      fig = influence_plot(self.res)
      assert_equal(isinstance(fig, plt.Figure), True)
      # test that we have the correct criterion for sizes #3103
      try:
          sizes = fig.axes[0].get_children()[0]._sizes
          ex = sm.add_constant(infl.cooks_distance[0])
          ssr = sm.OLS(sizes, ex).fit().ssr
          assert_array_less(ssr, 1e-12)
      except AttributeError:
          import warnings
  
          warnings.warn("test not compatible with matplotlib version")
  
      fig = influence_plot(self.res, criterion="DFFITS")
      assert_equal(isinstance(fig, plt.Figure), True)
      try:
          sizes = fig.axes[0].get_children()[0]._sizes
          ex = sm.add_constant(np.abs(infl.dffits[0]))
          ssr = sm.OLS(sizes, ex).fit().ssr
          assert_array_less(ssr, 1e-12)
      except AttributeError:
          pass
  
      assert_raises(
          ValueError, influence_plot, self.res, criterion="unknown"
      )
  
imports: import numpy
  from numpy.testing import assert_array_less, assert_equal, assert_raises
  from pandas import DataFrame, Series
  import pytest
  import statsmodels.api
  from statsmodels.graphics.regressionplots import abline_plot, add_lowess, influence_plot, plot_added_variable, plot_ccpr, plot_ccpr_grid, plot_ceres_residuals, plot_fit, plot_leverage_resid2, plot_partial_residuals, plot_partregress_grid, plot_regress_exog
label_desc: Use image node_id 4 for calling the TestPlot obj's underlying member method code with example usage: obj.test_plot_influence(close_figures) without return types