'Return a list of real and complex roots with multiplicities.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(2*x**3 - 7*x**2 + 4*x + 4).all_roots()
[-1/2, 2, 2]
>>> Poly(x**3 + x + 1).all_roots()
[CRootOf(x**3 + x + 1, 0),
CRootOf(x**3 + x + 1, 1),
CRootOf(x**3 + x + 1, 2)]'

def all_roots(f, multiple=True, radicals=True):

    roots = sympy.polys.rootoftools.CRootOf.all_roots(f, radicals=radicals)
    if multiple:
        return roots
    else:
        return group(roots, multiple=False)
