def _check_termination(factors, n, limitp1, use_trial, use_rho, use_pm1,
                       verbose):

    if verbose:
        print('Check for termination')

    # since we've already been factoring there is no need to do
    # simultaneous factoring with the power check
    p = perfect_power(n, factor=False)
    if p is not False:
        base, exp = p
        if limitp1:
            limit = limitp1 - 1
        else:
            limit = limitp1
        facs = factorint(base, limit, use_trial, use_rho, use_pm1,
                         verbose=False)
        for b, e in facs.items():
            if verbose:
                print(factor_msg % (b, e))
            factors[b] = exp*e
        raise StopIteration

    if isprime(n):
        factors[int(n)] = 1
        raise StopIteration

    if n == 1:
        raise StopIteration
Perform a Migration
dataset/ETHPy150Open sympy/sympy/sympy/ntheory/factor_.py/_check_termination--crossover with--dataset/ETHPy150Open sahana/eden/static/scripts/tools/fabfile.py/migrate