def _my_principal_branch(expr, period, full_pb=False):
 from sympy import principal_branch
 res = principal_branch(expr, period)
 if (not full_pb):
  res = res.replace(principal_branch, (lambda x, y: x))
 return res

def _my_principal_branch ( expr , period , full_pb = False ) : from sympy import principal_branch res = principal_branch ( expr , period ) if ( not full_pb ) : res = res . replace ( principal_branch , ( lambda x , y : x ) ) return res
bring expr nearer to its principal branch by removing superfluous factors .