code: def test_2d(self, use_pandas):
      data = gen_data(2, use_pandas)
      a = array_like(data, "a", ndim=2)
      assert a.ndim == 2
      assert a.shape == (20, 10)
      assert type(a) is np.ndarray
  
      a = array_like(data, "a", ndim=2)
      assert a.ndim == 2
      a = array_like(data, "a", ndim=2, shape=(20, None))
      assert a.shape == (20, 10)
      a = array_like(data, "a", ndim=2, shape=(20,))
      assert a.shape == (20, 10)
      a = array_like(data, "a", ndim=2, shape=(None, 10))
      assert a.shape == (20, 10)
  
      a = array_like(data, "a", ndim=2, shape=(None, None))
      assert a.ndim == 2
      a = array_like(data, "a", ndim=3)
      assert a.ndim == 3
      assert a.shape == (20, 10, 1)
  
      with pytest.raises(
          ValueError, match="a is required to have shape"
      ):
          array_like(data, "a", ndim=2, shape=(10,))
      with pytest.raises(
          ValueError, match="a is required to have shape"
      ):
          array_like(data, "a", ndim=2, shape=(20, 20))
      with pytest.raises(
          ValueError, match="a is required to have shape"
      ):
          array_like(data, "a", ndim=2, shape=(None, 20))
      match = "a is required to have ndim 1 but has ndim 2"
      with pytest.raises(ValueError, match=match):
          array_like(data, "a", ndim=1)
      match = "a must have ndim <= 1"
      with pytest.raises(ValueError, match=match):
          array_like(data, "a", maxdim=1)
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from statsmodels.tools.validation import array_like, PandasWrapper, bool_like, dict_like, float_like, int_like, string_like
  from statsmodels.tools.validation.validation import _right_squeeze
label_desc: Use image node_id 2 for calling the TestArrayLike obj's underlying member method code with example usage: obj.test_2d(use_pandas) without return types