code: def test_fit_ml_em_random_state():
      # Ensure Factor._fit_ml_em doesn't change numpy's singleton random state
      # see #7357
  
      T = 10
      epsilon = np.random.multivariate_normal(
          np.zeros(3), np.eye(3), size=T
      ).T
      initial = np.random.get_state()
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", message="Fitting did not converge"
          )
          Factor(endog=epsilon, n_factor=2, method="ml").fit()
      final = np.random.get_state()
  
      assert initial[0] == final[0]
      assert_equal(initial[1], final[1])
      assert initial[2:] == final[2:]
  
file_path: statsmodels/statsmodels/multivariate/tests/test_ml_factor.py
imports: import numpy
  from statsmodels.multivariate.factor import Factor
  from numpy.testing import assert_allclose, assert_equal
  from scipy.optimize import approx_fprime
  import warnings
label_desc: Use image node_id 6 for calling a global function with example usage: test_fit_ml_em_random_state() without return types