code: def test_setitem_execution(setup):
      rs = np.random.RandomState(0)
  
      raw = data = rs.randint(0, 10, size=(11, 8, 12, 13))
      arr = tensor(raw.copy(), chunk_size=6)
      raw = raw.copy()
  
      idx = slice(2, 9, 2), slice(3, 7), slice(-1, -9, -2), 2
      arr[idx] = 20
      res = arr.execute().fetch()
  
      raw[idx] = 20
      np.testing.assert_array_equal(res, raw)
      assert res.flags["C_CONTIGUOUS"] == raw.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == raw.flags["F_CONTIGUOUS"]
  
      raw = data
      shape = raw[idx].shape
  
      arr2 = tensor(raw.copy(), chunk_size=6)
      raw = raw.copy()
  
      replace = rs.randint(10, 20, size=shape[:-1] + (1,)).astype("f4")
      arr2[idx] = tensor(replace, chunk_size=7)
      res = arr2.execute().fetch()
  
      raw[idx] = replace
      np.testing.assert_array_equal(res, raw)
  
      raw = np.asfortranarray(
          np.random.randint(0, 10, size=(11, 8, 12, 13))
      )
      arr = tensor(raw.copy("A"), chunk_size=6)
      raw = raw.copy("A")
  
      idx = slice(2, 9, 2), slice(3, 7), slice(-1, -9, -2), 2
      arr[idx] = 20
      res = arr.execute().fetch()
  
      raw[idx] = 20
      np.testing.assert_array_equal(res, raw)
      assert res.flags["C_CONTIGUOUS"] == raw.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == raw.flags["F_CONTIGUOUS"]
  
      # test bool indexing set
      raw = data
  
      arr = tensor(raw.copy(), chunk_size=6)
      raw1 = rs.rand(11)
      arr[tensor(raw1, chunk_size=4) < 0.6, 2:7] = 3
      res = arr.execute().fetch()
  
      raw[raw1 < 0.6, 2:7] = 3
      np.testing.assert_array_equal(res, raw)
  
      raw = np.random.randint(3, size=10).astype(np.int64)
      raw2 = np.arange(3)
  
      arr = zeros((10, 3))
      arr[tensor(raw) == 1, tensor(raw2) == 1] = 1
      res = arr.execute().fetch()
  
      expected = np.zeros((10, 3))
      expected[raw == 1, raw2 == 1] = 1
      np.testing.assert_array_equal(res, expected)
  
      raw = data
  
      arr = tensor(raw.copy(), chunk_size=6)
      raw1 = rs.rand(11)
      set_data = rs.rand((raw1 < 0.8).sum(), 8, 12, 13)
      arr[tensor(raw1, chunk_size=4) < 0.8] = tensor(set_data)
  
      res = arr.execute().fetch()
  
      raw[raw1 < 0.8] = set_data
      np.testing.assert_array_equal(res, raw)
  
      # test error
      with pytest.raises(ValueError):
          t = tensor(raw, chunk_size=3)
          t[0, 0, 0, 0] = zeros(2, chunk_size=10)
          t.execute()
  
imports: import numpy
  import scipy.sparse
  import pytest
  from ....config import options
  from ...None import mod, stack, hstack
  from ...datasource import tensor, arange, zeros
  from ..None import take, compress, extract, choose, unravel_index, nonzero, flatnonzero, fill_diagonal
label_desc: Use image node_id 7 for calling a global function with example usage: test_setitem_execution(setup) without return types