code: def test_sparse_ufunc_execution(setup):
      from .. import add, square, arccosh, mod
  
      _normal_unary_ufunc = [square]
      _normal_bin_ufunc = [add]
      _sp_unary_ufunc = [arccosh]
      _sp_bin_ufunc = [mod]
  
      data1 = sps.random(5, 9, density=0.1)
      data2 = sps.random(5, 9, density=0.2)
      rand = np.random.random()
      arr1 = tensor(data1, chunk_size=3)
      arr2 = tensor(data2, chunk_size=3)
  
      for func in _normal_unary_ufunc:
          res_tensor = func(arr1)
          res = res_tensor.execute().fetch()
          expected = _get_sparse_func(res_tensor.op._func_name)(data1)
          _nan_equal(toarray(res[0]), expected)
  
      for func in _normal_bin_ufunc:
          res_tensor1 = func(arr1, arr2)
          res_tensor2 = func(arr1, rand)
          res_tensor3 = func(rand, arr1)
  
          res1 = res_tensor1.execute().fetch()
          res2 = res_tensor2.execute().fetch()
          res3 = res_tensor3.execute().fetch()
  
          expected1 = _get_sparse_func(res_tensor1.op._func_name)(
              data1, data2
          )
          expected2 = _get_sparse_func(res_tensor1.op._func_name)(
              data1, rand
          )
          expected3 = _get_sparse_func(res_tensor1.op._func_name)(
              rand, data1
          )
  
          _nan_equal(toarray(res1[0]), expected1)
          _nan_equal(toarray(res2[0]), expected2)
          _nan_equal(toarray(res3[0]), expected3)
  
      data1 = np.random.randint(2, 10, size=(10, 10))
      data2 = np.random.randint(2, 10, size=(10, 10))
      rand = np.random.randint(1, 10)
      arr1 = tensor(data1, chunk_size=3).tosparse()
      arr2 = tensor(data2, chunk_size=3).tosparse()
  
      for func in _sp_unary_ufunc:
          res_tensor = func(arr1)
          res = res_tensor.execute().fetch()
          expected = _get_sparse_func(res_tensor.op._func_name)(data1)
          _nan_equal(toarray(res[0]), expected)
  
      for func in _sp_bin_ufunc:
          res_tensor1 = func(arr1, arr2)
          res_tensor2 = func(arr1, rand)
          res_tensor3 = func(rand, arr1)
  
          res1 = res_tensor1.execute().fetch()
          res2 = res_tensor2.execute().fetch()
          res3 = res_tensor3.execute().fetch()
          expected1 = _get_sparse_func(res_tensor1.op._func_name)(
              data1, data2
          )
          expected2 = _get_sparse_func(res_tensor1.op._func_name)(
              data1, rand
          )
          expected3 = _get_sparse_func(res_tensor1.op._func_name)(
              rand, data1
          )
  
          _nan_equal(toarray(res1[0]), expected1)
          _nan_equal(toarray(res2[0]), expected2)
          _nan_equal(toarray(res3[0]), expected3)
  
imports: import functools
  import operator
  import numpy
  import scipy.sparse
  import pytest
  from ....config import option_context
  from ....session import execute, fetch
  from ....tests.core import require_cupy
  from ....utils import ignore_warning
  from ...datasource import ones, tensor, zeros, arange
  from ..None import add, cos, truediv, frexp, modf, clip, isclose, arctan2, tree_add, tree_multiply
label_desc: Use image node_id 8 for calling a global function with example usage: test_sparse_ufunc_execution(setup) without return types