(eq, subs={}, exponents_only=False)
return res.subs({exp_polar(0): 1, polar_lift(0): 0})
If p denotes the projection from the Riemann surface of the logarithm to
    the complex line, return a simplified version eq' of `eq` such that
    p(eq') == p(eq).
    Also apply the substitution subs in the end. (This is a convenience, since
    ``unpolarify``, in a certain sense, undoes polarify.)

    >>> from sympy import unpolarify, polar_lift, sin, I
    >>> unpolarify(polar_lift(I + 2))
    2 + I
    >>> unpolarify(sin(polar_lift(I + 7)))
    sin(7 + I)
If p denotes the projection from the Riemann surface of the logarithm to
    the complex line, return a simplified version eq' of `eq` such that
    p(eq') == p(eq).
    Also apply the substitution subs in the end. (This is a convenience, since
    ``unpolarify``, in a certain sense, undoes polarify.)
If p denotes the projection from the Riemann surface of the logarithm to the complex line return a simplified version eq of eq such that p ( eq ) == p ( eq ) . Also apply the substitution subs in the end . ( This is a convenience since unpolarify in a certain sense undoes polarify . )
def unpolarify(eq, subs={}, exponents_only=False):
    """
    If p denotes the projection from the Riemann surface of the logarithm to
    the complex line, return a simplified version eq' of `eq` such that
    p(eq') == p(eq).
    Also apply the substitution subs in the end. (This is a convenience, since
    ``unpolarify``, in a certain sense, undoes polarify.)

    >>> from sympy import unpolarify, polar_lift, sin, I
    >>> unpolarify(polar_lift(I + 2))
    2 + I
    >>> unpolarify(sin(polar_lift(I + 7)))
    sin(7 + I)
    """
    from sympy import exp_polar, polar_lift
    if isinstance(eq, bool):
        return eq

    eq = sympify(eq)
    if subs != {}:
        return unpolarify(eq.subs(subs))
    changed = True
    pause = False
    if exponents_only:
        pause = True
    while changed:
        changed = False
        res = _unpolarify(eq, exponents_only, pause)
        if res != eq:
            changed = True
            eq = res
        if isinstance(res, bool):
            return res
    # Finally, replacing Exp(0) by 1 is always correct.
    # So is polar_lift(0) -> 0.
    return res.subs({exp_polar(0): 1, polar_lift(0): 0})
def unpolarify ( eq , subs = { } , exponents_only = False ) : from sympy import exp_polar , polar_lift if isinstance ( eq , bool ) : return eq eq = sympify ( eq ) if subs != { } : return unpolarify ( eq . subs ( subs ) ) changed = True pause = False if exponents_only : pause = True while changed : changed = False res = _unpolarify ( eq , exponents_only , pause ) if res != eq : changed = True eq = res if isinstance ( res , bool ) : return res # Finally, replacing Exp(0) by 1 is always correct. # So is polar_lift(0) -> 0. return res . subs ( { exp_polar ( 0 ) : 1 , polar_lift ( 0 ) : 0 } )