code: def _get_mapping_from_subranks(subranks):
      mapping = {}
      counter = 0
      for i, rank in enumerate(subranks):
          for j in range(rank):
              mapping[counter] = (i, j)
              counter += 1
      return mapping
  
file_path: sympy/sympy/tensor/array/expressions/utils.py
imports: import bisect
  from collections import defaultdict
  from sympy.combinatorics import Permutation
  from sympy.core.containers import Tuple
  from sympy.core.numbers import Integer
label_desc: Use image node_id 1 for calling a global function with example usage: _get_mapping_from_subranks(subranks) and returns: mapping