def _get_coeff_exp(expr, x):
    from sympy import powsimp
    (c, m) = expand_power_base(powsimp(expr)).as_coeff_mul(x)
    if not m:
        return c, S(0)
    [m] = m
    if m.is_Pow:
        if m.base != x:
            raise _CoeffExpValueError('expr not of form a*x**b')
        return c, m.exp
    elif m == x:
        return c, S(1)
    else:
        raise _CoeffExpValueError('expr not of form a*x**b: %s' % expr)
When expr is known to be of the form c*x**b, with c and/or b possibly 1,
dataset/ETHPy150Open sympy/sympy/sympy/integrals/meijerint.py/_get_coeff_exp