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
A helper function for inverse scaling and squaring for Pade approximation.
dataset/ETHPy150Open sympy/sympy/sympy/integrals/meijerint.py/_my_principal_branch--crossover with--dataset/ETHPy150Open scipy/scipy/scipy/linalg/_matfuncs_inv_ssq.py/_inverse_squaring_helper