(arg, n=None)
return rv.xreplace(n1pow)
Return the real nth-root of arg if possible. If n is omitted then
    all instances of -1**(1/odd) will be changed to -1.

    Examples
    ========

    >>> from sympy import root, real_root, Rational
    >>> from sympy.abc import x, n

    >>> real_root(-8, 3)
    -2
    >>> root(-8, 3)
    2*(-1)**(1/3)
    >>> real_root(_)
    -2

    See Also
    ========

    sympy.polys.rootoftools.RootOf
    sympy.core.power.integer_nthroot
    root, sqrt
Return the real nth-root of arg if possible. If n is omitted then
    all instances of -1**(1/odd) will be changed to -1.
Return the real nth - root of arg if possible . If n is omitted then all instances of - 1 ** ( 1 / odd ) will be changed to - 1 .
def real_root(arg, n=None):
    """Return the real nth-root of arg if possible. If n is omitted then
    all instances of -1**(1/odd) will be changed to -1.

    Examples
    ========

    >>> from sympy import root, real_root, Rational
    >>> from sympy.abc import x, n

    >>> real_root(-8, 3)
    -2
    >>> root(-8, 3)
    2*(-1)**(1/3)
    >>> real_root(_)
    -2

    See Also
    ========

    sympy.polys.rootoftools.RootOf
    sympy.core.power.integer_nthroot
    root, sqrt
    """
    if n is not None:
        n = as_int(n)
        rv = C.Pow(arg, Rational(1, n))
        if n % 2 == 0:
            return rv
    else:
        rv = sympify(arg)
    n1pow = Transform(lambda x: S.NegativeOne,
                      lambda x:
                      x.is_Pow and
                      x.base is S.NegativeOne and
                      x.exp.is_Rational and
                      x.exp.p == 1 and x.exp.q % 2)
    return rv.xreplace(n1pow)
def real_root ( arg , n = None ) : if n is not None : n = as_int ( n ) rv = C . Pow ( arg , Rational ( 1 , n ) ) if n % 2 == 0 : return rv else : rv = sympify ( arg ) n1pow = Transform ( lambda x : S . NegativeOne , lambda x : x . is_Pow and x . base is S . NegativeOne and x . exp . is_Rational and x . exp . p == 1 and x . exp . q % 2 ) return rv . xreplace ( n1pow )