@public
def real_roots(f, multiple=True):
    """
    Return a list of real roots with multiplicities of ``f``.

    Examples
    ========

    >>> from sympy import real_roots
    >>> from sympy.abc import x

    >>> real_roots(2*x**3 - 7*x**2 + 4*x + 4)
    [-1/2, 2, 2]

    """
    try:
        F = Poly(f, greedy=False)
    except GeneratorsNeeded:
        raise PolynomialError(
            "can't compute real roots of %s, not a polynomial" % f)

    return F.real_roots(multiple=multiple)
dataset/ETHPy150Open sympy/sympy/sympy/polys/polytools.py/real_roots/original