code: def _generate_permutation(self, npoints):
          
          i = np.arange(0, npoints)
          # permutation
          p = np.random.permutation(npoints)
          ip = np.empty_like(p)
          # inverse permutation
          ip[p[i]] = i
          return p, ip
docs: Create shuffle and deshuffle vectors