code: def inverse_permutation(indices):
      
      # use intp instead of int64 because of windows :(
      inverse_permutation = np.empty(len(indices), dtype=np.intp)
      inverse_permutation[indices] = np.arange(len(indices), dtype=np.intp)
      return inverse_permutation
docs: Return indices for an inverse permutation.
  
      Parameters
      ----------
      indices : 1D np.ndarray with dtype=int
          Integer positions to assign elements to.
  
      Returns
      -------
      inverse_permutation : 1D np.ndarray with dtype=int
          Integer indices to take from the original array to create the
          permutation.