def _construct_simple(coeffs, opt):
    'Handle simple domains, e.g.: ZZ, QQ, RR and algebraic domains. '
    rationals = floats = complexes = algebraics = False
    float_numbers = []
    if (opt.extension is True):
        is_algebraic = (lambda coeff: (coeff.is_number and coeff.is_algebraic))
    else:
        is_algebraic = (lambda coeff: False)
    for coeff in coeffs:
        if coeff.is_Rational:
            if (not coeff.is_Integer):
                rationals = True
        elif coeff.is_Float:
            if algebraics:
                return False
            else:
                floats = True
                float_numbers.append(coeff)
        else:
            is_complex = pure_complex(coeff)
            if is_complex:
                complexes = True
                (x, y) = is_complex
                if (x.is_Rational and y.is_Rational):
                    if (not (x.is_Integer and y.is_Integer)):
                        rationals = True
                    continue
                else:
                    floats = True
                    if x.is_Float:
                        float_numbers.append(x)
                    if y.is_Float:
                        float_numbers.append(y)
            if is_algebraic(coeff):
                if floats:
                    return False
                algebraics = True
            else:
                return None
    max_prec = (max((c._prec for c in float_numbers)) if float_numbers else 53)
    if algebraics:
        (domain, result) = _construct_algebraic(coeffs, opt)
    else:
        if (floats and complexes):
            domain = ComplexField(prec=max_prec)
        elif floats:
            domain = RealField(prec=max_prec)
        elif (rationals or opt.field):
            domain = (QQ_I if complexes else QQ)
        else:
            domain = (ZZ_I if complexes else ZZ)
        result = [domain.from_sympy(coeff) for coeff in coeffs]
    return (domain, result)
Handle simple domains, e.g.: ZZ, QQ, RR and algebraic domains.
def _construct_simple(coeffs, opt):
    ' '
    rationals = floats = complexes = algebraics = False
    float_numbers = []
    if (opt.extension is True):
        is_algebraic = (lambda coeff: (coeff.is_number and coeff.is_algebraic))
    else:
        is_algebraic = (lambda coeff: False)
    for coeff in coeffs:
        if coeff.is_Rational:
            if (not coeff.is_Integer):
                rationals = True
        elif coeff.is_Float:
            if algebraics:
                return False
            else:
                floats = True
                float_numbers.append(coeff)
        else:
            is_complex = pure_complex(coeff)
            if is_complex:
                complexes = True
                (x, y) = is_complex
                if (x.is_Rational and y.is_Rational):
                    if (not (x.is_Integer and y.is_Integer)):
                        rationals = True
                    continue
                else:
                    floats = True
                    if x.is_Float:
                        float_numbers.append(x)
                    if y.is_Float:
                        float_numbers.append(y)
            if is_algebraic(coeff):
                if floats:
                    return False
                algebraics = True
            else:
                return None
    max_prec = (max((c._prec for c in float_numbers)) if float_numbers else 53)
    if algebraics:
        (domain, result) = _construct_algebraic(coeffs, opt)
    else:
        if (floats and complexes):
            domain = ComplexField(prec=max_prec)
        elif floats:
            domain = RealField(prec=max_prec)
        elif (rationals or opt.field):
            domain = (QQ_I if complexes else QQ)
        else:
            domain = (ZZ_I if complexes else ZZ)
        result = [domain.from_sympy(coeff) for coeff in coeffs]
    return (domain, result)