def unpolarify(eq, subs={}, exponents_only=False):
 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
 return res.subs({exp_polar(0): 1, polar_lift(0): 0})

def unpolarify ( eq , subs = { } , exponents_only = False ) : 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 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 .