code: def test_bernstein_1d():
      k = 5
      xg1 = np.arange(k) / (k - 1)
      xg2 = np.arange(2 * k) / (2 * k - 1)
      # verify linear coefficients are mapped to themselves
      res_bp = dt._eval_bernstein_1d(xg2, xg1)
      assert_allclose(res_bp, xg2, atol=1e-12)
  
      res_bp = dt._eval_bernstein_1d(xg2, xg1, method="beta")
      assert_allclose(res_bp, xg2, atol=1e-12)
  
      res_bp = dt._eval_bernstein_1d(xg2, xg1, method="bpoly")
      assert_allclose(res_bp, xg2, atol=1e-12)
  
file_path: statsmodels/statsmodels/distributions/tests/test_tools.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_equal
  from scipy import stats
  import statsmodels.distributions.tools
label_desc: Use image node_id 4 for calling a global function with example usage: test_bernstein_1d() without return types