(expr, assumptions)
Imaginary**integer/odd  -> Imaginary
        Imaginary**integer/even -> Real if integer % 2 == 0
        b**Imaginary            -> !Imaginary if exponent is an integer multiple of I*pi/log(b)
        Imaginary**Real         -> ?
        Negative**even root     -> Imaginary
        Negative**odd root      -> Real
        Negative**Real          -> Imaginary
        Real**Integer           -> Real
        Real**Positive          -> Real
Imaginary**integer/odd  -> Imaginary
        Imaginary**integer/even -> Real if integer % 2 == 0
        b**Imaginary            -> !Imaginary if exponent is an integer multiple of I*pi/log(b)
        Imaginary**Real         -> ?
        Negative**even root     -> Imaginary
        Negative**odd root      -> Real
        Negative**Real          -> Imaginary
        Real**Integer           -> Real
        Real**Positive          -> Real
Imaginary ** integer / odd - > Imaginary Imaginary ** integer / even - > Real if integer % 2 == 0 b ** Imaginary - > !Imaginary if exponent is an integer multiple of I * pi / log ( b ) Imaginary ** Real - > ? Negative ** even root - > Imaginary Negative ** odd root - > Real Negative ** Real - > Imaginary Real ** Integer - > Real Real ** Positive - > Real
def Pow(expr, assumptions):
        """
        Imaginary**integer/odd  -> Imaginary
        Imaginary**integer/even -> Real if integer % 2 == 0
        b**Imaginary            -> !Imaginary if exponent is an integer multiple of I*pi/log(b)
        Imaginary**Real         -> ?
        Negative**even root     -> Imaginary
        Negative**odd root      -> Real
        Negative**Real          -> Imaginary
        Real**Integer           -> Real
        Real**Positive          -> Real
        """
        if expr.is_number:
            return AskImaginaryHandler._number(expr, assumptions)

        if expr.base.func == C.exp:
            if ask(Q.imaginary(expr.base.args[0]), assumptions):
                if ask(Q.imaginary(expr.exp), assumptions):
                    return False
                i = expr.base.args[0]/I/pi
                if ask(Q.integer(2*i), assumptions):
                    return ask(Q.imaginary(((-1)**i)**expr.exp), assumptions)

        if ask(Q.imaginary(expr.base), assumptions):
            if ask(Q.integer(expr.exp), assumptions):
                odd = ask(Q.odd(expr.exp), assumptions)
                if odd is not None:
                    return odd
                return

        if ask(Q.imaginary(expr.exp), assumptions):
            imlog = ask(Q.imaginary(C.log(expr.base)), assumptions)
            if imlog is not None:
                return False  # I**i -> real; (2*I)**i -> complex ==> not imaginary

        if ask(Q.real(expr.base), assumptions):
            if ask(Q.real(expr.exp), assumptions):
                if ask(Q.rational(expr.exp) & Q.even(denom(expr.exp)), assumptions):
                    return ask(Q.negative(expr.base), assumptions)
                elif ask(Q.integer(expr.exp), assumptions):
                    return False
                elif ask(Q.positive(expr.base), assumptions):
                    return False
                elif ask(Q.negative(expr.base), assumptions):
                    return True
def Pow ( expr , assumptions ) : if expr . is_number : return AskImaginaryHandler . _number ( expr , assumptions ) if expr . base . func == C . exp : if ask ( Q . imaginary ( expr . base . args [ 0 ] ) , assumptions ) : if ask ( Q . imaginary ( expr . exp ) , assumptions ) : return False i = expr . base . args [ 0 ] / I / pi if ask ( Q . integer ( 2 * i ) , assumptions ) : return ask ( Q . imaginary ( ( ( - 1 ) ** i ) ** expr . exp ) , assumptions ) if ask ( Q . imaginary ( expr . base ) , assumptions ) : if ask ( Q . integer ( expr . exp ) , assumptions ) : odd = ask ( Q . odd ( expr . exp ) , assumptions ) if odd is not None : return odd return if ask ( Q . imaginary ( expr . exp ) , assumptions ) : imlog = ask ( Q . imaginary ( C . log ( expr . base ) ) , assumptions ) if imlog is not None : return False # I**i -> real; (2*I)**i -> complex ==> not imaginary if ask ( Q . real ( expr . base ) , assumptions ) : if ask ( Q . real ( expr . exp ) , assumptions ) : if ask ( Q . rational ( expr . exp ) & Q . even ( denom ( expr . exp ) ) , assumptions ) : return ask ( Q . negative ( expr . base ) , assumptions ) elif ask ( Q . integer ( expr . exp ) , assumptions ) : return False elif ask ( Q . positive ( expr . base ) , assumptions ) : return False elif ask ( Q . negative ( expr . base ) , assumptions ) : return True