code: def test_partregress_formula_env():
      # test that user function in formulas work, see #7672
  
      @np.vectorize
      def lg(x):
          return np.log10(x) if x > 0 else 0
  
      df = DataFrame(
          dict(
              a=np.random.random(size=10),
              b=np.random.random(size=10),
              c=np.random.random(size=10),
          )
      )
      sm.graphics.plot_partregress(
          "a", "lg(b)", ["c"], obs_labels=False, data=df, eval_env=1
      )
  
      sm.graphics.plot_partregress(
          "a", "lg(b)", ["c"], obs_labels=False, data=df
      )
  
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 2 for calling a global function with example usage: test_partregress_formula_env() and returns: unknown