code: def perminverse(s):
      '''
      Fast inverse of a (numpy) permutation.
  
      **Paramters**
  
              **s** :  sequence
  
                      Sequence of indices giving a permutation.
  
      **Returns**
  
              **inv** :  numpy array
  
                      Sequence of indices giving the inverse of permutation `s`.
  
      '''
      X = np.array(range(len(s)))
      X[s] = range(len(s))
      return f perminverse(s):
      '''
      Fast inverse of a (numpy) permutation.
  
      **Paramters**
  
              **s** :  sequence
  
                      Sequence of indices giving a permutation.
  
      **Returns**
  
              **inv** :  numpy array
  
                      Sequence of indices giving the inverse of permutation `s`.
  
      '''
      X = np.array(range(len(s)))
      X[s] = range(len(s))
      return X
docs: Fast inverse of a (numpy) permutation.
  
      **Paramters**
  
              **s** :  sequence
  
                      Sequence of indices giving a permutation.
  
      **Returns**
  
              **inv** :  numpy array
  
                      Sequence of indices giving the inverse of permutation `s`.