code: def test_choose_execution(setup):
      options.chunk_size = 2
  
      choices = [
          [0, 1, 2, 3],
          [10, 11, 12, 13],
          [20, 21, 22, 23],
          [30, 31, 32, 33],
      ]
      a = choose([2, 3, 1, 0], choices)
  
      res = a.execute().fetch()
      expected = np.choose([2, 3, 1, 0], choices)
  
      np.testing.assert_array_equal(res, expected)
  
      a = choose(
          [2, 4, 1, 0], choices, mode="clip"
      )  # 4 goes to 3 (4-1)
      expected = np.choose([2, 4, 1, 0], choices, mode="clip")
  
      res = a.execute().fetch()
      np.testing.assert_array_equal(res, expected)
  
      a = choose(
          [2, 4, 1, 0], choices, mode="wrap"
      )  # 4 goes to (4 mod 4)
      expected = np.choose(
          [2, 4, 1, 0], choices, mode="wrap"
      )  # 4 goes to (4 mod 4)
  
      res = a.execute().fetch()
      np.testing.assert_array_equal(res, expected)
  
      a = [[1, 0, 1], [0, 1, 0], [1, 0, 1]]
      choices = [-10, 10]
  
      b = choose(a, choices)
      expected = np.choose(a, choices)
  
      res = b.execute().fetch()
      np.testing.assert_array_equal(res, expected)
  
      a = np.array([0, 1]).reshape((2, 1, 1))
      c1 = np.array([1, 2, 3]).reshape((1, 3, 1))
      c2 = np.array([-1, -2, -3, -4, -5]).reshape((1, 1, 5))
  
      b = choose(a, (c1, c2))
      expected = np.choose(a, (c1, c2))
  
      res = b.execute().fetch()
      np.testing.assert_array_equal(res, expected)
  
      # test order
      a = np.array([0, 1]).reshape((2, 1, 1), order="F")
      c1 = np.array([1, 2, 3]).reshape((1, 3, 1), order="F")
      c2 = np.array([-1, -2, -3, -4, -5]).reshape((1, 1, 5), order="F")
  
      b = choose(a, (c1, c2))
      expected = np.choose(a, (c1, c2))
  
      res = b.execute().fetch()
      np.testing.assert_array_equal(res, expected)
      assert res.flags["C_CONTIGUOUS"] == expected.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == expected.flags["F_CONTIGUOUS"]
  
      b = choose(
          a, (c1, c2), out=tensor(np.empty(res.shape, order="F"))
      )
      expected = np.choose(
          a, (c1, c2), out=np.empty(res.shape, order="F")
      )
  
      res = b.execute().fetch()
      np.testing.assert_array_equal(res, expected)
      assert res.flags["C_CONTIGUOUS"] == expected.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == expected.flags["F_CONTIGUOUS"]
  
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 12 for calling a global function with example usage: test_choose_execution(setup) without return types