code: def unravel_indices(idx, shape) -> NdarrayOrTensor:
      """Computing unravel coordinates from indices.
  
      Args:
          idx: a sequence of indices to unravel.
          shape: shape of array/tensor.
  
      Returns:
          Stacked indices unravelled for given shape
      """
      lib_stack = (
          torch.stack if isinstance(idx[0], torch.Tensor) else np.stack
      )
      return lib_stack([unravel_index(i, shape) for i in idx])
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import TypeVar
  import numpy
  import torch
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor
  from monai.utils.misc import is_module_ver_at_least
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 12 for calling a global function with example usage: unravel_indices(idx, shape) and returns: lib_stack