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

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
return the maximum depth of any square root argument of p .