code: def test_store_tiledb_execution(setup):
      ctx = tiledb.Ctx()
  
      tempdir = tempfile.mkdtemp()
      try:
          # store TileDB dense array
          expected = np.random.rand(8, 4, 3)
          a = tensor(expected, chunk_size=(3, 3, 2))
          save = totiledb(tempdir, a, ctx=ctx)
          save.execute()
  
          with tiledb.DenseArray(uri=tempdir, ctx=ctx) as arr:
              np.testing.assert_allclose(expected, arr.read_direct())
      finally:
          shutil.rmtree(tempdir)
  
      tempdir = tempfile.mkdtemp()
      try:
          # store tensor with 1 chunk to TileDB dense array
          a = arange(12)
          save = totiledb(tempdir, a, ctx=ctx)
          save.execute()
  
          with tiledb.DenseArray(uri=tempdir, ctx=ctx) as arr:
              np.testing.assert_allclose(
                  np.arange(12), arr.read_direct()
              )
      finally:
          shutil.rmtree(tempdir)
  
      tempdir = tempfile.mkdtemp()
      try:
          # store 2-d TileDB sparse array
          expected = sps.random(8, 7, density=0.1)
          a = tensor(expected, chunk_size=(3, 5))
          save = totiledb(tempdir, a, ctx=ctx)
          save.execute()
  
          with tiledb.SparseArray(uri=tempdir, ctx=ctx) as arr:
              data = arr[:, :]
              coords = data["coords"]
              value = data[arr.attr(0).name]
              ij = tuple(
                  coords[arr.domain.dim(k).name]
                  for k in range(arr.ndim)
              )
              result = sps.coo_matrix((value, ij), shape=arr.shape)
  
              np.testing.assert_allclose(
                  expected.toarray(), result.toarray()
              )
      finally:
          shutil.rmtree(tempdir)
  
      tempdir = tempfile.mkdtemp()
      try:
          # store TileDB dense array
          expected = np.asfortranarray(np.random.rand(8, 4, 3))
          a = tensor(expected, chunk_size=(3, 3, 2))
          save = totiledb(tempdir, a, ctx=ctx)
          save.execute()
  
          with tiledb.DenseArray(uri=tempdir, ctx=ctx) as arr:
              np.testing.assert_allclose(expected, arr.read_direct())
              assert arr.schema.cell_order == "col-major"
      finally:
          shutil.rmtree(tempdir)
  
file_path: mars/mars/tensor/datastore/tests/test_datastore_execution.py
imports: import os
  import shutil
  import tempfile
  import time
  import numpy
  import scipy.sparse
  import pytest
  from ...None import tensor, arange, totiledb, tohdf5, tozarr, tovineyard
  from ...datasource import fromvineyard
label_desc: Use image node_id 1 for calling a global function with example usage: test_store_tiledb_execution(setup) without return types