code: def test_add_constant_has_constant2d(self):
      x = np.asarray([[1, 1, 1, 1], [1, 2, 3, 4.0]]).T
      y = tools.add_constant(x, has_constant="skip")
      assert_equal(x, y)
  
      with pytest.raises(ValueError):
          tools.add_constant(x, has_constant="raise")
  
      assert_equal(
          tools.add_constant(x, has_constant="add"),
          np.column_stack((np.ones(4), x)),
      )
  
imports: from statsmodels.compat.pandas import assert_frame_equal, assert_series_equal
  from statsmodels.compat.python import lrange
  import string
  import numpy
  from numpy.random import standard_normal
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal, assert_string_equal
  import pandas
  import pytest
  from statsmodels.datasets import longley
  from statsmodels.tools import tools
  from statsmodels.tools.tools import pinv_extended
label_desc: Use image node_id 4 for calling the TestTools obj's underlying member method code with example usage: obj.test_add_constant_has_constant2d() without return types