def METHOD_NAME(ideals, auts): #(label,g) -> label
    cideals = {}
    from copy import copy
    ideals = sorted(copy(ideals))
    for ig,g in enumerate(auts):
        gideals = copy(ideals)
        for I in gideals:
            I[0] = g(I[1]).pari_hnf().python()
        gideals.sort()
        for I,J in zip(ideals,gideals):
            cideals[(J[2],ig)] = I[2]
    return cideals