code: def test_create_row_sparse():
      dim0 = 50
      dim1 = 50
      densities = [0, 0.5, 1]
      for density in densities:
          shape = rand_shape_2d(dim0, dim1)
          matrix = rand_ndarray(shape, "row_sparse", density)
          data = matrix.data
          indices = matrix.indices
          rsp_created = mx.nd.sparse.row_sparse_array(
              (data, indices), shape=shape
          )
          assert rsp_created.stype == "row_sparse"
          assert same(rsp_created.data.asnumpy(), data.asnumpy())
          assert same(rsp_created.indices.asnumpy(), indices.asnumpy())
          rsp_copy = mx.nd.array(rsp_created)
          assert same(rsp_copy.asnumpy(), rsp_created.asnumpy())
  
          # add this test since we added np.int32 and np.int64 to integer_types
          if len(shape) == 2:
              for np_int_type in (np.int32, np.int64):
                  shape = list(shape)
                  shape = [np_int_type(x) for x in shape]
                  arg1 = tuple(shape)
                  mx.nd.sparse.row_sparse_array(arg1, tuple(shape))
                  shape[0] += 1
                  assert_exception(
                      mx.nd.sparse.row_sparse_array,
                      ValueError,
                      arg1,
                      tuple(shape),
                  )
  
imports: import pickle
  from mxnet.ndarray import NDArray
  import mxnet
  from mxnet.test_utils import *
  from common import random_seed
  from mxnet.base import mx_real_t
  from numpy.testing import assert_allclose
  import numpy.random
  import numpy
  import scipy.sparse
  from common import assertRaises, xfail_when_nonstandard_decimal_separator
  from mxnet.ndarray.sparse import RowSparseNDArray, CSRNDArray
  import pytest
label_desc: Use image node_id 29 for calling a global function with example usage: test_create_row_sparse() without return types