code: def test_homogeneity():
      for k, table in enumerate(tables):
          st = sm.stats.SquareTable(table, shift_zeros=False)
          hm = st.homogeneity()
          assert_allclose(hm.statistic, r_results.loc[k, "homog_stat"])
          assert_allclose(hm.df, r_results.loc[k, "homog_df"])
  
          # Test Bhapkar via its relationship to Stuart_Maxwell.
          hmb = st.homogeneity(method="bhapkar")
          assert_allclose(
              hmb.statistic,
              hm.statistic / (1 - hm.statistic / table.sum()),
          )
  
imports: import os
  import warnings
  import numpy
  import statsmodels.stats.contingency_tables
  import pandas
  from numpy.testing import assert_allclose, assert_equal
  import statsmodels.api
label_desc: Use image node_id 1 for calling a global function with example usage: test_homogeneity() without return types