code: def test_nb2():
      y, X = patsy.dmatrices("los ~ C(type) + hmo + white", medpar)
      y = np.array(y)[:, 0]
      nb2 = NBin(y, X, "nb2").fit(maxiter=10000, maxfun=5000)
      assert_almost_equal(
          nb2.params,
          [
              2.31027893349935,
              0.221248978197356,
              0.706158824346228,
              -0.067955221930748,
              -0.129065442248951,
              0.4457567,
          ],
          decimal=2,
      )
  
imports: from urllib.request import urlopen
  import numpy
  from numpy.testing import assert_almost_equal
  from scipy.special import digamma
  from scipy.stats import nbinom
  import pandas
  import patsy
  from statsmodels.base.model import GenericLikelihoodModel
  from statsmodels.base.model import GenericLikelihoodModelResults
label_desc: Use image node_id 7 for calling a global function with example usage: test_nb2() without return types