code: def index_natsorted(seq, key=lambda x: x, number_type=float, signed=True, exp=True):
      
      from operator import itemgetter
      item1 = itemgetter(1)
      # Pair the index and sequence together, then sort by
      index_seq_pair = [[x, key(y)] for x, y in zip(range(len(seq)), seq)]
      index_seq_pair.sort(key=lambda x: natsort_key(item1(x),
                                                    number_type=number_type,
                                                    signed=signed, exp=exp))
      return [x[0] for x in index_seq_pair]
docs: \
      Sorts a sequence naturally, but returns a list of sorted the
      indeces and not the sorted list.
  
          >>> a = ['num3', 'num5', 'num2']
          >>> b = ['foo', 'bar', 'baz']
          >>> index = index_natsorted(a)
          >>> index
          [2, 0, 1]
          >>> # Sort both lists by the sort order of a
          >>> [a[i] for i in index]
          ['num2', 'num3', 'num5']
          >>> [b[i] for i in index]
          ['baz', 'foo', 'bar']
          >>> c = [('a', 'num3'), ('b', 'num5'), ('c', 'num2')]
          >>> from operator import itemgetter
          >>> index_natsorted(c, key=itemgetter(1))
          [2, 0, 1]