code: def test_dense_constructor_with_shape():
      res1d = coo_array([1, 2, 3], shape=(3,))
      assert res1d.shape == (3,)
      assert np.array_equal(res1d.toarray(), np.array([1, 2, 3]))
  
      res2d = coo_array([[1, 2, 3], [4, 5, 6]], shape=(2, 3))
      assert res2d.shape == (2, 3)
      assert np.array_equal(
          res2d.toarray(), np.array([[1, 2, 3], [4, 5, 6]])
      )
  
      with pytest.raises(
          ValueError, match="shape must be a 1- or 2-tuple"
      ):
          coo_array([[[3]], [[4]]], shape=(2, 1, 1))
  
imports: import numpy
  import pytest
  from scipy.sparse import coo_array
label_desc: Use image node_id 3 for calling a global function with example usage: test_dense_constructor_with_shape() without return types