@classmethod
    def from_inversion_vector(self, inversion):
        """
        Calculates the permutation from the inversion vector.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> Permutation.from_inversion_vector([3, 2, 1, 0, 0])
        Permutation([3, 2, 1, 0, 4, 5])

        """
        size = len(inversion)
        N = list(range(size + 1))
        perm = []
        try:
            for k in range(size):
                val = N[inversion[k]]
                perm.append(val)
                N.remove(val)
        except __HOLE__:
            raise ValueError("The inversion vector is not valid.")
        perm.extend(N)
        return _af_new(perm)
dataset/ETHPy150Open sympy/sympy/sympy/combinatorics/permutations.py/Permutation.from_inversion_vector