#NEWLINE# def alternating( n ) : #NEWLINE# #INDENT# '\n    Generates the alternating group of order n, An.\n\n    Examples\n    ========\n\n    >>> from sympy.combinatorics.permutations import Permutation\n    >>> Permutation.print_cyclic = True\n    >>> from sympy.combinatorics.generators import alternating\n    >>> list(alternating(3))\n    [(2), (0 1 2), (0 2 1)]\n    ' #NEWLINE# for perm in variations ( list ( range ( n ) ) , n ) : #NEWLINE# #INDENT# p = Permutation ( perm ) #NEWLINE# if p . is_even : #NEWLINE# #INDENT# ( yield p )