code: def test_ufunc_execution(setup):
      from .. import (
          UNARY_UFUNC,
          BIN_UFUNC,
          arccosh,
          invert,
          mod,
          fmod,
          bitand,
          bitor,
          bitxor,
          lshift,
          rshift,
          ldexp,
      )
  
      _sp_unary_ufunc = {arccosh, invert}
      _sp_bin_ufunc = {
          mod,
          fmod,
          bitand,
          bitor,
          bitxor,
          lshift,
          rshift,
          ldexp,
      }
  
      data1 = np.random.random((5, 6, 2))
      data2 = np.random.random((5, 6, 2))
      rand = np.random.random()
      arr1 = tensor(data1, chunk_size=3)
      arr2 = tensor(data2, chunk_size=3)
  
      _new_unary_ufunc = UNARY_UFUNC - _sp_unary_ufunc
      for func in _new_unary_ufunc:
          res_tensor = func(arr1)
          assert res_tensor.dtype is not None
          res = res_tensor.execute().fetch()
          expected = _get_func(res_tensor.op._func_name)(data1)
          np.testing.assert_array_almost_equal(res, expected)
  
      _new_bin_ufunc = BIN_UFUNC - _sp_bin_ufunc
      for func in _new_bin_ufunc:
          res_tensor1 = func(arr1, arr2)
          assert res_tensor1.dtype is not None
          res_tensor2 = func(arr1, rand)
          assert res_tensor2.dtype is not None
          res_tensor3 = func(rand, arr1)
          assert res_tensor3.dtype is not None
  
          res1 = res_tensor1.execute().fetch()
          res2 = res_tensor2.execute().fetch()
          res3 = res_tensor3.execute().fetch()
  
          expected1 = _get_func(res_tensor1.op._func_name)(data1, data2)
          expected2 = _get_func(res_tensor1.op._func_name)(data1, rand)
          expected3 = _get_func(res_tensor1.op._func_name)(rand, data1)
  
          np.testing.assert_array_almost_equal(res1, expected1)
          np.testing.assert_array_almost_equal(res2, expected2)
          np.testing.assert_array_almost_equal(res3, expected3)
  
      data1 = np.random.randint(2, 10, size=(10, 10, 10))
      data2 = np.random.randint(2, 10, size=(10, 10, 10))
      rand = np.random.randint(1, 10)
      arr1 = tensor(data1, chunk_size=6)
      arr2 = tensor(data2, chunk_size=6)
  
      for func in _sp_unary_ufunc:
          res_tensor = func(arr1)
          assert res_tensor.dtype is not None
          res = res_tensor.execute().fetch()
          expected = _get_func(res_tensor.op._func_name)(data1)
          np.testing.assert_array_almost_equal(res, expected)
  
      for func in _sp_bin_ufunc:
          res_tensor1 = func(arr1, arr2)
          assert res_tensor1.dtype is not None
          res_tensor2 = func(arr1, rand)
          assert res_tensor2.dtype is not None
          res_tensor3 = func(rand, arr1)
          assert res_tensor3.dtype is not None
  
          res1 = res_tensor1.execute().fetch()
          res2 = res_tensor2.execute().fetch()
          res3 = res_tensor3.execute().fetch()
  
          expected1 = _get_func(res_tensor1.op._func_name)(data1, data2)
          expected2 = _get_func(res_tensor1.op._func_name)(data1, rand)
          expected3 = _get_func(res_tensor1.op._func_name)(rand, data1)
  
          np.testing.assert_array_almost_equal(res1, expected1)
          np.testing.assert_array_almost_equal(res2, expected2)
          np.testing.assert_array_almost_equal(res3, 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 7 for calling a global function with example usage: test_ufunc_execution(setup) without return types