code: def test_sparse_nd_save_load(save_fn):
      stypes = ["default", "row_sparse", "csr"]
      stype_dict = {
          "default": NDArray,
          "row_sparse": RowSparseNDArray,
          "csr": CSRNDArray,
      }
      num_data = 20
      densities = [0, 0.5]
      fname = "tmp_list.npz"
      data_list1 = []
      for _ in range(num_data):
          stype = stypes[np.random.randint(0, len(stypes))]
          shape = rand_shape_2d(dim0=40, dim1=40)
          density = densities[np.random.randint(0, len(densities))]
          data_list1.append(rand_ndarray(shape, stype, density))
          assert isinstance(data_list1[-1], stype_dict[stype])
      if save_fn is mx.nd.save:
          save_fn(fname, data_list1)
      else:
          save_fn(fname, *data_list1)
  
      data_list2 = mx.nd.load(fname)
      if save_fn is mx.npx.savez:
          data_list2 = [
              data_list2["arr_" + str(i)] for i in range(num_data)
          ]
      assert len(data_list1) == len(data_list2)
      for x, y in zip(data_list1, data_list2):
          assert same(x.asnumpy(), y.asnumpy())
  
      data_map1 = {
          f"ndarray xx {i}": x for i, x in enumerate(data_list1)
      }
      if save_fn is mx.nd.save:
          save_fn(fname, data_map1)
      else:
          save_fn(fname, **data_map1)
      data_map2 = mx.nd.load(fname)
      assert len(data_map1) == len(data_map2)
      for k, x in data_map1.items():
          y = data_map2[k]
          assert same(x.asnumpy(), y.asnumpy())
      os.remove(fname)
  
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 25 for calling a global function with example usage: test_sparse_nd_save_load(save_fn) without return types