code: def test_permutation_execute(setup):
      rs = tensor.random.RandomState(0)
      x = rs.permutation(10)
      res = x.execute().fetch()
      assert not np.all(res[:-1] < res[1:])
      np.testing.assert_array_equal(np.sort(res), np.arange(10))
  
      arr = from_ndarray([1, 4, 9, 12, 15], chunk_size=2)
      x = rs.permutation(arr)
      res = x.execute().fetch()
      assert not np.all(res[:-1] < res[1:])
      np.testing.assert_array_equal(
          np.sort(res), np.asarray([1, 4, 9, 12, 15])
      )
  
      arr = from_ndarray(np.arange(48).reshape(12, 4), chunk_size=2)
      # axis = 0
      x = rs.permutation(arr)
      res = x.execute().fetch()
      assert not np.all(res[:-1] < res[1:])
      np.testing.assert_array_equal(
          np.sort(res, axis=0), np.arange(48).reshape(12, 4)
      )
      # axis != 0
      x2 = rs.permutation(arr, axis=1)
      res = x2.execute().fetch()
      assert not np.all(res[:, :-1] < res[:, 1:])
      np.testing.assert_array_equal(
          np.sort(res, axis=1), np.arange(48).reshape(12, 4)
      )
  
file_path: mars/mars/tensor/random/tests/test_random_execution.py
imports: from collections import namedtuple
  import numpy
  import pytest
  from ....None import tensor
  from ....core import tile
  from ....lib.sparse.core import issparse
  from ...datasource import tensor
label_desc: Use image node_id 7 for calling a global function with example usage: test_permutation_execute(setup) without return types