code: def test_conditional_mnlogit_grad():
      df = gen_mnlogit(90)
      model = ConditionalMNLogit.from_formula(
          "y ~ 0 + x1 + x2", groups="g", data=df
      )
  
      # Compare the gradients to numeric gradients
      for _ in range(5):
          za = np.random.normal(size=4)
          grad = model.score(za)
          ngrad = approx_fprime(za, model.loglike)
          assert_allclose(grad, ngrad, rtol=1e-5, atol=1e-3)
  
file_path: statsmodels/statsmodels/discrete/tests/test_conditional.py
imports: import numpy
  from statsmodels.discrete.conditional_models import ConditionalLogit, ConditionalPoisson, ConditionalMNLogit
  from statsmodels.tools.numdiff import approx_fprime
  from numpy.testing import assert_allclose
  import pandas
label_desc: Use image node_id 9 for calling a global function with example usage: test_conditional_mnlogit_grad() without return types