@classmethod
    def _reals_index(cls, reals, index):
        i = 0

        for j, (_, factor, k) in enumerate(reals):
            if index < i + k:
                poly, index = factor, 0

                for _, factor, _ in reals[:j]:
                    if factor == poly:
                        index += 1

                return poly, index
            else:
                i += k
Map initial real root index to an index in a factor where
dataset/ETHPy150Open sympy/sympy/sympy/polys/rootoftools.py/ComplexRootOf._reals_index