(expr, assumptions)
Handler for exponential function.

    >>> from sympy import Symbol, Q, exp, I, pi
    >>> from sympy.assumptions.refine import refine_exp
    >>> from sympy.abc import x
    >>> refine_exp(exp(pi*I*2*x), Q.real(x))
    >>> refine_exp(exp(pi*I*2*x), Q.integer(x))
    1
Handler for exponential function.
Handler for exponential function .
def refine_exp(expr, assumptions):
    """
    Handler for exponential function.

    >>> from sympy import Symbol, Q, exp, I, pi
    >>> from sympy.assumptions.refine import refine_exp
    >>> from sympy.abc import x
    >>> refine_exp(exp(pi*I*2*x), Q.real(x))
    >>> refine_exp(exp(pi*I*2*x), Q.integer(x))
    1

    """
    arg = expr.args[0]
    if arg.is_Mul:
        coeff = arg.as_coefficient(S.Pi*S.ImaginaryUnit)
        if coeff:
            if ask(Q.integer(2*coeff), assumptions):
                if ask(Q.even(coeff), assumptions):
                    return S.One
                elif ask(Q.odd(coeff), assumptions):
                    return S.NegativeOne
                elif ask(Q.even(coeff + S.Half), assumptions):
                    return -S.ImaginaryUnit
                elif ask(Q.odd(coeff + S.Half), assumptions):
                    return S.ImaginaryUnit
def refine_exp ( expr , assumptions ) : arg = expr . args [ 0 ] if arg . is_Mul : coeff = arg . as_coefficient ( S . Pi * S . ImaginaryUnit ) if coeff : if ask ( Q . integer ( 2 * coeff ) , assumptions ) : if ask ( Q . even ( coeff ) , assumptions ) : return S . One elif ask ( Q . odd ( coeff ) , assumptions ) : return S . NegativeOne elif ask ( Q . even ( coeff + S . Half ) , assumptions ) : return - S . ImaginaryUnit elif ask ( Q . odd ( coeff + S . Half ) , assumptions ) : return S . ImaginaryUnit