code: def _sort_contraction_indices(pairing_indices):
      pairing_indices = [Tuple(*sorted(i)) for i in pairing_indices]
      pairing_indices.sort(key=lambda x: min(x))
      return pairing_indices
  
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 3 for calling a global function with example usage: _sort_contraction_indices(pairing_indices) and returns: pairing_indices