code: def test_sparse_axis_operations():
      def test_variations(func_name):
          dim0 = 30
          dim1 = 100
          axes = [0, 1]
          densities = [0, 0.5, 1]
          for density in densities:
              shape = rand_shape_2d(dim0, dim1)
              csr_array = rand_ndarray(
                  shape=shape, stype="csr", density=density
              )
              dns = csr_array.tostype("default")
              for axis in axes:
                  ret = func_name(csr_array, axis=axis)
                  assert ret.stype == "default"
                  ret_expected = func_name(dns, axis=axis)
                  assert_almost_equal(
                      ret.asnumpy(), ret_expected.asnumpy()
                  )
  
      def test_fallback(func_name, axis=0, keepdims=True, exclude=True):
          dim0 = 30
          dim1 = 100
          shape = rand_shape_2d(dim0, dim1)
          csr_array = rand_ndarray(
              shape=shape, stype="csr", density=0.01
          )
          ret = func_name(
              csr_array, axis=axis, keepdims=keepdims, exclude=exclude
          )
  
      test_variations(mx.nd.sum)
      test_fallback(mx.nd.sum, axis=0, keepdims=True, exclude=True)
      test_variations(mx.nd.mean)
      test_fallback(mx.nd.mean, axis=0, keepdims=True, exclude=True)
  
imports: from mxnet.test_utils import *
  from mxnet.base import MXNetError
  import pytest
  from common import assertRaises
  import random
  import warnings
label_desc: Use image node_id 26 for calling a global function with example usage: test_sparse_axis_operations() without return types