code: def test_expected_freq():
      assert_array_equal(expected_freq([1]), np.array([1.0]))
  
      observed = np.array(
          [[[2, 0], [0, 2]], [[0, 2], [2, 0]], [[1, 1], [1, 1]]]
      )
      e = expected_freq(observed)
      assert_array_equal(e, np.ones_like(observed))
  
      observed = np.array([[10, 10, 20], [20, 20, 20]])
      e = expected_freq(observed)
      correct = np.array([[12.0, 12.0, 16.0], [18.0, 18.0, 24.0]])
      assert_array_almost_equal(e, correct)
  
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 2 for calling a global function with example usage: test_expected_freq() without return types