code: def test_mcnemar_exact():
      f_obs1 = np.array([[101, 121], [59, 33]])
      f_obs2 = np.array([[101, 70], [59, 33]])
      f_obs3 = np.array([[101, 80], [59, 33]])
      f_obs4 = np.array([[101, 30], [60, 33]])
      f_obs5 = np.array([[101, 10], [30, 33]])
      f_obs6 = np.array([[101, 10], [10, 33]])
  
      # vassar college online computation
      res1 = 0.000004
      res2 = 0.378688
      res3 = 0.089452
      res4 = 0.00206
      res5 = 0.002221
      res6 = 1.0
      stat = mcnemar(f_obs1, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [59, res1], decimal=6
      )
      stat = mcnemar(f_obs2, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [59, res2], decimal=6
      )
      stat = mcnemar(f_obs3, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [59, res3], decimal=6
      )
      stat = mcnemar(f_obs4, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [30, res4], decimal=6
      )
      stat = mcnemar(f_obs5, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [10, res5], decimal=6
      )
      stat = mcnemar(f_obs6, exact=True)
      assert_almost_equal(
          [stat.statistic, stat.pvalue], [10, res6], decimal=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 2 for calling a global function with example usage: test_mcnemar_exact() without return types