code: def sqrtdenest(expr, max_iter=3):
      """Denests sqrts in an expression that contain other square roots
      if possible, otherwise returns the expr unchanged. This is based on the
      algorithms of [1].
  
      Examples
      ========
  
      >>> from sympy.simplify.sqrtdenest import sqrtdenest
      >>> from sympy import sqrt
      >>> sqrtdenest(sqrt(5 + 2 * sqrt(6)))
      sqrt(2) + sqrt(3)
  
      See Also
      ========
  
      sympy.solvers.solvers.unrad
  
      References
      ==========
  
      .. [1] https://web.archive.org/web/20210806201615/https://researcher.watson.ibm.com/researcher/files/us-fagin/symb85.pdf
  
      .. [2] D. J. Jeffrey and A. D. Rich, 'Symplifying Square Roots of Square Roots
             by Denesting' (available at https://www.cybertester.com/data/denest.pdf)
  
      """
      expr = expand_mul(expr)
      for i in range(max_iter):
          z = _sqrtdenest0(expr)
          if expr == z:
              return expr
          expr = z
      return expr
  
imports: from sympy.core import Add, Expr, Mul, S, sympify
  from sympy.core.function import _mexpand, count_ops, expand_mul
  from sympy.core.sorting import default_sort_key
  from sympy.core.symbol import Dummy
  from sympy.functions import root, sign, sqrt
  from sympy.polys import Poly, PolynomialError
label_desc: Use image node_id 5 for calling a global function with example usage: sqrtdenest(expr, max_iter) and returns: expr, expr