human
Complete the below
def _pgroup_calcs():

    ''''Return the permutation groups for each of the polyhedra and the face
    definitions: tetrahedron, cube, octahedron, dodecahedron, icosahedron,
    tetrahedron_faces, cube_faces, octahedron_faces, dodecahedron_faces,
    icosahedron_faces
    (This author didn\'t find and didn\'t know of a better way to do it though
    there likely is such a way.)
    Although only 2 permutations are needed for a polyhedron in order to
    generate all the possible orientations, a group of permutations is
    provided instead. A set of permutations is called a "group" if::
    a*b = c (for any pair of permutations in the group, a and b, their
    product, c, is in the group)
    a*(b*c) = (a*b)*c (for any 3 permutations in the group associativity holds)
    there is an identity permutation, I, such that I*a = a*I for all elements
    in the group
    a*b = I (the inverse of each permutation is also in the group)
    None of the polyhedron groups defined follow these definitions of a group.
    Instead, they are selected to contain those permutations whose powers
    alone will construct all orientations of the polyhedron, i.e. for
    permutations ``a``, ``b``, etc... in the group, ``a, a**2, ..., a**o_a``,
    ``b, b**2, ..., b**o_b``, etc... (where ``o_i`` is the order of
    permutation ``i``) generate all permutations of the polyhedron instead of
    mixed products like ``a*b``, ``a*b**2``, etc....
    Note that for a polyhedron with n vertices, the valid permutations of the
    vertices exclude those that do not maintain its faces. e.g. the
    permutation BCDE of a square\'s four corners, ABCD, is a valid
    permutation while CBDE is not (because this would twist the square).
    Examples
    The is_group checks for: closure, the presence of the Identity permutation,
    and the presence of the inverse for each of the elements in the group. This
    confirms that none of the polyhedra are true groups:
    >>> from sympy.combinatorics.polyhedron import (
    ... tetrahedron, cube, octahedron, dodecahedron,...'''
 What is a Python program to find and didn\'t know of a better way to do it though?
assistant
#Here is Python program to find and didn\'t know of a better way to do it though
.
    def _pgroup_of_double(polyh, ordered_faces, pgroup):
        n = len(ordered_faces[0])
        fmap = dict(zip(ordered_faces, range(len(ordered_faces))))
        flat_faces = flatten(ordered_faces)
        new_pgroup = []
        for (i, p) in enumerate(pgroup):
            h = polyh.copy()
            h.rotate(p)
            c = h.corners
            reorder = unflatten([c[j] for j in flat_faces], n)
            reorder = [tuple(map(as_int, minlex(f, directed=False, is_set=True))) for f in reorder]
            new_pgroup.append(Perm([fmap[f] for f in reorder]))
        return new_pgroup
    tetrahedron_faces = [(0, 1, 2), (0, 2, 3), (0, 3, 1), (1, 2, 3)]
    _t_pgroup = [Perm([[1, 2, 3], [0]]), Perm([[0, 1, 2], [3]]), Perm([[0, 3, 2], [1]]), Perm([[0, 3, 1], [2]]), Perm([[0, 1], [2, 3]]), Perm([[0, 2], [1, 3]]), Perm([[0, 3], [1, 2]])]
    tetrahedron = Polyhedron(range(4), tetrahedron_faces, _t_pgroup)
    cube_faces = [(0, 1, 2, 3), (0, 1, 5, 4), (1, 2, 6, 5), (2, 3, 7, 6), (0, 3, 7, 4), (4, 5, 6, 7)]
    _c_pgroup = [Perm(p) for p in [[1, 2, 3, 0, 5, 6, 7, 4], [4, 0, 3, 7, 5, 1, 2, 6], [4, 5, 1, 0, 7, 6, 2, 3], [1, 0, 4, 5, 2, 3, 7, 6], [6, 2, 1, 5, 7, 3, 0, 4], [6, 7, 3, 2, 5, 4, 0, 1], [3, 7, 4, 0, 2, 6, 5, 1], [4, 7, 6, 5, 0, 3, 2, 1], [6, 5, 4, 7, 2, 1, 0, 3], [0, 3, 7, 4, 1, 2, 6, 5], [5, 1, 0, 4, 6, 2, 3, 7], [5, 6, 2, 1, 4, 7, 3, 0], [7, 4, 0, 3, 6, 5, 1, 2]]]
    cube = Polyhedron(range(8), cube_faces, _c_pgroup)
    octahedron_faces = [(0, 1, 2), (0, 2, 3), (0, 3, 4), (0, 1, 4), (1, 2, 5), (2, 3, 5), (3, 4, 5), (1, 4, 5)]
    octahedron = Polyhedron(range(6), octahedron_faces, _pgroup_of_double(cube, cube_faces, _c_pgroup))
    dodecahedron_faces = [(0, 1, 2, 3, 4), (0, 1, 6, 10, 5), (1, 2, 7, 11, 6), (2, 3, 8, 12, 7), (3, 4, 9, 13, 8), (0, 4, 9, 14, 5), (5, 10, 16, 15, 14), (6, 10, 16, 17, 11), (7, 11, 17, 18, 12), (8, 12, 18, 19, 13), (9, 13, 19, 15, 14), (15, 16, 17, 18, 19)]
    def _string_to_perm(s):
        rv = [Perm(range(20))]
        p = None
        for si in s:
            if (si...