code: def test_clip_execution(setup):
      a_data = np.arange(10)
  
      a = tensor(a_data.copy(), chunk_size=3)
  
      b = clip(a, 1, 8)
  
      res = b.execute().fetch()
      expected = np.clip(a_data, 1, 8)
      np.testing.assert_array_equal(res, expected)
  
      a = tensor(a_data.copy(), chunk_size=3)
      clip(a, 3, 6, out=a)
  
      res = a.execute().fetch()
      expected = np.clip(a_data, 3, 6)
      np.testing.assert_array_equal(res, expected)
  
      a = tensor(a_data.copy(), chunk_size=3)
      a_min_data = np.random.randint(1, 10, size=(10,))
      a_max_data = np.random.randint(1, 10, size=(10,))
      a_min = tensor(a_min_data)
      a_max = tensor(a_max_data)
      clip(a, a_min, a_max, out=a)
  
      res = a.execute().fetch()
      expected = np.clip(a_data, a_min_data, a_max_data)
      np.testing.assert_array_equal(res, expected)
  
      with option_context() as options:
          options.chunk_size = 3
  
          a = tensor(a_data.copy(), chunk_size=3)
          b = clip(a, [3, 4, 1, 1, 1, 4, 4, 4, 4, 4], 8)
  
          res = b.execute().fetch()
          expected = np.clip(a_data, [3, 4, 1, 1, 1, 4, 4, 4, 4, 4], 8)
          np.testing.assert_array_equal(res, expected)
  
          # test sparse clip
          a_data = sps.csr_matrix([[0, 2, 8], [0, 0, -1]])
          a = tensor(a_data, chunk_size=3)
          b_data = sps.csr_matrix([[0, 3, 0], [1, 0, -2]])
  
          c = clip(a, b_data, 4)
  
          res = c.execute().fetch()
          expected = np.clip(a_data.toarray(), b_data.toarray(), 4)
          np.testing.assert_array_equal(res, expected)
  
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 15 for calling a global function with example usage: test_clip_execution(setup) without return types