code: def unravel_index(indices, dims, order="C"):
      """
      Converts a flat index or tensor of flat indices into a tuple
      of coordinate tensors.
  
      Parameters
      ----------
      indices : array_like
          An integer tensor whose elements are indices into the flattened
          version of a tensor of dimensions ``dims``.
      dims : tuple of ints
          The shape of the tensor to use for unraveling ``indices``.
      order : {'C', 'F'}, optional
          Determines whether the indices should be viewed as indexing in
          row-major (C-style) or column-major (Fortran-style) order.
  
      Returns
      -------
      unraveled_coords : tuple of Tensor
          Each tensor in the tuple has the same shape as the ``indices``
          tensor.
  
      See Also
      --------
      ravel_multi_index
  
      Examples
      --------
      >>> import mars.tensor as mt
  
      >>> mt.unravel_index([22, 41, 37], (7,6)).execute()
      (array([3, 6, 6]), array([4, 5, 1]))
  
      >>> mt.unravel_index(1621, (6,7,8,9)).execute()
      (3, 1, 4, 1)
      """
      indices = astensor(indices)
      if isinstance(dims, Iterable):
          dims = tuple(dims)
      else:
          dims = (dims,)
  
      if order not in "CF":
          raise TypeError("only 'C' or 'F' order is permitted")
  
      op = TensorUnravelIndex(
          dims=dims, dtype=np.dtype(np.intp), order=order
      )
      return op(indices)
  
imports: from collections.abc import Iterable
  import numpy
  from ...None import opcodes
  from ...serialization.serializables import FieldTypes, KeyField, TupleField, StringField
  from ...core import ExecutableTuple
  from ..operands import TensorHasInput, TensorOperandMixin
  from ..datasource import tensor
  from ..array_utils import as_same_device, device
  from ..core import TensorOrder
label_desc: Use image node_id 1 for calling a global function with example usage: unravel_index(indices, dims, order) and returns: op