code: def test_bivariate_eg_null(data, trend, method):
      if isinstance(data, pd.DataFrame):
          y, x = data.y, data.x
      else:
          x = data[:, 0]
          y = data[:, 1]
      test_yx = engle_granger(y, x, trend=trend, method=method)
      key = (trend, "y")
      assert_allclose(test_yx.stat, NULL_TEST_VALUES[key][0], rtol=1e-4)
      assert_allclose(
          test_yx.rho, 1 + NULL_TEST_VALUES[key][2], rtol=1e-4
      )
      assert_allclose(
          test_yx.pvalue, NULL_TEST_VALUES[key][1], rtol=1e-2
      )
  
      test_xy = engle_granger(x, y, trend=trend, method=method)
      key = (trend, "x")
      assert_allclose(test_xy.stat, NULL_TEST_VALUES[key][0], rtol=1e-4)
      assert_allclose(
          test_xy.rho, 1 + NULL_TEST_VALUES[key][2], rtol=1e-4
      )
      assert_allclose(
          test_xy.pvalue, NULL_TEST_VALUES[key][1], rtol=1e-2
      )
      s = str(test_xy)
      assert "Engle-Granger" in s
      assert "Statistic:" in s
      assert "ID:" not in s
      r = test_yx.__repr__()
      assert "ID:" in r
      assert test_yx.null_hypothesis == "No Cointegration"
      assert test_yx.alternative_hypothesis == "Cointegration"
      assert 1 in test_yx.critical_values
      assert 5 in test_yx.critical_values
      assert 10 in test_yx.critical_values
  
file_path: arch/arch/tests/unitroot/test_engle_granger.py
imports: import numpy
  from numpy.testing import assert_allclose
  import pandas
  import pytest
  from statsmodels.iolib.summary import Summary
  from arch.unitroot._engle_granger import engle_granger_cv, engle_granger_pval
  from arch.unitroot._shared import ResidualCointegrationTestResult, _cross_section
  from arch.unitroot.cointegration import engle_granger
label_desc: Use image node_id 2 for calling a global function with example usage: test_bivariate_eg_null(data, trend, method) without return types