code: def _get_contraction_links(args, subranks, *contraction_indices):
      mapping = _get_mapping_from_subranks(subranks)
      contraction_tuples = [
          [mapping[j] for j in i] for i in contraction_indices
      ]
      dlinks = defaultdict(dict)
      for links in contraction_tuples:
          if len(links) == 2:
              (arg1, pos1), (arg2, pos2) = links
              dlinks[arg1][pos1] = (arg2, pos2)
              dlinks[arg2][pos2] = (arg1, pos1)
              continue
  
      return args, dict(dlinks)
  
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 2 for calling a global function with example usage: _get_contraction_links(args, subranks) and returns: args,  dict