code: def test_chi2_contingency_g():
      c = np.array([[15, 60], [15, 90]])
      g, p, dof, e = chi2_contingency(
          c, lambda_="log-likelihood", correction=False
      )
      assert_allclose(g, 2 * xlogy(c, c / e).sum())
  
      g, p, dof, e = chi2_contingency(
          c, lambda_="log-likelihood", correction=True
      )
      c_corr = c + np.array([[-0.5, 0.5], [0.5, -0.5]])
      assert_allclose(g, 2 * xlogy(c_corr, c_corr / e).sum())
  
      c = np.array([[10, 12, 10], [12, 10, 10]])
      g, p, dof, e = chi2_contingency(c, lambda_="log-likelihood")
      assert_allclose(g, 2 * xlogy(c, c / e).sum())
  
file_path: catboost/contrib/python/scipy/py2/scipy/stats/tests/test_contingency.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_equal, assert_array_equal, assert_array_almost_equal, assert_approx_equal, assert_allclose
  from pytest import raises
  from scipy.special import xlogy
  from scipy.stats.contingency import margins, expected_freq, chi2_contingency
label_desc: Use image node_id 5 for calling a global function with example usage: test_chi2_contingency_g() without return types