(p)
Return the maximum depth of any square root argument of p.

    >>> from sympy.functions.elementary.miscellaneous import sqrt
    >>> from sympy.simplify.sqrtdenest import sqrt_depth

    Neither of these square roots contains any other square roots
    so the depth is 1:

    >>> sqrt_depth(1 + sqrt(2)*(1 + sqrt(3)))
    1

    The sqrt(3) is contained within a square root so the depth is
    2:

    >>> sqrt_depth(1 + sqrt(2)*sqrt(1 + sqrt(3)))
    2
Return the maximum depth of any square root argument of p.
Return the maximum depth of any square root argument of p .
def sqrt_depth(p):
    """Return the maximum depth of any square root argument of p.

    >>> from sympy.functions.elementary.miscellaneous import sqrt
    >>> from sympy.simplify.sqrtdenest import sqrt_depth

    Neither of these square roots contains any other square roots
    so the depth is 1:

    >>> sqrt_depth(1 + sqrt(2)*(1 + sqrt(3)))
    1

    The sqrt(3) is contained within a square root so the depth is
    2:

    >>> sqrt_depth(1 + sqrt(2)*sqrt(1 + sqrt(3)))
    2
    """

    if p.is_Atom:
        return 0
    elif p.is_Add or p.is_Mul:
        return max([sqrt_depth(x) for x in p.args], key=default_sort_key)
    elif is_sqrt(p):
        return sqrt_depth(p.base) + 1
    else:
        return 0
def sqrt_depth ( p ) : if p . is_Atom : return 0 elif p . is_Add or p . is_Mul : return max ( [ sqrt_depth ( x ) for x in p . args ] , key = default_sort_key ) elif is_sqrt ( p ) : return sqrt_depth ( p . base ) + 1 else : return 0