def METHOD_NAME(item):
    if isinstance(item, Ideal_generic):
        return Ideal([METHOD_NAME(g) for g in item.gens()])
    elif isinstance(item, Polynomial):
        return item.map_coefficients(morphism)
    elif isinstance(item, MPolynomial):
        return item.map_coefficients(morphism)
    elif is_PolynomialSequence(item):
        return PolynomialSequence(map(METHOD_NAME, item),
                                  immutable=item.is_immutable())
    elif isinstance(item, list):
        return list(map(METHOD_NAME, item))
    elif isinstance(item, tuple):
        return tuple(map(METHOD_NAME, item))
    elif isinstance(item, set):
        return set(map(METHOD_NAME, list(item)))
    else:
        return item