code: def nthroot(expr, n, max_len=4, prec=15):
      """
      Compute a real nth-root of a sum of surds.
  
      Parameters
      ==========
  
      expr : sum of surds
      n : integer
      max_len : maximum number of surds passed as constants to ``nsimplify``
  
      Algorithm
      =========
  
      First ``nsimplify`` is used to get a candidate root; if it is not a
      root the minimal polynomial is computed; the answer is one of its
      roots.
  
      Examples
      ========
  
      >>> from sympy.simplify.simplify import nthroot
      >>> from sympy import sqrt
      >>> nthroot(90 + 34*sqrt(7), 3)
      sqrt(7) + 3
  
      """
      expr = sympify(expr)
      n = sympify(n)
      p = expr ** Rational(1, n)
      if not n.is_integer:
          return p
      if not _is_sum_surds(expr):
          return p
      surds = []
      coeff_muls = [x.as_coeff_Mul() for x in expr.args]
      for x, y in coeff_muls:
          if not x.is_rational:
              return p
          if y is S.One:
              continue
          if not (y.is_Pow and y.exp == S.Half and y.base.is_integer):
              return p
          surds.append(y)
      surds.sort()
      surds = surds[:max_len]
      if expr < 0 and n % 2 == 1:
          p = (-expr) ** Rational(1, n)
          a = nsimplify(p, constants=surds)
          res = a if _mexpand(a**n) == _mexpand(-expr) else p
          return -res
      a = nsimplify(p, constants=surds)
      if _mexpand(a) is not _mexpand(p) and _mexpand(
          a**n
      ) == _mexpand(expr):
          return _mexpand(a)
      expr = _nthroot_solve(expr, n, prec)
      if expr is None:
          return p
      return expr
  
imports: from collections import defaultdict
  from sympy.concrete.products import Product
  from sympy.concrete.summations import Sum
  from sympy.core import Basic, S, Add, Mul, Pow, Symbol, sympify, expand_func, Function, Dummy, Expr, factor_terms, expand_power_exp, Eq
  from sympy.core.exprtools import factor_nc
  from sympy.core.parameters import global_parameters
  from sympy.core.function import expand_log, count_ops, _mexpand, nfloat, expand_mul, expand
  from sympy.core.numbers import Float, I, pi, Rational
  from sympy.core.relational import Relational
  from sympy.core.rules import Transform
  from sympy.core.sorting import ordered
  from sympy.core.sympify import _sympify
  from sympy.core.traversal import bottom_up, walk
  from sympy.functions import gamma, exp, sqrt, log, exp_polar, re
  from sympy.functions.combinatorial.factorials import CombinatorialFunction
  from sympy.functions.elementary.complexes import unpolarify, Abs, sign
  from sympy.functions.elementary.exponential import ExpBase
  from sympy.functions.elementary.hyperbolic import HyperbolicFunction
  from sympy.functions.elementary.integers import ceiling
  from sympy.functions.elementary.piecewise import Piecewise, piecewise_fold, piecewise_simplify
  from sympy.functions.elementary.trigonometric import TrigonometricFunction
  from sympy.functions.special.bessel import BesselBase, besselj, besseli, besselk, bessely, jn
  from sympy.functions.special.tensor_functions import KroneckerDelta
  from sympy.integrals.integrals import Integral
  from sympy.matrices.expressions import MatrixExpr, MatAdd, MatMul, MatPow, MatrixSymbol
  from sympy.polys import together, cancel, factor
  from sympy.polys.numberfields.minpoly import _is_sum_surds, _minimal_polynomial_sq
  from sympy.simplify.combsimp import combsimp
  from sympy.simplify.cse_opts import sub_pre, sub_post
  from sympy.simplify.hyperexpand import hyperexpand
  from sympy.simplify.powsimp import powsimp
  from sympy.simplify.radsimp import radsimp, fraction, collect_abs
  from sympy.simplify.sqrtdenest import sqrtdenest
  from sympy.simplify.trigsimp import trigsimp, exptrigsimp
  from sympy.utilities.decorator import deprecated
  from sympy.utilities.iterables import has_variety, sift, subsets, iterable
  from sympy.utilities.misc import as_int
  import mpmath
label_desc: Use image node_id 20 for calling a global function with example usage: nthroot(expr, n, max_len, prec) and returns: expr, p, p, unknown, _mexpand, p, p, p