code: def process_index(tensor_ndim, item, convert_bool_to_fancy=None):
      if isinstance(item, list):
          arr = np.array(item)
          if arr.dtype == object:
              item = tuple(item)
          elif arr.dtype.kind == "f":
              raise IndexError(_INDEX_ERROR_MSG)
          else:
              item = (arr,)
      elif not isinstance(item, tuple):
          item = (item,)
  
      index = preprocess_index(
          item, convert_bool_to_fancy=convert_bool_to_fancy
      )
      index = replace_ellipsis(index, tensor_ndim)
      missing = tensor_ndim - sum(index_ndim(i) for i in index)
      if missing < 0:
          raise IndexError("too many indices for tensor")
      return index + (slice(None),) * missing
  
file_path: mars/mars/tensor/indexing/core.py
imports: import itertools
  from numbers import Integral
  import numpy
  from ..core import TENSOR_TYPE, TENSOR_CHUNK_TYPE
  from ..datasource import tensor
  from ..utils import calc_sliced_size, broadcast_shape, replace_ellipsis, index_ndim
label_desc: Use image node_id 3 for calling a global function with example usage: process_index(tensor_ndim, item, convert_bool_to_fancy) and returns: unknown