(poly, symbol)
return gens
process the generators of ``poly``, returning the set of generators that
    have ``symbol``.  If there are two generators that are inverses of each other,
    prefer the one that has no denominator.

    Examples
    ========

    >>> from sympy.solvers.bivariate import _filtered_gens
    >>> from sympy import Poly, exp
    >>> from sympy.abc import x
    >>> _filtered_gens(Poly(x + 1/x + exp(x)), x)
    set([x, exp(x)])
process the generators of ``poly``, returning the set of generators that
    have ``symbol``.  If there are two generators that are inverses of each other,
    prefer the one that has no denominator.
process the generators of poly returning the set of generators that have symbol . If there are two generators that are inverses of each other prefer the one that has no denominator .
def _filtered_gens(poly, symbol):
    """process the generators of ``poly``, returning the set of generators that
    have ``symbol``.  If there are two generators that are inverses of each other,
    prefer the one that has no denominator.

    Examples
    ========

    >>> from sympy.solvers.bivariate import _filtered_gens
    >>> from sympy import Poly, exp
    >>> from sympy.abc import x
    >>> _filtered_gens(Poly(x + 1/x + exp(x)), x)
    set([x, exp(x)])

    """
    gens = set([g for g in poly.gens if symbol in g.free_symbols])
    for g in list(gens):
        ag = 1/g
        if g in gens and ag in gens:
            if ag.as_numer_denom()[1] is not S.One:
                g = ag
            gens.remove(g)
    return gens
def _filtered_gens ( poly , symbol ) : gens = set ( [ g for g in poly . gens if symbol in g . free_symbols ] ) for g in list ( gens ) : ag = 1 / g if g in gens and ag in gens : if ag . as_numer_denom ( ) [ 1 ] is not S . One : g = ag gens . remove ( g ) return gens