code: def setup_class(cls):
      # from .results.results_discrete import Anes
      data = sm.datasets.anes96.load()
      data.exog = np.asarray(data.exog)
      data.endog = np.asarray(data.endog)
      exog = data.exog
      exog = sm.add_constant(exog, prepend=False)
      cls.mod = sm.MNLogit(data.endog, exog)
  
      # def loglikeflat(cls, params):
      # reshapes flattened params
      #    return cls.loglike(params.reshape(6,6))
      # cls.mod.loglike = loglikeflat  #need instance method
      # cls.params = [np.ones((6,6)).ravel()]
      res = cls.mod.fit(disp=0)
      cls.params = [res.params.ravel("F")]
  
imports: import numpy
  from numpy.testing import assert_allclose, assert_almost_equal
  import statsmodels.api
  from statsmodels.tools import numdiff
  from statsmodels.tools.numdiff import approx_fprime, approx_fprime_cs, approx_hess_cs, _approx_fprime_scalar, _approx_fprime_cs_scalar
label_desc: Use image node_id 1 for calling the TestGradMNLogit obj's underlying member method code with example usage: obj.setup_class(cls) without return types