docs: def index_natsorted(seq, key=None, reverse=False, alg=ns.DEFAULT):
      """
      Determine the list of the indexes used to sort the input sequence.
  
      Sorts a sequence naturally, but returns a list of sorted the
      indexes and not the sorted list itself. This list of indexes
      can be used to sort multiple lists by the sorted order of the
      given sequence.
  
      Parameters
      ----------
      seq : iterable
          The input to sort.
  
      key : callable, optional
          A key used to determine how to sort each element of the sequence.
          It is **not** applied recursively.
          It should accept a single argument and return a single value.
  
      reverse : {{True, False}}, optional
          Return the list in reversed sorted order. The default is
          `False`.
  
      alg : ns enum, optional
          This option is used to control which algorithm `natsort`
          uses when sorting. For details into these options, please see
          the :class:`ns` class documentation. The default is `ns.INT`.
  
      Returns
      -------
      out : tuple
          The ordered indexes of the input.
  
      See Also
      --------
      natsorted
      order_by_index
  
      Examples
      --------
  
      Use index_natsorted if you want to sort multiple lists by the
      sorted order of one 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
          >>> order_by_index(a, index)
          [{u}'num2', {u}'num3', {u}'num5']
          >>> order_by_index(b, index)
          [{u}'baz', {u}'foo', {u}'bar']
  
      """
      if key is None:
          newkey = itemgetter(1)
      else:
  
          def newkey(x):
              return key(itemgetter(1)(x))
  
      # Pair the index and sequence together, then sort by element
      index_seq_pair = [[x, y] for x, y in enumerate(seq)]
      index_seq_pair.sort(reverse=reverse, key=natsort_keygen(newkey, alg))
      return [x for x, _ in index_seq_pair]