code: def test_runstest_2sample():
      # regression test, checked with MonteCarlo and looks reasonable
  
      x = [31.8, 32.8, 39.2, 36, 30, 34.5, 37.4]
      y = [35.5, 27.6, 21.3, 24.8, 36.7, 30]
      y[-1] += 1e-6  # avoid tie that creates warning
      groups = np.concatenate((np.zeros(len(x)), np.ones(len(y))))
  
      res = runstest_2samp(x, y)
      res1 = (0.022428065200812752, 0.98210649318649212)
      assert_allclose(res, res1, rtol=1e-6)
  
      # check as stacked array
      res2 = runstest_2samp(x, y)
      assert_allclose(res2, res, rtol=1e-6)
  
      xy = np.concatenate((x, y))
      res_1s = runstest_1samp(xy)
      assert_allclose(res_1s, res1, rtol=1e-6)
      # check cutoff
      res2_1s = runstest_1samp(xy, xy.mean())
      assert_allclose(res2_1s, res_1s, rtol=1e-6)
  
imports: from statsmodels.compat.python import lzip
  import numpy
  from numpy.testing import assert_allclose, assert_almost_equal, assert_approx_equal, assert_
  from scipy import stats
  import pytest
  from statsmodels.stats.contingency_tables import mcnemar, cochrans_q, SquareTable
  from statsmodels.sandbox.stats.runs import Runs, runstest_1samp, runstest_2samp
  from statsmodels.sandbox.stats.runs import mcnemar
  from statsmodels.stats.nonparametric import rank_compare_2indep, rank_compare_2ordinal, prob_larger_continuous, cohensd2problarger
  from statsmodels.tools.testing import Holder
label_desc: Use image node_id 10 for calling a global function with example usage: test_runstest_2sample() without return types