code: def test_from_tile_db():
      ctx = tiledb.Ctx()
  
      for sparse in (True, False):
          dom = tiledb.Domain(
              tiledb.Dim(
                  ctx=ctx,
                  name="i",
                  domain=(1, 30),
                  tile=7,
                  dtype=np.int32,
              ),
              tiledb.Dim(
                  ctx=ctx,
                  name="j",
                  domain=(1, 20),
                  tile=3,
                  dtype=np.int32,
              ),
              tiledb.Dim(
                  ctx=ctx,
                  name="k",
                  domain=(1, 10),
                  tile=4,
                  dtype=np.int32,
              ),
              ctx=ctx,
          )
          schema = tiledb.ArraySchema(
              ctx=ctx,
              domain=dom,
              sparse=sparse,
              attrs=[tiledb.Attr(ctx=ctx, name="a", dtype=np.float32)],
          )
  
          tempdir = tempfile.mkdtemp()
          try:
              # create tiledb array
              array_type = (
                  tiledb.DenseArray
                  if not sparse
                  else tiledb.SparseArray
              )
              array_type.create(tempdir, schema)
  
              tensor = fromtiledb(tempdir)
              assert isinstance(tensor.op, TensorTileDBDataSource)
              assert tensor.op.issparse() == sparse
              assert tensor.shape == (30, 20, 10)
              assert tensor.extra_params.raw_chunk_size == (7, 3, 4)
              assert tensor.op.tiledb_config is None
              assert tensor.op.tiledb_uri == tempdir
              assert tensor.op.tiledb_key is None
              assert tensor.op.tiledb_timestamp is None
  
              tensor = tile(tensor)
  
              assert len(tensor.chunks) == 105
              assert isinstance(
                  tensor.chunks[0].op, TensorTileDBDataSource
              )
              assert tensor.chunks[0].op.issparse() == sparse
              assert tensor.chunks[0].shape == (7, 3, 4)
              assert tensor.chunks[0].op.tiledb_config is None
              assert tensor.chunks[0].op.tiledb_uri == tempdir
              assert tensor.chunks[0].op.tiledb_key is None
              assert tensor.chunks[0].op.tiledb_timestamp is None
              assert tensor.chunks[0].op.tiledb_dim_starts == (1, 1, 1)
  
              # test axis_offsets of chunk op
              assert tensor.chunks[0].op.axis_offsets == (0, 0, 0)
              assert tensor.chunks[1].op.axis_offsets == (0, 0, 4)
              assert tensor.cix[0, 2, 2].op.axis_offsets == (0, 6, 8)
              assert tensor.cix[0, 6, 2].op.axis_offsets == (0, 18, 8)
              assert tensor.cix[4, 6, 2].op.axis_offsets == (28, 18, 8)
  
              tensor2 = fromtiledb(tempdir, ctx=ctx)
              assert tensor2.op.tiledb_config == ctx.config().dict()
  
              tensor2 = tile(tensor2)
  
              assert (
                  tensor2.chunks[0].op.tiledb_config
                  == ctx.config().dict()
              )
          finally:
              shutil.rmtree(tempdir)
  
imports: import shutil
  import tempfile
  from copy import copy
  import numpy
  import scipy.sparse
  import pytest
  from ....None import dataframe
  from ....core import enter_mode, tile
  from ...None import ones, zeros, tensor, full, arange, diag, linspace, triu, tril, ones_like
  from ...core import Tensor, SparseTensor
  from ..None import array, fromtiledb, TensorTileDBDataSource, fromdense, asarray, ascontiguousarray, asfortranarray
  from ..tri import TensorTriu, TensorTril
  from ..zeros import TensorZeros
  from ..from_dense import DenseToSparse
  from ..array import CSRMatrixDataSource
  from ..ones import TensorOnes, TensorOnesLike
  from ..from_dataframe import from_dataframe
label_desc: Use image node_id 17 for calling a global function with example usage: test_from_tile_db() without return types