code: def test_arg_reduction(setup):
      raw = np.random.random((20, 20, 20))
  
      arr = tensor(raw, chunk_size=6)
  
      assert raw.argmax() == arr.argmax().execute().fetch()
      assert raw.argmin() == arr.argmin().execute().fetch()
  
      np.testing.assert_array_equal(
          raw.argmax(axis=0), arr.argmax(axis=0).execute().fetch()
      )
      np.testing.assert_array_equal(
          raw.argmin(axis=0), arr.argmin(axis=0).execute().fetch()
      )
  
      raw_format = sps.random(20, 20, density=0.1, format="lil")
  
      random_min = np.random.randint(0, 200)
      random_max = np.random.randint(200, 400)
      raw_format[np.unravel_index(random_min, raw_format.shape)] = -1
      raw_format[np.unravel_index(random_max, raw_format.shape)] = 2
  
      raw = raw_format.tocoo()
      arr = tensor(raw, chunk_size=6)
  
      assert raw.argmax() == arr.argmax().execute().fetch()
      assert raw.argmin() == arr.argmin().execute().fetch()
  
      # test order
      raw = np.asfortranarray(np.random.rand(10, 20, 30))
      arr = tensor(raw, chunk_size=13)
      arr2 = arr.argmax(axis=-1)
  
      res = arr2.execute().fetch()
      expected = raw.argmax(axis=-1)
      np.testing.assert_allclose(res, expected)
      assert res.flags["C_CONTIGUOUS"] == expected.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == expected.flags["F_CONTIGUOUS"]
  
      with pytest.raises(TypeError):
          tensor(list("abcdefghi"), dtype=object).argmax().execute()
  
imports: import numpy
  import scipy.sparse
  import pytest
  from ....utils import ignore_warning
  from ...datasource import ones, tensor
  from ..None import mean, nansum, nanmax, nanmin, nanmean, nanprod, nanargmax, nanargmin, nanvar, nanstd, count_nonzero, allclose, array_equal, var, std, nancumsum, nancumprod
label_desc: Use image node_id 7 for calling a global function with example usage: test_arg_reduction(setup) without return types