'Allows applying a permutation instance as a bijective function.
Examples
>>> from sympy.combinatorics.permutations import Permutation
>>> p = Permutation([[2, 0], [3, 1]])
>>> p.array_form
[2, 3, 0, 1]
>>> [p(i) for i in range(4)]
[2, 3, 0, 1]
If an array is given then the permutation selects the items
from the array (i.e. the permutation is applied to the array):
>>> from sympy.abc import x
>>> p([x, 1, 0, x**2])
[0, x**2, x, 1]'

def __call__(self, *i):

    if (len(i) == 1):
        i = i[0]
        try:
            return self._array_form[i]
        except TypeError:
            try:
                return [i[j] for j in self._array_form]
            except Exception:
                raise TypeError('unrecognized    argument')
    else:
        return (self * Permutation(Cycle(*i), size=self.size))
