(a, b)
return not any(a[b[i]] != b[a[i]] for i in range(len(a) - 1))
Checks if the two permutations with array forms
    given by ``a`` and ``b`` commute.

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_commutes_with
    >>> _af_commutes_with([1,2,0], [0,2,1])
    False

    See Also
    ========

    Permutation, commutes_with
Checks if the two permutations with array forms
    given by ``a`` and ``b`` commute.
Checks if the two permutations with array forms given by a and b commute .
def _af_commutes_with(a, b):
    """
    Checks if the two permutations with array forms
    given by ``a`` and ``b`` commute.

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_commutes_with
    >>> _af_commutes_with([1,2,0], [0,2,1])
    False

    See Also
    ========

    Permutation, commutes_with
    """
    return not any(a[b[i]] != b[a[i]] for i in range(len(a) - 1))
def _af_commutes_with ( a , b ) : return not any ( a [ b [ i ] ] != b [ a [ i ] ] for i in range ( len ( a ) - 1 ) )