code: def test_brunnermunzel_two_sided():
      # copied from scipy with adjustment
      x = [1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1]
      y = [3, 3, 4, 3, 1, 2, 3, 1, 1, 5, 4]
      significant = 13
  
      # revere direction to match our definition
      x, y = y, x
  
      # Results are compared with R's lawstat package.
      res1 = rank_compare_2indep(x, y)
      u1, p1 = res1
      t1 = res1.test_prob_superior(alternative="two-sided")
      res2 = rank_compare_2indep(y, x)
      u2, p2 = res2
      t2 = res2.test_prob_superior(alternative="two-sided")
  
      assert_approx_equal(p1, p2, significant=significant)
      assert_approx_equal(
          u1, 3.1374674823029505, significant=significant
      )
      assert_approx_equal(
          u2, -3.1374674823029505, significant=significant
      )
      assert_approx_equal(
          p2, 0.0057862086661515377, significant=significant
      )
  
      assert_allclose(t1[0], u1, rtol=1e-13)
      assert_allclose(t2[0], u2, rtol=1e-13)
      assert_allclose(t1[1], p1, rtol=1e-13)
      assert_allclose(t2[1], p2, rtol=1e-13)
  
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 12 for calling a global function with example usage: test_brunnermunzel_two_sided() without return types