def _has_rational_power(expr, symbol):
    "\n    Returns (bool, den) where bool is True if the term has a\n    non-integer rational power and den is the denominator of the\n    expression's exponent.\n\n    Examples\n    ========\n\n    >>> from sympy.solvers.solveset import _has_rational_power\n    >>> from sympy import sqrt\n    >>> from sympy.abc import x\n    >>> _has_rational_power(sqrt(x), x)\n    (True, 2)\n    >>> _has_rational_power(x**2, x)\n    (False, 1)\n    "
    (a, p, q) = (Wild('a'), Wild('p'), Wild('q'))
    pattern_match = (expr.match((a * (p ** q))) or {})
    if (pattern_match.get(a, S.Zero) is S.Zero):
        return (False, S.One)
    elif (p not in pattern_match.keys()):
        return (False, S.One)
    elif (isinstance(pattern_match[q], Rational) and pattern_match[p].has(symbol)):
        if (not (pattern_match[q].q == S.One)):
            return (True, pattern_match[q].q)
    if ((not isinstance(pattern_match[a], Pow)) or isinstance(pattern_match[a], Mul)):
        return (False, S.One)
    else:
        return _has_rational_power(pattern_match[a], symbol)
Returns (bool, den) where bool is True if the term has a
non-integer rational power and den is the denominator of the
expression's exponent.

Examples
========

>>> from sympy.solvers.solveset import _has_rational_power
>>> from sympy import sqrt
>>> from sympy.abc import x
>>> _has_rational_power(sqrt(x), x)
(True, 2)
>>> _has_rational_power(x**2, x)
(False, 1)
def _has_rational_power(expr, symbol):
    "\n    Returns (bool, den) where bool is True if the term has a\n    non-integer rational power and den is the denominator of the\n    expression's exponent.\n\n    Examples\n    ========\n\n    >>> from sympy.solvers.solveset import _has_rational_power\n    >>> from sympy import sqrt\n    >>> from sympy.abc import x\n    >>> _has_rational_power(sqrt(x), x)\n    (True, 2)\n    >>> _has_rational_power(x**2, x)\n    (False, 1)\n    "
    (a, p, q) = (Wild('a'), Wild('p'), Wild('q'))
    pattern_match = (expr.match((a * (p ** q))) or {})
    if (pattern_match.get(a, S.Zero) is S.Zero):
        return (False, S.One)
    elif (p not in pattern_match.keys()):
        return (False, S.One)
    elif (isinstance(pattern_match[q], Rational) and pattern_match[p].has(symbol)):
        if (not (pattern_match[q].q == S.One)):
            return (True, pattern_match[q].q)
    if ((not isinstance(pattern_match[a], Pow)) or isinstance(pattern_match[a], Mul)):
        return (False, S.One)
    else:
        return _has_rational_power(pattern_match[a], symbol)