code: def compute_output_of_indexing(tensor, tensor_index):
      """
      Compute the output information of `__{set,get}item__` on tensor for every chunk.
      """
      from ...tensor.indexing.core import process_index, calc_shape
      from ...tensor.indexing.getitem import TensorIndex
  
      tensor_index = process_index(tensor.ndim, tensor_index)
      output_shape = calc_shape(tensor.shape, tensor_index)
  
      index_tensor_op = TensorIndex(
          dtype=tensor.dtype, sparse=False, indexes=list(tensor_index)
      )
      index_tensor = tile(
          index_tensor_op.new_tensor(
              [tensor], shape=tuple(output_shape)
          )
      )
      output_chunks = index_tensor.chunks
  
      nsplits_acc = [
          np.cumsum(
              (0,)
              + tuple(
                  c.shape[i]
                  for c in output_chunks
                  if all(
                      idx == 0
                      for j, idx in enumerate(c.index)
                      if j != i
                  )
              )
          )
          for i in range(len(output_chunks[0].shape))
      ]
      return output_shape, output_chunks, nsplits_acc
  
file_path: mars/mars/services/mutable/utils.py
imports: from datetime import datetime
  import itertools
  from numbers import Integral
  from typing import Optional
  import uuid
  import numpy
  from ...core import tile
label_desc: Use image node_id 2 for calling a global function with example usage: compute_output_of_indexing(tensor, tensor_index) and returns: output_shape,  output_chunks,  nsplits_acc