code: def totiledb(uri, x, ctx=None, key=None, timestamp=None):
      import tiledb
  
      x = astensor(x)
      raw_ctx = ctx
      if raw_ctx is None:
          ctx = tiledb.Ctx()
  
      tiledb_array_type = (
          tiledb.SparseArray if x.issparse() else tiledb.DenseArray
      )
      try:
          tiledb_array = tiledb_array_type(
              uri=uri, key=key, timestamp=timestamp, ctx=ctx
          )
          # if already created, we will check the shape and dtype
          check_tiledb_array_with_tensor(x, tiledb_array)
      except tiledb.TileDBError:
          # not exist, as we don't know the tile,
          # we will create the tiledb array in the tile of tensor
          pass
  
      tiledb_config = (
          None if raw_ctx is None else raw_ctx.config().dict()
      )
      op = TensorTileDBDataStore(
          tiledb_config=tiledb_config,
          tiledb_uri=uri,
          tiledb_key=key,
          tiledb_timestamp=timestamp,
          dtype=x.dtype,
          sparse=x.issparse(),
      )
      return op(x)
  
imports: import numpy
  from ...None import opcodes
  from ...serialization.serializables import FieldTypes, DictField, TupleField, StringField, Int64Field, KeyField
  from ...lib.sparse import SparseNDArray
  from ...lib.sparse.core import sps
  from ..datasource import tensor
  from ..operands import TensorOperandMixin, TensorOperand
  from ..utils import get_tiledb_ctx
  from .core import TensorDataStore
  from .utils import check_tiledb_array_with_tensor, get_tiledb_schema_from_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: totiledb(uri, x, ctx, key, timestamp) and returns: op