code: def test_partition():
      a = tensor(np.random.rand(10, 10), chunk_size=(5, 10))
  
      pa = partition(a, [4, 9])
      assert type(pa.op).__name__ == "TensorPartition"
  
      pa = tile(pa)
  
      assert len(pa.chunks) == 2
      for c in pa.chunks:
          assert type(c.op).__name__ == "TensorPartition"
          assert type(c.inputs[0].op).__name__ == "ArrayDataSource"
  
      a = tensor(np.random.rand(100), chunk_size=(10))
  
      pa = partition(a, 4)
      assert type(pa.op).__name__ == "TensorPartition"
  
      pa = tile(pa)
  
      for c in pa.chunks:
          assert type(c.op).__name__ == "PartitionMerged"
          assert c.shape == (np.nan,)
  
      a = tensor(
          np.empty(
              (10, 10), dtype=[("id", np.int32), ("size", np.int64)]
          ),
          chunk_size=(10, 5),
      )
      pa = partition(a, 3)
      assert pa.op.order == ["id", "size"]
  
      with pytest.raises(ValueError):
          partition(a, 4, order=["unknown_field"])
  
      with pytest.raises(np.AxisError):
          partition(np.random.rand(100), 4, axis=1)
  
      with pytest.raises(ValueError):
          partition(np.random.rand(100), 4, kind="non_valid_kind")
  
      with pytest.raises(ValueError):
          partition(np.random.rand(10), 10)
  
      with pytest.raises(TypeError):
          partition(np.random.rand(10), tensor([1.0, 2.0]))
  
      with pytest.raises(ValueError):
          partition(np.random.rand(10), tensor([[1, 2]]))
  
      with pytest.raises(ValueError):
          partition(np.random.rand(10), [-11, 2])
  
imports: import numpy
  import pytest
  from ....core import tile
  from ....core.operand import OperandStage
  from ...datasource import ones, tensor, arange
  from ..None import transpose, broadcast_to, where, argwhere, array_split, split, squeeze, result_type, repeat, copyto, isin, moveaxis, TensorCopyTo, atleast_1d, atleast_2d, atleast_3d, ravel, searchsorted, unique, sort, partition, topk, to_gpu, to_cpu
label_desc: Use image node_id 23 for calling a global function with example usage: test_partition() without return types